/* Inventori brand sheet.
 *
 * Instrument, not toy: white paper, one rust accent doing one job, a single
 * sans, hairline rules, 2px corners, no shadows, no rotation, and no decoration
 * that is not the product.
 *
 * Accent #B4451B is the deeper rust Stephen picked; it clears 5.5:1 on white so
 * it works as text as well as a control fill. #7A2E05 is the hover and link tone.
 */

@font-face {
  font-family: "Nunito Sans";
  src: url("/static/fonts/nunito-sans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #ffffff;
  --surface: #f7f7f5;
  --ink: #101010;
  --muted: #57574f;
  --rule: #e3e3df;
  --rule-strong: #c9c9c3;
  --signal: #b4451b;
  --signal-ink: #7a2e05;
  --font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }
img, svg { display: block; max-width: 100%; }
code, kbd, samp { font-family: var(--mono); font-size: 0.9em; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
  left: 24px;
  top: 12px;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 14px;
  text-decoration: none;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.wordmark { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.wordmark img { width: 20px; height: 20px; }
.wordmark span { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.nav a { text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .nav-cta { background: var(--signal); color: #fff; padding: 7px 14px; border-radius: 2px; }
.nav .nav-cta:hover { background: var(--signal-ink); color: #fff; }

main { padding: 0 0 64px; }

.site-footer {
  margin-top: 48px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0; }
.site-footer .footer-links { margin-top: 8px; }
.site-footer .trademarks { margin-top: 10px; font-size: 11px; line-height: 1.5; max-width: 72ch; }

/* Type */

h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; margin: 0 0 14px; }
h2 { font-size: 24px; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0 0 14px; }

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { max-width: 68ch; font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.muted, .fine, .meta { color: var(--muted); }
.fine, .meta { font-size: 12.5px; }
.error { color: var(--signal-ink); }

.section { padding: 28px 0; }
.section > *:last-child { margin-bottom: 0; }

/* Landing hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
  padding: 64px 0 56px;
}
.hero-copy h1 { max-width: 18ch; }
.landing-line { max-width: 46ch; font-size: 18px; color: var(--muted); margin: 0 0 28px; }

.hero-media { margin: 0; }
.hero-media img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.hero-media figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Actions */

.actions { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #000; }
.button.secondary { background: #fff; color: var(--ink); border-color: var(--rule-strong); }
.button.secondary:hover { background: var(--surface); border-color: var(--ink); }
.button.signal { background: var(--signal); border-color: var(--signal); }
.button.signal:hover { background: var(--signal-ink); border-color: var(--signal-ink); }
.button.small { min-height: 32px; padding: 0 12px; font-size: 14px; }

/* Tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tbody tr { height: 44px; }
thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--surface);
}
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); }
tr.is-selected th, tr.is-selected td { background: var(--surface); }

/* Panels, steps, grids */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 20px;
}
.card p:last-child { margin-bottom: 0; }
.card .num { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--signal-ink); margin: 0 0 8px; }
.price { font-size: 28px; font-weight: 700; margin: 6px 0; font-variant-numeric: tabular-nums; }

.steps { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.steps .card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: 22px 0;
}
.steps .card .num { grid-row: 1 / span 3; margin: 0; line-height: 23px; }
.steps .card > *:not(.num) { grid-column: 2; }

.prices, .docs-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.callout {
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--signal);
  border-radius: 2px;
  background: var(--surface);
  font-size: 15px;
}
.callout p:last-child { margin-bottom: 0; }

/* Reference block: detail kept on the page, but subordinate to the list. */
.reference { border-top: 1px solid var(--rule); padding-top: 24px; }
.reference h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.reference p { max-width: 78ch; margin-bottom: 10px; }
.reference p:last-child { margin-bottom: 0; }

/* Forms */

form.stack, .stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 9px 12px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 2px rgba(180, 69, 27, 0.18);
  outline: none;
}
input[type="checkbox"], input[type="radio"], input[type="hidden"] { width: auto; }

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--signal);
  border-radius: 2px;
  background: var(--surface);
  font-size: 15px;
}
.notice.error { color: var(--signal-ink); background: #fdf3ef; border-color: #efd6ca; border-left-color: var(--signal); }

/* Lists and rows */

.list { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--rule); }
.list a { text-decoration: none; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.row code { color: var(--muted); }
.row:hover code { color: var(--ink); }

.codes {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.item-photo { margin: 16px 0; max-width: 320px; }
.item-photo img { border: 1px solid var(--rule); border-radius: 2px; }

.container-row { align-items: flex-end; flex-wrap: wrap; }
.container-edit { flex: 1; grid-template-columns: 1fr auto; align-items: end; }

/* Policy pages */

.policy { max-width: 68ch; }
.policy h2 { margin-top: 1.8em; }
.policy p { margin: 0 0 1em; }
.policy a { color: var(--signal-ink); text-decoration-color: var(--signal); }

.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;
}

/* Signed-in app: catalog, containers, item.
 *
 * Instrument density. Every screen here is a table or a single hairline row;
 * the accent appears on the primary action only. Nothing in these screens
 * carries an inline style, so all of it lives here.
 */

.app-head h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.app-head p { margin-bottom: 0; }
.count-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.count-line a { color: var(--ink); text-decoration-color: var(--rule-strong); }

/* One strip instead of a shop: sheet, its spec, its action. */

.sheet-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.sheet-strip-main { flex: 1 1 220px; min-width: 0; }
.sheet-title { margin: 0; font-size: 15px; font-weight: 700; }
.sheet-strip .fine { margin: 2px 0 0; }
.strip-link { font-size: 13px; color: var(--muted); }
.strip-link:hover { color: var(--ink); }

.disclosure { border-top: 1px solid var(--rule); margin-top: 16px; }
.disclosure > summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.disclosure > summary:hover { color: var(--ink); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { color: var(--ink); }
.disclosure .list { border-top: 0; }

/* Tables that link on the whole row. */

.items-table tbody tr { position: relative; }
.items-table tbody tr:hover td { background: var(--surface); }
.table-link { font-weight: 600; text-decoration: none; }
.table-link::after { content: ""; position: absolute; inset: 0; }
.cell-thumb { width: 1%; padding-right: 0; }
.thumb {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface);
}
.thumb-empty { background: var(--paper); }
.code, .date {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.code { color: var(--muted); }
.date { color: var(--muted); white-space: nowrap; }
.cell-count { width: 1%; }
td.cell-actions, th.cell-actions { text-align: right; }

/* Per-row menu: a details element, so it works with no JavaScript. */

.row-actions { display: inline-block; text-align: left; }
.row-actions > summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions > summary:hover { border-color: var(--ink); color: var(--ink); }
.row-actions[open] > summary { border-color: var(--ink); color: var(--ink); }
.menu {
  display: grid;
  gap: 8px;
  width: 232px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
}
.menu label { font-size: 12px; }
.menu input { font-size: 14px; padding: 6px 8px; }
.menu .actions { gap: 8px; }
.menu .menu-note { margin: 0; font-size: 12px; color: var(--muted); }
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 18px;
}
.filter label { display: flex; align-items: center; gap: 8px; }
.filter input { width: 240px; max-width: 100%; padding: 6px 10px; font-size: 14px; }
.add-form input { width: 300px; }
.empty-state { margin: 0 0 18px; }

/* Item page: photo left at 320, fields right; one column on a phone. */

.item-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.item-grid h2:first-child { margin-top: 0; }
.item-media .item-photo { margin: 0 0 14px; }
.photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface);
}
.code-line {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.form-narrow { max-width: 460px; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 32px); }
  .site-header { flex-wrap: wrap; gap: 10px 20px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 32px; }
  .hero-copy h1 { max-width: none; }
  .steps .card { grid-template-columns: 36px minmax(0, 1fr); }
  .prices, .docs-grid { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .section { padding: 20px 0; }
  .item-grid { gap: 28px; }
}

@media (max-width: 640px) {
  .item-grid { grid-template-columns: 1fr; gap: 24px; }
  .item-photo { max-width: none; }
  .filter input { width: 100%; }
  .menu { width: 208px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
