@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url(fonts/montserrat-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 300; font-display: swap; src: url(fonts/roboto-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url(fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url(fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url(fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 900; font-display: swap; src: url(fonts/roboto-latin-900-normal.woff2) format("woff2"); }

:root {
  --brand: #004AAD; --brand-dark: #003A8A; --accent: #FF9D00; --ink: #00295F; --text: #1d1f23; --muted: #646973;
  --line: #dfe1e5; --bg: #f3f5f8; --card: #ffffff; --ok: #0f6b3c; --ok-bg: #e6f4ec; --err: #a3001d; --err-bg: #fdebee;
  --head: "Montserrat", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 "Roboto", "Segoe UI", Arial, sans-serif; }
a { color: var(--brand-dark); }
h1, h2, h3 { font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--ink); margin: 0; }
h1 { font-size: 24px; line-height: 1.15; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: .03em; margin-bottom: 14px; }
h3 { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 17px/1.05 var(--head); text-transform: uppercase; letter-spacing: .01em; }
.brand small { display: block; font: 500 11px/1.3 "Roboto", sans-serif; letter-spacing: .08em; color: #9db4d6; margin-top: 4px; }
.brand-mark { width: 10px; height: 34px; background: var(--accent); flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #d9e4f3; text-decoration: none; padding: 9px 12px; border-left: 3px solid transparent; font-weight: 500; }
.side nav a:hover { color: #fff; background: #003a85; }
.side nav a.on { color: #fff; border-left-color: var(--accent); background: #003a85; }
.who { margin-top: auto; font-size: 13px; display: flex; flex-direction: column; gap: 3px; border-top: 1px solid #1b4a8c; padding-top: 14px; }
.who span { color: #9db4d6; margin-bottom: 6px; }
.who a { color: #d9e4f3; }
.main { padding: 28px 34px 80px; min-width: 0; max-width: 1180px; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; margin-bottom: 4px; text-decoration: none; }
.back::before { content: "\2190\00a0"; }
.lead { max-width: 70ch; color: var(--muted); margin: -6px 0 20px; }

.card { background: var(--card); border: 1px solid var(--line); padding: 22px; margin-bottom: 18px; }
.card.flush { padding: 0; }
.card.narrow { max-width: 460px; }
.empty { color: var(--muted); padding: 22px; margin: 0; }
.card:not(.flush) .empty { padding: 0; }
.notice { background: #fff7e0; border: 1px solid #ecd58a; border-left: 4px solid #d9a400; padding: 12px 16px; margin-bottom: 18px; }
.flash { padding: 11px 16px; margin-bottom: 18px; border-left: 4px solid; font-weight: 500; }
.flash.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.flash.err { background: var(--err-bg); border-color: var(--err); color: var(--err); }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 16px 20px; text-decoration: none; color: var(--text); }
.stat:hover { border-top-color: var(--brand); }
.stat b { display: block; font: 800 32px/1.1 var(--head); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1 "Roboto", sans-serif; padding: 10px 16px; border: 1px solid #b9bcc3; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; border-radius: 2px; }
.btn:hover { border-color: var(--ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #1a66d6; outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { border-color: #b9bcc3; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.danger { color: var(--err); }
.btn.danger:hover, .btn.armed { background: var(--err); border-color: var(--err); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.link { font-size: 14px; }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font: 600 12px/1 "Roboto", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list a { text-decoration: none; color: var(--ink); }
table.list a:hover strong { color: var(--brand-dark); }
.thumb-col { width: 60px; padding-right: 0 !important; }
.thumb { width: 46px; height: 46px; object-fit: contain; background: #f1f2f4; display: block; }
.thumb.none { background: repeating-linear-gradient(45deg, #f1f2f4 0 6px, #e6e8eb 6px 12px); }
.code { font: 500 12px/1 ui-monospace, Menlo, Consolas, monospace; background: #f1f2f4; padding: 3px 6px; margin-left: 6px; color: var(--muted); }
.clip { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill.active { background: var(--ok-bg); color: var(--ok); }
.pill.draft { background: #eceef1; color: #4b4f57; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.menu { display: inline-block; position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "\25BE"; font-size: 11px; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--ink); min-width: 230px; text-align: left; box-shadow: 0 8px 22px rgba(0, 0, 0, .14); }
.menu-list a { display: block; padding: 10px 14px; white-space: normal; }
.menu-list a:hover { background: #f1f2f4; }

/* forms */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { width: 260px; }
label { display: block; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
label small, .upload small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
input, select, textarea { font: 400 15px/1.4 "Roboto", sans-serif; color: var(--text); background: #fff; border: 1px solid #b9bcc3; border-radius: 2px; padding: 9px 10px; }
label input:not([type=checkbox]):not([type=color]):not([type=file]), label select, label textarea { display: block; width: 100%; margin-top: 5px; }
input[type=color] { display: block; width: 64px; height: 40px; padding: 3px; margin-top: 5px; }
input[type=file] { display: block; margin-top: 5px; padding: 7px; width: 100%; background: #fafafa; }
input.compact { width: 150px; padding: 6px 8px; font-size: 13px; }
textarea { resize: vertical; }
textarea.mono { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; tab-size: 16; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 0 20px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 8px 0 0; }
.upload { margin-bottom: 14px; }
.upload .current img { max-width: 220px; max-height: 120px; object-fit: contain; background: #f1f2f4; padding: 8px; display: block; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); z-index: 5; }
.specs { display: grid; gap: 8px; margin-bottom: 10px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }

/* brochure picker */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.picker input[type=search] { width: 100%; margin-bottom: 8px; }
.pick-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); max-height: 420px; overflow: auto; }
.pick-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pick-list li:last-child { border-bottom: 0; }
.pick-name { font-weight: 600; min-width: 0; }
.pick-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.pick-btns { display: flex; gap: 4px; flex: none; }
.pick-empty { color: var(--muted); }
ol.pick-list { counter-reset: n; }
ol.pick-list li:not(.pick-empty)::before { counter-increment: n; content: counter(n); font: 700 14px/1 var(--head); color: var(--brand); width: 20px; flex: none; }
ol.pick-list .pick-name { flex: 1; }

/* sign in + setup */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--ink); }
.auth-card { background: #fff; width: 100%; max-width: 400px; padding: 30px; border-top: 6px solid var(--brand); }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { margin-bottom: 14px; }
.auth-card h2 { margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 14px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 22px; }
.auth-brand .brand-mark { height: 22px; width: 8px; }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 13px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 10px; }
  .side nav a.on { border-bottom-color: var(--brand); }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; gap: 12px; }
  .who strong, .who span { display: none; }
  .main { padding: 20px 16px 70px; }
  .grid2, .grid3, .picker, .stats { grid-template-columns: 1fr; }
  .card.flush { overflow-x: auto; }
  .spec-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: background .12s, border-color .12s; } }
.who .ver { color: #7d828b; margin: 8px 0 0; font-size: 12px; }

/* document viewer */
body.viewer { background: #33475f; display: flex; flex-direction: column; height: 100vh; margin: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 18px; background: var(--ink); color: #fff; font-size: 14px; flex: none; }
.toolbar a.tb-back { color: #fff; text-decoration: none; font-weight: 500; }
.toolbar a.tb-back::before { content: "\2190\00a0"; }
.toolbar .tb-title { font-weight: 700; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.toolbar label { color: #c9ccd2; margin: 0; font-weight: 400; display: flex; align-items: center; gap: 8px; }
.toolbar select { padding: 7px 8px; font-size: 14px; }
.toolbar .btn { border-color: #5f7fae; background: transparent; color: #fff; }
.toolbar .btn:hover { border-color: #fff; }
.toolbar .btn.primary { background: var(--brand); border-color: var(--brand); }
.toolbar .btn:focus-visible, .toolbar a:focus-visible, .toolbar select:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pdf-frame { flex: 1; width: 100%; border: 0; background: #33475f; }
.pdf-fallback { color: #c9ccd2; font-size: 13px; padding: 6px 18px; background: #00204a; flex: none; }
.pdf-fallback a { color: #fff; }

/* catalog builder */
.builder { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.cat-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: c; }
.cat-item { border: 1px solid var(--line); background: #fff; padding: 10px 12px; counter-increment: c; }
.cat-item.custom { border-left: 4px solid var(--ink); background: #fafafa; }
.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-head::before { content: counter(c); font: 700 14px/1 var(--head); color: var(--brand); width: 22px; flex: none; }
.cat-head .pick-name { flex: 1; }
.cat-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cat-fields { margin: 10px 0 0 32px; }
.cat-fields label { margin-bottom: 10px; }
.cat-empty { color: var(--muted); padding: 14px; border: 1px dashed #b9bcc3; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 4px; }
details.raw { margin-top: 10px; }
details.raw pre { white-space: pre-wrap; background: #f1f2f4; padding: 12px; max-height: 340px; overflow: auto; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.plan-new { color: var(--ok); font-weight: 700; } .plan-update { color: #8a5a00; font-weight: 700; } .plan-skip { color: var(--err); font-weight: 700; }
@media (max-width: 860px) { .builder { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }
.builder input[type=search] { width: 100%; margin-bottom: 8px; }
.found-photo { background: #f6f7f8; border: 1px solid var(--line); padding: 12px; }
.found-photo .current img { max-width: 420px; max-height: 150px; background: #fff; }
.grid-preview { overflow-x: auto; margin-top: -4px; }
.grid-preview table { border-collapse: collapse; font-size: 12.5px; min-width: 60%; }
.grid-preview caption { text-align: left; color: var(--muted); font-size: 12.5px; padding-bottom: 4px; }
.grid-preview th { background: var(--ink); color: #fff; font-weight: 500; padding: 4px 8px; border: 1px solid #1b4a8c; text-align: center; }
.grid-preview td { padding: 3px 8px; border: 1px solid var(--line); text-align: center; }
.grid-preview td:first-child { text-align: left; }

/* business cards */
.card-preview { width: 100%; max-width: 520px; aspect-ratio: 92 / 122; border: 1px solid var(--line); background: #fff; display: block; }
.card-preview + .card-preview { margin-top: 12px; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
details.more[open] summary { margin-bottom: 10px; }

/* logo choice and placement */
.logo-source { margin: 4px 0 14px; }
.logo-tune { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr); gap: 24px; margin: 18px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.logo-tune fieldset.tune { border: 0; padding: 0; margin: 0; }
.logo-tune output { float: right; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.logo-tune input[type=range] { padding: 0; accent-color: var(--brand); }
.logo-preview { width: 100%; height: 340px; border: 1px solid var(--line); background: #33475f; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 860px) { .logo-tune { grid-template-columns: 1fr; } }
.logo-source label.check input[type=radio] { display: inline-block; width: auto; margin: 0; flex: none; }

/* PDF log */
.pill.viewed { background: #eceef1; color: #4b4f57; }
.pill.downloaded { background: #fde8ec; color: #a3001e; }
.pill.printed { background: #e7eefb; color: #1f4f9c; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pager .muted { margin-left: auto; }
.filters label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.filters label select, .filters label input { margin-top: 0; width: auto; }

/* revisions */
.rev-tag { display: inline-block; font: 600 11.5px/1 var(--body, inherit); letter-spacing: .02em; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #fff; text-decoration: none; vertical-align: middle; white-space: nowrap; }
h1 .rev-tag { font-size: 13px; margin-left: 6px; position: relative; top: -3px; }
a.rev-tag:hover { border-color: var(--ink); color: var(--ink); }
.rev-tag.big { font-size: 14px; padding: 5px 9px; color: var(--ink); border-color: var(--ink); margin-right: 6px; }
.rev-tag.gone { color: #a3001e; border-color: #f1b8c3; background: #fde8ec; }
.rev-panel.clash { border-color: #c62828; box-shadow: inset 4px 0 0 #c62828; }
.rev-now { margin: 0 0 12px; }
table.diff td { vertical-align: top; }
table.diff td.val { white-space: pre-wrap; word-break: break-word; max-width: 40ch; font-size: 13.5px; }
table.diff tr.changed td { background: #fff8e6; }
table.diff tr.changed td.was { color: #8a1a2b; text-decoration: line-through; text-decoration-color: rgba(138,26,43,.45); }
.changed-list { color: var(--muted); font-size: 13px; }
.rev-img { display: block; max-width: 140px; max-height: 90px; object-fit: contain; background: #f1f2f4; padding: 4px; margin-bottom: 4px; }

/* workflow stages */
.pill.review { background: #fff4d6; color: #7a5200; }
.pill.approved { background: #e7eefb; color: #1f4f9c; }
.pill.archived { background: #f1f1f1; color: #6b6b6b; text-decoration: line-through; }
.rev-grid { align-items: start; grid-template-columns: 1fr 1fr 1.2fr; }
.stage-fixed { display: block; margin-top: 9px; }
.label-like { display: block; font-weight: 600; margin-bottom: 5px; }
.small-notice { margin-bottom: 14px; font-size: 14px; }
.card.quiet .empty { padding: 4px 0; }
h2.pad { padding: 16px 20px 0; }

/* product gallery */
.gallery-group { margin-bottom: 26px; }
.gallery-group h2 { font-size: 15px; margin: 0 0 10px; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.tile .frame { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 10px; cursor: zoom-in; width: 100%; }
.tile .frame img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tile .frame:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.tile.missing .frame { background: repeating-linear-gradient(45deg, #f6f6f7, #f6f6f7 8px, #efeff1 8px, #efeff1 16px); cursor: pointer; text-align: center; color: var(--muted); text-decoration: none; font-size: 13px; }
.tile .cap { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.tile .cap a { color: var(--text); text-decoration: none; }
.tile .cap .pill { align-self: flex-start; margin-top: 2px; }
dialog.zoom { border: 0; padding: 0; max-width: min(1100px, 94vw); width: 100%; background: #fff; }
dialog.zoom::backdrop { background: rgba(20, 21, 24, 0.82); }
.zoom img { display: block; width: 100%; max-height: 74vh; object-fit: contain; background: #fff; padding: 18px; box-sizing: border-box; }
.zoom-close { position: absolute; top: 10px; right: 10px; }
.zoom-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }

/* categories settings */
.cat-card { padding-bottom: 8px; }
.cat-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.cat-top { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.cat-top .cat-edit input[name=name] { font-weight: 700; font-size: 16px; }
.cat-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 1 1 420px; }
.cat-edit input[name=name] { flex: 1 1 220px; min-width: 160px; }
.cat-edit select, .cat-row select { width: auto; max-width: 210px; }
.cat-subs { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 3px solid var(--line); margin-left: 4px; }
.cat-subs .cat-row + .cat-row { border-top: 1px dashed var(--line); }
.cat-add input { font-style: italic; }

/* send for review */
.pill.emailed { background: #e6f4ea; color: #1e6b34; }
.wrap { white-space: normal; max-width: 34ch; }
fieldset.reviewers { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.reviewers legend { font-weight: 600; margin-bottom: 4px; }
table.kv td { vertical-align: top; }
.photo-tune h3 { margin-top: 0; }
.photo-preview { height: 420px; }
.actions.sticky { flex-wrap: wrap; }
.actions.sticky .btn { white-space: nowrap; }

/* login page */
body.auth { background-color: var(--ink); background-size: cover; background-position: center; }
.auth-card { box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-version { text-align: center; color: var(--muted); font-size: 12.5px; margin: 16px 0 0; letter-spacing: .02em; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.wp-tile { position: relative; display: block; border: 2px solid var(--line); padding: 0; margin: 0; cursor: pointer; background: #fff; font-weight: 500; }
.wp-tile input { position: absolute; top: 10px; left: 10px; width: auto; margin: 0; z-index: 1; }
.wp-tile img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wp-tile:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.wp-name { display: block; padding: 8px 10px; font-size: 14px; }
.wp-rotate { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; overflow: hidden; }
.wp-rotate img { aspect-ratio: auto; height: 100%; }
/* module access */
details.mods summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 3px; }
.mod-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0 4px; }
.mod-form label { font-size: 13px; margin: 0; }
.mod-form select { margin-top: 3px; padding: 5px 6px; font-size: 13px; }
fieldset.mod-grid { border: 1px solid var(--line); padding: 12px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 18px; margin: 4px 0 16px; }
fieldset.mod-grid legend { font-weight: 600; padding: 0 6px; }
.hidden { display: none !important; }

/* hose labels */
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; }
.grid4 input[type=color] { width: 100%; height: 38px; padding: 2px; }
.label-preview { width: 100%; aspect-ratio: 297 / 210; border: 1px solid var(--line); background: #fff; display: block; }
.label-chip { display: inline-block; width: 26px; height: 10px; border-radius: 2px; border: 1px solid var(--line); vertical-align: middle; }
.lbl-list { display: grid; gap: 8px; margin-bottom: 10px; }
.lbl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, #fafafa); }
.lbl-row > * { margin: 0; }
.lbl-row [hidden] { display: none !important; }
.lbl-kind { font-weight: 600; min-width: 110px; }
.lbl-text { flex: 1 1 160px; width: auto; min-width: 0; }
.lbl-font { width: auto; }
.lbl-size { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.lbl-size input { width: 110px; }
.lbl-size output { min-width: 44px; font-variant-numeric: tabular-nums; }
.lbl-colour, .lbl-orig { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.lbl-colour input[type=color] { width: 36px; height: 28px; padding: 1px; }
.lbl-file { display: inline-flex; align-items: center; gap: 8px; }
.lbl-file img { height: 28px; max-width: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.lbl-move { margin-left: auto; display: inline-flex; gap: 4px; }
.mod-form .wide { grid-column: 1 / -1; }

/* settings group in the menu */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; border-top: 1px solid #1b4a8c; padding-top: 6px; }
.nav-group summary { list-style: none; cursor: pointer; color: #d9e4f3; padding: 9px 12px; border-left: 3px solid transparent; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #8a8f98; border-bottom: 2px solid #8a8f98; transform: rotate(45deg); margin-top: -4px; transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.nav-group summary:hover { color: #fff; background: #003a85; }
.nav-group summary.on { color: #fff; }
.nav-group a { padding-left: 24px !important; font-size: 14px; }
.side nav .nav-group { display: block; }
.side nav .nav-group[open] { display: flex; }
@media (max-width: 860px) { .nav-group { border: 0; margin: 0; padding: 0; } .nav-group[open] { flex-direction: row; flex-wrap: wrap; } .nav-group a { padding-left: 10px !important; } }
/* label preview sized to the page; label options */
.label-preview { aspect-ratio: auto; height: 260px; }
.opt-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; padding: 14px 16px; border-top: 1px solid var(--line); }
.opt-bar label { margin: 0; }
.opt-bar input[name=title] { min-width: 260px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
th.pick, td.pick { width: 34px; padding-right: 0; }
td.pick input { width: 18px; height: 18px; }
.opt-bar .opt-msg { margin: 0; padding: 8px 12px; }
.side nav .nav-group, .side nav .nav-group[open] { display: block; }
.side nav .nav-group a { display: block; margin-top: 2px; }
.side nav .nav-group summary { margin-bottom: 2px; }
@media (max-width: 860px) { .side nav .nav-group a { display: inline-block; } }
.opt-bar > div:first-child { flex: 1 1 100%; }
.opt-bar > label { flex: 1 1 200px; }

/* sign-in logo, door link, PDM */
.auth-logo { margin: 2px 0 14px; }
.auth-logo img { width: 220px; max-width: 70%; height: auto; display: block; }
.auth-brand { color: #5A5F68; }
.door-link { margin-top: 10px; border: 1px dashed #4f79b5 !important; color: #d9e4f3 !important; font-size: 13.5px; }
.door-link:hover { border-color: var(--accent) !important; }
fieldset.doors { display: flex; flex-wrap: wrap; gap: 6px 22px; border: 1px solid var(--line); padding: 10px 14px 12px; margin: 0 0 14px; }
fieldset.doors legend { font-weight: 600; padding: 0 6px; }
.door-pick { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; font-weight: 600; grid-column: 1 / -1; }
.door-pick label { font-weight: 400; }
.appr { border-left: 4px solid var(--brand); }
.appr-steps { display: flex; flex-wrap: wrap; gap: 0; margin: 6px 0 16px; counter-reset: st; }
.appr-step { flex: 1 1 160px; position: relative; padding: 12px 14px 12px 44px; border: 1px solid var(--line); background: #fff; margin: 0 -1px -1px 0; }
.appr-step::before { counter-increment: st; content: counter(st); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: #e7e9ec; color: #5a5f68; font: 700 12px/22px Roboto, sans-serif; text-align: center; }
.appr-step.done::before { content: "\2713"; background: #1f8a4c; color: #fff; }
.appr-step.now { background: #fff8e1; border-color: #f0c34a; }
.appr-step.now::before { background: #f0a500; color: #fff; }
.appr-step strong { display: block; }
.appr-step small { display: block; color: var(--muted); margin-top: 2px; }
.appr-act { display: grid; gap: 10px; }
.appr-act .row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.ok { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.btn.ok:hover { background: #18703d; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.stat b { display: block; font: 800 28px/1 var(--head); color: var(--ink); }
.stat span { color: var(--muted); font-size: 13px; }
.stat:hover { border-color: var(--brand); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.prow-table input, .prow-table select { width: 100%; min-width: 0; padding: 6px 8px; }
.prow-table td { padding: 4px 4px; vertical-align: middle; }
.prow-table .num { text-align: right; }
.prow-table th { white-space: nowrap; }
.pl-table td.num, .pl-table th.num { text-align: right; white-space: nowrap; }
.pl-table input.special { width: 110px; text-align: right; }
.pl-group td { background: #f2f3f5; font-weight: 700; }
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 10px 0; }
.table-tools label { margin: 0; }
.master-note { background: #f2f3f5; padding: 10px 14px; border-left: 4px solid #9ba0a8; margin-bottom: 14px; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filters label { margin: 0; }
.stage-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.stage-form input[name=name] { width: 200px; }
.stage-form select { width: auto; }
