/* Archive Desk, browser app page. The page opens straight into the app: a white sheet for the project folder,
   a spruce sheet for the backup ZIP, and the ZIP's checksum seal drawn large once it is made.
   Colours come from the Workbench app's own screens: sage paper, white panels, spruce text, leaf green on
   verified things. Archivo for text, Chivo Mono only for paths, sizes and hashes. */
:root {
  --ink: #1c2b22; --ink-soft: #2c4034; --paper: #eef1ec; --surface: #ffffff; --surface-soft: #f5f7f3; --folder: #e3e9e1;
  --line: #d3dbd3; --line-strong: #7b897f; --muted: #4b5a50; --brand: #1c2b22; --brand-soft: #e6ece4; --deep: #1c2b22;
  --seal: #2e6b3c; --seal-soft: #e5f1d6; --steel: #2e6b3c; --leaf: #cfe8a9;
  --added: #2b5a86; --added-soft: #e1eaf3; --amber-soft: #f3ead0; --warning: #6f5400; --stamp: #a3261d; --error: #a3261d; --error-soft: #f8e4e1;
  --zip: #1c2b22; --zip-text: #edf2ea; --zip-muted: #a9b9ad; --zip-line: rgba(237, 242, 234, .13); --ok: #cfe8a9;
  --radius: 12px; --radius-button: 8px;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--seal);
  --heading: "Archivo", "Segoe UI", system-ui, sans-serif;
  --body: "Archivo", "Segoe UI", system-ui, sans-serif;
  --mono: "Chivo Mono", ui-monospace, Consolas, monospace;
  --edge: max(16px, calc((100vw - 1360px) / 2 + 24px));
}
html { overflow-x: clip; }
body { background: var(--paper); font: 400 16px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--heading); letter-spacing: -.01em; }
a { text-decoration-color: var(--seal); }

/* Top bar: the product name and one way back */
.topbar { padding: 12px var(--edge); border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.topbar .brand, .topbar .topbar-link { color: var(--ink); }
.topbar .topbar-right { gap: 24px; }
.topbar .local-badge { font: 400 15px/1.3 var(--body); color: var(--muted); letter-spacing: 0; }
.topbar .topbar-link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.topbar .topbar-link:hover { text-decoration-color: var(--ink); }
.sb-logo text { font-family: "Archivo", sans-serif; font-stretch: 112%; }

/* Page frame: the steps on the left, the app on the right */
.shell.desk { max-width: none; margin: 0; padding: 28px var(--edge) 0; }
.rail, .main-col { min-width: 0; }
.caption { max-width: 30ch; margin: 0 0 18px; font: 600 19px/1.3 var(--heading); font-stretch: 108%; color: var(--ink); text-wrap: balance; }
@media (min-width: 1080px) {
  .shell.desk { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .rail { position: sticky; top: 24px; }
  .caption { margin-top: 4px; font-size: 22px; }
  .site-footer { grid-column: 1 / -1; }
}

/* Steps. A real sequence, so they keep their numbers. Down the left on a desktop, across the top below that. */
.tabbar { margin: 0; padding: 0; border: 0; }
.tabbar button { position: relative; border: 0; border-radius: var(--radius-button); background: transparent; color: var(--ink); font: 600 16px/1.2 var(--body); box-shadow: none; }
.tab-number { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); border-radius: 50%; font: 600 14px/1 var(--body); opacity: 1; }
.tabbar button:hover:not([aria-selected=true]) { background: var(--brand-soft); }
.tabbar button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.tabbar button[aria-selected=true] .tab-number { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.tabbar button[aria-selected=true]:focus-visible, .tabbar button:focus-visible { box-shadow: var(--focus); }
@media (min-width: 1080px) {
  .tabbar { display: flex; flex-direction: column; gap: 4px; }
  .tabbar button { justify-content: flex-start; gap: 12px; min-height: 56px; padding: 10px 12px; text-align: left; font-size: 18px; }
}
@media (max-width: 1079px) {
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: calc(var(--radius-button) + 4px); background: var(--folder); }
  .tabbar button { gap: 8px; min-height: 48px; padding: 6px 8px; }
  .tabbar button:hover:not([aria-selected=true]) { background: rgba(255, 255, 255, .55); }
}

/* Buttons */
.button { border-width: 1.5px; border-radius: var(--radius-button); font-family: var(--body); font-weight: 600; letter-spacing: 0; }
.button.primary { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.button.primary:hover:not(:disabled) { border-color: var(--ink-soft); background: var(--ink-soft); }
.button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button.secondary:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-soft); }
.button.light { border-color: var(--ok); background: var(--ok); color: var(--zip); }
.button.light:hover:not(:disabled) { border-color: #e0f1c6; background: #e0f1c6; }
.button.light:focus-visible { box-shadow: 0 0 0 2px var(--zip), 0 0 0 4px var(--zip-text); }
.text-button { font-weight: 600; text-decoration-color: var(--seal); }
.text-button:hover:not(:disabled) { background: var(--brand-soft); }

/* The bench: folder sheet, arrow, ZIP sheet */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); align-items: start; }
.card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--radius); container-type: inline-size; }
.folder-card { background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: background-color .18s ease-out, box-shadow .18s ease-out; }
.folder-card.drag-over { background: var(--seal-soft); box-shadow: 0 0 0 2px var(--seal); }
.zip-card { background: var(--zip); color: var(--zip-text); }
.card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "label meta clear" "name actions actions"; align-items: center; gap: 10px 14px; padding: 18px 20px; }
.zip-card .card-head { grid-template-areas: "label meta meta" "name actions actions"; }
.card-label { grid-area: label; }
.card-meta { grid-area: meta; }
.card-clear { grid-area: clear; }
.card-name, .zip-name { grid-area: name; }
.card-actions { grid-area: actions; }
@container (max-width: 470px) {
  .folder-card .card-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label clear" "name meta" "actions actions"; }
  .folder-card .card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .folder-card .card-actions .button { padding: 8px 10px; }
  .card-name, .zip-name { font-size: 18px; }
  .zip-card .card-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label meta" "name actions"; }
  .zip-card .card-actions .button { padding: 8px 12px; }
}
.card-label { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 16px/1.3 var(--body); letter-spacing: 0; color: var(--muted); }
.zip-card .card-label { color: var(--zip-muted); }
.card-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.card-meta { justify-self: end; display: flex; align-items: center; min-height: 30px; font: 500 14px/1.3 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zip-card .card-meta { color: var(--zip-muted); }
.card-clear.text-button { justify-self: end; min-height: 44px; margin: -6px -8px -6px 0; padding: 2px 8px; font-size: 15px; }
.card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 24px/1.2 var(--mono); color: var(--ink); }
.card-name.is-empty { color: var(--muted); font: 600 22px/1.2 var(--body); }
.card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.card-actions .button { min-height: 44px; padding: 8px 16px; }
.zip-name { display: flex; align-items: baseline; min-width: 0; font: 600 24px/1.2 var(--mono); }
.zip-name input { flex: 0 1 auto; width: auto; min-width: 0; min-height: 44px; padding: 6px 0; border: 0; border-bottom: 2px solid var(--zip-muted); border-radius: 0; background: transparent; color: var(--zip-text); font: inherit; }
.zip-name input:hover { border-bottom-color: var(--zip-text); }
.zip-name input:focus-visible { box-shadow: none; outline: 2px solid var(--ok); outline-offset: 2px; }
.zip-name span { flex: none; color: var(--zip-muted); }

/* File rows, the same grid on both sheets so they line up */
.file-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 46px; padding: 0 20px; border-top: 1px solid var(--line); font: 400 15px/1.3 var(--mono); }
.f-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-dir { color: var(--muted); }
.f-name { font-weight: 600; }
.f-size { color: var(--muted); font-family: var(--body); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; min-width: 7ch; }
.folder-list li { transition: background-color .3s ease-out, color .3s ease-out; }
.folder-list li.packed { background: var(--surface-soft); }
.folder-list li.packed .f-name { color: var(--seal); }
.zip-list { border-bottom-color: var(--zip-line); }
.zip-list li { grid-template-columns: 22px minmax(0, 1fr) auto auto; border-top-color: var(--zip-line); transition: opacity .25s ease-out; }
.zip-list .f-dir, .zip-list .f-size { color: var(--zip-muted); }
.zip-list li.wait { opacity: 0; }
.f-check { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid rgba(237, 242, 234, .35); border-radius: 50%; transition: border-color .25s ease-out, background-color .25s ease-out; }
.f-check .tick { width: 14px; height: 14px; }
.f-check .tick path { fill: none; stroke: var(--zip); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s ease-out .05s; }
.zip-list li.ok .f-check { border-color: var(--ok); background: var(--ok); }
.zip-list li.ok .f-check .tick path { stroke-dashoffset: 0; }
.f-hash { color: var(--zip-muted); font-size: 13.5px; opacity: 0; transition: opacity .3s ease-out; }
.zip-list li.ok .f-hash { opacity: 1; }
.flyer { position: fixed; z-index: 60; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--surface); color: var(--ink); font: 600 14px/1.2 "Chivo Mono", ui-monospace, Consolas, monospace; white-space: nowrap; box-shadow: 0 10px 22px rgba(28, 43, 34, .25); pointer-events: none; will-change: transform; }

/* Folder sheet foot: drop target and limits */
.drop-area { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; margin: 18px 20px 0; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-button); color: var(--muted); text-align: center; font-size: 15px; }
.folder-card.is-empty .drop-area { min-height: 220px; margin-top: 0; border-color: var(--ink); color: var(--ink); font-size: 17px; }
.folder-card.drag-over .drop-area { border-style: solid; border-color: var(--seal); color: var(--seal); }
.drop-icon-svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.folder-card .notice { margin: 14px 20px 0; border-radius: var(--radius-button); }
.notice.amber { border: 0; background: var(--amber-soft); color: #4f3c00; }
.limit-note { margin: 0; padding: 12px 20px 18px; font-size: 14px; color: var(--muted); }

/* ZIP sheet foot: result, seal, download */
.zip-empty { padding: 22px 20px; color: var(--zip-muted); font-size: 16px; border-top: 1px solid var(--zip-line); }
.zip-done { display: grid; gap: 14px; padding: 20px 20px 0; }
#created-result.zip-done { margin-top: 0; border-top: 0; }
.zip-summary { font: 600 17px/1.35 var(--body); color: var(--zip-text); }
.zip-done .button.full { min-height: 50px; font-size: 16px; }
.zip-done .file-name { margin: 2px 0 6px; font: 400 13px/1.45 var(--mono); color: var(--zip-text); overflow-wrap: anywhere; }
.zip-card .hash-details { margin: -4px 0 0; color: var(--zip-muted); }
.zip-card .hash-details summary { gap: 10px; min-height: 44px; color: var(--zip-text); font-size: 15px; font-weight: 600; }
.hash-details summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%; font: 600 14px/1 var(--body); }
.hash-details[open] summary::before { content: "-"; }
.zip-card .hash-details code { border-radius: 6px; background: rgba(237, 242, 234, .06); border-color: var(--zip-line); color: var(--zip-text); }
.zip-note { margin-top: auto; padding: 14px 20px 18px; font-size: 14px; color: var(--zip-muted); }
.zip-done + .zip-note { margin-top: 0; }

/* The seal: the ZIP's own face, drawn from its SHA-256 */
.seal-glyph { gap: 16px; border: 0; border-radius: var(--radius-button); background: var(--seal-soft); }
.seal-glyph strong { text-transform: none; letter-spacing: 0; font: 600 15px/1.35 var(--body); color: var(--seal); }
.seal-glyph span { font: 500 14px/1.45 var(--mono); }
.seal-glyph small { font-size: 14px; }
.seal-glyph svg .ring { fill: var(--surface); stroke: var(--seal); }
.zip-card .seal-glyph { margin: 0; padding: 4px 0; background: transparent; }
.zip-card .seal-glyph svg { width: 112px; height: 112px; }
.zip-card .seal-glyph svg .ring { fill: rgba(207, 232, 169, .08); stroke: var(--ok); }
.zip-card .seal-glyph svg .tick { stroke: var(--ok); }
.zip-card .seal-glyph svg .core { fill: var(--ok); }
.zip-card .seal-glyph strong { color: var(--ok); }
.zip-card .seal-glyph span { color: var(--zip-text); font-size: 15px; }
.zip-card .seal-glyph small { color: var(--zip-muted); }

/* Arrow between the sheets */
.bench-arrow { display: flex; justify-content: center; align-items: flex-start; padding-top: 80px; color: var(--line-strong); }
.bench-arrow svg { width: 32px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Status line under the app */
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 16px 0 0; padding: 10px 16px; border: 0; border-radius: var(--radius-button); background: var(--folder); color: var(--ink); }
.status-bar.done { background: var(--folder); }
.status-bar.busy { background: var(--folder); }
.status-bar.error { background: var(--error-soft); color: var(--error); }
.status-bar p { flex: 1 1 320px; font-size: 15px; }
.status-label { font: 600 14px/1.5 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.status-bar.error .status-label { color: var(--error); }
.status-bar.busy .status-label::after { content: ""; }
.status-bar .text-button { margin: -8px 0; font-size: 15px; }
#run-tour.running { cursor: progress; }

/* Verify and Compare: white sheets */
.workspace-grid { grid-template-columns: minmax(0, 1fr) 320px; }
.panel { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.panel-heading h2, .sidebar h2 { font-size: 24px; font-weight: 700; font-stretch: 108%; }
.panel-heading { padding-bottom: 10px; }
.sidebar .panel > p:not(.eyebrow), .format-card p, .section-intro { color: var(--muted); }
.file-picker { border: 1.5px dashed var(--ink); border-radius: var(--radius-button); background: var(--surface-soft); }
.file-picker:hover { background: var(--seal-soft); }
.picker-icon, .drop-icon { border: 0; background: transparent; }
.table-wrap { border-top: 1px solid var(--line); }
th { background: var(--surface-soft); border-top: 0; border-bottom: 1px solid var(--line); font: 600 14px/1.4 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
td:first-child, td:nth-child(n+2) { font-family: var(--mono); font-size: 14px; }
.empty-row td { background: var(--surface); }
.result-heading { border: 0; border-radius: var(--radius-button); background: var(--seal-soft); }
.result-heading h3 { font-weight: 700; }
.result-check { border: 0; border-radius: 50%; background: var(--seal); }
.result-check svg { width: 20px; height: 20px; fill: none; stroke: var(--surface); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.seal-glyph.in-panel svg { width: 88px; height: 88px; }
.archive-facts, .diff-stats { border: 0; border-radius: var(--radius-button); background: var(--surface-soft); }
.archive-facts dt { font-weight: 600; }
.diff-stats strong { font: 700 44px/1 var(--heading); font-stretch: 112%; }
.diff-stats span { font-weight: 600; }
.diff-stats > div { border-left-color: var(--line); }
.format-card h3 { font-size: 19px; font-weight: 700; }
.compare-slot { border: 0; border-radius: var(--radius-button); background: var(--surface-soft); box-shadow: 0 0 0 1px var(--line); }
.input-step { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 600 14px/1 var(--body); }
.slot-head { font-weight: 600; }
.change-badge { border: 0; border-radius: 4px; padding: 1px 8px; font: 600 13px/1.6 var(--body); letter-spacing: 0; }
.change-badge.added { background: var(--added-soft); color: var(--added); }
.change-badge.changed { background: var(--amber-soft); color: #4f3c00; }
.change-badge.removed { background: var(--error-soft); color: #8a1f19; }
.change-badge.unchanged { background: var(--surface-soft); color: var(--muted); }
td.path-cell { overflow-wrap: break-word; word-break: normal; }
#verified-rows td:nth-child(2), #comparison-rows td:nth-child(n+3) { white-space: nowrap; }
dialog { border: 0; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(28, 43, 34, .3); }
dialog h2 { font-weight: 700; }
dialog::backdrop { background: rgba(28, 43, 34, .5); }
.hash-details summary { font-weight: 600; }

/* Footer: the rest of the product, then contacts */
.site-footer { margin-top: 64px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .sb-foot { color: var(--ink); }
.site-footer nav { gap: 0 24px; }
.site-footer nav a { font: 600 17px/1.2 var(--body); color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.site-footer nav a:hover { text-decoration-color: var(--ink); }
.site-footer .footer-contact { border-top: 1px solid var(--line); }
.footer-contact span { font: 600 14px/1.5 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.footer-contact a { font-weight: 500; text-decoration-color: var(--line-strong); }

/* Tablets: the sheets stay side by side, the checksum column goes */
@media (max-width: 1079px) {
  .caption { max-width: 40ch; }
  .f-hash { display: none; }
  .zip-list li { grid-template-columns: 22px minmax(0, 1fr) auto; }
}
@media (max-width: 880px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Below 900 pixels the sheets stack: the folder as a pile of file tags, an arrow down, the ZIP below */
@media (max-width: 899px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .bench-arrow { height: 36px; padding: 0; align-items: center; }
  .bench-arrow svg { transform: rotate(90deg); width: 26px; }
  .folder-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow-y: auto; padding: 0 20px 14px; border-bottom: 0; }
  .folder-list li { display: block; min-height: 0; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; }
  .folder-list li .f-size { display: none; }
  .folder-list li.packed { border-color: var(--seal); }
  .drop-area { display: none; }
  .folder-card.is-empty .drop-area { display: flex; min-height: 140px; margin: 0 20px; }
  .limit-note { padding-top: 0; }
  .folder-card.is-empty .limit-note { padding-top: 12px; }
}

/* Phones */
@media (max-width: 719px) {
  .shell.desk { padding-top: 18px; }
  .caption { margin-bottom: 14px; font-size: 18px; }
  .card-head { gap: 8px 10px; padding: 14px; }
  .card-name, .zip-name { font-size: 17px; }
  .card-name.is-empty { font-size: 18px; }
  .folder-list { padding: 0 14px 12px; }
  .folder-list li { font-size: 13px; }
  .zip-list li { min-height: 40px; gap: 10px; padding: 0 14px; font-size: 13.5px; }
  .f-size { font-size: 13px; min-width: 0; }
  .f-check { width: 20px; height: 20px; }
  .zip-list li { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .folder-card.is-empty .drop-area { min-height: 120px; margin: 0 14px; }
  .folder-card .notice { margin: 10px 14px 0; }
  .limit-note { padding: 0 14px 14px; font-size: 14px; }
  .folder-card.is-empty .limit-note { padding-top: 12px; }
  .zip-empty { padding: 16px 14px; font-size: 15px; }
  .zip-done { gap: 12px; padding: 16px 14px 0; }
  .zip-card .seal-glyph svg { width: 84px; height: 84px; }
  .zip-summary { font-size: 16px; }
  .zip-note { padding: 12px 14px 16px; font-size: 14px; }
  .status-bar { margin-top: 14px; padding: 10px 14px; }
  .status-bar .text-button { margin: 0 -12px; }
  .site-footer { margin-top: 48px; }
  .topbar .topbar-right { gap: 12px; }
}
@media (max-width: 640px) { .status-bar { align-items: flex-start; } .status-bar p { flex: none; } .seal-glyph.in-panel svg { width: 64px; height: 64px; } }
@media (max-width: 380px) {
  .card-meta { font-size: 13px; gap: 8px; }
  .folder-card .card-actions .button { font-size: 14px; }
  .tabbar button { gap: 6px; padding: 6px 4px; font-size: 14px; }
  .tab-number { width: 24px; height: 24px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .zip-list li, .f-check, .f-check .tick path, .f-hash, .folder-list li { transition: none; }
}
