:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, .64);
  --surface-solid: rgba(255, 255, 255, .78);
  --surface-muted: rgba(255, 255, 255, .58);
  --surface-hover: #f0f4ff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --line: rgba(0, 0, 0, .09);
  --line-strong: rgba(0, 0, 0, .14);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e8f2ff;
  --green: #248a3d;
  --green-soft: #e9f7ed;
  --orange: #b85c00;
  --orange-soft: #fff3e5;
  --red: #d70015;
  --red-soft: #fff0f1;
  --shadow: 0 22px 80px rgba(15, 23, 42, .10), inset 0 1px 0 rgba(255,255,255,.52);
  --shadow-small: 0 12px 36px rgba(15, 23, 42, .09), inset 0 1px 0 rgba(255,255,255,.46);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgba(24, 24, 28, .56);
  --surface-solid: rgba(28, 28, 32, .72);
  --surface-muted: rgba(38, 38, 43, .60);
  --surface-hover: #1c2c42;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .18);
  --blue: #0a84ff;
  --blue-hover: #409cff;
  --blue-soft: #102b46;
  --green: #30d158;
  --green-soft: #15371f;
  --orange: #ff9f0a;
  --orange-soft: #3b2b13;
  --red: #ff453a;
  --red-soft: #3c1b1c;
  --shadow: 0 24px 90px rgba(0, 0, 0, .44), inset 0 1px 0 rgba(255,255,255,.08);
  --shadow-small: 0 12px 36px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255,255,255,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(64, 156, 255, .18), transparent 22rem),
    radial-gradient(circle at 82% 9%, rgba(94, 92, 230, .18), transparent 22rem),
    radial-gradient(circle at 50% 100%, rgba(175, 82, 222, .10), transparent 24rem),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, white 12%), var(--bg));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
a { color: inherit; }
svg { display: block; }
.section-anchor { scroll-margin-top: 76px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar {
  position: sticky;
  top: 10px;
  z-index: 50;
  width: min(1180px, calc(100% - 36px));
  height: 58px;
  margin: 10px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-small);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
}
.topbar-inner {
  width: calc(100% - 18px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #0a84ff, #0064d8);
  box-shadow: 0 4px 12px rgba(0, 113, 227, .26);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.topnav { display: flex; align-items: center; gap: 30px; }
.topnav a { color: var(--text-secondary); font-size: 12px; text-decoration: none; transition: color .18s ease; }
.topnav a:hover { color: var(--text); }
.theme-toggle {
  justify-self: end;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-muted); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }

.shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 0 0 52px; }
.hero { position: relative; padding: 96px 0 62px; text-align: center; }
.hero::before { content: ''; position: absolute; inset: 16px 8% auto; height: 240px; border-radius: 40px; background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.04)); filter: blur(14px); pointer-events: none; }
.badge, .section-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
}
.badge {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 14%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, var(--blue-soft) 24%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
h1 {
  margin: 20px auto 16px;
  max-width: 820px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.02;
  font-weight: 740;
  letter-spacing: -.06em;
}
h1 span {
  background: linear-gradient(92deg, #0071e3 3%, #5e5ce6 48%, #af52de 96%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.hero > p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.72;
  letter-spacing: -.012em;
}
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.hero-button { text-decoration: none; }
.model-route {
  max-width: 760px;
  margin: 38px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.route-item { min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.route-item > div { min-width: 0; display: grid; gap: 2px; }
.route-item strong { font-size: 13px; font-weight: 650; white-space: nowrap; }
.route-item small { color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
.route-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent); }
.route-dot.plus { color: #34c759; background: currentColor; }
.route-dot.deepseek { color: #0a84ff; background: currentColor; }
.route-dot.max { color: #af52de; background: currentColor; }
.route-arrow { color: var(--text-tertiary); font-size: 14px; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-muted) 86%, transparent));
  box-shadow: var(--shadow);
  padding: 34px;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  overflow: hidden;
}
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 38%); pointer-events: none; }
.upload-card, #progressCard, #batchResultCard, #resultCard { margin-bottom: 24px; }
.card-heading, .result-head, .history-head, .settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}
.card-heading h2, .result-head h2, .history-head h2, .capabilities-heading h2 { margin: 7px 0 0; font-size: clamp(28px, 3.5vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.card-heading p, .history-head p, .capabilities-heading p { margin: 10px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.status { display: inline-flex; align-items: center; max-width: 410px; padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 550; line-height: 1.45; }
.status::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 11%, transparent); }
.status-loading { color: var(--orange); background: var(--orange-soft); }
.status-ok { color: var(--green); background: var(--green-soft); }
.status-warn { color: var(--orange); background: var(--orange-soft); }

.drop-zone {
  position: relative;
  display: flex;
  min-height: 270px;
  margin-top: 28px;
  padding: 32px 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  border: 1.5px dashed color-mix(in srgb, var(--blue) 42%, var(--line));
  border-radius: 24px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--blue-soft) 55%, var(--surface-solid)), var(--surface-solid));
  cursor: pointer;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
/* Removed the decorative bottom-right radial glow: it read as a stray blue patch. */
.drop-zone::before {
  content: none;
  display: none;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--blue);
  background: linear-gradient(145deg, color-mix(in srgb, var(--blue-soft) 85%, var(--surface-solid)), var(--surface-solid));
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 113, 227, .10);
}
.upload-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2196ff, #006edc);
  color: white;
  box-shadow: 0 12px 28px rgba(0, 113, 227, .26);
}
.upload-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { max-width: 680px; font-size: 19px; line-height: 1.35; letter-spacing: -.015em; }
.drop-zone > span:not(.upload-icon):not(.choose-file-button) { color: var(--text-secondary); font-size: 13px; }
.choose-file-button { margin-top: 8px; padding: 8px 15px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 13px; font-weight: 650; }

.settings-header { align-items: flex-end; margin: 30px 0 14px; padding-top: 26px; border-top: 1px solid var(--line); }
.settings-header h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.025em; }
.processing-context {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin-left: auto;
  text-align: right;
}
.processing-context strong { color: var(--text); font-size: 13px; font-weight: 650; }
.processing-context small { color: var(--text-tertiary); font-size: 11px; line-height: 1.45; }
.settings-note { color: var(--text-tertiary); font-size: 12px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.option-panel {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-muted);
}
.option-panel legend { padding: 0 7px; color: var(--text); font-size: 14px; font-weight: 650; }
.option-panel > label:not(.radio-card) { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; }
.glass-segment { display: inline-grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface-solid) 74%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.42); }
.segment-pill { min-height: 42px; border: 0; border-radius: 14px; background: transparent; color: var(--text-secondary); font-weight: 650; letter-spacing: -.015em; cursor: pointer; transition: all .18s ease; }
.segment-pill.active { color: var(--text); background: color-mix(in srgb, var(--surface-solid) 82%, transparent); box-shadow: 0 8px 18px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.48); }
.segment-pill:hover { color: var(--text); }
.option-help { margin: 10px 0 0; color: var(--text-tertiary); font-size: 11px; line-height: 1.55; }
.radio-card { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; background: transparent; transition: background-color .18s ease, border-color .18s ease; }
.radio-card:hover { background: color-mix(in srgb, var(--surface-solid) 76%, transparent); border-color: var(--line); }
.radio-card:has(input:checked) { background: color-mix(in srgb, var(--surface-solid) 84%, transparent); border-color: var(--line); }
.radio-card input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  display: grid;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--text-secondary) 72%, transparent);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.radio-card input::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
  transform: scale(.45);
}
.radio-card input:checked { border-color: var(--blue); }
.radio-card input:checked::before { opacity: 1; transform: scale(1); }
.radio-card input:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 58%, transparent); outline-offset: 3px; }
.radio-card:hover input { box-shadow: none; }
.radio-card:has(input:checked) input { border-color: var(--blue); }
.radio-card span { display: grid; gap: 3px; }
.radio-card strong { font-size: 13px; }
.radio-card small { color: var(--text-secondary); font-size: 11px; line-height: 1.45; }

.switch-list { display: grid; gap: 10px; margin-top: 14px; }
.check-option {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 13px;
  min-height: 66px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
  cursor: pointer;
}
.check-option input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { position: relative; width: 42px; height: 25px; border-radius: 999px; background: #d1d1d6; transition: background .2s ease; }
.switch-control::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.check-option input:checked + .switch-control { background: var(--green); }
.check-option input:checked + .switch-control::after { transform: translateX(17px); }
.check-option input:focus-visible + .switch-control { outline: 4px solid color-mix(in srgb, var(--blue) 18%, transparent); }
.check-option input:disabled + .switch-control { opacity: .45; }
.switch-copy { display: grid; gap: 3px; }
.switch-copy strong { font-size: 13px; }
.switch-copy small { color: var(--text-secondary); font-size: 11px; line-height: 1.5; }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.primary, .secondary, .danger, .danger-outline {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 620;
  font-size: 14px;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: white; background: linear-gradient(180deg, color-mix(in srgb, var(--blue-hover) 88%, white 12%), var(--blue)); box-shadow: 0 12px 28px rgba(0, 113, 227, .22), inset 0 1px 0 rgba(255,255,255,.28); }
.primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
.primary:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.secondary { color: var(--text); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.34); }
.secondary:hover { background: color-mix(in srgb, var(--surface-muted) 65%, var(--text) 5%); transform: translateY(-1px); }
.danger { color: var(--red); background: var(--red-soft); }
.danger:hover { background: color-mix(in srgb, var(--red-soft) 88%, var(--red) 8%); }
.danger-outline { color: var(--red); background: transparent; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }
.link-button { text-decoration: none; white-space: nowrap; }
button:disabled { cursor: not-allowed; opacity: .45; }
.privacy { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; color: var(--text-tertiary); font-size: 11px; line-height: 1.58; }
.privacy svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.selected-file-list { display: grid; gap: 8px; margin-top: 12px; }
.selected-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}
.selected-file-item > div { min-width: 0; display: grid; gap: 3px; }
.selected-file-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.selected-file-item span { color: var(--text-tertiary); font-size: 11px; }
.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; color: var(--text-secondary); background: var(--surface-solid); cursor: pointer; font-size: 19px; line-height: 1; }
.icon-button:hover { color: var(--red); background: var(--red-soft); }

#progressCard { display: flex; align-items: center; gap: 18px; }
#progressCard h2 { margin: 5px 0 5px; font-size: 22px; letter-spacing: -.025em; }
#progressCard p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.spinner { width: 42px; height: 42px; flex: 0 0 auto; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-head { align-items: center; }
#resultTitle { text-wrap: balance; }
.result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0; }
.metrics div { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
.validation-metrics div:first-child { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 18%, transparent); }
.metrics span { display: block; color: var(--text-tertiary); font-size: 10px; }
.metrics strong { display: block; overflow: hidden; margin-top: 7px; color: var(--text); font-size: 15px; line-height: 1.3; text-overflow: ellipsis; }
details { margin-top: 12px; padding: 0 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
summary { padding: 15px 0 0; cursor: pointer; font-size: 13px; font-weight: 650; }
.paragraph-list, .audit-list { display: grid; gap: 8px; margin-top: 13px; }
.paragraph-item { display: grid; grid-template-columns: 100px 1fr 50px; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; background: var(--surface-solid); }
.role { color: var(--blue); font-size: 11px; font-weight: 650; }
.paragraph-text { color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.confidence { color: var(--text-tertiary); font-size: 10px; text-align: right; }
.warning-list { margin: 13px 0 0; padding-left: 20px; color: var(--orange); font-size: 12px; line-height: 1.7; }
.audit-item { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-solid); }
.audit-item strong { color: var(--blue); font-size: 11px; }
.audit-item span { color: var(--text-secondary); font-size: 12px; line-height: 1.55; word-break: break-word; }
.issue-list .audit-item { background: var(--orange-soft); }
.audit-empty { padding: 16px; border-radius: 14px; color: var(--text-tertiary); background: var(--surface-muted); font-size: 12px; text-align: center; }

.batch-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 22px 0 15px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.batch-summary strong { color: var(--blue); font-size: 20px; }
.batch-summary span { margin-right: 12px; color: var(--text-tertiary); font-size: 11px; }
.batch-result-list, .history-list { display: grid; gap: 9px; }
.batch-result-item, .history-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 66px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-muted); }
.batch-result-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.batch-result-main > div:last-child, .history-main { min-width: 0; display: grid; gap: 4px; }
.batch-result-main strong, .history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.batch-result-main span, .history-main span, .history-main small { overflow: hidden; color: var(--text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.batch-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 12%, transparent); }
.batch-fail .batch-status-dot { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 12%, transparent); }
.batch-review .batch-status-dot { background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 12%, transparent); }
.batch-result-actions, .history-item-actions, .history-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.compact { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 11px; }
.failure-label { color: var(--red); font-size: 11px; font-weight: 650; }
.history-card { margin: 24px 0 72px; }
.history-list { margin-top: 20px; }

.capabilities { padding-bottom: 18px; }
.capabilities-heading { max-width: 620px; margin-bottom: 20px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.compact-grid { max-width: 920px; }
.rule-card { position: relative; min-height: 180px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 88%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)); box-shadow: var(--shadow-small); }
.rule-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 34%); pointer-events: none; }
.rule-card > span { color: var(--text-tertiary); font-size: 11px; font-weight: 650; }
.rule-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-top: 24px; border-radius: 16px; color: var(--blue); background: color-mix(in srgb, var(--blue-soft) 74%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.36); }
.rule-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rule-card h3 { margin: 18px 0 6px; font-size: 18px; letter-spacing: -.024em; }
.rule-card p { margin: 0; max-width: 28ch; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }

footer { margin-top: 56px; padding: 24px 0 0; border-top: 1px solid var(--line); color: var(--text-tertiary); text-align: center; font-size: 11px; line-height: 1.6; }
.footer-brand { margin-bottom: 8px; color: var(--text); font-size: 13px; font-weight: 650; }
footer p { max-width: 720px; margin: 0 auto 5px; }

.feedback-card {
  position: relative;
  margin: 24px 0 0;
  overflow: hidden;
  isolation: isolate;
}
.feedback-card::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  top: -238px;
  right: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 18%, transparent), transparent 69%);
  pointer-events: none;
}
.feedback-heading { display: block; }
.feedback-heading h2 { margin: 7px 0 0; font-size: clamp(28px, 3.5vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.feedback-heading p { margin: 10px 0 0; max-width: 46ch; color: var(--text-secondary); font-size: 14px; line-height: 1.65; }
.feedback-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.feedback-files { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feedback-upload-slot { position: relative; min-width: 0; }
.feedback-upload-card {
  --feedback-glow-x: 50%;
  --feedback-glow-y: 50%;
  position: relative;
  min-width: 0;
  min-height: 78px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 12px 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  isolation: isolate;
  transition: color .24s ease, border-color .24s ease, box-shadow .32s ease;
  width: 100%;
}
.feedback-upload-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(190px circle at var(--feedback-glow-x) var(--feedback-glow-y), color-mix(in srgb, var(--blue) 16%, transparent), transparent 66%);
  opacity: 0;
  pointer-events: none;
  transform: scale(.965);
  transform-origin: var(--feedback-glow-x) var(--feedback-glow-y);
  transition: opacity .28s ease, transform .46s cubic-bezier(.22,1,.36,1);
}
.feedback-upload-card:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  box-shadow: 0 10px 26px rgba(0,113,227,.075);
}
.feedback-upload-card:hover::after { opacity: 1; transform: scale(1); }
.feedback-upload-card:active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 24%, transparent), 0 6px 18px rgba(0,113,227,.06); }
.feedback-upload-card:active::after { opacity: .72; transform: scale(.94); transition-duration: .1s; }
.feedback-upload-card:has(.feedback-file-input:focus-visible) { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft), 0 10px 26px rgba(0,113,227,.08); }
.feedback-upload-card.has-file { color: var(--text); border-color: color-mix(in srgb, var(--blue) 48%, var(--line)); box-shadow: 0 12px 30px rgba(0,113,227,.09); }
.feedback-upload-card.has-file::after { opacity: .58; }
.feedback-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.feedback-upload-selection {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--blue-soft) 74%, var(--bg));
  opacity: 0;
  pointer-events: none;
  transform: scale(.965);
  transition: opacity .28s ease, transform .58s cubic-bezier(.22,1,.36,1);
}
.feedback-upload-card.has-file .feedback-upload-selection { opacity: 1; transform: scale(1); }
.feedback-upload-copy { position: relative; z-index: 2; min-width: 0; max-width: 100%; display: grid; justify-items: center; gap: 5px; text-align: center; }
.feedback-upload-copy strong { color: currentColor; font-size: 14px; font-weight: 690; line-height: 1.2; letter-spacing: -.015em; }
.feedback-upload-copy em { margin-left: 4px; color: var(--blue); font-size: 9.5px; font-style: normal; font-weight: 650; }
.feedback-upload-copy small { max-width: 100%; overflow: hidden; color: var(--text-tertiary); font-size: 10px; font-weight: 500; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.feedback-upload-card.has-file .feedback-upload-copy small { color: var(--text-secondary); }
.feedback-file-clear {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  width: 23px;
  height: 23px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 38%, var(--line));
  border-radius: 50%;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 86%, var(--surface-solid));
  box-shadow: 0 5px 14px rgba(0,113,227,.12), inset 0 1px 0 rgba(255,255,255,.08);
  cursor: pointer;
  opacity: 0;
  transform: scale(.65) translateY(3px);
  pointer-events: none;
  transition: opacity .22s ease, transform .46s cubic-bezier(.22,1,.36,1);
}
.feedback-file-clear.is-visible { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.feedback-file-clear:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 42%, var(--line)); background: color-mix(in srgb, var(--red-soft) 78%, var(--surface-solid)); }
.feedback-file-clear:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 68%, transparent); outline-offset: 2px; }
.feedback-file-clear svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feedback-note-field, .feedback-contact { display: grid; gap: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.feedback-note-field > span, .feedback-contact > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.feedback-note-field span small, .feedback-contact span small { color: var(--text-tertiary); font-size: 9.5px; font-weight: 520; }
.feedback-contact input, .feedback-note-field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); font: inherit; outline: none; transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease; }
.feedback-contact input { min-height: 50px; padding: 0 14px; }
.feedback-note-field textarea { min-height: 118px; padding: 13px 14px; resize: vertical; line-height: 1.65; }
.feedback-contact input::placeholder, .feedback-note-field textarea::placeholder { color: var(--text-tertiary); }
.feedback-contact input:focus, .feedback-note-field textarea:focus { border-color: color-mix(in srgb, var(--blue) 70%, var(--line)); background: var(--surface-solid); box-shadow: 0 0 0 3px var(--blue-soft); }
.feedback-submit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.feedback-submit-button { min-width: 166px; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.feedback-submit-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .24s ease; }
.feedback-submit-button:hover svg { transform: translate(2px, -1px); }
.feedback-submit-button:disabled { color: var(--text-tertiary); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 64%, transparent); box-shadow: none; opacity: .78; }
.feedback-submit-button:disabled svg { opacity: .55; transform: none; }
.feedback-form-foot { min-height: 19px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.feedback-form-foot > span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-tertiary); font-size: 9.5px; white-space: nowrap; }
.feedback-form-foot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feedback-status { min-height: 18px; margin: 0; color: var(--text-tertiary); font-size: 11px; }
.feedback-status.is-success { color: var(--green, #34c759); }
.feedback-status.is-error { color: var(--danger, #ff453a); }

@media (max-width: 720px) {
  .feedback-files, .feedback-submit-row { grid-template-columns: 1fr; }
  .feedback-submit-row button { width: 100%; }
  .feedback-form-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
  .feedback-form-foot > span { white-space: normal; }
}

@media (max-width: 460px) {
  .feedback-form { margin-left: -7px; margin-right: -7px; padding: 13px; border-radius: 18px; }
  .feedback-upload-card { min-height: 74px; padding-inline: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-upload-card,
  .feedback-upload-card::after,
  .feedback-upload-selection,
  .feedback-file-clear { transition: none !important; }
}

@media (max-width: 900px) {
  .topbar { width: min(100% - 24px, 1180px); }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .option-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules-grid { grid-template-columns: repeat(2, 1fr); }
  .model-route { gap: 10px; }
  .route-arrow { display: none; }
}

@media (max-width: 700px) {
  .shell, .topbar-inner { width: min(100% - 24px, 1120px); }
  .topbar { top: 8px; margin-top: 8px; }
  .hero { padding: 74px 0 46px; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .hero > p { font-size: 16px; }
  .model-route { display: grid; grid-template-columns: 1fr; padding: 15px; }
  .route-item { padding: 7px 4px; }
  .card { padding: 22px; border-radius: 24px; }
  .card-heading, .result-head, .history-head, .settings-header { flex-direction: column; align-items: flex-start; }
  .status { max-width: 100%; }
  .drop-zone { min-height: 240px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-grid { grid-template-columns: 1fr; }
  .rule-card { min-height: 170px; }
  .batch-result-item, .history-item { align-items: flex-start; flex-direction: column; }
  .batch-result-actions, .history-item-actions, .history-actions { width: 100%; justify-content: flex-start; }
  .batch-result-main span, .history-main span, .history-main small { white-space: normal; }
  .paragraph-item { grid-template-columns: 80px 1fr; }
  .confidence { display: none; }
}

@media (max-width: 460px) {
  .hero-actions, .actions { flex-direction: column; }
  .hero-button, .actions button { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .result-actions { width: 100%; justify-content: flex-start; }
  .result-actions a { flex: 1 1 auto; text-align: center; }
  .settings-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* v5.11.1 liquid glass refinement */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(12px);
}
body::before {
  top: 92px;
  left: -40px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,132,255,.22), rgba(10,132,255,0) 68%);
}
body::after {
  right: -40px;
  top: 220px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(175,82,222,.18), rgba(175,82,222,0) 70%);
}
.shell { position: relative; z-index: 1; }
.topbar::before,
.topbar::after,
.card::after,
.primary::before,
.secondary::before,
.hero-button::after {
  pointer-events: none;
}
.topbar::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.04) 34%, rgba(255,255,255,.10));
}
.topbar::after {
  content: '';
  position: absolute;
  inset: auto 16px 6px 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
}
:root[data-theme="dark"] .topbar::before {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02) 34%, rgba(255,255,255,.05));
}
.hero-actions {
  align-items: center;
}
.hero-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 164px;
  white-space: nowrap;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
}
.hero-button::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.02) 52%, rgba(255,255,255,.10));
  opacity: .9;
  z-index: -1;
}
.hero-button::after {
  content: '';
  position: absolute;
  left: -28%;
  top: -90%;
  width: 60%;
  height: 240%;
  transform: rotate(24deg);
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
  opacity: .46;
  z-index: -1;
}
.primary,
.secondary,
.danger,
.danger-outline {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.primary > *,
.secondary > *,
.hero-button > * {
  position: relative;
  z-index: 1;
}
.primary::before,
.secondary::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.06) 48%, rgba(255,255,255,.14));
}
:root[data-theme="dark"] .primary::before,
:root[data-theme="dark"] .secondary::before {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 48%, rgba(255,255,255,.08));
}
.secondary {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
}
.secondary:hover {
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}
.primary:hover,
.secondary:hover {
  transform: translateY(-1px) scale(1.01);
}
.primary:active,
.secondary:active {
  transform: scale(.985);
}
.card::after {
  content: '';
  position: absolute;
  inset: auto 18px 0 18px;
  height: 34%;
  border-radius: 0 0 inherit inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.08));
  opacity: .42;
}
:root[data-theme="dark"] .card::after {
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.03));
}
.option-panel,
.check-option,
.selected-file-item,
.batch-result-item,
.history-item,
.metrics div,
details,
.rule-card,
.model-route,
.drop-zone {
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.model-route,
.option-panel,
.check-option,
.rule-card {
  box-shadow: var(--shadow-small);
}
.drop-zone {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 76%, rgba(255,255,255,.18)), color-mix(in srgb, var(--surface-muted) 86%, transparent));
}
.rule-card > span {
  letter-spacing: .08em;
}
.rule-card p {
  max-width: 24ch;
}
footer {
  position: relative;
  padding-bottom: 24px;
}
footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
}
@media (max-width: 700px) {
  .hero-button { min-width: 148px; }
}


/* v5.13.0 — faithful vanilla adaptation of rdev/liquid-glass-react */
#liquidGlassSvgFilters,
.lg-filter-host {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.lg-surface {
  --lg-x: 50%;
  --lg-y: 0%;
  --lg-fade: 0;
  --lg-tx: 0px;
  --lg-ty: 0px;
  --lg-sx: 1;
  --lg-sy: 1;
  --lg-border-screen: linear-gradient(135deg, transparent, rgba(255,255,255,.22) 42%, rgba(255,255,255,.58) 68%, transparent);
  --lg-border-overlay: linear-gradient(135deg, transparent, rgba(255,255,255,.38) 42%, rgba(255,255,255,.72) 68%, transparent);
  position: relative;
  isolation: isolate;
}

.lg-layer {
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

.lg-interactive {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  color: var(--text);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: translate3d(var(--lg-tx), var(--lg-ty), 0) scaleX(var(--lg-sx)) scaleY(var(--lg-sy));
  transform-origin: center;
  will-change: transform;
  transition: transform .2s ease-out, color .18s ease, opacity .18s ease;
}

.lg-interactive.lg-active {
  transform: translate3d(var(--lg-tx), var(--lg-ty), 0) scale(.96);
  transition-duration: .09s;
}

.lg-content {
  position: relative;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  min-width: 0;
  min-height: inherit;
  width: 100%;
  pointer-events: none;
  white-space: nowrap;
}

.lg-warp,
.lg-tint,
.lg-border,
.lg-hover {
  inset: 0;
}

.lg-warp {
  z-index: 0;
  background:
    radial-gradient(130% 100% at var(--lg-x) var(--lg-y), rgba(255,255,255,calc(.20 + .18 * var(--lg-fade))), rgba(255,255,255,.035) 46%, rgba(255,255,255,.015) 75%),
    rgba(255,255,255,.035);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
}

:root[data-theme="dark"] .lg-warp {
  background:
    radial-gradient(130% 100% at var(--lg-x) var(--lg-y), rgba(255,255,255,calc(.14 + .13 * var(--lg-fade))), rgba(255,255,255,.025) 46%, rgba(255,255,255,.008) 75%),
    rgba(255,255,255,.018);
  backdrop-filter: blur(8px) saturate(175%);
  -webkit-backdrop-filter: blur(8px) saturate(175%);
}

.lg-tint {
  z-index: 1;
  inset: 1px;
  opacity: .92;
  background: var(--lg-tint, rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.lg-border {
  z-index: 5;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow:
    inset 0 0 0 .5px rgba(255,255,255,.5),
    inset 0 1px 3px rgba(255,255,255,.25),
    0 1px 4px rgba(0,0,0,.35);
}

.lg-border-screen {
  opacity: .56;
  mix-blend-mode: screen;
  background: var(--lg-border-screen);
}

.lg-border-overlay {
  opacity: .78;
  mix-blend-mode: overlay;
  background: var(--lg-border-overlay);
}

.lg-hover {
  z-index: 6;
  opacity: 0;
  transition: opacity .2s ease-out;
  mix-blend-mode: overlay;
}

.lg-hover-soft {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.54) 0%, rgba(255,255,255,0) 52%);
}

.lg-hover-press {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 80%);
}

.lg-hover-glow {
  background: radial-gradient(circle at var(--lg-x) var(--lg-y), rgba(255,255,255,.94) 0%, rgba(255,255,255,0) 100%);
}

.lg-hovered .lg-hover-soft { opacity: .5; }
.lg-hovered .lg-hover-glow { opacity: .38; }
.lg-active .lg-hover-press { opacity: .55; }
.lg-active .lg-hover-glow { opacity: .76; }

/* Button tones: transparent neutral, vivid accent and vivid destructive glass. */
.lg-interactive[data-lg-tone="neutral"] {
  --lg-tint: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.025));
  color: var(--text);
  text-shadow: 0 1px 10px rgba(0,0,0,.18);
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.18));
}

.lg-interactive[data-lg-tone="primary"] {
  --lg-tint: linear-gradient(180deg, rgba(51,164,255,.92), rgba(0,113,227,.82));
  color: #fff;
  text-shadow: 0 1px 12px rgba(0,57,117,.48);
  filter: drop-shadow(0 14px 28px rgba(0,113,227,.30));
}

.lg-interactive[data-lg-tone="danger"] {
  --lg-tint: linear-gradient(180deg, rgba(255,86,78,.31), rgba(159,20,28,.22));
  color: #ff5f57;
  text-shadow: 0 0 16px rgba(255,69,58,.46);
  filter: drop-shadow(0 14px 28px rgba(255,69,58,.18));
}

.lg-interactive[data-lg-tone="selected"] {
  --lg-tint: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.045));
  color: var(--text);
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.14));
}

:root[data-theme="dark"] .lg-interactive[data-lg-tone="neutral"] {
  --lg-tint: linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.018));
  color: #f5f5f7;
}

:root[data-theme="dark"] .lg-interactive[data-lg-tone="danger"] {
  --lg-tint: linear-gradient(180deg, rgba(255,69,58,.27), rgba(117,16,22,.20));
  color: #ff6961;
}

/* The main buttons follow the repository's large pill proportions. */
.hero-button,
.actions > button,
.result-actions > a,
.history-actions > button,
.batch-result-actions > button,
.batch-result-actions > a,
.history-item-actions > button,
.history-item-actions > a {
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1;
}

.history-actions {
  position: relative;
  isolation: isolate;
}
.history-actions::before {
  content: '';
  position: absolute;
  inset: -18px -22px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80px 50px at 24% 52%, rgba(255,255,255,.17), transparent 72%),
    radial-gradient(110px 62px at 82% 52%, rgba(255,69,58,.20), transparent 74%);
  filter: blur(16px);
}

/* Liquid switch: bright track under a dark refractive glass thumb, matching the reference interaction. */
.switch-control {
  position: relative;
  width: 50px;
  height: 29px;
  border-radius: 999px;
  overflow: visible;
  background: rgba(142,142,147,.38);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.22),
    inset 0 0 0 1px rgba(255,255,255,.08);
  transition: background .25s ease, box-shadow .25s ease;
}

.switch-control::after { content: none !important; }

.lg-switch-glow {
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  opacity: .3;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0));
}

.lg-switch-knob {
  top: -3px;
  left: -2px;
  width: 35px;
  height: 35px;
  z-index: 2;
  border-radius: 999px;
  overflow: hidden;
  transform: translateX(0);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), filter .25s ease;
  filter: drop-shadow(0 7px 12px rgba(0,0,0,.38));
}

.lg-switch-knob-warp {
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(80% 65% at 42% 10%, rgba(255,255,255,.28), rgba(255,255,255,.045) 55%, rgba(0,0,0,.16) 100%);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.34),
    inset 0 -4px 10px rgba(0,0,0,.28);
}

.lg-switch-knob-border {
  inset: 0;
  z-index: 2;
  padding: 1.4px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: linear-gradient(145deg, rgba(255,255,255,.68), rgba(255,255,255,.08) 52%, rgba(109,255,145,.38));
}
.lg-switch-knob-border-screen { mix-blend-mode: screen; opacity: .72; }
.lg-switch-knob-border-overlay { mix-blend-mode: overlay; opacity: .88; }

.check-option input:checked + .switch-control {
  background: linear-gradient(180deg, #34ee73, #1dce5b);
  box-shadow:
    0 0 24px rgba(48,209,88,.34),
    inset 0 1px 2px rgba(255,255,255,.36),
    inset 0 -2px 5px rgba(0,92,34,.18);
}

.check-option input:checked + .switch-control .lg-switch-knob {
  transform: translateX(20px);
}

.check-option input:focus-visible + .switch-control {
  outline: 4px solid rgba(10,132,255,.20);
}

/* Panel glass is clearer and less gray than the previous version. */
.card,
.topbar,
.model-route,
.option-panel,
.check-option,
.drop-zone,
.rule-card,
.selected-file-item,
.batch-result-item,
.history-item,
.metrics div,
details {
  background-color: color-mix(in srgb, var(--surface) 46%, transparent) !important;
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  border-color: rgba(255,255,255,.14);
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .model-route,
:root[data-theme="dark"] .option-panel,
:root[data-theme="dark"] .check-option,
:root[data-theme="dark"] .drop-zone,
:root[data-theme="dark"] .rule-card,
:root[data-theme="dark"] .selected-file-item,
:root[data-theme="dark"] .batch-result-item,
:root[data-theme="dark"] .history-item,
:root[data-theme="dark"] .metrics div,
:root[data-theme="dark"] details {
  background-color: rgba(28,28,32,.42) !important;
  border-color: rgba(255,255,255,.12);
}

/* Hide legacy decorative pseudo layers to avoid duplicate outlines. */
.lg-interactive::before,
.lg-interactive::after,
.card::before,
.card::after,
.topbar::before,
.topbar::after,
.rule-card::before {
  content: none !important;
}

.lg-displacement-fallback .lg-warp { filter: none !important; }

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .lg-warp,
  .lg-switch-knob-warp {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(44,44,48,.94) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-interactive { transform: none !important; }
  .lg-switch-knob { transition: none; }
}

@media (max-width: 700px) {
  .hero-button,
  .actions > button,
  .result-actions > a,
  .history-actions > button {
    min-height: 48px;
    padding-inline: 20px;
  }
}

.card,
.topbar,
.model-route,
.option-panel,
.check-option,
.drop-zone,
.rule-card,
.selected-file-item,
.batch-result-item,
.history-item,
.metrics div,
details {
  background-image: none !important;
}

/* Final calibration against the reference demo. */
.lg-interactive[data-lg-tone="neutral"] {
  --lg-tint: linear-gradient(180deg, rgba(255,255,255,.082), rgba(255,255,255,.018));
}
.lg-interactive[data-lg-tone="danger"] {
  --lg-tint: linear-gradient(180deg, rgba(255,96,87,.40), rgba(156,19,27,.30));
  color: #ff6b63;
  text-shadow: 0 0 18px rgba(255,69,58,.58);
  filter: drop-shadow(0 14px 30px rgba(255,69,58,.25));
}
:root[data-theme="dark"] .lg-interactive[data-lg-tone="danger"] {
  --lg-tint: linear-gradient(180deg, rgba(255,78,70,.37), rgba(123,15,22,.28));
  color: #ff746c;
}
.history-actions::before {
  background:
    radial-gradient(82px 52px at 24% 52%, rgba(255,255,255,.20), transparent 72%),
    radial-gradient(118px 68px at 82% 52%, rgba(255,69,58,.30), transparent 74%);
}
.lg-switch-knob {
  width: 38px;
  height: 38px;
  top: -4.5px;
  left: -3px;
}
.lg-switch-knob-warp {
  background:
    radial-gradient(90% 68% at 42% 8%, rgba(255,255,255,.32), rgba(255,255,255,.065) 38%, rgba(22,22,25,.58) 70%, rgba(8,8,10,.78) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.40),
    inset 0 -5px 12px rgba(0,0,0,.46),
    inset 3px 0 8px rgba(255,255,255,.04);
}
.check-option input:checked + .switch-control .lg-switch-knob {
  transform: translateX(18px);
}


/* v5.13.1 clean glass rollback */
body::before,
body::after,
.hero::before,
.card::before,
.card::after,
.rule-card::before,
.primary::before,
.secondary::before,
.hero-button::before,
.hero-button::after,
.topbar::before,
.topbar::after {
  content: none !important;
  display: none !important;
}

body {
  background:
    radial-gradient(circle at 14% 18%, rgba(28,116,255,.14), transparent 18rem),
    radial-gradient(circle at 86% 16%, rgba(128,92,255,.12), transparent 18rem),
    linear-gradient(180deg, #09090b 0%, #050507 48%, #07070a 100%) !important;
}

.topbar {
  top: 12px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(24,24,28,.72) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.26) !important;
}

.badge {
  min-height: 36px !important;
  padding: 0 18px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(28,28,32,.56) !important;
  color: #d5d7dc !important;
  box-shadow: none !important;
}

.hero {
  padding: 92px 0 52px !important;
}

h1 {
  max-width: 980px !important;
  font-size: clamp(48px, 7vw, 84px) !important;
  letter-spacing: -.055em !important;
  line-height: 1.02 !important;
}

.hero > p {
  max-width: 680px !important;
  font-size: 17px !important;
  color: rgba(255,255,255,.72) !important;
}

.model-route { display: none !important; }

.card,
.rule-card,
.option-panel,
.drop-zone,
.check-option,
.batch-result-item,
.history-item,
.metrics div,
details {
  background: rgba(22,22,26,.78) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(20px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
}

.glass-segment {
  padding: 4px !important;
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

.segment-pill {
  min-height: 46px !important;
  border-radius: 14px !important;
  color: rgba(255,255,255,.70) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.segment-pill.active {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: none !important;
}

.primary,
.secondary,
.danger,
.danger-outline,
.hero-button,
.choose-file-button,
.link-button {
  min-height: 48px !important;
  border-radius: 999px !important;
  font-weight: 650 !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.18) !important;
  transform: none !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.hero-button,
.actions button,
.history-actions button,
.choose-file-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
}

.primary,
.hero-button.primary,
.choose-file-button {
  background: linear-gradient(180deg, #2994ff 0%, #0a7aff 100%) !important;
  color: #fff !important;
}

.secondary,
.hero-button.secondary,
.link-button.secondary,
#refreshHistoryButton,
#resetButton,
#newBatchButton {
  background: rgba(255,255,255,.06) !important;
  color: #f3f4f6 !important;
}

.danger,
#clearHistoryButton {
  background: rgba(255,59,48,.24) !important;
  border-color: rgba(255,59,48,.30) !important;
  color: #ff7b72 !important;
}

.primary:hover,
.secondary:hover,
.danger:hover,
.hero-button:hover,
.choose-file-button:hover {
  filter: brightness(1.04) !important;
  transform: none !important;
}

.switch-control {
  width: 46px !important;
  height: 28px !important;
  border-radius: 999px !important;
  background: rgba(120,120,128,.42) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
  position: relative !important;
}
.switch-control::before,
.switch-control::after { content: '' !important; display: block !important; position: absolute !important; }
.switch-control::before {
  inset: 0 !important;
  border-radius: inherit !important;
  background: transparent !important;
}
.switch-control::after {
  width: 22px !important;
  height: 22px !important;
  left: 2px !important;
  top: 2px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.28) !important;
  transform: translateX(0) !important;
  transition: transform .18s ease !important;
}
.check-option input:checked + .switch-control {
  background: #34c759 !important;
  border-color: rgba(52,199,89,.36) !important;
}
.check-option input:checked + .switch-control::after {
  transform: translateX(18px) !important;
}

.check-option {
  border-radius: 20px !important;
  grid-template-columns: 46px 1fr !important;
}

.history-head,
.card-heading,
.settings-header,
.result-head {
  gap: 14px !important;
}

.capabilities {
  padding-bottom: 6px !important;
}

.rules-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
}

footer {
  margin-top: 44px !important;
  color: rgba(255,255,255,.56) !important;
}

@media (max-width: 700px) {
  .rules-grid { grid-template-columns: 1fr !important; }
  .processing-context { margin-left: 0; text-align: left; }
}


/* v5.14.0 dark-only segmented control and expandable capability rows */
:root,
:root[data-theme="dark"] {
  color-scheme: dark !important;
  --bg: #050507 !important;
  --surface: rgba(20,20,23,.78) !important;
  --surface-solid: rgba(27,27,31,.90) !important;
  --surface-muted: rgba(31,31,36,.72) !important;
  --text: #f5f5f7 !important;
  --text-secondary: #a1a1a6 !important;
  --text-tertiary: #7f7f86 !important;
}

.theme-toggle { display: none !important; }
.topbar-inner { grid-template-columns: 1fr auto !important; }

.option-panel {
  padding: 22px !important;
}
.option-panel-title {
  margin-bottom: 16px;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.option-panel-format {
  display: flex;
  flex-direction: column;
}
.glass-segment {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  width: 100% !important;
  min-height: 58px !important;
  padding: 5px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #333336 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
.segment-pill {
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #c7c7cc !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  transition: background .2s ease, color .2s ease, transform .2s ease !important;
}
.segment-pill.active {
  color: #111114 !important;
  background: #f2f2f7 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.20) !important;
}
.segment-pill:active { transform: scale(.985) !important; }
.option-help {
  margin-top: 14px !important;
  padding-left: 4px;
}
.seal-options {
  display: grid;
  gap: 7px;
}
.radio-card {
  min-height: 52px;
  border-radius: 14px !important;
}

.history-actions {
  gap: 10px !important;
}
.history-tool {
  min-height: 42px !important;
  padding: 0 15px !important;
  gap: 7px !important;
  border-radius: 13px !important;
  box-shadow: none !important;
}
.history-tool svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#clearHistoryButton {
  background: transparent !important;
  color: #ff6961 !important;
  border-color: rgba(255,105,97,.24) !important;
}
#clearHistoryButton:hover {
  background: rgba(255,105,97,.08) !important;
  border-color: rgba(255,105,97,.38) !important;
}

.capabilities-heading {
  max-width: 720px !important;
  margin-bottom: 22px !important;
}
.capability-list {
  display: grid;
  gap: 12px;
}
.capability-item {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: rgba(20,20,23,.84);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  transition: border-color .2s ease, background .2s ease;
}
.capability-item:hover {
  border-color: rgba(255,255,255,.13);
}
.capability-item.open {
  background: rgba(24,24,28,.92);
  border-color: rgba(10,132,255,.30);
}
.capability-trigger {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 42px 1fr 50px;
  align-items: center;
  gap: 14px;
  padding: 13px 16px 13px 22px;
  border: 0;
  color: #f5f5f7;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.capability-index {
  color: #8e8e93;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.capability-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.capability-plus {
  position: relative;
  width: 44px;
  height: 44px;
  justify-self: end;
  border-radius: 50%;
  background: #0a84ff;
  box-shadow: 0 8px 22px rgba(10,132,255,.24);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
.capability-plus::before,
.capability-plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
}
.capability-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.capability-item.open .capability-plus {
  transform: rotate(45deg);
  background: #3a3a3c;
  box-shadow: none;
}
.capability-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s cubic-bezier(.2,.8,.2,1);
}
.capability-detail > div {
  overflow: hidden;
}
.capability-detail p {
  margin: 0;
  padding: 0 74px 24px 78px;
  color: #a1a1a6;
  font-size: 14px;
  line-height: 1.72;
}
.capability-item.open .capability-detail {
  grid-template-rows: 1fr;
}

@media (max-width: 700px) {
  .glass-segment { min-height: 54px !important; }
  .segment-pill { min-height: 44px !important; }
  .capability-trigger {
    grid-template-columns: 34px 1fr 46px;
    min-height: 72px;
    padding-left: 16px;
  }
  .capability-title { font-size: 17px; }
  .capability-plus { width: 40px; height: 40px; }
  .capability-detail p { padding: 0 20px 22px 64px; }
}


/* v5.14.1 dark readability and hover stability */
.hero {
  padding-top: 78px !important;
}
.hero h1 {
  margin-top: 0 !important;
}

/* Keep hover visually responsive without moving the whole upload panel. */
.drop-zone,
.drop-zone:hover,
.drop-zone.dragging {
  transform: none !important;
  border-width: 1px !important;
}
.drop-zone {
  will-change: background-color, border-color, box-shadow;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}
.drop-zone:hover,
.drop-zone.dragging {
  border-color: rgba(10,132,255,.56) !important;
  background: rgba(25,25,29,.88) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.24), 0 0 0 1px rgba(10,132,255,.10) inset !important;
}
.upload-icon,
.choose-file-button {
  transform: none !important;
}

/* Use stable opacity/background transitions rather than translateY hover motion. */
.primary,
.secondary,
.danger,
.history-tool,
.hero-button,
.choose-file-button {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease !important;
}
.primary:hover,
.secondary:hover,
.danger:hover,
.history-tool:hover,
.hero-button:hover,
.choose-file-button:hover {
  transform: none !important;
}

.history-actions {
  align-items: center !important;
}
.history-tool {
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -.01em !important;
  backdrop-filter: blur(18px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
}
#refreshHistoryButton {
  color: #f5f5f7 !important;
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.15) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.18) !important;
}
#refreshHistoryButton:hover {
  background: rgba(255,255,255,.15) !important;
  border-color: rgba(255,255,255,.22) !important;
}
#clearHistoryButton {
  color: #ff746b !important;
  background: rgba(255,69,58,.10) !important;
  border-color: rgba(255,105,97,.30) !important;
  box-shadow: 0 8px 20px rgba(255,69,58,.06) !important;
}
#clearHistoryButton:hover {
  color: #ff8a82 !important;
  background: rgba(255,69,58,.16) !important;
  border-color: rgba(255,105,97,.46) !important;
}
#refreshHistoryButton:disabled,
#clearHistoryButton:disabled {
  opacity: .68 !important;
  cursor: not-allowed !important;
}
#clearHistoryButton:disabled {
  color: #d96a64 !important;
  background: rgba(255,69,58,.07) !important;
  border-color: rgba(255,105,97,.18) !important;
}

/* Improve text hierarchy and legibility on dark material surfaces. */
.history-head p,
.card-heading p,
.settings-note,
.option-help,
.switch-copy small,
.capability-detail p,
.audit-empty {
  color: #b3b3b8 !important;
}
.history-main span,
.history-main small,
.batch-result-main span {
  color: #a9a9af !important;
}
.history-item,
.batch-result-item {
  background: rgba(30,30,34,.82) !important;
  border-color: rgba(255,255,255,.10) !important;
}

@media (prefers-reduced-motion: reduce) {
  .drop-zone,
  .primary,
  .secondary,
  .danger,
  .history-tool,
  .hero-button,
  .choose-file-button {
    transition: none !important;
  }
}


/* v5.15.0 batch action stability and readability */
.batch-result-item,
.history-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

.batch-result-main,
.history-main {
  min-width: 0 !important;
}

.batch-result-actions,
.history-item-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: max-content !important;
}

.batch-result-actions > *,
.history-item-actions > *,
.failure-label {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex: 0 0 auto !important;
}

.batch-result-actions .compact,
.history-item-actions .compact {
  min-width: 84px !important;
  min-height: 38px !important;
  padding: 0 15px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
}

.failure-label {
  min-width: 76px !important;
  text-align: center !important;
  color: #ff453a !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.batch-result-main strong,
.history-main strong {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.batch-result-main span,
.history-main span,
.history-main small {
  display: block !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 780px) {
  .batch-result-item,
  .history-item {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }
  .batch-result-actions,
  .history-item-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }
}

/* v5.15.1 compact model status */
.status { max-width: none; width: fit-content; white-space: nowrap; padding: 8px 14px; }
@media (max-width: 700px) { .status { max-width: 100%; white-space: normal; } }


/* v5.15.2 result controls and motion polish */
.result-actions {
  align-items: center !important;
}
.result-actions > .link-button:not(.hidden):not([hidden]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  padding: 0 24px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  text-align: center !important;
  white-space: nowrap !important;
}
.result-actions > .secondary.link-button,
.result-actions > .primary.link-button {
  font-size: 15px !important;
  font-weight: 650 !important;
}

/* Smooth entrance for the full result section. */
#resultCard:not(.hidden) {
  opacity: 0;
  transform: translateY(14px) scale(.992);
}
#resultCard.result-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity .42s cubic-bezier(.22,1,.36,1),
    transform .48s cubic-bezier(.22,1,.36,1);
}
#resultCard .result-head,
#resultCard .metrics > div,
#resultCard details {
  opacity: 0;
  transform: translateY(10px);
}
#resultCard.result-visible .result-head,
#resultCard.result-visible .metrics > div,
#resultCard.result-visible details {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .38s cubic-bezier(.22,1,.36,1),
    transform .42s cubic-bezier(.22,1,.36,1);
}
#resultCard.result-visible .result-head { transition-delay: .04s; }
#resultCard.result-visible .metrics > div:nth-child(1) { transition-delay: .07s; }
#resultCard.result-visible .metrics > div:nth-child(2) { transition-delay: .09s; }
#resultCard.result-visible .metrics > div:nth-child(3) { transition-delay: .11s; }
#resultCard.result-visible .metrics > div:nth-child(4) { transition-delay: .13s; }
#resultCard.result-visible .metrics > div:nth-child(n+5) { transition-delay: .15s; }
#resultCard.result-visible details:nth-of-type(1) { transition-delay: .18s; }
#resultCard.result-visible details:nth-of-type(2) { transition-delay: .21s; }
#resultCard.result-visible details:nth-of-type(3) { transition-delay: .24s; }
#resultCard.result-visible details:nth-of-type(4) { transition-delay: .27s; }

/* Native details remain logically open; .is-open controls a smooth accordion. */
#resultCard details {
  padding: 0 16px !important;
  overflow: clip;
}
#resultCard details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 !important;
  list-style: none;
  user-select: none;
  outline: none;
}
#resultCard details > summary::-webkit-details-marker { display: none; }
#resultCard details > summary::marker { content: ''; }
#resultCard details > summary::before {
  content: '';
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transform: rotate(0deg);
  transform-origin: 42% 50%;
  transition: transform .34s cubic-bezier(.22,1,.36,1);
}
#resultCard details.is-open > summary::before {
  transform: rotate(90deg);
}
#resultCard details > .details-motion {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-5px);
  transition:
    grid-template-rows .42s cubic-bezier(.22,1,.36,1),
    opacity .28s ease,
    transform .42s cubic-bezier(.22,1,.36,1);
}
#resultCard details > .details-motion > .details-motion-inner {
  min-height: 0;
  overflow: hidden;
}
#resultCard details.is-open > .details-motion {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}
#resultCard details .audit-list,
#resultCard details .paragraph-list,
#resultCard details .warning-list {
  margin-top: 0 !important;
  padding-bottom: 16px;
}
#resultCard details .warning-list {
  padding-left: 20px;
}
#resultCard details:hover {
  border-color: rgba(255,255,255,.14) !important;
  background: rgba(24,24,28,.88) !important;
}

@media (max-width: 700px) {
  .result-actions > .link-button {
    min-width: 0 !important;
    padding: 0 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #resultCard,
  #resultCard .result-head,
  #resultCard .metrics > div,
  #resultCard details,
  #resultCard details > summary::before,
  #resultCard details > .details-motion {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* v5.17.0 AI drafting workspace */
.workspace-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.workspace-mode-button {
  min-width: 0;
  min-height: 76px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 17px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .28s ease, background .28s ease, border-color .28s ease, transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease;
}
.workspace-mode-button:hover { color: var(--text); transform: none; border-color: color-mix(in srgb, var(--blue) 18%, var(--line)); box-shadow: 0 8px 24px rgba(0,113,227,.06); }
.workspace-mode-button.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: linear-gradient(145deg, color-mix(in srgb, var(--blue-soft) 72%, var(--surface-solid)), var(--surface-solid));
  box-shadow: 0 10px 30px rgba(0,113,227,.10), inset 0 1px 0 rgba(255,255,255,.10);
}
.workspace-mode-button > span:last-child { min-width: 0; display: grid; gap: 4px; }
.workspace-mode-button strong { font-size: 14px; font-weight: 680; }
.workspace-mode-button small { color: var(--text-tertiary); font-size: 11px; line-height: 1.35; }
.mode-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 20px;
  font-weight: 700;
}
.mode-icon.sparkle { font-size: 17px; }
.workspace-panel { animation: workspacePanelIn .38s cubic-bezier(.16,1,.3,1) both; }
@keyframes workspacePanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.card-heading h2,
.card-heading p { will-change: opacity, transform; }

.generation-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 92%, transparent), color-mix(in srgb, var(--surface-solid) 72%, transparent));
}
.generation-type-wrap { display: grid; gap: 10px; }
.official-source-hint {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.55;
}
.form-label { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.form-label em { color: var(--orange); font-style: normal; font-size: 10px; }
.generation-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.generation-type-card {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .24s ease, background .24s ease, color .24s ease, transform .24s cubic-bezier(.16,1,.3,1), box-shadow .24s ease;
}
.generation-type-card:hover { color: var(--text); transform: none; border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); box-shadow: 0 8px 20px rgba(0,113,227,.06); }
.generation-type-card.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 72%, var(--surface-solid));
  box-shadow: 0 10px 26px rgba(0,113,227,.09);
}
.generation-type-card strong { font-size: 13px; }
.generation-type-card small { color: var(--text-tertiary); font-size: 10px; line-height: 1.45; }
.generation-grid { display: grid; gap: 12px; }
.generation-grid.two-columns { grid-template-columns: minmax(0, 2fr) minmax(180px, .9fr); align-items: start; }
.generation-grid.three-columns { grid-template-columns: repeat(3, minmax(0,1fr)); }
.generation-detail-segment { display: inline-grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface-solid) 78%, transparent); box-shadow: none; }
.generation-detail-hint { min-height: 2.8em; color: var(--text-tertiary); font-size: 10px; line-height: 1.45; }
.detail-pill { min-height: 46px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text-secondary); font-weight: 650; letter-spacing: -.015em; cursor: pointer; box-shadow: none; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.detail-pill:hover:not(.active) { color: var(--text-secondary); background: transparent; }
.detail-pill.active { color: var(--text); border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); background: color-mix(in srgb, var(--blue-soft) 46%, var(--surface-solid)); box-shadow: none; }
.detail-pill:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 52%, transparent); outline-offset: 2px; }
.form-field { min-width: 0; display: grid; gap: 8px; }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  outline: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.form-field input,
.form-field select { min-height: 46px; padding: 0 13px; }
.form-field textarea { padding: 12px 13px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: color-mix(in srgb, var(--blue) 70%, transparent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: color-mix(in srgb, var(--text-tertiary) 82%, transparent); }

.date-picker { position: relative; min-width: 0; }
.date-trigger {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.date-trigger:hover { border-color: color-mix(in srgb, var(--text-secondary) 40%, var(--line)); background: color-mix(in srgb, var(--surface-solid) 96%, transparent); }
.date-trigger[aria-expanded="true"],
.date-trigger:focus-visible { border-color: color-mix(in srgb, var(--blue) 58%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent); }
.date-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.date-trigger svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--text-secondary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.date-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 90;
  width: min(326px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 96%, #0d0d10 4%);
  box-shadow: 0 24px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  transform-origin: right bottom;
  animation: datePopoverIn .24s cubic-bezier(.16,1,.3,1) both;
}
.date-popover[hidden] { display: none; }
@keyframes datePopoverIn { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.date-popover-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; margin-bottom: 10px; }
.date-popover-head strong { text-align: center; font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.date-nav-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 11px; color: var(--text-secondary); background: transparent; cursor: pointer; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.date-nav-button:hover { color: var(--text); background: var(--surface-muted); border-color: var(--line); }
.date-nav-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-weekdays, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.date-weekdays { margin-bottom: 4px; }
.date-weekdays span { min-height: 28px; display: grid; place-items: center; color: var(--text-tertiary); font-size: 10px; font-weight: 650; }
.date-day {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}
.date-day:hover { color: var(--text); background: var(--surface-muted); }
.date-day.outside-month { color: color-mix(in srgb, var(--text-tertiary) 55%, transparent); }
.date-day.is-today { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); color: var(--blue); }
.date-day.is-selected { color: #fff; border-color: color-mix(in srgb, var(--blue) 72%, transparent); background: color-mix(in srgb, var(--blue) 72%, #0b2944 28%); }
.date-day.is-selected:hover { background: color-mix(in srgb, var(--blue) 78%, #0b2944 22%); }
.date-day:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 52%, transparent); outline-offset: 1px; }
.date-popover-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.date-popover-foot button { min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 650; transition: background-color .18s ease, border-color .18s ease; }
.date-popover-foot button:hover { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 18%, var(--line)); }

.field-help { color: var(--text-tertiary); font-size: 10px; line-height: 1.55; }
.generation-safety-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 15px;
  color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 62%, var(--surface-muted));
}
.generation-safety-note > span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--green) 15%, transparent);
  font-weight: 800;
}
.generation-safety-note p { margin: 0; display: grid; gap: 3px; }
.generation-safety-note strong { color: var(--text); font-size: 12px; }
.generation-safety-note small { color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
body[data-workspace-mode="generate"] #sortTables { pointer-events: none; }
body[data-workspace-mode="generate"] .check-option:has(#sortTables) { opacity: .42; }

@media (max-width: 900px) {
  .generation-type-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .generation-grid.three-columns { grid-template-columns: 1fr 1fr; }
  .generation-grid.three-columns .form-field:last-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .workspace-mode-switch { grid-template-columns: 1fr; }
  .generation-form { padding: 16px; border-radius: 19px; }
  .generation-type-grid,
  .generation-grid.two-columns,
  .generation-grid.three-columns { grid-template-columns: 1fr; }
  .generation-grid.three-columns .form-field:last-child { grid-column: auto; }
}

@media(max-width:620px){
  .date-popover { right: auto; left: 0; width: min(326px, calc(100vw - 52px)); }
}
@media(prefers-reduced-motion:reduce){
  .date-popover { animation: none !important; }
}

/* v5.18.1 minimal-input drafting refinement */
.minimal-generation-form { gap: 18px; }
.minimal-input-head {
  display: block;
  max-width: 720px;
  padding: 10px 2px 2px;
}
.minimal-input-head .section-kicker {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 11px;
  letter-spacing: .055em;
}
.minimal-input-head h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.045em;
}
.minimal-input-head p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: -.01em;
}
.generation-brief-field {
  gap: 9px;
}
.generation-brief-field .form-label {
  padding-left: 2px;
}
.generation-brief-field textarea {
  height: 76px;
  min-height: 70px;
  padding: 17px 18px;
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--line) 92%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -.012em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.generation-brief-field textarea:hover {
  border-color: color-mix(in srgb, var(--text-tertiary) 36%, var(--line));
}
.generation-brief-field textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  background: color-mix(in srgb, var(--surface-solid) 99%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 9%, transparent), inset 0 1px 0 rgba(255,255,255,.06);
}
.generation-material-field textarea { min-height: 230px; }
.form-label small { margin-left: 5px; color: var(--text-tertiary); font-size: 9px; font-weight: 550; }
.generation-advanced-toggle {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  cursor: pointer;
  text-align: left;
  transition: color .22s ease, border-color .22s ease, background-color .22s ease;
}
.generation-advanced-toggle:hover { color: var(--text); border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-muted) 94%, transparent); }
.generation-advanced-toggle > span { display: grid; gap: 3px; }
.generation-advanced-toggle strong { font-size: 12px; }
.generation-advanced-toggle small { color: var(--text-tertiary); font-size: 10px; }
.generation-advanced-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .38s cubic-bezier(.16,1,.3,1); }
.generation-advanced-toggle.is-open svg { transform: rotate(180deg); }
.generation-advanced-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: max-height .52s cubic-bezier(.16,1,.3,1), opacity .24s ease, transform .44s cubic-bezier(.16,1,.3,1);
}
.generation-advanced-panel.is-open {
  max-height: 900px;
  opacity: 1;
  overflow: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.generation-advanced-inner {
  display: grid;
  gap: 16px;
  margin-top: 2px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
}

@media (max-width: 760px) {
  .auto-draft-tags { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .generation-advanced-inner { padding: 14px; }
  .auto-draft-tags span { min-height: 26px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .generation-advanced-panel,
  .generation-advanced-toggle svg { transition: none !important; }
}

/* v5.18.4 Apple-style sliding selection polish */
.apple-slide-group {
  position: relative;
  isolation: isolate;
}
.apple-slide-group > :not(.apple-selection-indicator) {
  position: relative;
  z-index: 1;
}
.apple-selection-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, width, height;
  transform: translate3d(0,0,0);
  transition:
    transform .58s cubic-bezier(.22,1,.36,1),
    width .58s cubic-bezier(.22,1,.36,1),
    height .58s cubic-bezier(.22,1,.36,1),
    opacity .18s ease;
}
.apple-slide-group.slider-ready > .apple-selection-indicator { opacity: 1; }
.apple-slide-group.slider-instant > .apple-selection-indicator { transition: none !important; }

.workspace-mode-switch > .apple-selection-indicator {
  border: 1px solid color-mix(in srgb, var(--blue) 42%, var(--line));
  border-radius: 17px;
  /* Keep the selected surface opaque and single-layered so no pale hover layer
     remains visible underneath after a click. */
  background: linear-gradient(145deg, color-mix(in srgb, var(--blue-soft) 72%, var(--bg)), color-mix(in srgb, var(--blue-soft) 38%, var(--bg)));
  box-shadow: 0 12px 34px rgba(0,113,227,.10);
}
.workspace-mode-button,
.workspace-mode-button:hover,
.workspace-mode-button.active {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.workspace-mode-button.active { color: var(--text) !important; }
.workspace-mode-button:not(.active):hover { background: transparent !important; }
.workspace-mode-button .mode-icon {
  transition: color .38s ease, background-color .38s ease, transform .58s cubic-bezier(.22,1,.36,1);
}
.workspace-mode-button.active .mode-icon { transform: scale(1.035); }

.generation-type-grid > .apple-selection-indicator {
  z-index: 1;
  border: 1px solid color-mix(in srgb, var(--blue) 48%, var(--line));
  border-radius: 16px;
  /* Opaque fill masks the resting card outline while the indicator passes it. */
  background: color-mix(in srgb, var(--blue-soft) 74%, var(--bg));
  box-shadow: 0 12px 30px rgba(0,113,227,.09);
}
.generation-type-grid > .generation-type-card {
  /* Do not create a card stacking context: its outline stays below the slider,
     while the text is lifted above it. */
  z-index: auto;
  border-color: transparent !important;
  transition: color .24s ease;
}
.generation-type-card,
.generation-type-card:hover,
.generation-type-card.active {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.generation-type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  pointer-events: none;
}
.generation-type-card > strong,
.generation-type-card > small {
  position: relative;
  z-index: 2;
}
.generation-type-card.active { color: var(--text) !important; }
.generation-type-card:not(.active):hover::before { border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); }

/* Short, centered labels keep all four document types visually balanced. */
.generation-type-card {
  min-height: 78px;
  padding: 12px 9px;
  justify-items: center;
  text-align: center;
}
.generation-type-card strong {
  font-size: 14px;
  font-weight: 690;
  line-height: 1.2;
  letter-spacing: -.015em;
  white-space: nowrap;
}
.generation-type-card small {
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.generation-detail-segment > .apple-selection-indicator {
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue-soft) 48%, var(--surface-solid));
}
.detail-pill,
.detail-pill:hover,
.detail-pill.active {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.detail-pill.active { color: var(--text) !important; }
.detail-pill:not(.active):hover { color: var(--text-secondary) !important; background: transparent !important; }

.glass-segment > .apple-selection-indicator {
  border-radius: 999px;
  background: #f2f2f7;
  box-shadow: 0 1px 2px rgba(0,0,0,.20);
}
.barcode-mode-segment {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.barcode-mode-segment .segment-pill {
  min-width: 0;
  white-space: nowrap;
}
.barcode-mode-segment .segment-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 52%, transparent);
  outline-offset: -3px;
}
.segment-pill,
.segment-pill:hover,
.segment-pill.active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.segment-pill.active { color: #111114 !important; }
.segment-pill:not(.active):hover { color: #fff !important; }

#profileSegment { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
#profileSegment .segment-pill { font-size: 13px !important; }

.seal-options > .apple-selection-indicator {
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 14px;
  /* Keep the selected row dark and slightly blue-tinted.  A pale surface here
     reads as a white flash while the indicator moves between the two rows. */
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--blue-soft) 48%, var(--surface-muted)),
    color-mix(in srgb, var(--blue-soft) 24%, var(--surface-muted))
  );
  box-shadow: 0 9px 24px rgba(0,113,227,.055), inset 0 1px 0 rgba(255,255,255,.018);
}
.seal-options .radio-card,
.seal-options .radio-card:hover,
.seal-options .radio-card:has(input:checked),
.seal-options .radio-card:not(:has(input:checked)):hover {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.seal-options .radio-card input {
  transition: border-color .34s ease, background-color .34s ease, transform .34s ease;
}
.seal-options .radio-card input::before {
  transition: opacity .28s ease, transform .36s cubic-bezier(.22,1,.36,1);
}
.seal-options .radio-card:has(input:checked) input { transform: scale(1.025); }
.seal-options .radio-card strong,
.seal-options .radio-card small { transition: color .30s ease; }

.generation-advanced-toggle {
  transition: color .28s ease, border-color .28s ease, background-color .28s ease;
}
.generation-advanced-toggle svg {
  transition: transform .62s cubic-bezier(.22,1,.36,1);
}
.generation-advanced-panel {
  height: 0;
  max-height: none !important;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    height .72s cubic-bezier(.22,1,.36,1),
    opacity .34s ease,
    transform .64s cubic-bezier(.22,1,.36,1);
}
.generation-advanced-panel.is-open {
  max-height: none !important;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.generation-advanced-inner {
  transform: translateY(-3px);
  opacity: .88;
  transition: transform .58s cubic-bezier(.22,1,.36,1), opacity .34s ease;
}
.generation-advanced-panel.is-open .generation-advanced-inner {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .workspace-mode-switch > .apple-selection-indicator,
  .generation-type-grid > .apple-selection-indicator { transition-duration: .48s; }
}
@media (prefers-reduced-motion: reduce) {
  .apple-selection-indicator,
  .generation-advanced-panel,
  .generation-advanced-inner,
  .generation-advanced-toggle svg { transition: none !important; }
}


/* v5.18.5 action refinement: cleaner Apple-like utility buttons */
.settings-header { align-items: end; }
.settings-note { display: none !important; }

#processButton {
  gap: 0 !important;
  justify-content: center !important;
  padding-inline: 28px !important;
}
#processButton svg { display: none !important; }
#processButtonLabel { letter-spacing: -.012em; }

.history-actions {
  gap: 12px !important;
}
.history-tool {
  min-height: 46px !important;
  padding: 0 20px !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -.012em !important;
  border-width: 1px !important;
  transform: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 6px 16px rgba(0,0,0,.16) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
}
.history-tool svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 1.75 !important;
}
#refreshHistoryButton {
  color: #f5f5f7 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.08)) !important;
  border-color: rgba(255,255,255,.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px rgba(0,0,0,.16) !important;
}
#refreshHistoryButton:hover {
  color: #ffffff !important;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10)) !important;
  border-color: rgba(255,255,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 20px rgba(0,0,0,.18) !important;
}
#clearHistoryButton {
  color: #ff8c85 !important;
  background: linear-gradient(180deg, rgba(255,69,58,.14), rgba(255,69,58,.08)) !important;
  border-color: rgba(255,105,97,.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.14) !important;
}
#clearHistoryButton:hover {
  color: #ff9a94 !important;
  background: linear-gradient(180deg, rgba(255,69,58,.18), rgba(255,69,58,.10)) !important;
  border-color: rgba(255,105,97,.30) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 8px 20px rgba(0,0,0,.16) !important;
}
#refreshHistoryButton:disabled,
#clearHistoryButton:disabled {
  opacity: .58 !important;
  box-shadow: none !important;
}


/* v5.18.6 centered glyph glow for history actions */
.history-tool {
  /* No directional under-light: the material itself stays visually flat. */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
}
.history-tool:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15) !important;
}
.history-tool span {
  position: relative;
  z-index: 1;
  text-shadow: none;
  transition: color .18s ease, text-shadow .18s ease !important;
}
.history-tool svg {
  position: relative;
  z-index: 1;
  filter: none;
  transition: stroke .18s ease, filter .18s ease !important;
}
#refreshHistoryButton {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14) !important;
}
#refreshHistoryButton span {
  color: #f5f5f7 !important;
  text-shadow:
    0 0 4px rgba(255,255,255,.22),
    0 0 9px rgba(255,255,255,.10);
}
#refreshHistoryButton svg {
  filter:
    drop-shadow(0 0 2px rgba(255,255,255,.20))
    drop-shadow(0 0 5px rgba(255,255,255,.08));
}
#refreshHistoryButton:hover span {
  color: #ffffff !important;
  text-shadow:
    0 0 4px rgba(255,255,255,.34),
    0 0 10px rgba(255,255,255,.16);
}
#refreshHistoryButton:hover svg {
  filter:
    drop-shadow(0 0 2px rgba(255,255,255,.30))
    drop-shadow(0 0 6px rgba(255,255,255,.12));
}
#clearHistoryButton {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055) !important;
}
#clearHistoryButton span {
  color: #ff8b84 !important;
  text-shadow:
    0 0 4px rgba(255,105,97,.24),
    0 0 9px rgba(255,69,58,.10);
}
#clearHistoryButton svg {
  filter:
    drop-shadow(0 0 2px rgba(255,105,97,.20))
    drop-shadow(0 0 5px rgba(255,69,58,.08));
}
#clearHistoryButton:hover span {
  color: #ffa19b !important;
  text-shadow:
    0 0 4px rgba(255,105,97,.38),
    0 0 10px rgba(255,69,58,.17);
}
#clearHistoryButton:hover svg {
  filter:
    drop-shadow(0 0 2px rgba(255,105,97,.32))
    drop-shadow(0 0 6px rgba(255,69,58,.13));
}
#refreshHistoryButton:disabled span,
#clearHistoryButton:disabled span {
  text-shadow: none !important;
}
#refreshHistoryButton:disabled svg,
#clearHistoryButton:disabled svg {
  filter: none !important;
}

/* Keep disabled state muted, but retain a centered glyph halo rather than a lower cast shadow. */
#refreshHistoryButton:disabled span {
  text-shadow: 0 0 3px rgba(255,255,255,.12) !important;
}
#refreshHistoryButton:disabled svg {
  filter: drop-shadow(0 0 2px rgba(255,255,255,.10)) !important;
}
#clearHistoryButton:disabled span {
  text-shadow: 0 0 3px rgba(255,105,97,.12) !important;
}
#clearHistoryButton:disabled svg {
  filter: drop-shadow(0 0 2px rgba(255,105,97,.10)) !important;
}


/* v5.18.7 true glyph-centered glow: remove underlighting behind history buttons */
.history-actions::before {
  content: none !important;
  display: none !important;
  background: none !important;
  filter: none !important;
}
.history-actions {
  position: relative !important;
  isolation: isolate !important;
}
.history-tool,
#refreshHistoryButton,
#clearHistoryButton {
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
}
#refreshHistoryButton {
  background: rgba(255,255,255,.085) !important;
  border-color: rgba(255,255,255,.16) !important;
}
#refreshHistoryButton:hover {
  background: rgba(255,255,255,.11) !important;
  border-color: rgba(255,255,255,.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16) !important;
}
#clearHistoryButton {
  background: rgba(255,69,58,.085) !important;
  border-color: rgba(255,105,97,.18) !important;
}
#clearHistoryButton:hover {
  background: rgba(255,69,58,.11) !important;
  border-color: rgba(255,105,97,.24) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}
.history-tool span,
.history-tool svg {
  position: relative;
  z-index: 1;
}
#refreshHistoryButton span {
  color: #f7f7fa !important;
  text-shadow: 0 0 1px rgba(255,255,255,.45), 0 0 6px rgba(255,255,255,.20), 0 0 14px rgba(255,255,255,.08) !important;
}
#refreshHistoryButton svg {
  color: #f7f7fa !important;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.38)) drop-shadow(0 0 5px rgba(255,255,255,.14)) !important;
}
#refreshHistoryButton:hover span {
  color: #ffffff !important;
  text-shadow: 0 0 1px rgba(255,255,255,.60), 0 0 7px rgba(255,255,255,.26), 0 0 16px rgba(255,255,255,.11) !important;
}
#refreshHistoryButton:hover svg {
  filter: drop-shadow(0 0 1px rgba(255,255,255,.52)) drop-shadow(0 0 6px rgba(255,255,255,.18)) !important;
}
#clearHistoryButton span {
  color: #ff938c !important;
  text-shadow: 0 0 1px rgba(255,120,112,.45), 0 0 6px rgba(255,105,97,.22), 0 0 14px rgba(255,69,58,.09) !important;
}
#clearHistoryButton svg {
  color: #ff938c !important;
  filter: drop-shadow(0 0 1px rgba(255,120,112,.34)) drop-shadow(0 0 5px rgba(255,69,58,.12)) !important;
}
#clearHistoryButton:hover span {
  color: #ffa39d !important;
  text-shadow: 0 0 1px rgba(255,138,130,.60), 0 0 7px rgba(255,105,97,.28), 0 0 16px rgba(255,69,58,.12) !important;
}
#clearHistoryButton:hover svg {
  filter: drop-shadow(0 0 1px rgba(255,138,130,.46)) drop-shadow(0 0 6px rgba(255,69,58,.16)) !important;
}
#refreshHistoryButton:disabled,
#clearHistoryButton:disabled {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}
#refreshHistoryButton:disabled span {
  text-shadow: 0 0 1px rgba(255,255,255,.16), 0 0 4px rgba(255,255,255,.07) !important;
}
#refreshHistoryButton:disabled svg {
  filter: drop-shadow(0 0 1px rgba(255,255,255,.14)) !important;
}
#clearHistoryButton:disabled span {
  text-shadow: 0 0 1px rgba(255,120,112,.16), 0 0 4px rgba(255,105,97,.07) !important;
}
#clearHistoryButton:disabled svg {
  filter: drop-shadow(0 0 1px rgba(255,120,112,.14)) !important;
}


/* v5.18.8 clearer red tone for danger history action */
#clearHistoryButton {
  background: rgba(255,95,87,.14) !important;
  border-color: rgba(255,95,87,.28) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}
#clearHistoryButton:hover {
  background: rgba(255,95,87,.18) !important;
  border-color: rgba(255,95,87,.36) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10) !important;
}
#clearHistoryButton span {
  color: #ff6b63 !important;
  text-shadow: 0 0 1px rgba(255,107,99,.50), 0 0 6px rgba(255,95,87,.26), 0 0 14px rgba(255,95,87,.12) !important;
}
#clearHistoryButton svg {
  color: #ff6b63 !important;
  filter: drop-shadow(0 0 1px rgba(255,107,99,.38)) drop-shadow(0 0 5px rgba(255,95,87,.16)) !important;
}
#clearHistoryButton:hover span {
  color: #ff7a72 !important;
  text-shadow: 0 0 1px rgba(255,122,114,.62), 0 0 7px rgba(255,95,87,.32), 0 0 16px rgba(255,95,87,.15) !important;
}
#clearHistoryButton:hover svg {
  filter: drop-shadow(0 0 1px rgba(255,122,114,.48)) drop-shadow(0 0 6px rgba(255,95,87,.20)) !important;
}
#clearHistoryButton:disabled span {
  color: #ea7b75 !important;
  text-shadow: 0 0 1px rgba(255,107,99,.18), 0 0 4px rgba(255,95,87,.08) !important;
}
#clearHistoryButton:disabled svg {
  color: #ea7b75 !important;
  filter: drop-shadow(0 0 1px rgba(255,107,99,.15)) !important;
}


/* v5.18.9 keep danger action vivid even when history is empty */
#clearHistoryButton[aria-disabled="true"] {
  opacity: 1 !important;
  cursor: pointer !important;
}
#clearHistoryButton[aria-disabled="true"] span {
  color: #ff6b63 !important;
  text-shadow: 0 0 1px rgba(255,107,99,.50), 0 0 6px rgba(255,95,87,.26), 0 0 14px rgba(255,95,87,.12) !important;
}
#clearHistoryButton[aria-disabled="true"] svg {
  color: #ff6b63 !important;
  filter: drop-shadow(0 0 1px rgba(255,107,99,.38)) drop-shadow(0 0 5px rgba(255,95,87,.16)) !important;
}


/* v5.21.0: only the indicator and .active label may signal a selected length. */
.detail-pill:not(.active),
.detail-pill:not(.active):hover,
.detail-pill:not(.active):active,
.detail-pill:not(.active):focus {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.authority-template-fields {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue-soft) 12%, transparent);
}

.document-type-specific-section {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-muted) 90%, var(--blue-soft) 10%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.document-type-specific-section.hidden { display: none; }
.document-type-specific-heading {
  display: grid;
  gap: 14px;
}
.document-type-specific-heading > span:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.document-type-specific-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.document-type-specific-field {
  min-width: 0;
}
.document-type-specific-field.is-wide {
  grid-column: 1 / -1;
}
.document-type-specific-field textarea {
  min-height: 76px;
  resize: vertical;
}
.document-type-specific-field input,
.document-type-specific-field textarea {
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.document-type-specific-field:focus-within input,
.document-type-specific-field:focus-within textarea {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--line));
  background: color-mix(in srgb, var(--surface-solid) 98%, var(--blue) 2%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 11%, transparent);
}
.type-specific-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 14px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.6;
}
.authority-template-fields.hidden { display: none; }
.authority-template-fields .form-field.hidden { display: none; }
.authority-template-fields [data-authority-component].hidden { display: none; }

/* 版头部件的说明行：留空会保留〔待补充〕的必填项，以及当前版式排不出来
   的部件为什么不见了。用户不需要猜界面为什么少了一块。 */
.authority-component-note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11.5px;
  line-height: 1.6;
}
.authority-template-fields .form-field > .authority-component-note {
  margin-top: 2px;
}
.authority-component-note.is-layout-note {
  padding: 9px 12px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.authority-template-fields [data-authority-component].is-required-component > .form-label small {
  color: color-mix(in srgb, var(--blue) 72%, white);
}
.authority-unavailable-note {
  margin: 0;
  padding: 13px 14px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.65;
}
.authority-unavailable-note[hidden] { display: none; }
.advanced-subheading { display: grid; gap: 4px; }
.advanced-subheading strong { font-size: 13px; color: var(--text); }
.advanced-subheading small,
.authority-safety-note { color: var(--text-tertiary); line-height: 1.65; }

.authority-template-fields select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 38px 0 13px;
  color: var(--text);
  background: var(--surface-solid);
  font: inherit;
}

/* v5.21.1 Apple-style authority picker, aligned controls and fixed ambience. */
body {
  background:
    radial-gradient(ellipse 25rem 25rem at 9vw 42vh, rgba(28,116,255,.14), transparent 72%),
    radial-gradient(ellipse 25rem 25rem at 91vw 42vh, rgba(128,92,255,.12), transparent 72%),
    linear-gradient(180deg, #09090b 0%, #050507 48%, #07070a 100%) !important;
  background-attachment: fixed, fixed, fixed !important;
  background-position: 0 0, 0 0, 0 0 !important;
  background-repeat: no-repeat, no-repeat, no-repeat !important;
  background-size: 100vw 100vh, 100vw 100vh, 100vw 100vh !important;
}

#processor { overflow-anchor: none; }
.workspace-panel {
  animation: workspacePanelFade .22s ease-out both !important;
  will-change: opacity;
}
@keyframes workspacePanelFade {
  from { opacity: .01; }
  to { opacity: 1; }
}

.generation-topic-detail-row {
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr) !important;
  gap: 16px !important;
  align-items: start !important;
}
.generation-topic-detail-row > .form-field {
  grid-template-rows: 18px 56px;
  gap: 8px;
  align-self: stretch;
}
.generation-topic-detail-row .form-label {
  min-height: 18px;
  display: flex;
  align-items: baseline;
  line-height: 18px;
}
.generation-topic-detail-row input,
.generation-topic-detail-row .generation-detail-segment {
  height: 56px;
  min-height: 56px;
}
.generation-topic-detail-row .generation-detail-segment { align-self: stretch; }
.generation-topic-detail-row .detail-pill {
  height: 46px;
  min-height: 46px;
}

.authority-template-field { position: relative; }
.apple-select {
  position: relative;
  min-width: 0;
}
.apple-select-trigger {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.apple-select-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 590;
  letter-spacing: -.01em;
}
.apple-select-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), stroke .18s ease;
}
.apple-select-trigger:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-solid) 98%, transparent);
}
.apple-select-trigger:focus-visible,
.apple-select.is-open .apple-select-trigger {
  border-color: color-mix(in srgb, var(--blue) 72%, transparent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent), inset 0 1px 0 rgba(255,255,255,.06);
}
.apple-select.is-open .apple-select-trigger svg {
  stroke: var(--blue);
  transform: rotate(180deg);
}
.apple-select-trigger:disabled {
  opacity: .48;
  cursor: default;
}
.apple-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(356px, 52vh);
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  color: var(--text);
  background: rgba(35,35,39,.93);
  box-shadow: 0 22px 56px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
  animation: appleSelectIn .16s cubic-bezier(.2,.8,.2,1) both;
}
.apple-select-menu[hidden] { display: none !important; }
@keyframes appleSelectIn {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.apple-select-option {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  text-align: left;
  outline: none;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -.01em;
  transition: color .14s ease, background-color .14s ease;
}
.apple-select-option:hover,
.apple-select-option:focus-visible {
  color: var(--text);
  background: rgba(255,255,255,.075);
}
.apple-select-option.is-selected {
  color: #fff;
  background: rgba(10,132,255,.22);
}
.apple-select-option.is-selected:hover,
.apple-select-option.is-selected:focus-visible { background: rgba(10,132,255,.29); }
.apple-select-check {
  width: 20px;
  flex: 0 0 20px;
  color: #5eb0ff;
  font-size: 15px;
  font-weight: 750;
  text-align: center;
  opacity: 0;
}
.apple-select-option.is-selected .apple-select-check { opacity: 1; }

.generation-type-picker { z-index: 12; }
.generation-type-trigger {
  min-height: 60px;
  padding: 9px 13px 9px 15px;
  border-radius: 15px;
}
.apple-select-trigger > .generation-type-trigger-copy {
  display: grid;
  gap: 2px;
  overflow: visible;
  white-space: normal;
}
.generation-type-trigger-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
}
.generation-type-trigger-copy small {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.35;
}
.generation-type-menu {
  max-height: min(440px, 62vh);
  padding: 7px;
}
.apple-select-group-label {
  position: static;
  margin: 8px 8px 3px;
  padding: 8px 4px 5px;
  color: var(--text-tertiary);
  background: transparent;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.generation-type-menu > .apple-select-group-label:first-of-type { border-top: 0; }
.generation-type-option { min-height: 38px; }
.generation-quick-label {
  margin: 2px 0 -2px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
}

select.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
}
.authority-template-fields.is-school-layout #generationRedheadField { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .generation-topic-detail-row { grid-template-columns: 1fr !important; }
  .document-type-specific-grid { grid-template-columns: 1fr; }
  .document-type-specific-field.is-wide { grid-column: auto; }
  .document-type-specific-heading { align-items: center; }
  .apple-select-menu { max-height: min(330px, 48vh); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-panel,
  .apple-select-menu { animation: none !important; }
}

/* v5.22.1 — compact copy and symmetric focus motion */
.draft-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(365px, 43%);
  align-items: start;
  gap: 18px;
  margin-top: 22px;
}
body[data-workspace-mode="generate"] #processor { overflow: visible; }
.draft-editor-column { min-width: 0; }
.draft-studio .generation-form { margin-top: 0; }
.draft-preview-panel {
  position: sticky;
  top: 84px;
  z-index: 12;
  min-width: 0;
  max-height: calc(100vh - 104px);
  padding: 12px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 25px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  box-shadow: 0 22px 64px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 45%, transparent) transparent;
  transition: width .36s cubic-bezier(.16,1,.3,1), border-radius .28s ease, box-shadow .28s ease;
}
@media (min-width: 1181px) {
  body[data-workspace-mode="generate"]:not(.preview-focus-open) .draft-preview-panel.is-initial-height-matched::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: calc(100% - 25px);
    height: calc(var(--preview-shell-extension, 0px) + 25px);
    z-index: 0;
    pointer-events: none;
    border: 1px solid var(--line-strong);
    border-top: 0;
    border-radius: 0 0 25px 25px;
    background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
    backdrop-filter: blur(32px) saturate(165%);
    -webkit-backdrop-filter: blur(32px) saturate(165%);
  }
  body[data-workspace-mode="generate"]:not(.preview-focus-open) .draft-preview-panel.is-initial-height-matched > .preview-toolbar,
  body[data-workspace-mode="generate"]:not(.preview-focus-open) .draft-preview-panel.is-initial-height-matched > .preview-stage,
  body[data-workspace-mode="generate"]:not(.preview-focus-open) .draft-preview-panel.is-initial-height-matched > .preview-foot,
  body[data-workspace-mode="generate"]:not(.preview-focus-open) .draft-preview-panel.is-initial-height-matched > .preview-side-tools {
    position: relative;
    z-index: 1;
  }
}
.preview-toolbar,
.preview-status-copy,
.reference-style-head,
.copilot-head { display: flex; align-items: center; }
.preview-toolbar { min-height: 42px; justify-content: space-between; gap: 14px; padding: 1px 2px 10px; }
.preview-status-copy { min-width: 0; gap: 9px; }
.preview-status-copy > span:last-child,
.reference-style-head > span:last-child,
.copilot-head > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.preview-status-copy strong,
.reference-style-head strong,
.copilot-head strong { font-size: 12px; font-weight: 690; letter-spacing: -.01em; }
.preview-status-copy small,
.reference-style-head small,
.copilot-head small { color: var(--text-tertiary); font-size: 9.5px; line-height: 1.4; }
.preview-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 5px rgba(48,209,88,.10), 0 0 16px rgba(48,209,88,.38);
}
.preview-live-dot.is-working { background: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 12%, transparent), 0 0 16px color-mix(in srgb, var(--blue) 42%, transparent); animation: previewPulse 1.2s ease-in-out infinite; }
@keyframes previewPulse { 50% { opacity: .45; transform: scale(.82); } }
.preview-icon-button {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-muted) 86%, transparent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 630;
  transition: color .24s ease, background-color .24s ease, border-color .24s ease, transform .32s cubic-bezier(.16,1,.3,1), box-shadow .32s ease;
}
.preview-icon-button:hover { color: var(--text); border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); background: var(--surface-solid); box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 10%, transparent), 0 0 18px color-mix(in srgb, var(--blue) 16%, transparent); transform: none; }
.preview-icon-button:active { transform: none; }
.preview-icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.preview-icon-button svg path {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .24s ease, transform .4s cubic-bezier(.16,1,.3,1);
}
.preview-close-path { opacity: 0; transform: scale(.55) rotate(-38deg); }
.preview-focus-label {
  min-width: 2em;
  display: grid;
  overflow: hidden;
  line-height: 1.2;
}
.preview-focus-label > span {
  grid-area: 1 / 1;
  transition: opacity .22s ease, transform .38s cubic-bezier(.16,1,.3,1);
}
.preview-focus-label > span:last-child { opacity: 0; transform: translateY(9px); }
.preview-stage {
  position: relative;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 19px;
  background:
    radial-gradient(circle at 50% -10%, rgba(10,132,255,.13), transparent 52%),
    color-mix(in srgb, var(--bg) 82%, #17171a 18%);
}
.draft-paper {
  --paper-body-font: "仿宋", "STFangsong", serif;
  --paper-title-font: "方正小标宋简体", "STSong", serif;
  --paper-body-size: 8.9px;
  --paper-title-size: 13px;
  --paper-line-height: 1.82;
  --paper-first-line: 2em;
  position: relative;
  width: min(100%, 410px);
  min-height: 492px;
  margin: 0 auto;
  padding: 51px 38px 34px;
  overflow: hidden;
  color: #111;
  background: #fff;
  box-shadow: 0 18px 46px rgba(0,0,0,.32), 0 1px 0 rgba(255,255,255,.8) inset;
  font-family: var(--paper-body-font);
  font-size: var(--paper-body-size);
  line-height: var(--paper-line-height);
  text-rendering: geometricPrecision;
  transition: width .44s cubic-bezier(.16,1,.3,1), padding .4s cubic-bezier(.16,1,.3,1), min-height .44s cubic-bezier(.16,1,.3,1), font-size .32s ease;
}
.draft-paper.is-refreshing > *:not(.paper-watermark) { animation: paperContentIn .26s cubic-bezier(.16,1,.3,1) both; }
@keyframes paperContentIn { from { opacity: .38; transform: translateY(3px); filter: blur(1px); } to { opacity: 1; transform: none; filter: none; } }
.paper-watermark { position: absolute; top: 10px; right: 11px; color: #a1a1a6; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: 6.5px; letter-spacing: .04em; }
.paper-topline { min-height: 12px; display: flex; justify-content: space-between; gap: 8px; font-family: "黑体", "SimHei", sans-serif; font-size: 7.3px; }
.paper-redhead { margin: 3px -8px 0; color: #c00000; font-family: "方正小标宋简体", "STSong", serif; font-size: 18px; font-weight: 500; line-height: 1.3; text-align: center; letter-spacing: .03em; }
.paper-document-number { margin-top: 16px; text-align: center; }
.paper-red-separator { height: 1px; margin: 5px 0 18px; background: #c00000; }
.draft-paper h4 { max-width: 92%; margin: 3px auto 16px; font-family: var(--paper-title-font); font-size: var(--paper-title-size); font-weight: 500; line-height: 1.55; text-align: center; letter-spacing: .01em; }
.paper-recipient { margin: 0 0 2px; text-align: left; }
.paper-body { display: grid; gap: 0; }
.paper-body p { margin: 0; min-height: 1.7em; text-align: justify; text-justify: inter-ideograph; text-indent: var(--paper-first-line); overflow-wrap: anywhere; }
.school-disclosure { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-5px); transition: grid-template-rows .48s cubic-bezier(.22,1,.36,1), opacity .24s ease, transform .4s cubic-bezier(.22,1,.36,1), margin .48s cubic-bezier(.22,1,.36,1); }
.school-disclosure.is-open { grid-template-rows: 1fr; opacity: 1; transform: translateY(0); }
.school-disclosure-inner { min-height: 0; overflow: hidden; }
.school-format-options { margin-top: 0; }
.school-format-options.is-open { margin-top: 14px; }
.school-format-fields { display: grid; gap: 8px; }
.school-format-options label { display: block; margin: 2px 0 5px; font-size: 13px; }
.school-format-options select { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px; background: rgba(255, 255, 255, .06); color: inherit; font: inherit; }
.school-picker.is-ready > select { display: none; }
.school-choice-trigger { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.06); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .22s, border-color .22s, box-shadow .28s, transform .2s; }
.school-choice-trigger[hidden] { display: none; }
.school-choice-trigger:hover, .school-choice-trigger[aria-expanded="true"] { background: rgba(255,255,255,.1); border-color: rgba(120,165,255,.48); box-shadow: 0 0 0 3px rgba(71,129,255,.1); }
.school-choice-trigger:active { transform: scale(.985); }
.school-choice-trigger:focus-visible, .school-choice-option:focus-visible { outline: 2px solid #75a7ff; outline-offset: -3px; }
.school-choice-chevron { width: 7px; height: 7px; flex: 0 0 7px; margin: 0 3px 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .35s cubic-bezier(.22,1,.36,1); opacity: .7; }
.school-choice-trigger[aria-expanded="true"] .school-choice-chevron { transform: translateY(3px) rotate(225deg); }
.school-choice-menu.is-open { margin-top: 7px; }
.school-choice-options { display: grid; gap: 3px; padding: 5px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.045); }
.school-choice-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .22s, color .22s, transform .2s; }
.school-choice-option:hover { background: rgba(255,255,255,.08); }
.school-choice-option:active { transform: scale(.98); }
.school-choice-option[aria-selected="true"] { background: rgba(62,125,255,.18); color: #b4cfff; }
.school-choice-check { opacity: 0; transform: scale(.65); transition: opacity .18s, transform .3s cubic-bezier(.22,1,.36,1); }
.school-choice-option[aria-selected="true"] .school-choice-check { opacity: 1; transform: scale(1); }
.school-format-note { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-secondary, #999); }
@media (prefers-reduced-motion: reduce) {
  .school-disclosure, .school-choice-trigger, .school-choice-chevron, .school-choice-option, .school-choice-check { transition: none !important; }
  .school-disclosure, .school-choice-trigger:active, .school-choice-option:active, .school-choice-check { transform: none !important; }
}
.paper-body p.heading_l1 { font-family: "黑体", "SimHei", sans-serif; font-weight: 600; text-indent: 2em; }
.paper-body p.heading_l2 { font-family: "楷体", "KaiTi", serif; font-weight: 600; text-indent: 2em; }
.paper-body p.heading_l3 { font-weight: 650; text-indent: 2em; }
.paper-body p.centered_text { text-align: center; text-indent: 0; }
.paper-body p.closing { text-indent: 2em; }
.paper-body p.paper-placeholder { color: #9a9a9e; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: .88em; }
.draft-paper[data-preview-state="empty"] > :not(.paper-body) { display: none; }
.draft-paper[data-preview-state="empty"] .paper-body { position: absolute; inset: 36% 14% auto; }
.paper-body p.paper-empty-hint { text-align: center; text-indent: 0; line-height: 1.8; }
.draft-paper[hidden], .actual-pdf-preview[hidden], .actual-pdf-retry[hidden] { display: none !important; }
.actual-pdf-preview { width: 410px; max-width: 100%; height: 580px; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.actual-pdf-navigation { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; }
.actual-pdf-navigation > span { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.preview-page-button { min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface-muted); font: inherit; font-size: 10px; cursor: pointer; transition: background-color .16s, opacity .16s; }
.preview-page-button:hover { background: color-mix(in srgb, var(--surface-muted) 80%, var(--text) 6%); }
.preview-page-button:disabled { opacity: .38; cursor: default; }
.preview-page-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.actual-pdf-page-stage { min-height: 0; flex: 1 1 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.actual-pdf-page-stage > canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; box-shadow: 0 9px 24px rgba(0,0,0,.25); }
.actual-pdf-status { flex: 0 0 auto; margin: 0; color: var(--text-tertiary); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.actual-pdf-retry { align-self: center; }
.draft-paper h4.paper-placeholder,
.paper-recipient.paper-placeholder,
.paper-document-number.paper-placeholder,
.paper-signature .paper-placeholder,
.paper-public-note.paper-placeholder {
  color: #8e8e93;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: .88em;
  font-weight: 500;
}
.paper-redhead.paper-placeholder { color: #c85b5b; opacity: .86; }
.paper-signature { display: grid; justify-items: end; gap: 0; min-height: 39px; margin-top: 11px; padding-right: 1em; text-align: center; }
.paper-public-note { margin-top: 4px; text-indent: 2em; }
.paper-colophon { margin: 15px 0 0; padding: 4px 3px; border-top: .7px solid #111; border-bottom: .7px solid #111; display: grid; gap: 2px; font-size: 7px; }
.paper-page-number { position: absolute; bottom: 11px; left: 0; right: 0; color: #333; text-align: center; font-family: "宋体", serif; font-size: 7px; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px 3px; color: var(--text-tertiary); font-size: 9px; }
.preview-foot span:first-child { color: var(--text-secondary); font-weight: 620; }
.preview-foot span:last-child { max-width: 72%; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.reference-style-card,
.draft-copilot {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.reference-style-head { gap: 10px; }
.reference-style-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #bf5af2;
  background: rgba(191,90,242,.13);
}
.reference-style-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.reference-style-actions { margin-top: 10px; display: flex; gap: 7px; }
.reference-upload-button,
.reference-remove-button,
.copilot-undo-button,
.copilot-quick-actions button {
  border: 1px solid var(--line);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.reference-upload-button { flex: 1; min-height: 34px; border-radius: 11px; color: var(--blue); font-size: 10px; font-weight: 660; }
.reference-remove-button { min-height: 34px; padding: 0 10px; border-radius: 11px; font-size: 10px; }
.reference-upload-button:hover,
.reference-remove-button:hover,
.copilot-quick-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.reference-style-card.is-loading .reference-style-icon { animation: referenceSpin 1.2s linear infinite; }
@keyframes referenceSpin { to { transform: rotate(360deg); } }
.reference-style-card.is-applied { border-color: rgba(48,209,88,.24); background: color-mix(in srgb, var(--green-soft) 28%, var(--surface-muted)); }
.reference-style-card.is-error { border-color: rgba(255,69,58,.26); }

.copilot-head { gap: 9px; }
.copilot-orb { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(145deg, #0a84ff, #5e5ce6 62%, #af52de); box-shadow: 0 7px 18px rgba(94,92,230,.25); font-size: 12px; }
.copilot-undo-button { min-height: 29px; margin-left: auto; padding: 0 8px; border-radius: 9px; font-size: 9px; }
.copilot-messages { max-height: 145px; margin-top: 10px; padding: 1px 2px; display: grid; align-content: start; gap: 7px; overflow-y: auto; scrollbar-width: thin; }
.copilot-message { display: flex; }
.copilot-message p { max-width: 88%; margin: 0; padding: 8px 10px; border-radius: 12px; font-size: 10px; line-height: 1.55; }
.copilot-message.assistant p { color: var(--text-secondary); background: color-mix(in srgb, var(--surface-solid) 74%, transparent); border-bottom-left-radius: 4px; }
.copilot-message.user { justify-content: flex-end; }
.copilot-message.user p { color: #fff; background: var(--blue); border-bottom-right-radius: 4px; }
.copilot-message.is-typing p::after { content: "•••"; letter-spacing: .14em; animation: typingDots 1s ease-in-out infinite; }
@keyframes typingDots { 50% { opacity: .35; } }
.copilot-quick-actions { margin-top: 9px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.copilot-quick-actions::-webkit-scrollbar { display: none; }
.copilot-quick-actions button { flex: 0 0 auto; min-height: 27px; padding: 0 8px; border-radius: 999px; font-size: 9px; white-space: nowrap; }
.copilot-composer { margin-top: 9px; min-height: 42px; padding: 5px 5px 5px 10px; display: flex; align-items: flex-end; gap: 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 90%, transparent); transition: border-color .18s ease, box-shadow .18s ease; }
.copilot-composer:focus-within { border-color: color-mix(in srgb, var(--blue) 62%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent); }
.copilot-composer textarea { width: 100%; min-height: 30px; max-height: 94px; padding: 6px 0 4px; resize: none; overflow-y: auto; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; font-size: 11px; line-height: 1.45; }
.copilot-composer textarea::placeholder { color: var(--text-tertiary); }
.copilot-composer button { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 10px; color: white; background: var(--blue); cursor: pointer; transition: transform .16s ease, opacity .16s ease; }
.copilot-composer button:hover { transform: none; }
.copilot-composer button:disabled { opacity: .38; cursor: wait; transform: none; }
.copilot-composer button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.copilot-safety { margin: 7px 1px 0; color: var(--text-tertiary); font-size: 8.5px; line-height: 1.5; }

.preview-focus-backdrop { position: fixed; inset: 0; z-index: 109; background: rgba(0,0,0,.58); animation: focusBackdropIn .38s ease both; }
@keyframes focusBackdropIn { from { opacity: 0; } to { opacity: 1; } }
body.preview-focus-open { overflow: hidden; }
body.preview-focus-open .draft-preview-panel {
  position: fixed;
  top: 24px;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 24px;
  z-index: 110;
  width: min(610px, calc(100vw - 48px));
  max-height: none;
  border-radius: 28px;
  animation: previewFocusIn .46s cubic-bezier(.16,1,.3,1) both;
}
body.preview-focus-open .draft-paper { width: min(100%, 492px); min-height: 650px; --paper-body-size: 10.5px; --paper-title-size: 16px; }
body.preview-focus-open .preview-expand-path { opacity: 0; transform: scale(.55) rotate(38deg); }
body.preview-focus-open .preview-close-path { opacity: 1; transform: scale(1) rotate(0); }
body.preview-focus-open .preview-focus-label > span:first-child { opacity: 0; transform: translateY(-9px); }
body.preview-focus-open .preview-focus-label > span:last-child { opacity: 1; transform: translateY(0); }
body.preview-focus-open.preview-focus-closing .draft-preview-panel { pointer-events: none; animation: previewFocusOut .32s cubic-bezier(.4,0,.6,1) both; }
body.preview-focus-open.preview-focus-closing .preview-focus-backdrop { pointer-events: none; animation: focusBackdropOut .32s ease both; }
@keyframes previewFocusIn { from { opacity: 0; transform: translate3d(0,18px,0) scale(.965); } to { opacity: 1; transform: none; } }
@keyframes previewFocusOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(0,15px,0) scale(.975); } }
@keyframes focusBackdropOut { from { opacity: 1; } to { opacity: 0; } }
.mobile-preview-button { display: none; }

@media (max-width: 980px) {
  .draft-studio { grid-template-columns: 1fr; }
  .draft-preview-panel { position: relative; top: auto; max-height: none; }
  .mobile-preview-button {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 48;
    min-height: 42px;
    padding: 0 15px;
    display: none;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    color: #fff;
    background: rgba(10,132,255,.9);
    box-shadow: 0 12px 30px rgba(0,80,180,.32), inset 0 1px 0 rgba(255,255,255,.22);
    backdrop-filter: blur(18px);
    cursor: pointer;
    font-size: 11px;
    font-weight: 650;
  }
  body[data-workspace-mode="generate"] .mobile-preview-button { display: inline-flex; }
}
@media (max-width: 620px) {
  .draft-studio { margin-top: 16px; }
  .draft-preview-panel { padding: 9px; border-radius: 21px; }
  .preview-stage { padding: 8px; }
  .draft-paper { min-height: 470px; padding: 47px 30px 32px; }
  body.preview-focus-open .draft-preview-panel { inset: 10px; width: auto; }
  body.preview-focus-open .draft-paper { min-height: 570px; }
}
@media (prefers-reduced-motion: reduce) {
  .draft-paper.is-refreshing > *:not(.paper-watermark),
  .preview-live-dot.is-working,
  .reference-style-card.is-loading .reference-style-icon,
  body.preview-focus-open .draft-preview-panel,
  body.preview-focus-open.preview-focus-closing .draft-preview-panel,
  .preview-focus-backdrop { animation: none !important; }
}

/* v5.22.2 motion refinements retained; v5.22.3 owns scrollbar rendering. */
.draft-preview-placeholder { min-width: 0; visibility: hidden; pointer-events: none; }
.draft-preview-panel {
  /* FLIP controls the focus motion. Width transitions after the panel is
     returned to the grid caused the visible closing hitch. */
  transition: box-shadow .28s ease, border-color .24s ease !important;
}
.draft-paper { transition: none !important; }

.generation-advanced-panel {
  transition:
    height var(--advanced-duration, 980ms) cubic-bezier(.25,.1,.25,1),
    opacity .48s ease,
    transform .72s cubic-bezier(.25,.1,.25,1) !important;
}
.generation-advanced-inner {
  transition: transform .72s cubic-bezier(.25,.1,.25,1), opacity .48s ease !important;
}
.generation-advanced-toggle svg { transition-duration: .66s !important; }

.date-popover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0,9px,0) scale(.975);
  animation: none !important;
  transition:
    opacity .26s ease,
    transform .38s cubic-bezier(.16,1,.3,1),
    visibility 0s linear .38s;
  will-change: opacity, transform;
}
.date-popover.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0,0,0) scale(1);
  transition-delay: 0s;
}
.date-popover.is-closing { pointer-events: none; }

.apple-select-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0,-7px,0) scale(.98);
  transform-origin: center top;
  animation: none !important;
  transition:
    opacity .24s ease,
    transform .34s cubic-bezier(.16,1,.3,1),
    visibility 0s linear .34s;
  will-change: opacity, transform;
}
.apple-select.is-open .apple-select-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0,0,0) scale(1);
  transition-delay: 0s;
}
.apple-select.is-closing .apple-select-menu {
  pointer-events: none;
  overflow: hidden !important;
  scrollbar-width: none;
}
.apple-select.is-closing .apple-select-menu::-webkit-scrollbar { display: none; }

#profileSegment { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
#profileSegment.is-auto-locked { border-color: color-mix(in srgb, var(--blue) 17%, var(--line)); }
#profileSegment.is-auto-locked .segment-pill { cursor: default; }
#profileSegment.is-auto-locked .segment-pill:not(.active) { opacity: .55; }

.besti-profile-expander {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-5px);
  transform-origin: center top;
  pointer-events: none;
  transition:
    grid-template-rows .48s cubic-bezier(.16,1,.3,1),
    margin-top .48s cubic-bezier(.16,1,.3,1),
    opacity .2s ease,
    transform .48s cubic-bezier(.16,1,.3,1),
    visibility 0s linear .48s;
  will-change: grid-template-rows, opacity, transform;
}
.besti-profile-expander.is-open {
  grid-template-rows: 1fr;
  margin-top: 10px;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}
.besti-profile-expander-clip {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(0 50% 0 50% round 999px);
  transition:
    clip-path .44s cubic-bezier(.16,1,.3,1),
    opacity .16s ease;
  will-change: clip-path, opacity;
}
.besti-profile-expander.is-open .besti-profile-expander-clip {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 999px);
}
.besti-profile-subsegment {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.besti-profile-label {
  display: inline-block;
  opacity: 0;
  transform: translateY(-6px) scale(.96);
  transition:
    opacity .16s ease,
    transform .32s cubic-bezier(.16,1,.3,1);
}
.besti-profile-expander.is-open .besti-profile-label {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: .13s;
}
.besti-profile-expander.is-open .segment-pill:last-child .besti-profile-label {
  transition-delay: .19s;
}

.draft-copilot { padding: 13px; }
.copilot-messages { max-height: 132px; padding: 0; }
.copilot-message.assistant { width: 100%; }
.copilot-message.assistant p {
  width: 100%;
  max-width: none;
  padding: 9px 11px;
  border-radius: 12px;
  text-align: left;
}
.copilot-quick-actions { gap: 7px; }
.copilot-quick-actions button { min-height: 29px; padding-inline: 10px; }
.copilot-safety { margin-inline: 2px; }

.capability-detail {
  transition: grid-template-rows .56s cubic-bezier(.16,1,.3,1) !important;
}
.capability-detail > div {
  opacity: 0;
  transform: translateY(-7px);
  transition: opacity .34s ease, transform .52s cubic-bezier(.16,1,.3,1);
}
.capability-item.open .capability-detail > div { opacity: 1; transform: translateY(0); }
.capability-plus { transition-duration: .46s !important; }

.preview-focus-backdrop {
  opacity: 0;
  animation: none !important;
  transition: opacity .46s ease;
  will-change: opacity;
}
body.preview-focus-open.preview-focus-preparing .preview-focus-backdrop,
body.preview-focus-open.preview-focus-closing .preview-focus-backdrop { opacity: 0; }
body.preview-focus-open:not(.preview-focus-preparing):not(.preview-focus-closing) .preview-focus-backdrop { opacity: 1; }

body.preview-focus-open .draft-preview-panel {
  transform-origin: left top;
  animation: previewFocusIn .62s cubic-bezier(.16,1,.3,1) both;
  will-change: transform, opacity;
}
body.preview-focus-open.preview-focus-preparing .draft-preview-panel {
  opacity: 0;
  animation: none !important;
  transform: translate3d(var(--preview-origin-x, 0), var(--preview-origin-y, 0), 0)
    scale(var(--preview-origin-scale-x, .82), var(--preview-origin-scale-y, .82));
}
body.preview-focus-open.preview-focus-closing .draft-preview-panel {
  animation: previewFocusOut .51s cubic-bezier(.32,.72,0,1) both;
}
@keyframes previewFocusIn {
  from {
    opacity: .12;
    transform: translate3d(var(--preview-origin-x, 0), var(--preview-origin-y, 12px), 0)
      scale(var(--preview-origin-scale-x, .92), var(--preview-origin-scale-y, .92));
  }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
@keyframes previewFocusOut {
  from { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  to {
    opacity: .08;
    transform: translate3d(var(--preview-return-x, 0), var(--preview-return-y, 12px), 0)
      scale(var(--preview-return-scale-x, .92), var(--preview-return-scale-y, .92));
  }
}

@media (prefers-reduced-motion: reduce) {
  .date-popover,
  .apple-select-menu,
  .capability-detail,
  .capability-detail > div,
  .generation-advanced-panel,
  .generation-advanced-inner,
  .generation-advanced-toggle svg,
  .preview-focus-backdrop { transition: none !important; }
  body.preview-focus-open.preview-focus-preparing .draft-preview-panel { opacity: 1; transform: none; }
}

/* v5.22.3 — iOS scroll indicators, continuous preview motion and one-surface reports */
html {
  scrollbar-gutter: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
body,
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.ios-scroll-layer {
  position: fixed;
  inset: 0;
  z-index: 560;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.ios-scroll-indicator {
  position: fixed;
  width: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
  will-change: top, left, height, opacity;
}
.ios-scroll-indicator.is-available.is-visible { opacity: .82; }
.ios-scroll-indicator.is-detached {
  visibility: hidden;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}
.ios-scroll-thumb {
  position: absolute;
  inset: 0 auto auto 0;
  width: 4px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(174, 174, 178, .72);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 1px 5px rgba(0,0,0,.18);
  will-change: transform, height;
}

.draft-copilot { padding: 10px; }
.copilot-toolbar { display: flex; justify-content: flex-end; margin-bottom: 7px; }
.copilot-toolbar:not(:has(.copilot-undo-button:not(.hidden))) { display: none; }
.copilot-undo-button { min-height: 28px; margin: 0; padding: 0 9px; }
.copilot-messages { margin-top: 0; }
.copilot-messages:empty { display: none; }
.copilot-messages:not(:empty) + .copilot-composer { margin-top: 9px; }
.copilot-composer { margin-top: 0; min-height: 46px; padding-left: 12px; }

.report-viewer {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
}
.report-viewer[hidden] { display: none !important; }
.report-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  cursor: default;
}
.report-viewer-shell {
  position: relative;
  width: min(1120px, calc(100vw - 40px));
  height: min(880px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  color: #f5f5f7;
  background: rgba(10,10,13,.96);
  box-shadow: 0 38px 120px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
  opacity: 0;
  transform: translate3d(0,22px,0) scale(.975);
  transform-origin: center 54%;
  transition:
    opacity .30s ease,
    transform .58s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.report-viewer.is-open { opacity: 1; pointer-events: auto; }
.report-viewer.is-open .report-viewer-shell { opacity: 1; transform: translate3d(0,0,0) scale(1); }
.report-viewer.is-closing { opacity: 0; transition-duration: .42s; }
.report-viewer.is-closing .report-viewer-shell {
  opacity: 0;
  transform: translate3d(0,14px,0) scale(.985);
  transition: opacity .28s ease, transform .44s cubic-bezier(.32,.72,0,1);
}
.report-viewer-header {
  min-width: 0;
  padding: 0 14px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(20,20,24,.82);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
}
.report-viewer-header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.report-viewer-header strong { overflow: hidden; font-size: 14px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.report-viewer-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #0a84ff; box-shadow: 0 0 0 5px rgba(10,132,255,.12); }
.report-viewer-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  color: #c7c7cc;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, transform .32s cubic-bezier(.16,1,.3,1);
}
.report-viewer-close:hover { color: #fff; background: rgba(255,255,255,.11); transform: rotate(5deg) scale(1.04); }
.report-viewer-close:active { transform: scale(.92); }
.report-viewer-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.report-viewer-frame { width: 100%; height: 100%; border: 0; background: #070709; }
body.report-viewer-open { overflow: hidden; }

.form-label,
.field-help,
.official-source-hint,
.workspace-mode-button small,
.reference-style-head small,
.preview-status-copy small,
.card-heading p {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#generationDocumentNumber {
  padding-inline: 10px;
  font-size: 12px;
  letter-spacing: -.025em;
}
#generationDocumentNumber::placeholder {
  font-size: 11px;
  letter-spacing: -.035em;
}

.seal-options .radio-card { align-items: center; }
.seal-options .radio-card input,
.seal-options .radio-card:has(input:checked) input {
  position: relative;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  display: block;
  box-sizing: border-box;
  transform: none;
}
.seal-options .radio-card input::before,
.seal-options .radio-card input:checked::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: 0;
  transform-origin: center;
}
.seal-options .radio-card input::before { transform: translate(-50%, -50%) scale(.45); }
.seal-options .radio-card input:checked::before { transform: translate(-50%, -50%) scale(1); }

@media (max-width: 1180px) {
  .draft-studio { grid-template-columns: minmax(0, 1fr); }
  .draft-preview-panel { position: relative; top: auto; max-height: none; }
}
@media (max-width: 760px) {
  .workspace-mode-button { padding-inline: 12px; }
  .workspace-mode-button small { font-size: 10px; }
  .report-viewer { padding: 8px; }
  .report-viewer-shell {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ios-scroll-indicator,
  .report-viewer,
  .report-viewer-shell,
  .report-viewer-close { transition: none !important; }
}

/* v5.22.4 — crisp preview motion, draggable iOS rails and flatter controls */
:root,
:root[data-theme="dark"] {
  --blue: #0a84ff;
  --blue-hover: #2997ff;
}

/* The focused preview dims the page without rasterising or blurring it. */
.preview-focus-backdrop,
body.preview-focus-open .preview-focus-backdrop,
body.preview-focus-open.preview-focus-closing .preview-focus-backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  background: rgba(0, 0, 0, .64);
  animation: none !important;
}
body.preview-focus-open .draft-preview-panel {
  contain: layout paint;
  background: rgba(24, 24, 28, .985);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.preview-focus-open.preview-focus-geometry-closing .draft-preview-panel {
  pointer-events: none;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  will-change: left, top, width, height;
}
body.preview-focus-open.preview-focus-closing .preview-focus-backdrop {
  opacity: 0;
  transition: opacity .50s ease !important;
}

/* A wide invisible hit area keeps the 4 px iOS thumb easy to grab. */
.ios-scroll-indicator {
  width: 14px;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ios-scroll-indicator.is-available.is-visible,
.ios-scroll-indicator.is-available.is-dragging {
  opacity: .84;
  pointer-events: auto;
}
.ios-scroll-indicator.is-dragging { opacity: 1; }
.ios-scroll-thumb {
  left: 5px;
  width: 4px;
  cursor: grab;
  touch-action: none;
  background: rgba(174, 174, 178, .76);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16);
}
.ios-scroll-indicator.is-dragging .ios-scroll-thumb {
  width: 5px;
  cursor: grabbing;
  background: rgba(199, 199, 204, .94);
}

/* One clear composer surface instead of nested cards. */
.draft-copilot {
  margin-top: 10px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.copilot-toolbar { margin: 0 1px 6px; }
.copilot-messages { margin: 0 1px 8px; }
.copilot-messages:empty { margin: 0; }
.copilot-messages:not(:empty) + .copilot-composer { margin-top: 0; }
.copilot-composer {
  min-height: 50px;
  margin-top: 0;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-solid) 76%, #1c1c1e) !important;
  box-shadow: none !important;
}
.copilot-composer:focus-within {
  border-color: color-mix(in srgb, var(--blue) 68%, var(--line)) !important;
  box-shadow: none !important;
}
.copilot-composer textarea { min-height: 34px; padding-block: 7px 5px; font-size: 11px; }
.copilot-composer button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue) !important;
  box-shadow: none !important;
}

/* Short placeholders stay readable while the editor is resized. */
.generation-advanced-panel { height: 0; max-height: none !important; }
.generation-advanced-panel.is-open { height: auto; }
.generation-requirements-field textarea {
  min-height: 82px;
  padding: 13px 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.generation-requirements-field textarea::placeholder {
  white-space: normal;
  font-size: 12px;
}

/* Consistent flat Apple-blue icon and action language. */
.brand-mark,
.upload-icon {
  background: var(--blue) !important;
  box-shadow: none !important;
}
.mode-icon,
.reference-style-icon {
  color: var(--blue) !important;
  background: color-mix(in srgb, var(--blue) 14%, transparent) !important;
  box-shadow: none !important;
}
.mode-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-icon.sparkle svg { width: 20px; height: 20px; }
.primary,
.copilot-composer button,
.mobile-preview-button {
  background: var(--blue) !important;
  box-shadow: none !important;
}
.primary::before { content: none !important; }
.primary:hover,
.copilot-composer button:hover,
.mobile-preview-button:hover { background: var(--blue-hover) !important; }
.workspace-mode-switch > .apple-selection-indicator,
.generation-type-grid > .apple-selection-indicator,
.seal-options > .apple-selection-indicator {
  background: color-mix(in srgb, var(--blue) 11%, var(--surface-solid)) !important;
  box-shadow: none !important;
}
.reference-upload-button { color: var(--blue); box-shadow: none; }

@media (max-width: 620px) {
  .generation-requirements-field textarea { min-height: 92px; }
  .workspace-mode-button { min-height: 68px; gap: 10px; }
  .mode-icon { width: 34px; height: 34px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body.preview-focus-open.preview-focus-geometry-closing .draft-preview-panel { will-change: auto; }
}

/* v5.22.5 — symmetric shared-preview motion and final-layout paper metrics */
.draft-paper {
  width: min(100%, 410px);
  min-height: 0;
  aspect-ratio: 210 / 297;
  padding: 72.3px 50.8px 68.3px 54.7px;
  --paper-body-size: 11px;
  --paper-title-size: 15.2px;
}
.paper-body p { white-space: pre-wrap; }
.paper-document-number,
.paper-colophon { white-space: pre-wrap; }
.paper-barcode-reservation {
  position: absolute;
  right: 14.76%;
  bottom: 5.72%;
  width: 23.81%;
  height: 5.05%;
  border: 1px dashed rgba(72, 83, 97, .34);
  border-radius: 3px;
  display: grid;
  place-items: center;
  color: rgba(72, 83, 97, .62);
  font-family: "宋体", serif;
  font-size: max(5px, calc(var(--paper-page-size, 7px) * .82));
  letter-spacing: 0;
  pointer-events: none;
}
.paper-barcode-reservation.hidden { display: none; }
.paper-document-number.has-signatory {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}
.paper-page-number { bottom: 10.14%; }
.draft-paper[data-profile="2024-10-27"],
.draft-paper[data-profile="besti-youth-student-2024"],
.draft-paper[data-profile="auto"] {
  padding: 70.3px 52.7px 58.6px;
}
.draft-paper[data-profile="2024-10-27"] .paper-page-number,
.draft-paper[data-profile="besti-youth-student-2024"] .paper-page-number,
.draft-paper[data-profile="auto"] .paper-page-number { bottom: 7.14%; }
.draft-paper.is-refreshing > * {
  animation: previewContentSync .18s cubic-bezier(.22,1,.36,1) both !important;
}
@keyframes previewContentSync {
  from { opacity: .72; }
  to { opacity: 1; }
}

body.preview-focus-open .draft-preview-panel:not(.preview-motion-ghost) {
  animation: none !important;
  transition: none !important;
}
body.preview-focus-open .draft-paper {
  width: min(100%, 492px);
  min-height: 0;
  padding: 86.7px 61px 82px 65.6px;
  --paper-body-size: 13.2px;
  --paper-title-size: 18.2px;
}
body.preview-focus-open .draft-paper[data-profile="2024-10-27"],
body.preview-focus-open .draft-paper[data-profile="besti-youth-student-2024"],
body.preview-focus-open .draft-paper[data-profile="auto"] {
  padding: 84.3px 63.3px 70.3px;
}
.preview-motion-source-hidden {
  visibility: hidden !important;
  pointer-events: none !important;
}
.preview-motion-ghost {
  pointer-events: none !important;
  user-select: none !important;
  animation: none !important;
  transition: none !important;
  contain: layout paint;
  overflow: hidden auto;
  will-change: transform, opacity, border-radius;
  box-shadow: 0 28px 84px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] {
  border-radius: 25px;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .draft-paper {
  width: min(100%, 410px);
  min-height: 0;
  padding: 72.3px 50.8px 68.3px 54.7px;
  --paper-body-size: 11px;
  --paper-title-size: 15.2px;
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .draft-paper[data-profile="2024-10-27"],
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .draft-paper[data-profile="besti-youth-student-2024"],
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .draft-paper[data-profile="auto"] {
  padding: 70.3px 52.7px 58.6px;
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .preview-expand-path {
  opacity: 1;
  transform: scale(1) rotate(0);
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .preview-close-path {
  opacity: 0;
  transform: scale(.55) rotate(-38deg);
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .preview-focus-label > span:first-child {
  opacity: 1;
  transform: translateY(0);
}
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .preview-focus-label > span:last-child {
  opacity: 0;
  transform: translateY(9px);
}
.preview-motion-veil {
  position: fixed;
  inset: 0;
  z-index: 111;
  pointer-events: none;
  opacity: 0;
  background: rgba(7, 10, 16, .10);
  backdrop-filter: blur(0) saturate(1);
  -webkit-backdrop-filter: blur(0) saturate(1);
  will-change: opacity, backdrop-filter;
}
body.preview-focus-transitioning .preview-focus-backdrop { pointer-events: none; }

@media (max-width: 620px) {
  .draft-paper,
  body.preview-focus-open .draft-paper,
  body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] .draft-paper {
    padding: 52.8px 37.1px 50px 40px;
    --paper-body-size: 8.1px;
    --paper-title-size: 11.1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-motion-ghost,
  .preview-motion-veil,
  .draft-paper.is-refreshing > * { animation: none !important; }
}

/* v5.22.6 — scrollbar-free adaptive preview and unclipped shared motion */
.draft-preview-panel {
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto;
}
.preview-stage {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.draft-paper {
  width: 410px;
  min-width: 0;
  flex: 0 0 auto;
}
.paper-topline {
  min-height: var(--paper-topline-min, 12px);
  font-size: var(--paper-topline-size, 7.3px);
}
.paper-redhead {
  margin: var(--paper-redhead-margin-top, 3px) var(--paper-redhead-margin-side, -8px) 0;
  font-size: var(--paper-redhead-size, 18px);
}
.draft-paper[data-letterhead-variant="besti-formal"] .paper-redhead {
  color: #ff0000;
  font-family: "方正美黑_GBK", "方正美黑简体", "STHeiti", sans-serif;
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: 0;
}
.draft-paper[data-letterhead-variant="besti-formal"] .paper-red-separator {
  background: #ff0000;
}
.draft-paper[data-letterhead-variant="besti-correspondence"] .paper-redhead {
  color: #ff0000;
  font-family: "方正小标宋_GBK", "方正小标宋简体", "STSong", serif;
  font-weight: 500;
  letter-spacing: 0;
}
.draft-paper[data-letterhead-variant="besti-correspondence"] .paper-red-separator,
.draft-paper[data-letterhead-variant="besti-correspondence"] .paper-signature::after {
  height: max(1.5px, var(--paper-separator-height, 1px));
  background: linear-gradient(to bottom, #ff0000 0 38%, transparent 38% 55%, #ff0000 55% 100%);
}
.draft-paper[data-letterhead-variant="besti-correspondence"] .paper-signature::after {
  content: "";
  width: 100%;
  margin-top: var(--paper-separator-top, 5px);
  justify-self: stretch;
}
.draft-paper[data-letterhead-variant="besti-correspondence"] .paper-page-number {
  display: none;
}
.paper-document-number { margin-top: var(--paper-document-number-margin, 16px); }
.paper-red-separator {
  height: var(--paper-separator-height, 1px);
  margin: var(--paper-separator-top, 5px) 0 var(--paper-separator-bottom, 18px);
}
.draft-paper h4 {
  margin-top: var(--paper-title-margin-top, 3px);
  margin-bottom: var(--paper-title-margin-bottom, 16px);
}
.paper-signature {
  min-height: var(--paper-signature-min-height, 39px);
  margin-top: var(--paper-signature-margin-top, 11px);
}
.draft-paper[data-seal-mode="seal"] .paper-signature {
  justify-items: center;
  padding-right: 0;
}
.paper-public-note { margin-top: var(--paper-public-note-margin, 4px); }
.paper-colophon {
  margin-top: var(--paper-colophon-margin, 15px);
  padding: var(--paper-colophon-pad-y, 4px) var(--paper-colophon-pad-x, 3px);
  gap: var(--paper-colophon-gap, 2px);
  font-size: var(--paper-colophon-size, 7px);
}
.paper-page-number { font-size: var(--paper-page-size, 7px); }

/* The preview card never owns a scroll position. The document shrinks to the
   available surface; the page itself remains the only outer scroll context. */
.preview-motion-ghost { overflow: hidden !important; }
.copilot-messages {
  min-height: 0;
  max-height: clamp(180px, 32vh, 340px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  touch-action: pan-y;
}
.copilot-message { overflow-wrap: anywhere; animation: chat-message-in 180ms ease-out; }
.copilot-message.assistant { display: block; min-width: 0; }
.copilot-message p { font-size: 13px; line-height: 1.6; }
.copilot-message a { display: inline-flex; align-items: center; max-width: 100%; margin: 8px 5px 0 0; min-height: 34px; padding: 8px 12px !important; border-radius: 12px !important; font-size: 12px !important; line-height: 1.4; white-space: normal; }
.copilot-draft-text { display: block; width: 100%; margin-top: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.copilot-draft-text summary { cursor: pointer; color: var(--blue); }
.copilot-draft-text p { margin-top: 7px; white-space: pre-wrap; }
.copilot-draft-text[open] > p { animation: chat-message-in 180ms ease-out; }
.copilot-message.copilot-progress { border-left: 2px solid var(--blue); padding-left: 10px; }
.copilot-message.copilot-progress p { white-space: pre-line; }
.copilot-message.copilot-progress::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: chat-progress-pulse 1.4s ease-in-out infinite; }
@keyframes chat-message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chat-progress-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .copilot-message, .copilot-message.copilot-progress::before, .copilot-draft-text[open] > p { animation: none; } }

body.preview-focus-open .draft-preview-panel {
  width: min(920px, calc(100vw - 48px));
  max-height: none !important;
  display: grid;
  grid-template-columns: minmax(350px, 1fr) minmax(230px, 280px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 10px;
  overflow: hidden !important;
}
body.preview-focus-open .draft-preview-panel > .preview-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-bottom: 0;
}
body.preview-focus-open .draft-preview-panel > .preview-stage {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.preview-focus-open .draft-preview-panel > .preview-foot {
  grid-column: 1;
  grid-row: 3;
  padding: 0 4px;
}
body.preview-focus-open .draft-preview-panel > .reference-style-card {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin-top: 0;
}
body.preview-focus-open .draft-preview-panel > .draft-copilot {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  margin-top: 0;
}

/* While the real panel is in its focused grid, the inline endpoint clone must
   retain the original one-column layout. This prevents the top-right clipped
   frame visible in the supplied recording. */
body.preview-focus-open .preview-motion-ghost[data-preview-motion-layout="inline"] {
  display: block !important;
  max-height: none !important;
  overflow: hidden !important;
}

@media (max-width: 760px) {
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) {
    inset: 10px;
    width: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .preview-toolbar { grid-column: 1; grid-row: 1; }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .preview-stage { grid-column: 1; grid-row: 2; }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .preview-foot { grid-column: 1; grid-row: 3; }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .reference-style-card { display: none; }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .draft-copilot { grid-column: 1; grid-row: 4; }
}

/* v5.22.7 — zero-token browsing, compact side rail and clean layout morph */
.preview-side-tools {
  min-width: 0;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-side-tools > .reference-style-card,
.preview-side-tools > .draft-copilot { margin-top: 0 !important; }

body.preview-focus-open .draft-preview-panel > .preview-side-tools {
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: start;
  min-height: 0;
  margin-top: 0;
}

/* The short veil sits above both endpoint snapshots. Their opacity windows do
   not overlap, so the document can never form the split-page frame visible in
   the supplied recording. */
.preview-motion-veil {
  z-index: 114;
  background: rgba(7, 10, 16, .10);
  transform: translateZ(0);
}
.preview-motion-ghost {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  clip-path: inset(0 round 25px);
}

@media (max-width: 760px) {
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .preview-side-tools {
    grid-column: 1;
    grid-row: 4;
    width: 100%;
  }
  body.preview-focus-open .draft-preview-panel:not([data-preview-motion-layout="inline"]) > .preview-side-tools > .reference-style-card {
    display: none;
  }
}

/* v5.22.8 — integrated controls, balanced focus rail and one-panel motion */
.option-grid-integrated { align-items: stretch; }
.option-panel-auto { display: flex; flex-direction: column; }

.preview-side-tools {
  padding: 12px !important;
  gap: 0 !important;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.preview-tools-header {
  min-height: 34px;
  padding: 0 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.preview-tools-header > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; }
.preview-tools-header strong { font-size: 12px; font-weight: 680; }
.preview-tools-header small { color: var(--text-tertiary); font-size: 9.5px; }
.preview-side-tools > .reference-style-card {
  min-height: 60px;
  padding: 11px 2px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.preview-side-tools .reference-style-head { min-width: 0; gap: 9px; }
.preview-side-tools .reference-style-head small {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-side-tools .reference-style-icon { width: 29px; height: 29px; border-radius: 9px; }
.preview-side-tools .reference-style-actions { margin: 0; flex: 0 0 auto; }
.preview-side-tools .reference-upload-button { min-height: 32px; padding-inline: 10px; white-space: nowrap; }
.preview-side-tools .reference-remove-button { min-height: 32px; padding-inline: 8px; }
.preview-side-tools > .draft-copilot {
  min-height: 128px;
  flex: 1 1 auto;
  padding-top: 12px !important;
  display: flex;
  flex-direction: column;
}
.copilot-empty-hint {
  min-height: 54px;
  padding: 10px 4px 12px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-tertiary);
  text-align: center;
}
.copilot-empty-hint .copilot-empty-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 5px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 13%, transparent);
}
.copilot-empty-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.copilot-empty-hint strong { color: var(--text-secondary); font-size: 11px; font-weight: 650; }
.copilot-empty-hint > span:not(.copilot-empty-icon) { font-size: 9.5px; }
.draft-copilot:has(.copilot-messages:not(:empty)) .copilot-empty-hint { display: none; }
.preview-side-tools .copilot-messages:not(:empty) { margin-bottom: 9px; }
.preview-side-tools .copilot-composer { margin-top: auto; }

.preview-focus-backdrop,
body.preview-focus-open .preview-focus-backdrop {
  opacity: 1;
  animation: none !important;
  transition: none !important;
  will-change: opacity;
}
body.preview-focus-open .draft-preview-panel {
  top: 24px;
  right: max(24px, calc((100vw - 1120px) / 2));
  bottom: 24px;
  left: max(24px, calc((100vw - 1120px) / 2));
  width: auto;
  height: auto;
  max-width: 1120px;
  grid-template-columns: minmax(420px, 1fr) minmax(280px, 310px);
  column-gap: 14px;
  row-gap: 10px;
  contain: layout paint;
  animation: none !important;
  transition: none !important;
  transform-origin: 50% 50%;
  will-change: opacity, transform;
}
body.preview-focus-open .draft-preview-panel > .preview-side-tools {
  align-self: stretch;
  height: 100%;
  overflow: hidden;
}
body.preview-focus-open .preview-side-tools > .draft-copilot { min-height: 0; }
body.preview-focus-open .preview-side-tools .copilot-messages {
  min-height: 0;
  max-height: none;
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
}
body.preview-focus-open .preview-side-tools .copilot-empty-hint { min-height: 120px; }
body.preview-focus-transitioning .draft-preview-panel,
body.preview-focus-transitioning .preview-focus-backdrop { pointer-events: none !important; }

@media (max-width: 820px) {
  body.preview-focus-open .draft-preview-panel {
    inset: 12px;
    width: auto;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  body.preview-focus-open .draft-preview-panel > .preview-toolbar { grid-column: 1; grid-row: 1; }
  body.preview-focus-open .draft-preview-panel > .preview-stage { grid-column: 1; grid-row: 2; }
  body.preview-focus-open .draft-preview-panel > .preview-foot { grid-column: 1; grid-row: 3; }
  body.preview-focus-open .draft-preview-panel > .preview-side-tools {
    grid-column: 1;
    grid-row: 4;
    height: auto;
  }
  body.preview-focus-open .preview-side-tools > .reference-style-card,
  body.preview-focus-open .preview-tools-header { display: none; }
  body.preview-focus-open .preview-side-tools > .draft-copilot { padding-top: 0 !important; }
  body.preview-focus-open .preview-side-tools .copilot-empty-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.preview-focus-open .draft-preview-panel,
  .preview-focus-backdrop { will-change: auto; }
}

/* v5.22.9 — one visual language for format and seal selection */
.option-grid-integrated .option-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.option-grid-integrated .option-panel-title {
  margin-bottom: 16px;
}
#sealModeSegment {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#letterheadModeSegment {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#sealModeSegment .segment-pill,
#letterheadModeSegment .segment-pill {
  min-width: 0;
  padding-inline: 8px !important;
  font-size: 13px !important;
  white-space: nowrap;
  transition: color .3s ease !important;
}
#sealModeSegment .segment-pill:focus-visible,
#letterheadModeSegment .segment-pill:focus-visible,
#profileSegment .segment-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 82%, white);
  outline-offset: -4px;
}

@media (max-width: 420px) {
  #profileSegment { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #profileSegment .segment-pill {
    padding-inline: 4px !important;
    font-size: 12px !important;
  }
  #sealModeSegment .segment-pill {
    padding-inline: 4px !important;
    font-size: 12px !important;
  }
  #letterheadModeSegment .segment-pill {
    padding-inline: 4px !important;
    font-size: 12px !important;
  }
  .besti-profile-subsegment .segment-pill {
    padding-inline: 5px !important;
    font-size: 11.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sealModeSegment > .apple-selection-indicator {
    transition: none !important;
  }
  #letterheadModeSegment > .apple-selection-indicator {
    transition: none !important;
  }
  .besti-profile-expander,
  .besti-profile-expander-clip,
  .besti-profile-label { transition: none !important; }
}

@media (min-width: 901px) {
  .option-grid-integrated {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .option-grid-integrated { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v5.23.3 — source-linked preview expansion with a crisp, non-spring landing */
body.preview-focus-open.preview-focus-entering .draft-preview-panel {
  transform: none !important;
  clip-path: inset(0 round 28px);
  will-change: clip-path, opacity;
}
body.preview-focus-open.preview-focus-entering .preview-focus-backdrop {
  will-change: opacity;
}

@media (prefers-reduced-motion: reduce) {
  body.preview-focus-open.preview-focus-entering .draft-preview-panel {
    clip-path: none !important;
    will-change: auto;
  }
}

/* v5.23.4–5 — continuous, interruptible non-spring landing while supplemental
   settings or wheel input change the sticky live preview geometry. */
html.generation-advanced-layout-motion,
html.generation-advanced-layout-motion body,
html.generation-advanced-layout-motion body * {
  overflow-anchor: none !important;
}
html.settings-layout-motion,
html.settings-layout-motion body,
html.settings-layout-motion body * {
  overflow-anchor: none !important;
}
.draft-preview-panel.is-advanced-following {
  transform: translate3d(0, var(--advanced-preview-shift, 0px), 0) !important;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .draft-preview-panel.is-advanced-following {
    transform: none !important;
    will-change: auto;
  }
}

/* v5.23.60 — the feedback action stays visibly inactive until an original
   document is selected. This final override intentionally wins over the
   legacy global .primary rules collected above. */
.feedback-form .feedback-submit-button:disabled,
.feedback-form .feedback-submit-button:disabled:hover,
.feedback-form .feedback-submit-button:disabled:active {
  color: var(--text-tertiary) !important;
  border-color: var(--line) !important;
  background: color-mix(in srgb, var(--surface-solid) 66%, transparent) !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: .72 !important;
  transform: none !important;
  cursor: not-allowed !important;
}
.feedback-form .feedback-submit-button:disabled::before { content: none !important; }
.feedback-form .feedback-submit-button:disabled svg {
  opacity: .42 !important;
  transform: none !important;
}

/* v5.23.68 — hover feedback may change color and glow, never the control box.
   This keeps icons and labels on the same device-pixel coordinates in both
   normal and enlarged preview states. */
#previewFocusButton:hover,
#previewFocusButton:active {
  transform: none !important;
}
#copilotSendButton:hover,
#copilotSendButton:active {
  transform: none !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 28%, transparent),
    0 0 18px color-mix(in srgb, var(--blue) 25%, transparent) !important;
}
#copilotSendButton:disabled {
  box-shadow: none !important;
}

/* The product uses one dark theme. Keep panel surfaces opaque after all
   historical glass rules, including their !important declarations. */
.topbar,
:root[data-theme="dark"] .topbar {
  background: #16161a !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.26), 0 -12px 0 #09090b !important;
}
.card,
:root[data-theme="dark"] .card {
  background: linear-gradient(180deg, #17171b, #202026) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root { --draft-setting-gap: 14px; }
body[data-workspace-mode="generate"] .draft-settings-mount { margin-top: 24px; }
body[data-workspace-mode="generate"] .processing-settings .settings-header { padding-top: 0; border-top: 0; margin-bottom: 16px; }
body[data-workspace-mode="generate"] .processing-settings .option-grid { display: flex; flex-direction: column; gap: var(--draft-setting-gap); }
body[data-workspace-mode="generate"] .processing-settings .option-panel { min-height: 0; padding: 18px; border-radius: 20px; }
body[data-workspace-mode="generate"] .processing-settings .option-panel-letterhead,
body[data-workspace-mode="generate"] .processing-settings .option-panel-auto { display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 12px; }
body[data-workspace-mode="generate"] .processing-settings .option-panel-title { margin: 0 0 12px; }
body[data-workspace-mode="generate"] .processing-settings .option-panel-letterhead .option-panel-title,
body[data-workspace-mode="generate"] .processing-settings .option-panel-auto .option-panel-title { margin: 0; }
body[data-workspace-mode="generate"] .processing-settings .glass-segment { margin-top: 0; }
.draft-result .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
@media (max-width: 720px) { .draft-result .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
