:root {
  --bg-start: #f3ece4;
  --bg-end: #ede3d8;
  --surface: #f6f0e8;
  --surface-soft: #fbf6ef;
  --text: #4b3427;
  --text-muted: #8c7a6b;
  --text-soft: #a08f80;
  --accent: #4b3427;
  --accent-hover: #3a271d;
  --brand-a: #ffb347;
  --brand-b: #ff6a00;
  --line: rgba(75, 52, 39, 0.14);
  --line-soft: rgba(75, 52, 39, 0.08);
  --ok-bg: rgba(133, 173, 108, 0.2);
  --ok-text: #5c7448;

  --radius-card: 18px;
  --radius-field: 14px;
  --radius-pill: 999px;

  --shadow-paper: 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-button: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 36px rgba(75, 52, 39, 0.1);

  --ease: 260ms ease-out;
}

* {
  box-sizing: border-box;
}

/* ─── Skip to content link (accessibility + SEO)
   Visually hidden until focused: improves keyboard nav and signals
   content hierarchy to screen readers that Google also indexes. ──────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms ease;
}

.skip-link:focus {
  top: 16px;
}

/* ─── Core Web Vitals: content-visibility
   Deferring offscreen panel paint reduces LCP and TBT. ──────────────── */
.how-it-works,
.workspace {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}


html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', 'Geist', 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 182, 105, 0.28), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(255, 156, 84, 0.22), transparent 30%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

.noise-grain::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%234b3427' fill-opacity='0.08'%3E%3Ccircle cx='9' cy='10' r='1'/%3E%3Ccircle cx='41' cy='45' r='1.3'/%3E%3Ccircle cx='80' cy='22' r='0.9'/%3E%3Ccircle cx='125' cy='39' r='1.1'/%3E%3Ccircle cx='20' cy='93' r='1.2'/%3E%3Ccircle cx='68' cy='115' r='0.9'/%3E%3Ccircle cx='111' cy='99' r='1.25'/%3E%3C/g%3E%3C/svg%3E");
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.top-nav-wrap {
  position: sticky;
  top: 16px;
  z-index: 80;
  padding: 16px 0;
}

.top-nav {
  width: min(1160px, 94vw);
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-soft);
  background: rgba(248, 241, 233, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 30px rgba(75, 52, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-wordmark {
  font-size: clamp(1.26rem, 1.7vw, 1.52rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(120deg, #5a3f31 0%, #4b3427 45%, #8a5f44 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-chip {
  font-size: 0.84rem;
  color: var(--text-muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  white-space: normal;
  word-break: break-word;
}

.page-shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 12px 0 120px;
}

.panel {
  position: relative;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
  box-shadow: var(--shadow-paper);
  padding: clamp(28px, 4vw, 42px);
  overflow: clip;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(75, 52, 39, 0.18);
}

.panel-soft {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
}

[data-stagger] {
  opacity: 0;
  transform: translateY(24px);
  animation: rise-in 740ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

[data-stagger='1'] {
  animation-delay: 70ms;
}

[data-stagger='2'] {
  animation-delay: 140ms;
}

[data-stagger='3'] {
  animation-delay: 210ms;
}

[data-stagger='4'] {
  animation-delay: 280ms;
}

[data-stagger='5'] {
  animation-delay: 350ms;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 26px;
  padding-top: clamp(56px, 9vw, 110px);
  padding-bottom: clamp(56px, 9vw, 110px);
  margin-top: 8px;
}

.hero-copy {
  width: min(780px, 100%);
  display: grid;
  justify-items: center;
}

.hero-tag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-a), var(--brand-b));
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.05rem, 4.2vw, 3.85rem);
  line-height: 1.05;
  letter-spacing: -0.034em;
}

.hero-text {
  margin: 0;
  color: var(--text-muted);
  max-width: 52ch;
  font-size: clamp(1rem, 1.75vw, 1.14rem);
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.trust-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  width: min(820px, 100%);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.trust-list li {
  position: relative;
  padding: 8px 12px 8px 26px;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.5);
  text-align: left;
}

.trust-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-a), var(--brand-b));
  position: absolute;
  left: 11px;
  top: 0.58em;
}

.hero-showcase {
  position: relative;
  width: min(760px, 100%);
  min-height: clamp(220px, 28vw, 290px);
  display: grid;
  align-items: stretch;
  margin-top: 6px;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.25px);
  animation: float 6s ease-in-out infinite;
}

.floating-orb-a {
  width: clamp(140px, 18vw, 200px);
  height: clamp(140px, 18vw, 200px);
  left: 10%;
  top: 6%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 214, 157, 0.95), rgba(255, 172, 89, 0.55));
}

.floating-orb-b {
  width: clamp(110px, 14vw, 156px);
  height: clamp(110px, 14vw, 156px);
  right: 6%;
  bottom: 8%;
  animation-delay: 1.5s;
  background: radial-gradient(circle at 32% 32%, rgba(255, 193, 140, 0.8), rgba(255, 128, 54, 0.45));
}

.glass-stack {
  margin: auto;
  width: min(640px, 92%);
  padding: clamp(18px, 2.3vw, 28px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  backdrop-filter: blur(2px);
}

.mini-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: 12px 14px;
  transition: transform var(--ease), box-shadow var(--ease);
}

.mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(75, 52, 39, 0.12);
}

.mini-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.mini-body {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.how-it-works {
  margin-top: 24px;
}

.how-head {
  text-align: center;
  width: min(800px, 100%);
  margin: 0 auto 24px;
}

.how-head h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  letter-spacing: -0.024em;
  line-height: 1.12;
}

.how-head .section-text {
  margin-inline: auto;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.how-card {
  border-radius: 15px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.56);
  padding: 16px;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.how-card:hover {
  transform: translateY(-2px);
  border-color: rgba(75, 52, 39, 0.16);
  box-shadow: 0 10px 24px rgba(75, 52, 39, 0.09);
}

.how-step {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.how-card h3 {
  margin: 8px 0 8px;
  font-size: 1rem;
  letter-spacing: -0.016em;
}

.how-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.workspace {
  margin-top: 40px;
  display: grid;
  gap: 28px;
}

.workspace-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  color: var(--text-soft);
  font-weight: 600;
}

.workspace-intro h2,
.section-head h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.4rem, 2.2vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-text {
  margin: 0;
  color: var(--text-muted);
  max-width: 64ch;
}

.section-label {
  margin: 22px 0 6px;
  color: var(--text-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.connected-email {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.workspace-pill-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 100%;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.compact-head {
  margin-bottom: 10px;
}

.subtle-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.mapping-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.55);
  transition: transform var(--ease), box-shadow var(--ease);
}

.mapping-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(75, 52, 39, 0.08);
}

.mapping-item label {
  font-size: 0.9rem;
  font-weight: 600;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-field);
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(255, 131, 45, 0.56);
  box-shadow: 0 0 0 4px rgba(255, 179, 71, 0.18);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.tip-line {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.route-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scan-stats-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.scan-feedback {
  margin-top: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.48);
  display: grid;
  gap: 8px;
  animation: fade-in 220ms ease-out;
}

.scan-line {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.scan-eta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  max-width: 100%;
  line-height: 1.35;
}

#output {
  margin-top: 16px;
  min-height: 130px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.sorted-results {
  min-width: 0;
}

.results-shell {
  display: grid;
  gap: 14px;
}

.results-heading {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.results-sub {
  margin: -6px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sorted-card {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.56);
  padding: 10px 11px;
  min-width: 0;
  transition: border-color var(--ease), background var(--ease);
}

.sorted-card:hover {
  border-color: rgba(75, 52, 39, 0.18);
  background: rgba(255, 255, 255, 0.68);
}

.sorted-subject {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sorted-sender {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sorted-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-promotions {
  color: #80502c;
  background: rgba(255, 195, 139, 0.34);
  border-color: rgba(170, 107, 62, 0.28);
}

.badge-social {
  color: #5f5a92;
  background: rgba(196, 188, 255, 0.36);
  border-color: rgba(119, 111, 190, 0.3);
}

.badge-personal {
  color: #2f7052;
  background: rgba(174, 227, 202, 0.36);
  border-color: rgba(73, 147, 115, 0.28);
}

.badge-receipts {
  color: #67573f;
  background: rgba(231, 213, 177, 0.4);
  border-color: rgba(146, 123, 84, 0.28);
}

.badge-newsletters {
  color: #794860;
  background: rgba(237, 196, 218, 0.34);
  border-color: rgba(162, 102, 132, 0.28);
}

.badge-otp {
  color: #6c4f88;
  background: rgba(221, 197, 245, 0.37);
  border-color: rgba(134, 100, 174, 0.28);
}

.badge-none {
  color: #6f645b;
  background: rgba(213, 203, 193, 0.5);
  border-color: rgba(136, 120, 105, 0.28);
}

.sorted-action {
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.results-empty-card {
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.52);
  padding: 18px;
}

.results-empty-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.results-empty-text {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 15%, rgba(255, 255, 255, 0.66) 45%, transparent 75%);
  transform: translateX(-120%);
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line {
  height: 11px;
  border-radius: 999px;
  background: rgba(75, 52, 39, 0.08);
}

.skeleton-line+.skeleton-line {
  margin-top: 9px;
}

.skeleton-line-a {
  width: 84%;
}

.skeleton-line-b {
  width: 64%;
}

.skeleton-line-c {
  width: 43%;
}

.god-mode {
  grid-column: span 2;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 186, 127, 0.28), transparent 38%),
    radial-gradient(circle at 88% 80%, rgba(255, 143, 71, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.6);
}

.god-mode-rules {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.god-mode-rules span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(75, 52, 39, 0.16);
  background: rgba(255, 255, 255, 0.65);
  padding: 6px 10px;
  color: #5d4436;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-mobile {
  margin-top: 10px;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(75, 52, 39, 0.08);
}

.progress-mobile .bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  transition: width 220ms ease-out;
}

.auto-controls {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(170px, 220px) 1fr;
  gap: 12px;
  align-items: end;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9b9ab;
}

.status-badge.active {
  background: var(--ok-bg);
  border-color: rgba(95, 120, 72, 0.3);
  color: var(--ok-text);
}

.status-badge.active .status-dot {
  background: #6f8d57;
}

.meta-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.meta-card {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.6);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.meta-card span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.meta-card strong {
  font-size: 0.96rem;
}

.custom-labels-list {
  margin-top: 8px;
  display: grid;
  gap: 12px;
}

.custom-label-card {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
  display: grid;
  gap: 10px;
  transition: transform var(--ease), box-shadow var(--ease);
}

.custom-label-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(75, 52, 39, 0.08);
}

.label-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.label-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.label-title {
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label-actions {
  display: flex;
  gap: 8px;
}

.label-action-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  min-height: 36px;
  padding: 7px 12px;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), border-color var(--ease);
}

.label-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.95);
}

.label-action-btn.danger {
  border-color: rgba(163, 74, 52, 0.26);
  color: #8b4333;
}

.label-description,
.label-rules {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.label-rules {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.42);
}

.label-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 0.8rem;
  color: var(--text-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.52);
}

.empty-state {
  padding: 24px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.empty-state-title {
  margin-top: 8px;
  font-weight: 600;
}

.empty-state-description {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(53, 36, 26, 0.36);
  backdrop-filter: blur(6px);
}

.modal-overlay.active {
  display: flex;
  animation: fade-in 220ms ease-out;
}

.modal-content {
  width: min(680px, 100%);
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fdf8f1, #f6eee5);
  box-shadow: 0 20px 45px rgba(75, 52, 39, 0.2);
  padding: 24px;
  animation: modal-in 260ms ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.form-group {
  margin-bottom: 14px;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker {
  width: 46px;
  min-width: 46px;
  height: 36px;
  padding: 0;
}

.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease);
}

.color-option:hover {
  transform: translateY(-1px);
}

.color-option.selected {
  border-color: rgba(75, 52, 39, 0.45);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.site-footer {
  width: min(1120px, 92vw);
  margin: 44px auto 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .kaomoji {
  display: inline-block;
  color: var(--text-soft);
  margin-right: 2px;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}

.site-footer a:hover {
  color: var(--text);
  border-bottom-color: rgba(75, 52, 39, 0.24);
}

.btn {
  border: 0;
  outline: 0;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease), opacity var(--ease);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-soft {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.btn-soft:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #7a5c4c;
  color: #fff;
  box-shadow: var(--shadow-button);
}

.btn-secondary:hover:not(:disabled) {
  background: #674a3c;
  transform: translateY(-1px);
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(120%);
  }
}

@media (max-width: 1024px) {
  .top-nav {
    border-radius: 22px;
    align-items: center;
  }

  .glass-stack {
    grid-template-columns: 1fr;
    width: min(420px, 92%);
  }

  .hero-showcase {
    min-height: 250px;
  }

  .workspace-intro,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .workspace-pill-row {
    justify-content: flex-start;
    width: 100%;
  }

  .auto-controls {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .auto-controls .action-group {
    margin-top: 2px;
  }
}

@media (max-width: 768px) {
  .top-nav-wrap {
    top: 10px;
    padding-top: 8px;
  }

  .top-nav {
    padding: 12px 16px;
    border-radius: 18px;
    align-items: center;
    gap: 12px;
  }

  .nav-meta {
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
  }

  #status,
  #connectBtn {
    display: none !important;
  }

  .page-shell {
    width: min(92vw, 1120px);
    padding-bottom: 80px;
  }

  .hero {
    padding-top: 30px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.4rem);
  }

  .panel {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .workspace {
    margin-top: 24px;
    gap: 20px;
  }

  .section-head>button,
  .section-head>.btn {
    width: 100%;
    margin-top: 4px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .action-group {
    width: 100%;
  }

  .action-group .btn,
  .route-actions .btn {
    flex: 1 1 120px;
  }

  .auto-controls .action-group {
    flex-direction: column;
    width: 100%;
  }

  .auto-controls .action-group .btn {
    width: 100%;
    flex: auto;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .god-mode {
    grid-column: auto;
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-content {
    padding: 24px 20px;
    border-radius: 24px 24px 16px 16px;
    margin: 0;
    margin-bottom: constant(safe-area-inset-bottom);
    margin-bottom: env(safe-area-inset-bottom);
  }

  .label-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .label-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}