@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: #E6012A; --brand-dark: #B80021; --ink: #111214; --text: #1d1f23; --muted: #646973;
  --line: #dfe1e5; --bg: #f4f4f2; --card: #ffffff; --ok: #0f6b3c; --ok-bg: #e6f4ec; --err: #a3001d; --err-bg: #fdebee;
  --head: "Roboto", "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: 900; text-transform: uppercase; letter-spacing: .01em; color: var(--ink); margin: 0; }
h1 { font-size: 26px; line-height: 1.1; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: .04em; margin-bottom: 14px; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; 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; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 900 20px/1 var(--head); text-transform: uppercase; letter-spacing: .02em; }
.brand small { display: block; font: 500 11px/1.3 "Roboto", sans-serif; letter-spacing: .08em; color: #a9adb5; margin-top: 4px; }
.brand-mark { width: 12px; height: 34px; background: var(--brand); flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #d6d8dc; text-decoration: none; padding: 9px 12px; border-left: 3px solid transparent; font-weight: 500; }
.side nav a:hover { color: #fff; background: #1e2024; }
.side nav a.on { color: #fff; border-left-color: var(--brand); background: #1e2024; }
.who { margin-top: auto; font-size: 13px; display: flex; flex-direction: column; gap: 3px; border-top: 1px solid #2c2f35; padding-top: 14px; }
.who span { color: #a9adb5; margin-bottom: 6px; }
.who a { color: #d6d8dc; }
.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: 900 34px/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: #3c4047; 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: #5b6069; 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: #3c4047; }
.pdf-fallback { color: #c9ccd2; font-size: 13px; padding: 6px 18px; background: #2a2d32; 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 #3a3d42; 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: #3c4047; 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: #E6012A; box-shadow: inset 4px 0 0 #E6012A; }
.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; }
