:root {
  color-scheme: light;
  --bg: #e8e7e1;
  --surface: #f4f3ee;
  --surface-inset: #ecebe5;
  --line: #cac9c2;
  --line-soft: #dedcd6;
  --text: #1c1c1a;
  --muted: #5c5c57;
  --ok: #2f5a40;
  --ok-bright: #3d7a56;
  --glow-ok: rgba(47, 90, 64, 0.42);
  --highlight: #e4ede7;
  --preview-bg: #dedcd6;
  --accent: #1c1c1a;
  --accent-bright: #f5f4f0;
  --accent-soft: #c44b1a;
  --err: #8f3a3a;
  --err-bg: #faf0ee;
  --err-line: #e8d4d0;
  --preview-h: 48px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.15, 0.64, 1);
  --shadow-sm: 0 1px 2px rgba(28, 28, 26, 0.05);
  --shadow-md: 0 4px 16px rgba(28, 28, 26, 0.06);
  --shadow-elevated:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 1px 2px rgba(28, 28, 26, 0.04),
    0 10px 32px rgba(28, 28, 26, 0.06);
  --radius: 8px;
  --radius-lg: 10px;
  --hairline: rgba(28, 28, 26, 0.09);
  --page-pad: 10px;
  --content-max: 720px;
  --toggle-bg: var(--text);
  --toggle-fg: var(--bg);
  --toggle-border: transparent;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1a1c;
  --surface: #2c2c30;
  --surface-inset: #242428;
  --surface-raised: #35353b;
  --line: #48484f;
  --line-soft: #3a3a40;
  --text: #f2f2f0;
  --muted: #9b9ba3;
  --ok: #9bb5a6;
  --highlight: rgba(155, 181, 166, 0.14);
  --preview-bg: #222226;
  --accent: #f0efeb;
  --accent-bright: #e8e8e4;
  --accent-soft: #d4734a;
  --err: #e0a8a8;
  --err-bg: #2e2222;
  --err-line: #4a3636;
  --toggle-bg: rgba(255, 255, 255, 0.07);
  --toggle-fg: #e8e8e4;
  --toggle-border: #52525c;
  --hairline: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.28);
  --shadow-elevated:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 2px 8px rgba(0, 0, 0, 0.22),
    0 16px 40px rgba(0, 0, 0, 0.28);
  --ok-bright: #b5d4c4;
  --glow-ok: rgba(155, 181, 166, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scrollbar-gutter: stable;
  height: 100%;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}


html:not([data-theme="dark"]) body {
  background:
    radial-gradient(ellipse 85% 55% at 100% 0%, rgba(47, 90, 64, 0.05) 0%, transparent 58%),
    radial-gradient(ellipse 70% 45% at 0% 100%, rgba(28, 28, 26, 0.03) 0%, transparent 52%),
    var(--bg);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(212, 115, 74, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(155, 181, 166, 0.08) 0%, transparent 50%),
    var(--bg);
}

.ambient {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

html[data-theme="dark"] .ambient {
  display: block;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
}

html[data-theme="dark"] .ambient-orb-a {
  width: min(60vw, 480px);
  height: min(60vw, 480px);
  top: -15%;
  right: -10%;
  opacity: 1;
  background: radial-gradient(circle, rgba(155, 181, 166, 0.22) 0%, transparent 68%);
}

html[data-theme="dark"] .ambient-orb-b {
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  bottom: 5%;
  left: -12%;
  opacity: 1;
  background: radial-gradient(circle, rgba(212, 115, 74, 0.14) 0%, transparent 65%);
}

.grid-bg, .vignette, .grain { display: none !important; }

.mono, .tk-mono, .file-name, .brand-sub, .field-label, .size-caption, .slider-value, .footer,
.toolkit-title, .tool-pill-name, .tool-category-name {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@keyframes lamp-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--ok-bright) 22%, transparent),
      0 0 10px 2px var(--glow-ok);
  }
  50% {
    opacity: 0.82;
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--ok-bright) 12%, transparent),
      0 0 5px 1px color-mix(in srgb, var(--ok-bright) 30%, transparent);
  }
}

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

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .load-seq {
    animation: rise-in 0.85s var(--ease-out) forwards;
    animation-delay: calc(0.08s + var(--seq, 0) * 0.1s);
    opacity: 1;
  }

  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-child {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), border-color 0.35s, background 0.35s;
  }

  .reveal-child.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-orb { animation: none !important; }
  .offline-lamp { animation: none !important; }
  .reveal, .reveal-child, .load-seq { opacity: 1 !important; transform: none !important; animation: none !important; }
  .btn, .tool-pill, .drop-zone, .panel { transition-duration: 0.01ms !important; }
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 6px var(--page-pad) 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  justify-content: flex-start;
}

.main-hub {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}

.more-tools {
  margin-top: auto;
}

.hub-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.hub-brand h1 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-top .mode-tabs--main {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 2px;
}

.hub-top .mode-tab {
  padding: 5px 12px;
  font-size: 10px;
}

.hub-top .theme-toggle {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.main-hub:has(#readyPanel:not([hidden])),
.main-hub:has(#working:not([hidden])),
.main-hub:has(#result:not([hidden])) {
  flex: 1 1 auto;
  min-height: 0;
}

.hub-panel.panel {
  flex: 0 0 auto;
  min-height: 0;
  padding: 8px 10px 10px;
  gap: 6px;
  border: none;
  box-shadow: none;
  background: transparent;
}

.hub-panel.panel:hover {
  border-color: transparent;
}

.main-hub:has(#readyPanel:not([hidden])) .hub-panel.panel,
.main-hub:has(#working:not([hidden])) .hub-panel.panel,
.main-hub:has(#result:not([hidden])) .hub-panel.panel {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.main-hub > .panel-hero {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.main-hub > .panel-hero:hover {
  border-color: transparent;
}

.offline-badge {
  padding: 2px 7px 2px 6px;
  gap: 5px;
}

.offline-lamp {
  width: 6px;
  height: 6px;
}

.offline-label {
  font-size: 9px;
}

.mode-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px 4px;
}

.mode-guide-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.mode-guide-grid,
.tool-spotlight-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

@media (min-width: 520px) {
  .mode-guide-grid,
  .tool-spotlight-meta {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.mode-guide-grid > div,
.tool-spotlight-meta > div {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-inset) 55%, var(--surface));
}

.mode-guide-grid dt,
.tool-spotlight-meta dt {
  margin: 0 0 3px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
}

.mode-guide-grid dd,
.tool-spotlight-meta dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.more-tools {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.more-tools[open] {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.more-tools-summary {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  flex-shrink: 0;
}

.more-tools-summary::-webkit-details-marker {
  display: none;
}

.more-tools-summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}

.more-tools {
  position: relative;
}

.more-tools-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.more-tools-sub {
  font-size: 10px;
  color: var(--muted);
  padding-right: 0;
}

.more-tools .toolkit-section {
  padding: 0 8px 8px;
  border-top: 1px solid var(--hairline);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.more-tools[open] .toolkit-workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.more-tools .tool-spotlight {
  margin: 8px 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-inset) 55%, var(--surface));
  min-height: 0;
  gap: 2px;
}

.more-tools .tool-spotlight-meta {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.more-tools[open] .more-tools-summary::after {
  content: "−";
}

.drop-block {
  position: relative;
}

.format-more[open] .format-grid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 4px;
  z-index: 5;
  max-height: min(36vh, 220px);
}

.footer {
  text-align: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1.2;
}

.footer a {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
}

.tool-spotlight-meta {
  margin-top: 4px;
  flex-shrink: 0;
}

.tool-spotlight.is-live .tool-spotlight-detail {
  -webkit-line-clamp: 2;
}

.header {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

@media (min-width: 768px) {
  .header-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    align-items: stretch;
    gap: 14px;
  }
}

.header-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tool-spotlight {
  padding: 12px 14px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: flex-start;
  overflow: hidden;
  transition:
    border-color 0.32s var(--ease-out),
    box-shadow 0.32s var(--ease-out),
    background 0.32s var(--ease-out);
}

.tool-spotlight.is-live {
  border-color: color-mix(in srgb, var(--ok) 32%, var(--hairline));
  background: color-mix(in srgb, var(--highlight) 55%, var(--surface));
  box-shadow:
    var(--shadow-elevated),
    0 0 0 1px color-mix(in srgb, var(--ok) 8%, transparent);
}

.tool-spotlight-eyebrow {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.tool-spotlight.is-live .tool-spotlight-eyebrow {
  color: var(--ok);
}

.tool-spotlight-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-spotlight-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-spotlight.is-live .tool-spotlight-summary {
  color: var(--text);
}

.tool-spotlight-detail {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--hairline));
  background: color-mix(in srgb, var(--ok) 7%, var(--surface));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.offline-lamp {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-bright);
  flex-shrink: 0;
  animation: lamp-pulse 2.8s var(--ease-out) infinite;
}

.offline-label {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
  font-weight: 500;
}

.trust-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-chips li {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.trust-chips li:hover {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--hairline));
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    background 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--hairline));
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.theme-toggle-icon {
  font-size: 15px;
  line-height: 1;
}

.theme-toggle-icon::before {
  content: "☾";
}

html[data-theme="dark"] .theme-toggle-icon::before {
  content: "☀";
}

h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-sub {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.surface-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-elevated);
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.file-hub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.file-hub .panel-hero {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.file-hub .mode-tabs,
.file-hub .panel {
  width: 100%;
}

.mode-tabs {
  display: flex;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-inset) 70%, transparent);
  box-shadow: var(--shadow-sm);
}

.mode-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.28s var(--ease-out),
    color 0.28s var(--ease-out),
    box-shadow 0.28s var(--ease-out),
    transform 0.28s var(--ease-spring);
}

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

html[data-theme="dark"] .mode-tab.is-active {
  background: var(--surface-raised);
}

.header-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-compact h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pitch {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-compact .hero-title {
  font-size: 18px;
  font-weight: 600;
}

.hero-compact .hero-sub {
  font-size: 13px;
  margin: 0;
}

.hero-compact .panel {
  min-height: auto;
  padding: 12px;
}

.hero-compact .panel-hero {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.hero-compact .drop-zone {
  min-height: 110px;
  padding: 18px 14px;
  border-radius: 12px;
}

.file-hub .quick-bar {
  position: static;
}

.drop-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px;
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.format-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.format-chip-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.format-all {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.format-all summary {
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.format-all summary::-webkit-details-marker { display: none; }

.format-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.format-group-label {
  margin: 0 0 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.format-group-exts {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}

.drop-zone--pulse {
  border-color: var(--ok) !important;
  background: rgba(143, 168, 152, 0.08) !important;
  transition: border-color 0.2s, background 0.2s;
}

.hero-compact .drop-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.hero-compact .drop-title {
  font-size: 14px;
}

.hero-compact .drop-sub {
  font-size: 12px;
}

.hero-compact .btn-pick {
  padding: 8px 14px;
  font-size: 13px;
  margin-top: 4px;
}

.quick-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  z-index: 2;
}

.quick-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(143, 168, 152, 0.25);
  border-radius: 12px;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.35s var(--ease-out), background 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.quick-card:hover {
  border-color: rgba(143, 168, 152, 0.45);
  background: rgba(18, 20, 19, 0.95);
}

.quick-card.is-active {
  border-color: var(--ok);
  background: rgba(20, 24, 22, 0.95);
  box-shadow: 0 0 0 1px rgba(143, 168, 152, 0.15);
}

.quick-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(143, 168, 152, 0.12);
  color: var(--ok);
  font-size: 16px;
}

.quick-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quick-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.quick-card-sum {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

@media (max-width: 520px) {
  .quick-bar {
    grid-template-columns: 1fr;
    position: static;
  }
}

.hero-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.fine {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.brand-mark-inner {
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.mode-switch {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mode-btn {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.35s var(--ease-out), color 0.35s var(--ease-out), background 0.35s var(--ease-out);
}

.mode-btn.active {
  border-color: var(--ok);
  color: var(--text);
  background: #141816;
  font-weight: 600;
}

.panel {
  flex: 1;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-elevated);
  overflow: visible;
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.panel:hover {
  border-color: color-mix(in srgb, var(--ok) 12%, var(--hairline));
}

.panel-compact {
  gap: 6px;
  padding: 0;
}

.panel-compact .drop-zone {
  min-height: 52px;
  padding: 10px 12px;
  gap: 6px;
}

.panel-compact .drop-title {
  font-size: 13px;
  margin: 0;
}

.panel-compact .btn-pick {
  margin-top: 0;
  padding: 5px 12px;
  font-size: 10px;
}

.panel-compact .file-card {
  padding: 8px 10px;
}

.panel-compact .file-name {
  font-size: 13px;
}

.panel-compact .file-type {
  font-size: 11px;
}

.panel-hero {
  box-shadow: none;
}

.error-box {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--err-bg);
  color: var(--err);
  font-size: 13px;
  border: 1px solid var(--err-line);
}

.drop-zone {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed color-mix(in srgb, var(--hairline) 90%, var(--muted));
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  padding: 14px 12px;
  background: color-mix(in srgb, var(--surface-inset) 40%, transparent);
  transition:
    border-color 0.32s var(--ease-out),
    background 0.32s var(--ease-out),
    box-shadow 0.32s var(--ease-out),
    transform 0.32s var(--ease-spring);
}

.drop-zone:hover {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--hairline));
  background: var(--highlight);
  box-shadow: 0 4px 18px rgba(47, 90, 64, 0.07);
}

.drop-zone.dragover,
.drop-zone--pulse {
  border-color: var(--ok) !important;
  border-style: solid;
  background: var(--highlight) !important;
  color: var(--text);
}

.drop-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }
.drop-sub { margin: 0; font-size: 11px; color: var(--muted); }

.btn-pick {
  margin-top: 2px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-inset) 55%, var(--surface));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}

.file-meta { flex: 1; min-width: 0; }

.file-name {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type, .pipeline-note {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pipeline-note { color: var(--ok); }

.btn-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.size-row, .convert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.size-slider-sizes {
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
}

.size-from { color: var(--muted); }
.size-to {
  color: var(--ok);
  transition: color 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.arrow { color: var(--muted); }

.hint { margin: 0; font-size: 12px; color: var(--muted); }

#compressPanel,
#convertPanel,
.action-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lossless-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
}

.lossless-inline input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ok);
  flex-shrink: 0;
}

.lossless-inline .lossless-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.lossless-inline .lossless-desc {
  font-size: 11px;
  color: var(--muted);
}

.field-label--tight {
  margin: 0 0 4px;
  font-size: 10px;
}

#convertTarget {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.compress-size-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-inset);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.btn-compact {
  padding: 9px 12px;
  font-size: 12px;
}

.compress-size {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface-inset) 65%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.25s var(--ease-out), box-shadow 0.28s var(--ease-out);
}

.compress-size.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.compress-size.is-disabled .compress-track-input {
  cursor: not-allowed;
}

.compress-size-label {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.compress-size-value {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

.compress-size-ref {
  margin: 0 0 6px;
  font-size: 10px;
  color: var(--muted);
}

.compress-size-ref span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.compress-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compress-track-bar {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.compress-track-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--line-soft);
}

.compress-track-fill {
  position: absolute;
  left: 0;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8aab96 0%, var(--ok) 100%);
  pointer-events: none;
  transition: width 0.2s var(--ease-out);
}

.compress-track.is-dragging .compress-track-fill {
  transition: none;
}

.compress-track-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 24px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.compress-track-input:focus { outline: none; }

.compress-track-input::-webkit-slider-runnable-track {
  height: 3px;
  background: transparent;
}

.compress-track-input::-moz-range-track {
  height: 3px;
  background: transparent;
  border: none;
}

.compress-track-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
}

.compress-track-input:active::-webkit-slider-thumb {
  transform: scale(1.06);
}

.compress-track-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
}

.compress-track-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 35%, transparent);
}

.compress-track-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .compress-track-fill {
  background: linear-gradient(90deg, #7a9d8a 0%, var(--ok) 100%);
}

html[data-theme="dark"] .compress-track-input::-webkit-slider-thumb {
  background: #e8e8e4;
  border-color: #c8c8c4;
}

.size-slider {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-inset);
}

.size-slider-rail {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-soft);
  box-shadow: inset 0 1px 2px rgba(28, 28, 26, 0.06);
}

.size-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8aab96 0%, var(--ok) 100%);
  box-shadow: none;
  transition: width 0.45s var(--ease-out);
}

.size-slider-fill--shrunk {
  box-shadow: none;
}

.size-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
}

.size-slider-input:active::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

.size-slider-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
}

.btn {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.26s var(--ease-out),
    background 0.26s var(--ease-out),
    box-shadow 0.26s var(--ease-out),
    transform 0.22s var(--ease-spring);
}

.btn:hover {
  border-color: color-mix(in srgb, var(--ok) 25%, var(--line));
  background: var(--surface-inset);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  color: var(--ok);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

.btn-primary:hover {
  border-color: var(--ok);
  background: var(--highlight);
  box-shadow: 0 4px 18px rgba(47, 90, 64, 0.12);
  opacity: 1;
}

html[data-theme="dark"] .btn-primary {
  background: color-mix(in srgb, var(--ok) 18%, var(--surface-raised));
  color: var(--ok-bright);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .btn-primary:hover {
  background: color-mix(in srgb, var(--ok) 26%, var(--surface-raised));
}

html[data-theme="dark"] .panel {
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .size-slider-fill {
  background: linear-gradient(90deg, #7a9d8a 0%, var(--ok) 100%);
}

html[data-theme="dark"] .size-slider-input::-webkit-slider-thumb {
  background: #e8e8e4;
  border-color: #c8c8c4;
}

html[data-theme="dark"] .tool-pill:hover {
  border-color: #6a6a72;
  background: var(--surface-raised);
}

.progress {
  height: 4px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 8%;
  background: var(--ok);
  transition: width 0.35s var(--ease-out);
}

.preview-box--compact {
  border: none;
  background: transparent;
}

.preview-box--compact .preview-stage {
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.preview-info {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--muted);
}

.preview-stage {
  height: var(--preview-h);
  min-height: var(--preview-h);
  max-height: var(--preview-h);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--preview-bg);
  padding: 8px;
  box-sizing: border-box;
}

.preview-table th { background: var(--surface-inset); }

.size-slider-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 44px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.size-slider-input:focus { outline: none; }

.size-slider--compress:has(.size-slider-input:active) .size-to,
.size-slider--convert:has(.size-slider-input:active) .size-to {
  transform: scale(1.04);
}

.size-slider-track {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  margin: 2px 0;
}

.size-slider-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  pointer-events: none;
}

.size-slider-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(47, 90, 64, 0.25), var(--shadow-sm);
}

.size-slider-input::-webkit-slider-runnable-track {
  height: 10px;
  background: transparent;
  border: none;
}

.size-slider-input::-moz-range-track {
  height: 10px;
  background: transparent;
  border: none;
}

@media (prefers-reduced-motion: reduce) {
  .size-slider-fill,
  .compress-track-fill,
  .size-to {
    transition: none !important;
  }
}

.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.slider-value {
  font-size: 11px;
  color: var(--ok);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.slider-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
}

.field-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.convert-options {
  margin-top: 4px;
}

.convert-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.convert-summary {
  margin: 0;
  font-size: 12px;
  color: var(--ok);
  text-align: center;
}

.working { text-align: center; }

.working p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.result { text-align: center; }

.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.file-actions-hint {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.btn-ghost {
  padding: 7px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.result-note {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--muted);
}

.result-size { margin: 0 0 6px; font-size: 16px; font-weight: 600; }

.compress-size {
  padding: 8px 10px;
  gap: 2px;
}

.file-card {
  padding: 8px 10px;
  gap: 8px;
}

.result-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.result-btns .btn-primary {
  width: auto;
  flex: 1 1 auto;
}

.footer {
  text-align: center;
  flex-shrink: 0;
  padding: 0;
}

.footer a {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
}

.footer-sep {
  margin: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.8);
}

.modal-backdrop[hidden] { display: none !important; }

.modal {
  width: min(100%, 320px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111;
}

.modal-title { margin: 0 0 10px; font-size: 16px; }

.modal-file {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.modal-btns { display: flex; gap: 8px; }

.modal-btns .btn-primary { width: auto; flex: 1; }

.preview-label {
  margin: 0;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
  background: var(--surface);
}

.preview-info {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  min-height: 28px;
}

.preview-media,
.preview-img,
.preview-video,
.preview-canvas,
.video-thumb,
.pdf-page-canvas,
.pdf-embed {
  display: block;
  max-width: 100%;
  max-height: calc(var(--preview-h) - 12px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.preview-video {
  width: auto;
  background: var(--preview-bg);
}

.video-preview-wrap .preview-video:not([poster]) {
  background: var(--line-soft);
}

.preview-audio { width: 100%; max-width: 100%; }

.preview-text {
  margin: 0;
  padding: 8px;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  max-height: calc(var(--preview-h) - 12px);
  overflow: auto;
  box-sizing: border-box;
}

.preview-note, .preview-loading, .preview-placeholder {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.preview-sub {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.preview-table-wrap {
  width: 100%;
  height: calc(var(--preview-h) - 12px);
  max-height: calc(var(--preview-h) - 12px);
  overflow: auto;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.preview-table th, .preview-table td {
  border: 1px solid var(--line);
  padding: 4px 6px;
  text-align: left;
}

.preview-table th { background: #1a1a1a; }

.preview-doc {
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
  width: 100%;
  max-height: calc(var(--preview-h) - 12px);
  overflow: auto;
  box-sizing: border-box;
}

.video-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-height: calc(var(--preview-h) - 12px);
  overflow: auto;
  align-items: center;
}

/* —— Shared section labels —— */
.section-label {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ok);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover { opacity: 0.85; }

/* —— Format hint (compact) —— */
.format-line {
  margin: 0;
  padding: 0;
  font-size: 9px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#formatStrip {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
}

.format-more {
  display: inline;
  margin-left: 4px;
}

.format-more > summary {
  display: inline;
  cursor: pointer;
  color: var(--ok);
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.format-more > summary::-webkit-details-marker {
  display: none;
}

.format-more[open] > summary {
  margin-bottom: 6px;
}

.format-more .format-grid {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-inset);
  text-align: left;
  max-height: 160px;
  overflow: auto;
}

/* —— Toolkit section —— */
.toolkit-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.toolkit-section-label {
  margin: 0 0 2px;
  padding-left: 2px;
}

.toolkit-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

@media (max-width: 767px) {
  .toolkit-workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
}

.toolkit-compact-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolkit-head-label {
  flex-shrink: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-picker {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-inset);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.tool-empty {
  margin: 0;
  padding: 16px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.tool-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.toolkit-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 10px 12px;
  overflow: hidden;
}

.toolkit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolkit-head-label {
  flex-shrink: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-picker {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-inset);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.tool-picker:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line-soft));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 12%, transparent);
}

.tool-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  flex-shrink: 0;
}

.tool-empty {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-inset) 60%, transparent);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.tool-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

#toolkitToolRoot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

#toolkitToolRoot .field-label {
  margin: 0;
  font-size: 10px;
}

#toolkitToolRoot textarea {
  min-height: 52px;
  max-height: 72px;
  resize: none;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

#toolkitToolRoot input,
#toolkitToolRoot select {
  padding: 7px 10px;
  font-size: 12px;
}

#toolkitToolRoot .tk-row {
  gap: 6px;
}

#toolkitToolRoot .btn {
  padding: 6px 10px;
  font-size: 11px;
}

.tk-output {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  min-height: 36px;
  max-height: 96px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

.toolkit-card {
  padding: 12px;
  flex: 1;
  min-height: 0;
}

.tool-mosaic {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
  .tool-mosaic .tool-group {
    animation: tool-group-in 0.55s var(--ease-out) backwards;
    animation-delay: calc(var(--group-i, 0) * 55ms);
  }

  .tool-mosaic .tool-pill {
    animation: tool-pill-in 0.45s var(--ease-out) backwards;
    animation-delay: calc(80ms + var(--pill-i, 0) * 22ms);
  }
}

@keyframes dock-in {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

@keyframes tool-group-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tool-pill-in {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tool-group.is-dimmed {
  opacity: 0.38;
}

.tool-group-label {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tool-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 0;
  padding: 6px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-inset));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.26s var(--ease-out),
    background 0.26s var(--ease-out),
    box-shadow 0.26s var(--ease-out),
    transform 0.26s var(--ease-spring),
    opacity 0.26s var(--ease-out);
  transform: perspective(420px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0));
}

.tool-pill:hover,
.tool-pill.is-hovered {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line-soft));
  background: var(--highlight);
  box-shadow:
    0 2px 8px rgba(47, 90, 64, 0.08),
    0 8px 22px rgba(47, 90, 64, 0.06);
  transform: perspective(420px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0));
}

.tool-pill.is-active {
  border-color: var(--ok);
  background: var(--highlight);
  box-shadow: inset 0 0 0 1px rgba(47, 90, 64, 0.15);
}

.tool-pill-name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.tool-pill-sum {
  font-size: 9px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-pill.is-hovered .tool-pill-sum,
.tool-pill.is-active .tool-pill-sum {
  color: color-mix(in srgb, var(--ok) 70%, var(--muted));
}

.tool-dock {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  transition:
    opacity 0.28s var(--ease-out),
    max-height 0.32s var(--ease-out);
}

.tool-dock.is-open {
  opacity: 1;
  max-height: min(480px, 52vh);
}

@media (max-width: 767px) {
  .tool-dock {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .tool-dock.is-open {
    max-height: none;
    flex: 1 1 auto;
  }

  .tool-dock-inner {
    max-height: none;
    flex: 1 1 auto;
  }
}

@media (min-width: 768px) {
  .tool-dock.is-open {
    max-height: min(520px, 58vh);
  }

  .tool-dock-inner {
    max-height: min(520px, 58vh);
  }
}

.tool-dock-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.tool-dock-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.tool-dock .toolkit-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

#toolkitToolRoot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tool-dock {
    transition: opacity 0.15s ease;
  }
}

.format-grid {
  display: grid;
  gap: 10px;
  text-align: left;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-inset);
}

.tk-output,
#toolkitToolRoot textarea,
#toolkitToolRoot input,
#toolkitToolRoot select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.md-preview-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-inset);
  min-height: 80px;
}

.md-preview code {
  background: var(--line-soft);
}

.toolkit-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.toolkit-panel-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolkit-back {
  align-self: flex-start;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 8px;
}

.tk-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.vd-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vd-progress-label {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

#toolkitToolRoot input[type="url"] {
  width: 100%;
  box-sizing: border-box;
}

.md-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0a0a0c;
  min-height: 80px;
}

.md-preview {
  font-size: 14px;
  line-height: 1.6;
}

.md-preview h1, .md-preview h2, .md-preview h3 {
  margin: 0.6em 0 0.3em;
  font-size: 1.1em;
}

.md-preview code {
  background: #1a1a1c;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.toolkit-tool-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.toolkit-tool-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#toolkitToolRoot textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
}

.tk-output.ok { color: var(--text); }
.tk-output.err { color: var(--err); }

.tk-mono, #toolkitToolRoot textarea, #toolkitToolRoot input, #toolkitToolRoot select {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

#toolkitToolRoot input[type="text"],
#toolkitToolRoot input[type="number"],
#toolkitToolRoot select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
  box-sizing: border-box;
}

.tk-swatch {
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.diff-add { color: #8faf9a; }
.diff-del { color: var(--err); }

.tk-toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141414;
  font-size: 12px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.tk-toast.show { opacity: 1; }

.roadmap-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(10, 10, 10, 0.6);
}

.roadmap-block summary {
  cursor: pointer;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.roadmap-intro {
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.roadmap-list {
  display: grid;
  gap: 12px;
}

@media (min-width: 480px) {
  .roadmap-list { grid-template-columns: 1fr 1fr; }
}

.roadmap-cat-title {
  margin: 0 0 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.roadmap-cat ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}
