/* MAN AI editorial palette */
:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ink: #e6ecf2;
  --muted: #a7b5c3;
  --line: #253849;
  --control-line: #3a5062;
  --soft: #143045;
  --paper: #06111c;
  --surface: #0b1e2e;
  --raised: #0f2637;
  --accent: #c2a47b;
  --accent-hover: #dcc7a6;
  --accent-wash: #322d25;
  --positive: #b8d6ba;
  --positive-fill: #263e3c;
  --review: #f1cca0;
  --review-fill: #372d24;
  --sidebar: #081622;
  --sidebar-line: #253849;
  --stage: #191c20;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, a, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .46; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
h1, h2, h3, figure { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.shell { display: grid; grid-template-columns: 250px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  min-width: 0;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 18px 21px; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.015em; line-height: 1.12; }
.brand div span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.batch { padding: 15px 16px 13px; margin: 0 16px 18px; border: 1px solid var(--sidebar-line); border-radius: 11px; background: var(--surface); }
.batch-line { display: flex; align-items: baseline; gap: 6px; justify-content: space-between; font-size: 13px; }
.batch-line span { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 5px; margin: 12px 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--soft); color: var(--accent); }
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.counts { display: flex; justify-content: space-between; font-size: 11px; gap: 5px; color: var(--muted); }
.counts b { color: var(--ink); font-weight: 650; }
.browse { padding: 0 16px; }
.search-wrap { position: relative; }
.search-wrap span { position: absolute; left: 10px; top: 6px; color: var(--muted); font-size: 20px; }
.sidebar input, .sidebar select { width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); border-radius: 7px; }
.sidebar input { font-size: 13px; padding: 10px 8px 10px 31px; }
.sidebar input::placeholder { color: var(--muted); }
.filters { display: flex; gap: 6px; margin-top: 8px; }
.sidebar select { font-size: 11px; padding: 8px 3px; }
.list-heading { font-size: 11px; font-weight: 650; letter-spacing: .05em; color: var(--muted); padding: 20px 5px 8px; }
.product-list { min-height: 0; overflow-y: auto; padding: 0 9px 10px; }
.product { width: 100%; background: transparent; border: 1px solid transparent; color: var(--ink); text-align: left; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 2px; border-radius: 8px; }
.product:hover { background: var(--raised); }
.product[aria-current="true"] { background: var(--soft); border-color: var(--accent); }
.product img { width: 29px; height: 36px; border-radius: 4px; object-fit: cover; background: var(--stage); }
.product strong { display: block; font-size: 12px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; }
.product small { color: var(--muted); font-size: 10px; }
.product-count { color: var(--accent-hover); font-size: 11px; font-variant-numeric: tabular-nums; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 27px; background: var(--surface); border-bottom: 1px solid var(--line); }
.context { color: var(--muted); display: flex; gap: 9px; align-items: center; font-size: 13px; }
.context strong { color: var(--ink); }
.topbar-actions, .stage-nav, .zoom { display: flex; align-items: center; gap: 7px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 620; white-space: nowrap; }
.small { font-size: 12px; padding: 7px 11px; }
.icon { width: 33px; height: 32px; padding: 0; font-size: 17px; }
.outlined { background: var(--surface); border-color: var(--control-line); color: var(--ink); }
.outlined:hover, .ghost:hover { background: var(--soft); }
.ghost,.plain { background: transparent; color: var(--muted); border: 0; }
.plain { border-radius: 6px; height: 27px; font-size: 15px; }
.plain:hover { background: var(--soft); }
.desk { padding: 23px 26px 12px; max-width: 1800px; margin: 0 auto; }
.desk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
h1 { letter-spacing: -.04em; font-size: clamp(24px,3.1vw,34px); font-weight: 680; line-height: 1.15; }
.product-summary { color: var(--muted); font-size: 12px; margin-top: 6px; }
.stage-nav span { width: 54px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.review-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,280px); gap: 14px; }
.comparison { min-width: 0; }
.panes { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 11px; }
.image-card, .decision { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; min-width: 0; overflow: hidden; }
.image-card figcaption { min-height: 43px; display: flex; justify-content: space-between; padding: 6px 9px 6px 12px; align-items: center; gap: 4px; font-size: 12px; font-weight: 680; border-bottom: 1px solid var(--line); }
.dot { display: inline-block; border-radius: 100%; width: 7px; height: 7px; margin-right: 4px; vertical-align: 1px; }
.delivered { background: var(--accent); }
.raw { background: #8ea9c0; }
.image-stage { height: clamp(260px,48vh,580px); background: var(--stage); overflow: hidden; position: relative; touch-action: none; cursor: zoom-in; }
.image-stage img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none; }
.image-stage.zoomed { cursor: grab; }
.image-stage.dragging { cursor: grabbing; }
.image-stage.is-active { box-shadow: inset 0 0 0 1px var(--accent); }
.image-stage:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: -2px; z-index: 1; }
.image-stage[data-image-status] img { visibility: hidden; }
.image-stage[data-image-status]::after { content: attr(data-image-status); display: grid; place-items: center; position: absolute; inset: 0; font-size: 13px; color: var(--muted); }
.image-caption { display: flex; align-items: center; min-height: 38px; border-top: 1px solid var(--line); padding: 7px 10px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.image-caption select { width: 100%; min-width: 0; font-size: 12px; border: none; background-color: transparent; color: var(--ink); }
.no-reference { display: grid; place-items: center; position: absolute; inset: 0; font-size: 13px; color: var(--muted); padding: 8px; text-align: center; }
.view-toolbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 1px 0; }
.zoom { border: 1px solid var(--control-line); padding: 2px; border-radius: 8px; background: var(--surface); gap: 1px; }
.zoom button { min-width: 30px; padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; font-size: 11px; color: var(--ink); }
.zoom button:hover { background: var(--soft); }
.zoom output { font-size: 12px; color: var(--accent-hover); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.zoom button[data-zoom="in"], .zoom button[data-zoom="out"], .zoom button[data-lightbox-zoom="in"], .zoom button[data-lightbox-zoom="out"] { font-size: 17px; line-height: 1; }
.sync-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-hover); background: var(--accent-wash); }
.viewer { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.link-button { border: 0; background: transparent; padding: 3px 0; color: var(--accent-hover); font-size: 11px; text-align: left; }
.link-button:hover { text-decoration: underline; }
.link-button[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.decision { display: flex; flex-direction: column; align-self: start; padding: 14px; }
.decision-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
h2 { font-size: 15px; font-weight: 680; }
.pill { background: var(--soft); border-radius: 20px; color: var(--muted); font-size: 11px; font-weight: 620; padding: 5px 8px; white-space: nowrap; }
.pill.approved { background: var(--positive-fill); color: var(--positive); }
.pill.revise { background: var(--review-fill); color: var(--review); }
.file-meta { padding: 10px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.audit { background: var(--accent-wash); border-radius: 7px; padding: 9px; margin-bottom: 12px; color: var(--accent-hover); font-size: 12px; line-height: 1.4; }
.audit strong { font-size: 11px; display: block; margin-bottom: 3px; }
.audit p { margin: 3px 0 0; }
.criteria { margin-bottom: 12px; }
.criteria h3, .note-label { display: block; font-size: 12px; font-weight: 680; color: var(--ink); margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { font-size: 11px; padding: 5px 7px; border-radius: 6px; border: 1px solid var(--control-line); color: var(--muted); background: var(--surface); }
.chips button[aria-pressed="true"] { color: var(--positive); border-color: var(--accent); background: var(--accent-wash); }
textarea { width: 100%; min-height: 75px; resize: vertical; border: 1px solid var(--control-line); border-radius: 7px; padding: 9px; font-size: 12px; color: var(--ink); background: var(--sidebar); line-height: 1.45; }
textarea::placeholder { color: var(--muted); }
.decision-buttons { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 12px; }
.approve { background: var(--accent); color: var(--paper); }
.approve:hover { background: var(--accent-hover); }
.revise { color: var(--review); background: var(--review-fill); border-color: #6f5437; }
.revise:hover { background: #4b3826; }
.reset { justify-self: center; padding: 4px 0 0; }
.film-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.film-title { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 9px; }
.film-title > div { display: flex; align-items: baseline; gap: 9px; }
.frame-selection { color: var(--muted); font-size: 11px; }
.filmstrip { display: grid; grid-auto-flow: column; grid-auto-columns: 105px; gap: 9px; overflow-x: auto; padding: 1px 2px 8px; }
.frame { position: relative; }
.frame .frame-open { height: 113px; width: 100%; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 0; overflow: hidden; text-align: left; }
.frame .frame-open:hover { border-color: var(--accent-hover); }
.frame-open[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.frame-open img { display: block; width: 100%; height: 85px; object-fit: contain; background: var(--stage); }
.frame-label { display: flex; justify-content: space-between; align-items: center; gap: 3px; padding: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.frame-label .marker { width: 7px; height: 7px; border-radius: 100%; background: #8194a6; display: inline-block; }
.marker.approved { background: var(--positive); }
.marker.revise { background: var(--review); }
.frame-select { position: absolute; left: 5px; top: 5px; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; border-radius: 3px; background: var(--surface); }
.empty-state { color: var(--muted); padding: 52px 24px; text-align: center; font-size: 14px; }
.sidebar .empty-state { margin: 0; color: var(--muted); padding: 18px 10px; font-size: 12px; }
.toast { position: fixed; right: 18px; bottom: 18px; padding: 12px 17px; border-radius: 8px; background: var(--soft); color: white; font-size: 13px; z-index: 5; box-shadow: 0 8px 20px #040a1180; max-width: min(440px,93vw); }
.toast.error { background: #653137; }
.lightbox { max-width: min(95vw,1200px); width: 100%; max-height: 94vh; border: 1px solid var(--control-line); border-radius: 11px; padding: 0; background: var(--surface); }
.lightbox::backdrop { background: #040a11db; }
.lightbox-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.lightbox .lightbox-image { height: min(79vh, calc(94vh - 92px)); }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 218px minmax(0,1fr); }
  .desk, .topbar { padding-left: 17px; padding-right: 17px; }
  .review-layout { grid-template-columns: minmax(0,1fr) 222px; gap: 9px; }
  .decision { padding: 11px; }
  .panes { gap: 7px; }
}
@media (max-width: 850px) {
  .review-layout { grid-template-columns: minmax(0,1fr); }
  .decision { display: grid; grid-template-columns: minmax(130px,1fr) minmax(0,1.45fr); column-gap: 12px; }
  .decision-head,.file-meta,.audit,.criteria { grid-column: 1 / -1; }
  .note-label { grid-column: 1 / -1; }
  textarea { align-self: start; grid-column: 1; min-height: 90px; }
  .decision-buttons { margin: 0; }
  .image-stage { height: clamp(230px,46vh,465px); }
}
@media (max-width: 640px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; max-height: 345px; }
  .brand { padding: 14px 15px 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .batch { margin: 0 15px 9px; padding: 8px 11px; }
  progress { margin: 7px 0; }
  .list-heading { padding-top: 10px; }
  .product-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 103px; }
  .desk, .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  .desk-head { align-items: center; }
  .desk { padding-top: 15px; }
  .context, .viewer { display: none; }
  .topbar-actions { margin-left: auto; }
  .image-stage { height: 250px; }
  .view-toolbar { flex-wrap: wrap; }
}


.login-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, #0f2637 0%, var(--paper) 58%);
}
.login-card {
  width: min(100%, 440px);
  padding: clamp(25px, 7vw, 49px);
  border: 1px solid var(--control-line);
  border-top: 2px solid var(--accent);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 24px 75px #040a11b3;
}
.login-logo { display: block; width: 68px; height: 62px; object-fit: contain; margin-bottom: 25px; }
.login-project { color: var(--accent-hover); font-size: 11px; font-weight: 650; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 9px; }
.login-card p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 12px 0 24px; }
.login-card form { display: grid; gap: 9px; }
.login-card label { color: var(--ink); font-size: 13px; font-weight: 620; }
.login-card input { width: 100%; min-width: 0; border: 1px solid var(--control-line); background: var(--sidebar); color: var(--ink); border-radius: 7px; padding: 10px; }
.login-card .button { min-height: 40px; width: 100%; }
.login-card form .button { margin-top: 5px; }
.login-card .login-error { color: #ffc1bd; margin: 12px 0 0; }

#delivery { width: 100%; margin-block: 8px; }

.guest-login { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--control-line); }
.guest-login summary { font-size: 13px; color: var(--accent-hover); cursor: pointer; }
.guest-login form { margin-top: 13px; }
