/* AIMask — AITalon product UI aligned with the AIGate design system.
   System fonts and code-native SVG only; no remote runtime assets. */

:root {
  --bg: #020617;
  --bg2: #0f172a;
  --sidebar: #111827;
  --surface: rgba(17, 24, 39, 0.9);
  --surface-solid: #111827;
  --surface-raised: rgba(31, 41, 55, 0.72);
  --surface-subtle: rgba(15, 23, 42, 0.82);
  --border: #334155;
  --border-soft: #253247;
  --border-light: #475569;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #fb7185;
  --warning: #fbbf24;
  --success: #34d399;
  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-soft: rgba(16, 185, 129, 0.08);
  --primary-border: rgba(16, 185, 129, 0.35);
  --primary-glow: rgba(16, 185, 129, 0.25);
  --mode-accent: var(--primary);
  --mode-accent-strong: var(--primary-hover);
  --mode-soft: var(--primary-soft);
  --mode-border: var(--primary-border);
  --font-sans: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sidebar-width: 272px;
  --mobile-bar-height: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(2, 6, 23, 0.26);
  --shadow-card: 0 10px 28px rgba(2, 6, 23, 0.22);
  color-scheme: dark;
}

html[data-processing-mode="replace"] {
  --mode-accent: #38bdf8;
  --mode-accent-strong: #7dd3fc;
  --mode-soft: rgba(56, 189, 248, 0.11);
  --mode-border: rgba(56, 189, 248, 0.42);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg2: #ffffff;
  --sidebar: #ffffff;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-solid: #ffffff;
  --surface-raised: rgba(249, 250, 251, 0.92);
  --surface-subtle: rgba(249, 250, 251, 0.96);
  --border: #e5e7eb;
  --border-soft: #edf0f4;
  --border-light: #d1d5db;
  --text: #111827;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  --danger: #be123c;
  --primary: #10b981;
  --primary-hover: #047857;
  --primary-soft: rgba(16, 185, 129, 0.05);
  --primary-border: rgba(16, 185, 129, 0.28);
  --primary-glow: rgba(16, 185, 129, 0.15);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 10px 26px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

html[data-theme="light"][data-processing-mode="replace"] {
  --mode-accent: #0284c7;
  --mode-accent-strong: #0369a1;
  --mode-soft: rgba(2, 132, 199, 0.09);
  --mode-border: rgba(2, 132, 199, 0.34);
}

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

html {
  min-width: 320px;
  font-size: 16px;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

svg,
img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 700;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
}

::selection {
  background: var(--primary);
  color: #ffffff;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100dvh;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.brand,
.mobile-brand,
.settings-brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.logo-radar {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  opacity: 0.8;
}

.logo-radar-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  filter: blur(8px);
  opacity: 0.6;
  animation: brand-radar-pulse 2s ease-in-out infinite;
}

.logo-radar svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #10b981;
  stroke-width: 2;
  stroke-linecap: round;
  animation: brand-radar-spin 8s linear infinite;
}

.logo-radar .radar-ring-inner {
  stroke: rgba(16, 185, 129, 0.6);
  stroke-width: 1.5;
}

.logo-radar .radar-center,
.logo-radar .radar-dot {
  fill: #10b981;
  stroke: none;
}

.logo-radar .radar-arc-primary {
  stroke: rgba(16, 185, 129, 0.4);
}

.logo-radar .radar-arc-secondary {
  stroke: rgba(16, 185, 129, 0.2);
  stroke-width: 1;
}

.logo-radar .radar-dot-muted {
  fill: rgba(16, 185, 129, 0.6);
}

.logo-radar .radar-dot-dim {
  fill: rgba(16, 185, 129, 0.4);
}

.brand:hover .logo-radar {
  opacity: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand-eyebrow {
  color: var(--text-muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-product {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

@keyframes brand-radar-spin {
  to { transform: rotate(360deg); }
}

@keyframes brand-radar-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.05); }
}

.navigation {
  padding: 0.75rem 0 0.85rem;
}

.nav-section-label {
  margin: 0;
  padding: 0.35rem 1.1rem 0.25rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-section-label-spaced {
  padding-top: 0.9rem;
}

.nav-link {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 0.65rem;
  margin: 0.15rem 0.55rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-link svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-link.active {
  border-color: rgba(16, 185, 129, 0.16);
  background: var(--primary-soft);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--primary);
}

.nav-link:hover {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-link.active svg {
  color: var(--primary-hover);
}

.sidebar-mode {
  display: flex;
  align-items: center;
  margin: 0 0.8rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--mode-border);
  border-radius: var(--radius-md);
  background: var(--mode-soft);
}

.sidebar-mode > span {
  display: block;
  margin-right: auto;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.sidebar-mode strong,
.mobile-mode {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-mode i,
.mobile-mode i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mode-accent);
}

.sidebar-footer {
  display: grid;
  gap: 0.7rem;
  margin-top: auto;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
}

.sidebar-controls {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 0.5rem;
}

.sidebar-controls:has(.install-button:not([hidden])) {
  grid-template-columns: 1fr 38px 38px;
}

.language-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.language-control a {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
}

.language-control a[aria-current="true"] {
  background: var(--surface-raised);
  color: var(--primary-hover);
}

.theme-button,
.install-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.theme-button,
.install-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.theme-button:hover,
.install-button:hover {
  border-color: var(--primary-border);
  color: var(--text);
}

.theme-button svg,
.install-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.interface-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.interface-control-group {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.interface-control-button {
  display: grid;
  width: 32px;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font: 700 0.68rem/1 var(--font-mono);
  text-decoration: none;
  cursor: pointer;
}

.interface-control-button:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.interface-control-button[aria-pressed="true"],
.interface-control-button[aria-current="true"] {
  color: var(--primary-hover);
  background: var(--surface-raised);
}

.interface-control-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.interface-control-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.interface-auto-button {
  font-family: var(--font-sans);
  font-size: 0.72rem;
}

.settings-sidebar-footer .interface-controls {
  justify-content: center;
}

.settings-mobile-section {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-button {
  width: 38px;
  padding: 0;
}

.main {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
}

.license-degraded-banner {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  box-sizing: border-box;
  width: calc(100% - var(--sidebar-width));
  min-height: 48px;
  align-items: center;
  gap: 0.65rem;
  margin-left: var(--sidebar-width);
  border-bottom: 1px solid color-mix(in srgb, var(--warning, #d97706) 45%, var(--border));
  background: color-mix(in srgb, var(--warning, #d97706) 12%, var(--surface-solid));
  padding: 0.55rem 1rem;
  color: var(--text);
}

.license-degraded-banner > span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.license-degraded-banner strong {
  font-size: 0.78rem;
}

.license-degraded-banner small {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.license-degraded-mark {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--warning, #d97706);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
}

.workspace {
  width: min(100%, 1024px);
  margin: 0 auto;
}

.page-header {
  margin-bottom: 1.35rem;
  padding: 0.5rem 0 0;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--primary-hover);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.work-card {
  padding: clamp(1.1rem, 2.8vw, 1.65rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card), inset 0 1px rgba(255, 255, 255, 0.025);
}

.trust-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.trust-summary > span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.42rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.trust-summary svg {
  width: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-fieldset legend,
.section-heading h2 {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.workflow-section + .workflow-section {
  margin-top: 1.4rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-soft);
}

.mode-fieldset + .sr-only + .upload-section {
  margin-top: 1.4rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-soft);
}

.mode-fieldset legend,
.workflow-section-heading {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.15rem 0.55rem;
  margin-bottom: 0.8rem;
}

.workflow-step-kicker {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  padding: 0.2rem 0.48rem;
  border: 1px solid var(--mode-border);
  border-radius: 999px;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.workflow-step-title {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

.workflow-step-hint {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 400;
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.mode-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.mode-option:hover {
  border-color: var(--primary-border);
}

.mode-option:has(input:checked) {
  border-color: var(--mode-accent);
  background: var(--mode-soft);
  box-shadow: inset 3px 0 var(--mode-accent);
}

.mode-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.68;
}

.mode-unavailable {
  color: var(--danger);
}

.mode-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--mode-accent);
}

.mode-copy {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.mode-copy strong {
  font-size: 0.86rem;
  font-weight: 700;
}

.mode-copy small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.section-divider {
  height: 1px;
  margin: 1.4rem 0;
  background: var(--border-soft);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading span {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.dropzone {
  position: relative;
  display: flex;
  min-height: 236px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.25rem;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.dropzone:hover,
.dropzone.is-dragging,
.dropzone:focus-within {
  border-color: var(--mode-accent);
  background: var(--mode-soft);
  box-shadow: inset 0 0 0 1px var(--mode-border);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 0.65rem;
  place-items: center;
  border-radius: 10px;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
}

.upload-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.drop-title {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-help {
  margin-top: 0.2rem;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.choose-button {
  margin-top: 0.85rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--mode-accent);
  border-radius: var(--radius-sm);
  background: var(--mode-accent);
  color: #001a10;
  font-size: 0.78rem;
  font-weight: 750;
  box-shadow: var(--shadow-sm);
}

.choose-button:hover {
  background: var(--mode-accent-strong);
}

.file-formats {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.55;
  text-align: left;
}

.file-formats::before {
  color: var(--text);
  font-weight: 700;
  content: attr(data-prefix) ": ";
}

.file-queue {
  margin-top: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-subtle) 88%, transparent);
}

.file-queue-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.file-queue-head h2 {
  margin: 0;
  font-size: 0.76rem;
}

.file-count {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.file-queue-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.clear-files-button {
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
}

.clear-files-button:hover {
  border-color: var(--mode-border);
  color: var(--text);
}

.clear-files-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.file-queue-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-queue-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  transition: background-color 180ms ease, opacity 180ms ease;
}

.file-queue-item + .file-queue-item {
  border-top: 1px solid var(--border-soft);
}

.file-queue-item[data-state="uploading"],
.file-queue-item[data-state="processing"] {
  background: linear-gradient(90deg, var(--mode-soft), transparent 62%);
}

.file-type-badge {
  display: grid;
  width: 42px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--mode-border);
  border-radius: var(--radius-sm);
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
}

.file-queue-copy {
  display: grid;
  min-width: 0;
}

.file-queue-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-queue-copy small {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.63rem;
}

.file-queue-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.file-queue-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.file-queue-item[data-state="uploading"] .file-queue-status,
.file-queue-item[data-state="processing"] .file-queue-status {
  color: var(--mode-accent-strong);
}

.file-queue-item[data-state="processing"] .file-queue-status::before {
  animation: processing-pulse 1.4s ease-in-out infinite;
}

.logo-reference-section {
  margin-top: 1.4rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-soft);
}

.logo-masking-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--mode-border);
  border-radius: var(--radius-md);
  background: var(--mode-soft);
  cursor: pointer;
}

.logo-masking-option > input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0.08rem 0 0;
  accent-color: var(--mode-accent-strong);
}

.logo-masking-option > span {
  display: grid;
  gap: 0.2rem;
}

.logo-masking-option strong {
  color: var(--text);
  font-size: 0.83rem;
}

.logo-masking-option small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.logo-masking-option.is-disabled {
  border-color: var(--border-soft);
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: 0.68;
}

.logo-scope-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--mode-border);
  border-radius: var(--radius-sm);
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-size: 0.7rem;
  line-height: 1.4;
}

.logo-scope-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.9rem;
}

.logo-reference-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.64rem;
  list-style: none;
}

.logo-reference-flow li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.38rem;
}

.logo-reference-flow li > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
}

.logo-dropzone {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.logo-dropzone:hover,
.logo-dropzone:focus-within,
.logo-dropzone.is-dragging {
  border-color: var(--mode-accent);
  background: var(--mode-soft);
}

.logo-dropzone.is-full {
  border-style: solid;
  cursor: default;
  opacity: 0.72;
}

.logo-upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
}

.logo-upload-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.logo-drop-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.logo-drop-copy strong {
  color: var(--text);
  font-size: 0.78rem;
}

.logo-drop-copy small,
.logo-reference-status {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.logo-reference-status.is-error {
  color: var(--danger);
}

.logo-quality-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.logo-quality-tip span {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-size: 0.62rem;
  font-weight: 800;
}

.logo-choose-button,
.logo-reference-list-wrap header button,
.logo-reference-remove {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--mode-border);
  border-radius: var(--radius-sm);
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-size: 0.68rem;
  font-weight: 750;
}

.logo-reference-list-wrap {
  margin-top: 0.7rem;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.logo-reference-list-wrap header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.72rem;
}

.logo-reference-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-reference-count {
  display: grid;
  min-width: 36px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
}

.logo-reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0.65rem;
  list-style: none;
}

.logo-reference-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.logo-reference-preview {
  width: 52px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6e8eb 25%, transparent 25%),
    linear-gradient(-45deg, #e6e8eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e8eb 75%),
    linear-gradient(-45deg, transparent 75%, #e6e8eb 75%);
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-size: 8px 8px;
  object-fit: contain;
}

.logo-reference-copy {
  display: grid;
  min-width: 0;
}

.logo-reference-copy strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-reference-kind {
  width: fit-content;
  margin-bottom: 0.1rem;
  color: var(--mode-accent-strong);
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo-reference-copy small {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.logo-reference-quality {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.18rem;
  color: var(--primary-hover);
  font-size: 0.6rem;
  line-height: 1.3;
}

.logo-reference-quality::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.logo-reference-item[data-quality="warning"] .logo-reference-quality {
  color: var(--warning-text, #8a5a00);
}

.logo-reference-remove {
  display: grid;
  width: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border-color: var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.file-queue-item[data-state="ready"] .file-queue-status {
  color: var(--primary-hover);
}

.file-queue-item[data-state="failed"] .file-queue-status {
  color: var(--danger);
}

.file-queue-item[data-state="cancelled"] .file-queue-status {
  color: var(--warning);
}

.workflow-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.selected-file-meta {
  min-height: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.selected-file-meta.is-error {
  color: var(--danger);
}

.start-button,
.download-button {
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--mode-accent);
  border-radius: var(--radius-sm);
  background: var(--mode-accent);
  color: #001a10;
  font-size: 0.8rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.start-button:hover:not(:disabled),
.download-button:hover {
  background: var(--mode-accent-strong);
}

.start-button:disabled {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}

.workflow-access-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.processing-panel {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 10%, var(--mode-soft), transparent 34%),
    var(--surface-subtle);
  isolation: isolate;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.processing-panel[hidden] {
  display: none;
}

.processing-panel[data-state="safe"] {
  border-color: var(--primary-border);
  box-shadow: inset 0 0 28px var(--primary-soft);
}

.processing-panel[data-state="error"] {
  border-color: #be4b60;
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--danger) 9%, transparent), transparent 34%),
    var(--surface-subtle);
}

.processing-panel[data-state="warning"] {
  border-color: #a16207;
}

.processing-panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.processing-status-detail {
  max-width: 680px;
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.processing-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.processing-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mode-accent);
  box-shadow: 0 0 0 4px var(--mode-soft);
  animation: processing-pulse 1.4s ease-in-out infinite;
}

.processing-panel[data-state="safe"] .processing-live-dot {
  animation: none;
  background: var(--primary);
}

.processing-panel[data-state="error"] .processing-live-dot {
  animation: none;
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent);
}

.processing-experience {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}

.processing-orb {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--mode-border);
  border-radius: 50%;
  background: var(--mode-soft);
  color: var(--mode-accent-strong);
  box-shadow: 0 0 24px var(--mode-soft);
}

.processing-orb-ring {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--mode-border);
  border-radius: 50%;
  animation: processing-ring 2.2s ease-out infinite;
}

.processing-shield {
  width: 31px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.processing-check {
  opacity: 0;
  stroke-dasharray: 9;
  stroke-dashoffset: 9;
  transition: opacity 180ms ease, stroke-dashoffset 360ms ease;
}

.processing-panel[data-state="safe"] .processing-orb {
  border-color: var(--primary-border);
  color: var(--primary-hover);
}

.processing-panel[data-state="safe"] .processing-orb-ring {
  animation: none;
  opacity: 0.45;
}

.processing-panel[data-state="safe"] .processing-check {
  opacity: 1;
  stroke-dashoffset: 0;
}

.processing-panel[data-state="error"] .processing-orb {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
}

.processing-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-hover);
  opacity: 0;
}

.processing-panel[data-state="safe"] .processing-spark {
  animation: processing-spark 650ms ease-out both;
}

.processing-spark-one { --spark-x: -19px; --spark-y: -17px; }
.processing-spark-two { --spark-x: 22px; --spark-y: -12px; animation-delay: 80ms !important; }
.processing-spark-three { --spark-x: 17px; --spark-y: 21px; animation-delay: 150ms !important; }

.processing-steps {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.processing-steps li {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  text-align: center;
}

.processing-steps li::after {
  position: absolute;
  top: 11px;
  left: calc(50% + 13px);
  z-index: 0;
  width: calc(100% - 26px);
  height: 1px;
  background: var(--border);
  content: "";
}

.processing-steps li:last-child::after {
  display: none;
}

.processing-steps li > span {
  display: grid;
  position: relative;
  z-index: 1;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-solid);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 800;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.processing-steps li > strong {
  position: relative;
  z-index: 1;
  overflow: hidden;
  font-size: 0.59rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-steps li.is-complete::after,
.processing-steps li.is-complete > span {
  border-color: var(--mode-accent);
  background: var(--mode-accent);
  color: #001a10;
}

.processing-steps li.is-current {
  color: var(--text);
}

.processing-steps li.is-current > span {
  border-color: var(--mode-accent);
  color: var(--mode-accent-strong);
  box-shadow: 0 0 0 4px var(--mode-soft);
}

.processing-steps li.is-error > span {
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 10%, transparent);
}

.progress-row {
  display: grid;
  gap: 0.35rem;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.progress-label strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.progress-row progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--border-soft);
  color: var(--mode-accent);
}

.progress-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--border-soft);
}

.progress-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--mode-accent);
  transition: width 240ms ease;
}

.progress-row progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--mode-accent);
  transition: width 240ms ease;
}

.processing-estimate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  background: var(--primary-soft);
  padding: 0.75rem 0.85rem;
}

.processing-estimate[hidden] {
  display: none;
}

.processing-estimate-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--mode-accent-strong);
}

.processing-estimate-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.processing-estimate-label,
.processing-estimate strong,
.processing-estimate small {
  display: block;
}

.processing-estimate-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.processing-estimate strong {
  margin-top: 0.12rem;
  color: var(--text);
  font-size: 0.88rem;
}

.processing-estimate small {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

@keyframes processing-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes processing-ring {
  0% { opacity: 0.8; transform: scale(0.82); }
  75%, 100% { opacity: 0; transform: scale(1.12); }
}

@keyframes processing-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0); }
  38% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(1); }
}

.download-button {
  width: fit-content;
}

.processing-panel-head,
.job-actions,
.history-head,
.history-item-head,
.history-actions,
.workflow-dialog-card > header,
.workflow-dialog-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.stage-counter,
.history-mode,
.history-expiry,
.history-duration,
.history-stage {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.stage-counter {
  flex: 0 0 auto;
  padding: 0.28rem 0.52rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
}

.secondary-button,
.primary-button {
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--primary-border);
  color: var(--primary-hover);
}

.secondary-button:disabled,
.primary-button:disabled,
.download-button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: wait;
  pointer-events: none;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #001a10;
}

.history-panel,
.read-only-card {
  margin-top: 1rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.history-head h2,
.read-only-card h2 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.history-head p,
.read-only-card p,
.history-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.history-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  transition: border-color 150ms ease, transform 150ms ease;
}

.history-item:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.history-state {
  font-size: 0.8rem;
}

.history-file {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.history-item-meta,
.history-categories {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.history-item-meta {
  flex: 0 0 auto;
}

.history-summary {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.history-summary-empty {
  color: var(--text-muted);
  font-weight: 500;
}

.history-reused {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.history-category {
  padding: 0.22rem 0.42rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.history-item p {
  margin: 0;
}

.history-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.workflow-dialog {
  width: min(92vw, 640px);
  max-height: min(82vh, 760px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.workflow-dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
}

.workflow-dialog-card {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1rem;
}

.workflow-dialog-card h2 {
  margin: 0;
  font-size: 1rem;
}

.report-list {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr);
  gap: 0.45rem 0.8rem;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.report-list dt {
  color: var(--text-muted);
}

.report-list dd {
  margin: 0;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, auto);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.76rem;
}

.review-row select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
}

.is-error {
  color: var(--danger);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 18px;
  margin-top: 0.1rem;
  fill: none;
  stroke: var(--primary-hover);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.privacy-note p {
  margin: 0;
  font-size: 0.72rem;
}

.privacy-note strong {
  color: var(--text);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 0.5rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.mobile-bar,
.sidebar-overlay,
.close-button {
  display: none;
}

.mobile-context {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mobile-mode {
  padding-left: 0.55rem;
  border-left: 1px solid var(--border);
  font-size: 0.7rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
}

.icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

/* Shared enterprise sign-in surface. */
.shell-main {
  display: grid;
  min-height: 100vh;
  padding: 1.25rem;
  place-items: center;
}

.hero-card {
  width: min(100%, 420px);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.login-brand {
  width: fit-content;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.login-brand + .eyebrow {
  margin-bottom: 0.35rem;
}

.hero-card h1 {
  margin-bottom: 0.65rem;
  font-size: 1.45rem;
}

.hero-card > p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.hero-card form {
  display: grid;
  gap: 0.55rem;
  margin: 1.4rem 0;
}

.hero-card label {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-card input {
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text);
}

.hero-card input:focus {
  border-color: var(--primary);
  outline: 3px solid var(--primary-soft);
}

.hero-card button[type="submit"] {
  min-height: 44px;
  margin-top: 0.75rem;
  border: 0;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #001a10;
  font-weight: 750;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.hero-card [role="alert"] {
  padding: 0.65rem 0.75rem;
  border: 1px solid #be4b60;
  border-radius: var(--radius-sm);
  background: rgba(190, 75, 96, 0.12);
  color: #fecdd3;
}

.hero-card code {
  font-family: var(--font-mono);
  word-break: break-all;
}

/* API documentation administration. */
.settings-shell {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 1.5rem max(1rem, calc((100vw - var(--sidebar-width) - 920px) / 2)) 3rem;
}

.settings-intro {
  margin-bottom: 1rem;
}

.settings-intro h1 {
  margin-bottom: 0.4rem;
}

.settings-intro > p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.settings-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.settings-shell > .settings-card + .settings-card,
.settings-shell > .settings-card + .token-once-panel,
.settings-shell > .token-once-panel + .settings-card {
  margin-top: 0.65rem;
}

.settings-disclosure {
  display: block;
  padding: 0;
}

.settings-disclosure > summary {
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.settings-disclosure > summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure > summary::after {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  content: "";
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.settings-disclosure[open] > summary::after {
  transform: rotate(225deg);
}

.settings-disclosure > summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.settings-disclosure > summary small,
.settings-inline-help {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 400;
}

.disclosure-title {
  color: var(--text);
  font-size: 0.9rem;
}

.settings-disclosure-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border-soft);
}

.settings-inline-help {
  margin: 0;
  padding: 0.85rem 0;
}

.settings-disclosure-body > form:first-child {
  padding-top: 1rem;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.settings-summary > div,
.settings-paths > div {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.settings-summary span,
.settings-paths span {
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-summary strong {
  font-size: 0.86rem;
}

.settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  cursor: pointer;
}

.settings-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.settings-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 140ms ease;
}

.settings-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 140ms ease;
}

.settings-toggle > input:checked + .settings-switch {
  background: var(--primary);
}

.settings-toggle > input:checked + .settings-switch::after {
  transform: translateX(18px);
}

.settings-toggle > input:focus-visible + .settings-switch {
  outline: 3px solid var(--primary-hover);
  outline-offset: 3px;
}

.settings-toggle > span:last-child {
  display: grid;
  gap: 0.25rem;
}

.settings-toggle strong {
  font-size: 0.9rem;
}

.settings-toggle small {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.settings-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.settings-paths code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.settings-actions .choose-button {
  margin: 0;
  border: 0;
  cursor: pointer;
}

.settings-actions .choose-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.settings-actions a {
  color: var(--primary-hover);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
}

.settings-feedback {
  min-height: 1.2rem;
  margin: 0;
  color: var(--primary-hover);
  font-size: 0.76rem;
}

.settings-feedback.is-error {
  color: var(--danger);
}

.settings-note {
  margin-top: 0.9rem;
  padding: 0.6rem 0;
  border: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.settings-note strong {
  color: var(--text);
}

.settings-number-field {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
}

.settings-number-field input {
  width: min(100%, 320px);
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
}

.settings-number-field small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.proxy-warning,
.upload-limit-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface-subtle));
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.proxy-warning {
  display: grid;
  padding: 0.85rem;
}

.proxy-warning strong,
.proxy-warning b {
  color: var(--text);
}

.proxy-warning a {
  color: var(--primary-hover);
  text-decoration: none;
}

.proxy-examples summary {
  cursor: pointer;
  color: var(--primary-hover);
}

.proxy-examples > div {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.proxy-examples code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.proxy-examples i {
  font-style: normal;
}

.upload-limit-banner {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.7rem;
}

.upload-limit-banner.is-error {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
}

/* Scoped API token administration. */
.token-settings-shell {
  padding-right: max(1rem, calc((100vw - var(--sidebar-width) - 960px) / 2));
  padding-left: max(1rem, calc((100vw - var(--sidebar-width) - 960px) / 2));
}

.token-settings-shell > section + section {
  margin-top: 0.65rem;
}

.token-section-heading,
.token-item-top,
.token-secret-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.token-section-heading h2,
.token-item h3,
.token-once-panel h2 {
  margin: 0;
}

.token-section-heading p,
.token-once-panel p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.token-security-badge,
.token-status {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.token-create-card form {
  display: grid;
  gap: 1.1rem;
}

.token-reauth-card {
  display: grid;
  gap: 1rem;
  border-color: rgba(245, 158, 11, 0.42);
}

.token-reauth-card[hidden] {
  display: none;
}

.token-reauth-card h2,
.token-reauth-card p {
  margin: 0;
}

.token-reauth-card p:not(.eyebrow) {
  max-width: 72ch;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.token-reauth-form {
  display: grid;
  gap: 0.85rem;
}

.token-reauth-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.token-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr);
  gap: 0.75rem;
}

.token-field {
  display: grid;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.token-field input,
.token-field select,
.token-secret-row input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-subtle);
  color: var(--text);
}

.token-field input:focus,
.token-field select:focus,
.token-secret-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.token-scopes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.token-scopes legend {
  grid-column: 1 / -1;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.token-scope-preset {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0;
}

.token-scope-preset small {
  font-family: var(--font-sans);
}

.token-scopes label {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  cursor: pointer;
}

.token-scopes input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.token-scopes span {
  display: grid;
  gap: 0.15rem;
  font-size: 0.78rem;
}

.token-scopes small,
.token-item-top code {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.token-once-panel {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-md);
  background: var(--primary-soft);
}

.token-once-panel[hidden] {
  display: none;
}

.token-secret-row {
  align-items: stretch;
}

.token-secret-row input {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.token-secret-row .choose-button {
  min-width: 120px;
  margin: 0;
  border: 0;
  cursor: pointer;
}

.token-dismiss,
.token-refresh,
.token-revoke {
  width: fit-content;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--primary-hover);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.token-list {
  display: grid;
  gap: 0.7rem;
}

.token-item {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.token-item-top > div {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.token-item-top h3 {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.token-status.is-active {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--primary-hover);
}

.token-status.is-expired,
.token-status.is-revoked {
  color: var(--text-dim);
}

.token-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.token-scope-list code {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.64rem;
}

.token-meta {
  display: grid;
  grid-template-columns: repeat(6, auto);
  justify-content: start;
  gap: 0.25rem 0.55rem;
  margin: 0;
  font-size: 0.7rem;
}

.token-meta dt {
  color: var(--text-dim);
}

.token-meta dd {
  margin: 0;
  color: var(--text-muted);
}

.token-revoke {
  min-height: 32px;
  color: var(--danger);
}

.token-revoke[data-confirm="true"] {
  padding: 0 0.65rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
}

.token-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.token-empty.is-error {
  color: var(--danger);
}

.token-quickstart code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-mono);
}

.license-status-grid {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(0, 1fr) minmax(100px, auto) minmax(0, 1fr);
  gap: 0.35rem 0.8rem;
  margin: 1rem 0 0;
  font-size: 0.76rem;
}

.license-status-grid dt {
  color: var(--text-dim);
}

.license-status-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
}

.token-field textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
  font: 0.72rem/1.45 var(--font-mono);
}

.license-telemetry-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr);
  gap: 0.9rem;
  align-items: end;
  margin-top: 1rem;
}

.license-telemetry-form .settings-actions {
  grid-column: 1 / -1;
}

.license-toggle,
.license-policy-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  cursor: pointer;
}

.license-toggle span,
.license-policy-item span {
  display: grid;
  gap: 0.15rem;
}

.license-toggle small,
.license-policy-item small,
.license-policy-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.license-policy-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.license-policy-item {
  padding: 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.license-settings-shell > .settings-feedback:empty {
  min-height: 0;
}

@media (max-width: 1024px) {
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: var(--mobile-bar-height);
    align-items: center;
    justify-content: space-between;
    padding: max(0.45rem, env(safe-area-inset-top)) 0.7rem 0.45rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--sidebar);
  }

  .license-degraded-banner {
    top: var(--mobile-bar-height);
    width: 100%;
    margin-left: 0;
  }

  .sidebar {
    z-index: 50;
    width: min(84vw, var(--sidebar-width));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar-mode {
    display: none;
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    visibility: hidden;
    background: rgba(2, 6, 23, 0.7);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.menu-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
  }

  .close-button {
    display: block;
  }

  .main {
    width: 100%;
    min-height: calc(100vh - var(--mobile-bar-height));
    margin-left: 0;
    padding: clamp(1.5rem, 5vw, 2.5rem);
  }

  .settings-shell {
    width: 100%;
    margin-left: 0;
    padding: clamp(1.5rem, 5vw, 2.5rem);
  }
}

@media (max-width: 620px) {
  .main {
    padding: 1.2rem 0.8rem;
  }

  .page-header {
    margin-bottom: 0.9rem;
  }

  .trust-summary {
    display: grid;
    align-items: stretch;
  }

  .trust-summary > span {
    border-radius: var(--radius-sm);
  }

  h1 {
    font-size: 1.65rem;
  }

  .lead {
    font-size: 0.86rem;
  }

  .work-card {
    padding: 0.9rem;
  }

  .workflow-section + .workflow-section {
    margin-top: 1.1rem;
    padding-top: 1rem;
  }

  .mode-fieldset + .sr-only + .upload-section {
    margin-top: 1.1rem;
    padding-top: 1rem;
  }

  .workflow-step-hint {
    line-height: 1.35;
  }

  .logo-reference-flow {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .logo-dropzone {
    flex-wrap: wrap;
  }

  .logo-drop-copy {
    flex: 1 1 calc(100% - 58px);
  }

  .logo-choose-button {
    width: 100%;
    text-align: center;
  }

  .mode-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .mode-option {
    min-height: 48px;
    justify-content: center;
    padding: 0.55rem;
  }

  .mode-copy small {
    display: none;
  }

  .dropzone {
    min-height: 190px;
    padding: 1rem;
  }

  .workflow-actions {
    grid-template-columns: 1fr;
  }

  .file-queue-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .file-type-badge {
    width: 38px;
  }

  .file-queue-status {
    grid-column: 2;
    white-space: normal;
  }

  .processing-experience {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.8rem 0.45rem;
  }

  .processing-panel {
    padding: 0.85rem;
  }

  .processing-steps {
    width: 100%;
  }

  .processing-steps li > strong {
    max-width: 48px;
    font-size: 0.52rem;
  }

  .history-head,
  .processing-panel-head,
  .history-item-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage-counter {
    align-self: flex-start;
  }

  .file-queue-head {
    align-items: flex-start;
  }

  .file-queue-tools {
    align-items: flex-end;
    flex-direction: column;
  }

  .review-row,
  .report-list {
    grid-template-columns: 1fr;
  }

  .history-actions > *,
  .job-actions > * {
    flex: 1 1 auto;
  }

  .start-button,
  .download-button {
    width: 100%;
  }

  .section-heading span {
    display: none;
  }

  .drop-title {
    white-space: normal;
  }

  .page-footer {
    gap: 0.4rem;
    flex-direction: column;
  }

  .hero-card {
    padding: 1.3rem;
  }

  .settings-shell {
    width: 100%;
    padding: 1.2rem 0.8rem 2rem;
  }

  .settings-summary,
  .settings-paths {
    grid-template-columns: 1fr;
  }

  .token-form-grid,
  .token-scopes {
    grid-template-columns: 1fr;
  }

  .token-section-heading,
  .token-secret-row {
    align-items: stretch;
    flex-direction: column;
  }

  .token-secret-row .choose-button {
    width: 100%;
  }

  .token-meta {
    grid-template-columns: auto 1fr;
  }

  .license-status-grid {
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  }

  .license-telemetry-form {
    grid-template-columns: 1fr;
  }

  .settings-disclosure > summary {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.8rem 0.9rem;
  }

  .settings-disclosure > summary .token-security-badge {
    display: none;
  }

  .settings-disclosure-body {
    padding: 0 0.9rem 0.9rem;
  }

  .license-telemetry-form .settings-actions {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .logo-radar-glow,
  .logo-radar svg,
  .processing-live-dot,
  .processing-orb-ring,
  .processing-spark,
  .file-queue-status::before {
    animation: none !important;
  }

  .history-item:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .choose-button,
  .nav-link.active,
  .primary-button,
  .start-button,
  .download-button {
    forced-color-adjust: none;
  }
}
