.hat-tabs {
  --hat-accent: #1e73be;
  --hat-radius: 18px;
  --hat-tab-radius: 18px;
  --hat-panel-radius: 22px;
  --hat-panel-padding: 28px;
  --hat-border: rgba(15, 23, 42, .12);
  --hat-muted: #64748b;
  --hat-bg: #ffffff;
  --hat-tab-bg: #ffffff;
  --hat-panel-bg: #ffffff;
  --hat-panel-shadow: 0 18px 46px rgba(15, 23, 42, .08);
  --hat-soft: color-mix(in srgb, var(--hat-accent) 9%, #fff);
  display: grid;
  gap: 18px;
  margin: 1.5rem 0;
  color: #0f172a;
}

.hat-tabs * { box-sizing: border-box; }

.hat-orientation-vertical {
  grid-template-columns: minmax(220px, 32%) 1fr;
  align-items: start;
}

.hat-tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hat-orientation-vertical .hat-tab-list {
  flex-direction: column;
  flex-wrap: nowrap;
}

.hat-tab-button {
  appearance: none;
  border: 1px solid var(--hat-border);
  background: var(--hat-tab-bg);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--hat-tab-radius);
  line-height: 1.35;
  font: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  min-height: 56px;
}

.hat-tab-button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--hat-accent) 45%, var(--hat-border));
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.hat-tab-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hat-accent) 35%, transparent);
  outline-offset: 2px;
}

.hat-tab-button.is-active {
  border-color: var(--hat-accent);
  background: var(--hat-soft);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--hat-accent) 18%, transparent);
}

.hat-tab-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hat-accent) 12%, #fff);
  color: var(--hat-accent);
  font-weight: 700;
  white-space: nowrap;
}

.hat-tab-image {
  display: inline-flex;
  flex: 0 0 auto;
}

.hat-tab-image img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.hat-tab-texts {
  display: grid;
  gap: 2px;
}

.hat-tab-title {
  font-weight: 700;
}

.hat-tab-subtitle {
  color: var(--hat-muted);
  font-size: .86em;
}

.hat-panels,
.hat-editor-panels {
  min-width: 0;
}

.hat-panel {
  border: 1px solid var(--hat-border);
  border-radius: var(--hat-panel-radius);
  background: var(--hat-panel-bg);
  padding: var(--hat-panel-padding);
  box-shadow: var(--hat-panel-shadow);
}

.hat-panel > :first-child { margin-top: 0; }
.hat-panel > :last-child { margin-bottom: 0; }

.hat-animation-fade .hat-panel.is-active {
  animation: hatFade .24s ease both;
}

.hat-animation-slide .hat-panel.is-active {
  animation: hatSlide .28s ease both;
}

@keyframes hatFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hatSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hat-style-pills .hat-tab-button {
  border-radius: 999px;
  min-height: 48px;
}

.hat-style-underline .hat-tab-button {
  border-width: 0 0 3px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.hat-style-underline .hat-tab-button:hover {
  transform: none;
  box-shadow: none;
}

.hat-style-underline .hat-panel {
  box-shadow: none;
}

.hat-shadow-none { --hat-panel-shadow: none; }
.hat-shadow-soft { --hat-panel-shadow: 0 10px 26px rgba(15, 23, 42, .06); }
.hat-shadow-normal { --hat-panel-shadow: 0 18px 46px rgba(15, 23, 42, .08); }
.hat-shadow-strong { --hat-panel-shadow: 0 24px 70px rgba(15, 23, 42, .16); }

.hat-error {
  padding: 12px 14px;
  border-left: 4px solid #d63638;
  background: #fff5f5;
}

@media (max-width: 760px) {
  .hat-orientation-vertical {
    grid-template-columns: 1fr;
  }
  .hat-tab-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }
  .hat-tab-button {
    scroll-snap-align: start;
  }
}
