/* ===== Tokens ===== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro Thai", "Sukhumvit Set", "Noto Sans Thai", system-ui, "Segoe UI", sans-serif;

  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-text: #ffffff;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --ok: #248a3d;
  --err: #d70015;
  --err-soft: rgba(215, 0, 21, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.06);
  --hero-from: #000000;
  --hero-to: #666666;

  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px;
  --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;

  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 24px; --r-full: 9999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #000000;
    --surface: #181818;
    --surface-2: #1f1f1f;
    --surface-3: #313131;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --line: #313131;
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-text: #ffffff;
    --accent-soft: rgba(41, 151, 255, 0.14);
    --ok: #30d158;
    --err: #ff453a;
    --err-soft: rgba(255, 69, 58, 0.12);
    --nav-bg: rgba(24, 24, 24, 0.72);
    --shadow: none;
    --hero-from: #ffffff;
    --hero-to: #9b9b9b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #000000;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-3: #313131;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --line: #313131;
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-text: #ffffff;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --ok: #30d158;
  --err: #ff453a;
  --err-soft: rgba(255, 69, 58, 0.12);
  --nav-bg: rgba(24, 24, 24, 0.72);
  --shadow: none;
  --hero-from: #ffffff;
  --hero-to: #9b9b9b;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }
h1, h2, h3, .heading-1, .heading-2, .heading-3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-lg); }
.muted { color: var(--text-2); }

.skip-link {
  position: absolute; left: var(--s-200); top: -64px; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: var(--s-75) var(--s-100);
  border-radius: var(--r-lg); transition: transform 300ms var(--ease);
}
.skip-link:focus { transform: translateY(80px); }

/* ===== Text styles (Thai needs taller line height than Latin) ===== */
.heading-1 { font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 30px; line-height: 40px; font-weight: 600; letter-spacing: -0.015em; }
.heading-3 { font-size: 30px; line-height: 40px; font-weight: 600; letter-spacing: -0.015em; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-1 { font-size: 20px; line-height: 28px; font-weight: 500; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-lead { font-size: 18px; line-height: 28px; font-weight: 400; }
.body-3 { font-size: 16px; line-height: 26px; font-weight: 400; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-6 { font-size: 14px; line-height: 22px; font-weight: 400; }
.caption-1 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 18px; font-weight: 500; }
.caption-5 { font-size: 12px; line-height: 18px; font-weight: 400; }

@media (min-width: 768px) {
  .heading-1 { font-size: 60px; line-height: 72px; }
  .heading-2 { font-size: 48px; line-height: 60px; }
  .heading-3 { font-size: 36px; line-height: 48px; }
  .body-lead { font-size: 20px; line-height: 30px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75);
  border: 0; cursor: pointer; border-radius: var(--r-full); font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease), opacity 300ms var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-sm { font-size: 14px; line-height: 20px; padding: var(--s-50) var(--s-100); }
.btn-md { font-size: 16px; line-height: 24px; padding: var(--s-75) var(--s-200); }
.btn-lg { font-size: 18px; line-height: 28px; padding: var(--s-100) var(--s-300); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--line); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: var(--r-full); background: transparent; cursor: pointer; color: var(--text);
  transition: background-color 300ms var(--ease), transform 300ms var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Nav ===== */
.nav-wrap {
  position: fixed; top: var(--s-100); left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 var(--s-200); pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-50) var(--s-50) var(--s-50) var(--s-200);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  width: 100%; max-width: 760px;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: var(--s-75); color: var(--text); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--text); }
.nav-links { display: none; gap: var(--s-50); }
.nav-links a {
  display: block; padding: var(--s-50) var(--s-100); border-radius: var(--r-full);
  color: var(--text-2); font-size: 14px; line-height: 20px; font-weight: 500;
  transition: color 300ms var(--ease), background-color 300ms var(--ease);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="true"] { color: var(--text); background: var(--surface-3); }
.nav-actions { display: flex; align-items: center; gap: var(--s-25); }

#themeBtn .i-moon { display: none; }
:root[data-theme="dark"] #themeBtn .i-sun { display: none; }
:root[data-theme="dark"] #themeBtn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .i-sun { display: none; }
  :root:not([data-theme="light"]) #themeBtn .i-moon { display: block; }
}

.menu-btn { position: relative; }
.menu-btn .bar {
  position: absolute; left: 10px; width: 16px; height: 1.8px; border-radius: 2px; background: currentColor;
  transition: transform 500ms var(--ease);
}
.menu-btn .bar:nth-child(1) { transform: translateY(-3px); }
.menu-btn .bar:nth-child(2) { transform: translateY(3px); }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  padding: var(--s-900) var(--s-300) var(--s-300);
  opacity: 0; transition: opacity 300ms var(--ease);
}
.mobile-menu.open { opacity: 1; }
.mobile-menu ul { display: grid; gap: var(--s-75); }
.mobile-menu a {
  display: block; padding: var(--s-100) 0; color: var(--text);
  font-size: 30px; line-height: 40px; font-weight: 600;
  opacity: 0; transform: translateY(24px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.mobile-menu a:hover { text-decoration: none; }
.mobile-menu.open a { opacity: 1; transform: none; }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .mobile-menu { display: none !important; }
}

/* ===== Hero ===== */
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 120px var(--s-200) var(--s-700);
}
.eyebrow { color: var(--accent); margin-bottom: var(--s-100); }
.hero-title {
  max-width: 680px; padding-top: var(--s-50);
  background: linear-gradient(90deg, var(--hero-from), var(--hero-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 680px; margin-top: var(--s-200); color: var(--text-2); }
.br-desktop { display: none; }
@media (min-width: 768px) {
  .hero { padding-top: 160px; padding-bottom: var(--s-800); }
  .br-desktop { display: inline; }
}

/* ===== Converter ===== */
.converter {
  width: 100%; max-width: 760px; margin-top: var(--s-500);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3xl); padding: var(--s-75);
  box-shadow: var(--shadow); text-align: left;
}
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-75);
  min-height: 280px; padding: var(--s-500) var(--s-300); text-align: center;
  border-radius: var(--r-2xl); background: var(--surface-2); cursor: pointer;
  border: 2px dashed transparent;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease);
}
.drop:hover { background: var(--surface-3); }
.drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon {
  width: 56px; height: 56px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: var(--s-75);
}
.drop-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop .btn { margin-top: var(--s-100); }
.converter.has-files .drop { min-height: 0; padding: var(--s-300); flex-direction: row; gap: var(--s-100); }
.converter.has-files .drop .drop-icon { width: 40px; height: 40px; margin: 0; }
.converter.has-files .drop .drop-icon svg { width: 20px; height: 20px; }
.converter.has-files .drop #dropHint, .converter.has-files .drop .btn { display: none; }
.converter.has-files .drop .title-1 { font-size: 16px; line-height: 24px; }

.queue { padding: var(--s-200) var(--s-100) var(--s-100); }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-100); margin-bottom: var(--s-100); }
.queue-tools { display: flex; gap: var(--s-50); }

.bulk { display: flex; align-items: center; gap: var(--s-100); flex-wrap: wrap; margin-bottom: var(--s-100); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 1.8px solid var(--text-2); border-bottom: 1.8px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg);
}
.select-wrap select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-full);
  padding: var(--s-50) var(--s-500) var(--s-50) var(--s-200); font-size: 14px; line-height: 20px; font-weight: 500;
}

.items { display: grid; gap: var(--s-75); }
.item {
  background: var(--surface-2); border-radius: var(--r-xl); padding: var(--s-100);
  display: grid; gap: var(--s-100);
  animation: itemIn 500ms var(--ease) both;
}
@keyframes itemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.item-row { display: flex; align-items: center; gap: var(--s-100); min-width: 0; }
.item-icon {
  flex: none; width: 40px; height: 40px; border-radius: var(--r-lg);
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; overflow: hidden;
}
.item-icon img { width: 100%; height: 100%; object-fit: cover; }
.item-meta { flex: 1; min-width: 0; }
.item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-remove { flex: none; color: var(--text-2); }

.item-targets { display: flex; gap: var(--s-50); flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  border-radius: var(--r-full); padding: var(--s-50) var(--s-100);
  font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.02em;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease);
}
.chip:hover { border-color: var(--text-2); }
.chip:active { transform: scale(0.96); }
.chip[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

.item-progress { display: grid; gap: var(--s-50); }
.item-progress .bar { height: 4px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.item-progress .bar span {
  display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent);
  transform-origin: left; transform: scaleX(0); transition: transform 500ms var(--ease);
}
.item-progress.indeterminate .bar span { width: 40%; transform: none; animation: slide 1400ms var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.item-result { display: flex; flex-wrap: wrap; gap: var(--s-75); align-items: center; }
.item-result .ok { display: inline-flex; align-items: center; gap: var(--s-50); color: var(--ok); }
.item-result .ok svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.item-result .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.item-error { color: var(--err); background: var(--err-soft); border-radius: var(--r-lg); padding: var(--s-75) var(--s-100); }

.merge { display: flex; align-items: center; gap: var(--s-100); margin-top: var(--s-200); cursor: pointer; user-select: none; }
.merge input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--r-full); background: var(--surface-3);
  transition: background-color 300ms var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: var(--r-full);
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 500ms var(--ease);
}
.merge input:checked + .switch { background: var(--ok); }
.merge input:checked + .switch::after { transform: translateX(18px); }
.merge input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 2px; }

.queue-actions { display: flex; flex-direction: column; gap: var(--s-75); margin-top: var(--s-300); }
.queue-actions .btn { width: 100%; }
.queue-note { margin-top: var(--s-100); text-align: center; min-height: 20px; }
@media (min-width: 560px) {
  .queue-actions { flex-direction: row; justify-content: center; }
  .queue-actions .btn { width: auto; min-width: 200px; }
  .converter { padding: var(--s-100); }
}

.proof { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-200) var(--s-400); margin-top: var(--s-400); color: var(--text-2); }
.proof li { display: inline-flex; align-items: center; gap: var(--s-75); }
.proof svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Sections ===== */
.section { max-width: 1040px; margin: 0 auto; padding: var(--s-800) var(--s-200); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto var(--s-600); display: grid; gap: var(--s-100); }
.card { background: var(--bg-alt); border-radius: var(--r-3xl); padding: var(--s-300); }
:root[data-theme="dark"] .card { background: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { background: var(--surface); } }

.grid-formats { display: grid; gap: var(--s-200); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-formats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-formats { grid-template-columns: repeat(3, 1fr); } }
.fmt { display: grid; gap: var(--s-75); align-content: start; }
.fmt .caption-1 { margin-top: var(--s-75); }
.fmt-icon { width: 44px; height: 44px; border-radius: var(--r-xl); display: grid; place-items: center; color: #fff; margin-bottom: var(--s-75); }
.fmt-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c-blue { background: #0a84ff; } .c-purple { background: #bf5af2; } .c-pink { background: #ff375f; }
.c-red { background: #ff453a; } .c-indigo { background: #5e5ce6; } .c-green { background: #30b350; }
.c-orange { background: #ff9f0a; } .c-gray { background: #8e8e93; } .c-teal { background: #40c8e0; }

.tagline { max-width: 1040px; margin: 0 auto; padding: var(--s-900) var(--s-200); }
.tagline-text { max-width: 820px; margin: 0 auto; text-align: center; }
.tagline-text .w { color: var(--text); opacity: 0.28; transition: opacity 500ms var(--ease); }
.tagline-text .w.on { opacity: 1; }

.steps { display: grid; gap: var(--s-200); }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { display: grid; gap: var(--s-75); align-content: start; }
.step-num {
  width: 32px; height: 32px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--text); color: var(--bg); margin-bottom: var(--s-75);
}

.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s-300) var(--s-500) var(--s-300) 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: var(--s-75); top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg); transition: transform 500ms var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 var(--s-300); max-width: 680px; }

.final { text-align: center; padding: var(--s-800) var(--s-200) var(--s-900); display: grid; justify-items: center; gap: var(--s-300); }

.footer {
  border-top: 1px solid var(--line); padding: var(--s-300) var(--s-200) var(--s-400);
  max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--s-100) var(--s-300);
  justify-content: space-between; align-items: center;
}
.footer-links { display: flex; gap: var(--s-200); }
.footer-links a { color: var(--text-2); }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Simple pages (privacy, terms, 404) ===== */
.page { max-width: 680px; margin: 0 auto; padding: 140px var(--s-200) var(--s-800); display: grid; gap: var(--s-200); }
.page h2 { margin-top: var(--s-300); }
.page .back { margin-top: var(--s-300); justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .reveal { transform: none; transition: opacity 300ms linear; }
  .mobile-menu a { transform: none; }
  .tagline-text .w { opacity: 1; }
}

/* ===== Compact home + help page ===== */
.hero { min-height: 100svh; justify-content: center; padding-bottom: var(--s-600); }
.help { padding-top: var(--s-700); }
.help .final { padding-top: 0; }

/* ===== Mode switch (segmented control) ===== */
.segmented {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: var(--s-25); margin-bottom: var(--s-300);
  background: var(--surface-3); border-radius: var(--r-full);
}
.segmented button {
  position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
  padding: var(--s-75) var(--s-300); border-radius: var(--r-full);
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2);
  transition: color 300ms var(--ease);
}
.segmented button[aria-selected="true"] { color: var(--text); }
.seg-thumb {
  position: absolute; top: var(--s-25); bottom: var(--s-25); left: var(--s-25); width: calc(50% - 2px);
  background: var(--surface); border-radius: var(--r-full); box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: transform 500ms var(--ease);
}
:root[data-theme="dark"] .seg-thumb { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-thumb { background: #636366; } }
.segmented[data-mode="compress"] .seg-thumb { transform: translateX(100%); }

.saving { color: var(--ok); font-weight: 600; }
.chip-level { padding-left: var(--s-100); padding-right: var(--s-100); }
.hint-pdf { color: var(--text-2); }
