:root {
  --graphite: #1d1d1f;
  --graphite-soft: #2d2d2f;
  --graphite-muted: #424245;
  --warm: #f5f5f7;
  --paper: #ffffff;
  --line: #d2d2d7;
  --muted: #6e6e73;
  --orange: #ff5a1f;
  --orange-dark: #e4470c;
  --green: #34a853;
  --mask-green: #00be00;
  --error: #c9362b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
  --font-sans: "SF Pro SC", "SF Pro Text", "SF Pro Icons", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Helvetica, "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--graphite);
  background: var(--warm);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(242, 103, 44, 0.36);
  outline-offset: 3px;
}

.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; position: relative; display: block; overflow: hidden; background: var(--graphite); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand strong { display: block; font-size: 18px; font-weight: 600; letter-spacing: -0.025em; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.language-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: #e8e8ed; }
.language-switch button { min-width: 44px; padding: 5px 9px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.language-switch button[aria-pressed="true"] { color: white; background: var(--graphite); }

.service-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a7a39d; box-shadow: 0 0 0 4px rgba(127, 127, 127, 0.1); }
.service-status.is-ready .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(112, 184, 137, 0.13); }
.service-status.is-error .status-dot { background: var(--error); box-shadow: 0 0 0 5px rgba(200, 66, 50, 0.12); }

.hero { padding: 70px 24px 54px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(46px, 5.3vw, 72px); line-height: 1.08; letter-spacing: -0.045em; font-weight: 600; white-space: nowrap; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-copy { max-width: 620px; margin: 18px auto 0; font-size: 19px; line-height: 1.5; letter-spacing: -0.015em; color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; gap: 24px; }
.app-content { min-width: 0; }
.app-panel { min-width: 0; }
.primary-sidebar { position: sticky; top: 20px; align-self: start; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.72); box-shadow: 0 12px 40px rgba(0,0,0,.05); backdrop-filter: blur(18px); }
.sidebar-kicker { margin: 0 0 11px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.side-nav { display: grid; gap: 7px; }
.side-nav-item { position: relative; width: 100%; min-height: 68px; display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: center; gap: 9px; padding: 10px 9px; border: 0; border-radius: 13px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.side-nav-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: transparent; }
.side-nav-item:hover { color: var(--graphite); background: #f1f1f3; }
.side-nav-item.is-active { color: var(--graphite); background: #fff2e8; }
.side-nav-item.is-active::before { background: var(--orange); }
.nav-index { color: var(--orange); font-size: 9px; font-weight: 700; }
.side-nav-item strong, .side-nav-item small { display: block; }
.side-nav-item strong { font-size: 12px; font-weight: 600; }
.side-nav-item small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.nav-badge { position: absolute; right: 7px; top: 7px; padding: 3px 6px; border-radius: 999px; color: white; background: var(--orange); font-size: 8px; }
.archive-status { display: flex; gap: 9px; margin-top: 18px; padding: 12px 10px; border-top: 1px solid var(--line); }
.archive-status > span { flex: none; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,168,83,.1); }
.archive-status strong, .archive-status small { display: block; }
.archive-status strong { font-size: 9px; }
.archive-status small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }

.workspace { display: grid; grid-template-columns: minmax(320px, 410px) minmax(0, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.control-panel { padding: 30px 30px 26px; border-right: 1px solid var(--line); }
.result-panel { min-width: 0; padding: 30px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 11px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--graphite); color: var(--paper); font-size: 10px; font-weight: 700; }
.device-chip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; background: #ebe6dc; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.field-group { margin-top: 26px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field-label-row label, .model-fieldset legend { font-weight: 700; font-size: 13px; }
.field-label-row > span { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.drop-zone { min-height: 172px; border: 1px dashed #b7b7bc; border-radius: 16px; background: #fafafa; cursor: pointer; overflow: hidden; transition: border-color 180ms, background 180ms, transform 180ms; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--orange); background: #fff7f2; }
.drop-zone.is-dragging { transform: translateY(-2px); }
.upload-empty { height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 50%; color: var(--orange); font-size: 25px; font-weight: 300; line-height: 1; }
.upload-empty strong { font-size: 14px; }
.upload-empty p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.upload-preview { position: relative; height: 228px; overflow: hidden; background: var(--graphite); }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.file-summary { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; color: white; background: rgba(15, 17, 19, 0.88); backdrop-filter: blur(8px); }
.file-summary span { min-width: 0; }
.file-summary strong, .file-summary small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-summary strong { font-size: 11px; }
.file-summary small { margin-top: 3px; color: #bbb; font-size: 9px; }
.replace-button { flex: none; padding: 6px 9px; border: 1px solid rgba(255,255,255,.4); color: white; background: transparent; font-size: 10px; cursor: pointer; }
.field-error { margin: 8px 0 0; color: var(--error); font-size: 11px; line-height: 1.5; }
.privacy-hint { display: flex; align-items: flex-start; gap: 7px; margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.privacy-hint > span:first-child { flex: none; color: var(--green); font-size: 7px; }

.model-fieldset { margin-inline: 0; padding: 0; border: 0; }
.model-fieldset legend { margin-bottom: 10px; }
.model-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.model-card { cursor: pointer; }
.model-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.model-card-body { min-height: 94px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 9px; padding: 13px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); transition: border-color 160ms, background 160ms; }
.model-card:hover .model-card-body { border-color: #aaa39a; }
.model-card input:focus-visible + .model-card-body { outline: 3px solid rgba(242, 103, 44, 0.36); outline-offset: 2px; }
.model-card input:checked + .model-card-body { border-color: var(--orange); background: #fff6ed; }
.model-index { color: var(--orange); font-size: 10px; font-weight: 700; }
.model-card strong, .model-card small { display: block; }
.model-card strong { font-size: 12px; line-height: 1.35; }
.model-card small { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.model-card i { width: 9px; height: 9px; margin-top: 1px; border: 1px solid #a7a097; border-radius: 50%; }
.model-card input:checked + .model-card-body i { background: var(--orange); border-color: var(--orange); box-shadow: inset 0 0 0 2px #fff6ed; }

#threshold-value { min-width: 48px; padding: 4px 8px; border-radius: 999px; color: var(--orange-dark); background: #ffe6d5; font-size: 11px; font-weight: 700; text-align: center; }
input[type="range"] { accent-color: var(--orange); }
.threshold-group input[type="range"] { width: 100%; height: 4px; margin: 5px 0 0; cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 9px; }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.analyze-button { width: 100%; min-height: 54px; margin-top: 28px; padding: 0 20px; border: 0; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--orange); font-weight: 600; font-size: 14px; cursor: pointer; transition: background 160ms, transform 160ms; }
.analyze-button:not(:disabled):hover { background: var(--orange-dark); transform: translateY(-1px); }
.analyze-button:disabled { cursor: not-allowed; background: #b8b1a7; }
.button-arrow { font-size: 21px; font-weight: 300; }
.button-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin 800ms linear infinite; }
.analyze-button.is-loading .button-arrow { display: none; }
.analyze-button.is-loading .button-spinner { display: block; }
.control-note { display: flex; gap: 7px; margin: 13px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.control-note > span:first-child { flex: none; display: grid; place-items: center; width: 14px; height: 14px; border: 1px solid #a6a097; border-radius: 50%; font-size: 8px; font-weight: 700; }

.result-heading { min-height: 55px; }
.result-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.download-button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.download-button:hover { border-color: var(--graphite); }
.download-button.primary { color: white; border-color: var(--graphite); background: var(--graphite); }
.result-stage { min-height: 620px; position: relative; }
.empty-state, .loading-state, .error-state { min-height: 620px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.scan-frame { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 28px; color: #b7b0a7; }
.scan-frame .corner { position: absolute; width: 28px; height: 28px; border-color: #aaa39a; }
.corner-a { top: 0; left: 0; border-top: 1px solid; border-left: 1px solid; }
.corner-b { top: 0; right: 0; border-top: 1px solid; border-right: 1px solid; }
.corner-c { bottom: 0; left: 0; border-bottom: 1px solid; border-left: 1px solid; }
.corner-d { bottom: 0; right: 0; border-bottom: 1px solid; border-right: 1px solid; }
.scan-frame i { position: absolute; width: 1px; height: 95px; background: var(--orange); transform: rotate(27deg); opacity: .65; }
.scan-frame b { font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: .14em; }
.empty-state h3, .loading-state h3, .error-state h3 { margin: 0; font-size: 18px; }
.empty-state p, .loading-state p, .error-state p { max-width: 320px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.loading-visual { width: 112px; height: 112px; position: relative; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 50%; }
.loading-visual::before, .loading-visual::after { content: ""; position: absolute; left: 50%; top: 50%; background: #c9c1b7; transform: translate(-50%, -50%); }
.loading-visual::before { width: 1px; height: 74px; }
.loading-visual::after { width: 74px; height: 1px; }
.loading-visual i { position: absolute; inset: 9px; border: 2px solid transparent; border-top-color: var(--orange); border-right-color: var(--orange); border-radius: 50%; animation: spin 1.1s linear infinite; }
.loading-visual span { position: absolute; width: 9px; height: 9px; left: calc(50% - 4px); top: calc(50% - 4px); border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 8px rgba(242, 103, 44, .1); }
.loading-state .loading-kicker { margin: 0 0 9px; color: var(--orange); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.error-symbol { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 20px; border: 1px solid var(--error); border-radius: 50%; color: var(--error); font-size: 22px; font-weight: 700; }
.error-state button { margin-top: 22px; padding: 10px 18px; border: 0; color: white; background: var(--graphite); font-size: 11px; font-weight: 700; cursor: pointer; }

.result-content { padding-top: 19px; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 999px; background: #ececee; }
.view-toggle button { padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.view-toggle button.is-active { color: white; background: var(--graphite); }
.view-toggle button:disabled { opacity: .42; cursor: not-allowed; }
.comparison-help { color: var(--muted); font-size: 9px; }
.width-legend { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; align-items: center; gap: 8px; margin: -3px 0 11px; color: var(--muted); font-size: 9px; }
.width-legend i { height: 7px; border-radius: 999px; background: linear-gradient(90deg, #2056d6 0%, #00bebe 25%, #00be00 50%, #ffd600 75%, #ee362c 100%); }
.width-legend strong { min-width: 68px; padding: 4px 8px; border-radius: 999px; color: var(--graphite); background: #ececee; text-align: center; font-size: 9px; }
.comparison { --split: 50%; position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #202427; user-select: none; touch-action: pan-y; }
.comparison img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.comparison-result { position: absolute; inset: 0; width: var(--split); overflow: hidden; border-right: 2px solid white; }
.comparison-result img { width: calc(100% / (var(--split-ratio, .5))); max-width: none; }
.comparison-divider { position: absolute; top: 50%; left: var(--split); width: 34px; height: 34px; transform: translate(-50%, -50%); display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: var(--graphite); background: white; box-shadow: 0 3px 18px rgba(0,0,0,.28); font-size: 13px; font-weight: 700; pointer-events: none; }
.comparison-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: col-resize; }
.image-badge { position: absolute; top: 14px; padding: 5px 8px; color: white; background: rgba(14, 16, 17, .72); backdrop-filter: blur(6px); font-size: 9px; font-weight: 700; letter-spacing: .05em; pointer-events: none; }
.badge-original { right: 14px; }
.badge-result { left: 14px; background: rgba(242, 103, 44, .9); }
.comparison[data-view="mask"] .badge-result { background: rgba(0, 190, 0, .9); }
.comparison[data-view="width"] .badge-result { background: rgba(32, 86, 214, .92); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 18px 0 0; padding: 1px; border-radius: 14px; overflow: hidden; background: var(--line); }
.metrics div { min-width: 0; padding: 15px 13px; background: var(--paper); }
.metrics dt { color: var(--muted); font-size: 9px; white-space: nowrap; }
.metrics dd { margin: 8px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.metrics div:first-child dd { color: var(--orange-dark); }
.metrics .measurement-metric dd { color: #008b00; }
.result-disclaimer { margin: 14px 0 0; padding: 11px 12px; border-left: 3px solid var(--orange); color: var(--muted); background: #f7f2e9; font-size: 10px; line-height: 1.6; }

.section-heading { margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading h2, .section-heading p { margin: 0; }
.section-heading h2 { font-size: 20px; letter-spacing: -.025em; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.batch-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0,1fr); gap: 18px; }
.batch-controls, .batch-results { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.batch-drop-zone { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; border: 1px dashed #b7b7bc; border-radius: 16px; background: #fafafa; text-align: center; cursor: pointer; transition: border-color 180ms, background 180ms, transform 180ms; }
.batch-drop-zone:hover, .batch-drop-zone.is-dragging { border-color: var(--orange); background: #fff7f2; }
.batch-drop-zone.is-dragging { transform: translateY(-2px); }
.batch-drop-zone .upload-icon { margin-bottom: 12px; }
.batch-drop-zone strong { font-size: 13px; }
.batch-drop-zone p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.batch-parameter-grid { display: grid; gap: 17px; margin-top: 22px; }
.batch-parameter-grid label { display: grid; gap: 8px; color: var(--graphite); font-size: 11px; font-weight: 600; }
.batch-parameter-grid label > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.batch-parameter-grid output { color: var(--orange-dark); font-size: 10px; }
.batch-parameter-grid select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--graphite); background: var(--paper); font-size: 11px; }
.batch-parameter-grid input[type="range"] { width: 100%; }
.batch-controls .analyze-button { margin-top: 24px; }
.secondary-button { width: 100%; min-height: 42px; margin-top: 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--graphite); background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.secondary-button:hover:not(:disabled) { border-color: var(--graphite); }
.secondary-button:disabled { color: #a6a6aa; cursor: not-allowed; }

.batch-results { min-height: 600px; box-shadow: none; }
.batch-results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.batch-results-heading h3, .batch-results-heading p { margin: 0; }
.batch-results-heading h3 { font-size: 16px; }
.batch-results-heading p { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.batch-results-heading > strong { flex: none; padding: 5px 9px; border-radius: 999px; color: var(--orange-dark); background: #ffe9dc; font-size: 9px; }
.batch-results progress { width: 100%; height: 5px; display: block; margin: 14px 0 0; border: 0; accent-color: var(--orange); }
.batch-empty { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.batch-empty > span { display: grid; place-items: center; width: 82px; height: 82px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 50%; color: var(--orange); font-size: 24px; font-weight: 600; }
.batch-empty h3, .batch-empty p { margin: 0; }
.batch-empty h3 { color: var(--graphite); font-size: 16px; }
.batch-empty p { max-width: 280px; margin-top: 8px; font-size: 10px; line-height: 1.6; }
.batch-list { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.batch-item { min-width: 0; display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fafafa; }
.batch-thumbnail { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: var(--muted); background: #e9e9ec; font-size: 10px; font-weight: 700; }
.batch-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.batch-item-main { min-width: 0; }
.batch-item-main strong, .batch-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-item-main strong { font-size: 11px; }
.batch-item-main small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.batch-item-metrics { margin-top: 5px; color: #008b00; font-size: 8px; line-height: 1.45; }
.batch-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.batch-status { padding: 4px 7px; border-radius: 999px; color: var(--muted); background: #e8e8eb; font-size: 8px; font-weight: 700; white-space: nowrap; }
.batch-item.is-processing .batch-status { color: #a6420d; background: #ffe4d4; }
.batch-item.is-success .batch-status { color: #08732e; background: #dff4e6; }
.batch-item.is-error .batch-status { color: var(--error); background: #f9dfdc; }
.batch-downloads { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.batch-downloads button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 8px; cursor: pointer; }
.batch-downloads button:hover { border-color: var(--graphite); }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.guide-grid article { min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.guide-grid article > span { color: var(--orange); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.guide-grid h3 { margin: 24px 0 0; font-size: 17px; }
.guide-grid p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.guide-grid .guide-privacy { background: #f3f8f4; border-color: #cfe0d3; }
.guide-note { margin-top: 14px; padding: 20px 22px; border-left: 3px solid var(--orange); border-radius: 0 14px 14px 0; background: #fff5ed; }
.guide-note strong { font-size: 11px; }
.guide-note p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }

footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .1em; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; max-width: min(420px, calc(100% - 32px)); transform: translateX(-50%); padding: 12px 16px; color: white; background: var(--graphite); box-shadow: 0 8px 30px rgba(0,0,0,.22); font-size: 12px; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 168px minmax(0,1fr); gap: 18px; }
  .primary-sidebar { padding: 14px; }
  .workspace { grid-template-columns: 350px minmax(0, 1fr); }
  .control-panel, .result-panel { padding: 24px; }
  .batch-layout { grid-template-columns: minmax(250px, 300px) minmax(0,1fr); }
}

@media (max-width: 800px) {
  .page-shell { width: min(100% - 28px, 680px); }
  .site-header { min-height: 64px; }
  .header-actions { gap: 10px; }
  .hero { padding: 58px 0 48px; }
  .hero h1 { font-size: clamp(38px, 8vw, 52px); }
  .hero-copy { font-size: 16px; }
  .app-layout { grid-template-columns: 1fr; gap: 14px; }
  .primary-sidebar { position: static; padding: 9px; border-radius: 16px; }
  .sidebar-kicker, .archive-status { display: none; }
  .side-nav { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
  .side-nav-item { min-height: 60px; }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-stage, .empty-state, .loading-state, .error-state { min-height: 440px; }
  .result-heading { flex-wrap: wrap; }
  .comparison { aspect-ratio: 4 / 3; }
  .batch-layout { grid-template-columns: 1fr; }
  .batch-results { min-height: 460px; }
  .batch-empty { min-height: 300px; }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page-shell { width: 100%; }
  .site-header, .hero, footer { margin-inline: 18px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .brand strong { font-size: 17px; }
  .header-actions { gap: 7px; }
  .language-switch button { min-width: 36px; padding-inline: 7px; }
  .service-status { max-width: 116px; font-size: 9px; }
  .hero { padding: 46px 0 42px; }
  .hero h1 { font-size: 34px; }
  .hero-copy { max-width: 320px; font-size: 15px; }
  .workspace { border-left: 0; border-right: 0; border-radius: 0; }
  .control-panel, .result-panel { padding: 21px 18px; }
  .primary-sidebar { margin-inline: 10px; }
  .side-nav-item { min-height: 48px; grid-template-columns: 1fr; justify-items: center; padding: 8px 5px; text-align: center; }
  .side-nav-item::before { left: 22%; right: 22%; top: auto; bottom: 0; width: auto; height: 3px; }
  .side-nav-item .nav-index, .side-nav-item small { display: none; }
  .side-nav-item strong { font-size: 10px; }
  .app-content { overflow: hidden; }
  .model-options { grid-template-columns: 1fr; }
  .model-card-body { min-height: 74px; }
  .upload-preview { height: 210px; }
  .result-actions { width: 100%; }
  .download-button { flex: 1; }
  .result-toolbar { align-items: flex-start; flex-direction: column; }
  .comparison { aspect-ratio: 1 / 1; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .width-legend { grid-template-columns: auto minmax(80px, 1fr) auto; }
  .width-legend strong { grid-column: 1 / -1; justify-self: end; }
  .section-heading, .batch-controls, .batch-results { border-left: 0; border-right: 0; border-radius: 0; }
  .section-heading { padding: 18px; }
  .batch-controls, .batch-results { padding: 18px; }
  .batch-item { grid-template-columns: 44px minmax(0,1fr); }
  .batch-thumbnail { width: 44px; height: 44px; }
  .batch-item-actions { grid-column: 1 / -1; align-items: stretch; }
  .batch-downloads { justify-content: flex-start; }
  .guide-grid { padding-inline: 12px; }
  .guide-grid article { min-height: 0; }
  .guide-note { margin-inline: 12px; }
  footer { min-height: 76px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
}

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