:root {
  --ink: #1f2a2e; --muted: #6b7470; --bg: #f6f2ea; --card: #fffdf8; --line: #e3dccd;
  --brand: #23403f; --brand-2: #8a5a33; --ok: #2f6b45; --warn: #a3501f; --bad: #9b2d2d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Rubik, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--brand); }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 26px; margin: 8px 0 14px; font-weight: 600; }
h2 { font-size: 17px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 15px; margin: 14px 0 8px; font-weight: 600; }
code { font-size: 12.5px; background: #efe8da; padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }

.top { background: var(--brand); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .12em; }
.brand span { font-weight: 400; letter-spacing: 0; opacity: .75; margin-left: 6px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1; }
.top nav a { color: #e9efe9; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.top nav a.btn { background: var(--brand-2); color: #fff; }
.who { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.who .link { color: #e9efe9; }
.banner { background: #f3e2c4; color: #6a4a1f; font-size: 13px; text-align: center; padding: 6px 16px; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }

input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfc6b3; border-radius: 7px; background: #fff; color: var(--ink); max-width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label > input, label > select, label > textarea { color: var(--ink); font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 24px; color: var(--brand); }
.tile.alert b { color: var(--warn); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.wrap > * { flex: 1 1 160px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-grid .span2 { grid-column: span 4; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.subnav { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.inline { display: inline; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 13px; }
.r { text-align: right; }
tr.overdue td { color: var(--bad); }
.scroll { overflow-x: auto; }
ul.plain { list-style: none; padding: 0; margin: 0 0 10px; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.date { display: inline-block; min-width: 100px; font-weight: 500; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #e2efe5; color: var(--ok); }
.flash.error { background: #f6e0dc; color: var(--bad); }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: #ece5d6; white-space: nowrap; }
.pill.submitted { background: #f3e2c4; color: #6a4a1f; }
.pill.entered { background: #e2efe5; color: var(--ok); }
.pill.cancelled { background: #eee; color: #777; }
.pill.av-Shipsnow { background: #e2efe5; color: var(--ok); }
.pill.av-Preorder { background: #e3e9f3; color: #2d4a75; }
.pill.av-Soldout { background: #eee; color: #777; }
.note { background: #f5efe2; padding: 8px 12px; border-radius: 8px; }

.style { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.style-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.style-head h3 { margin: 0; }
.version { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.vmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 4px; }
.vmeta .price { margin-left: auto; }
table.sizes td, table.sizes th { text-align: center; padding: 4px 6px; }
table.sizes td:first-child { text-align: left; color: var(--muted); }
td.zero { color: #bbb; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
#search { min-width: 220px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 8px; }
.size { align-items: center; text-align: center; }
.size span { font-weight: 600; color: var(--ink); }
.size input { width: 100%; text-align: center; }
.size small { font-size: 11px; }
.line-total { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }
.totals { display: flex; justify-content: flex-end; gap: 16px; align-items: baseline; font-size: 18px; margin: 10px 0 14px; }
.sheet-list { list-style: none; padding: 0; }
.sheet-list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; }

.login { max-width: 380px; margin: 10vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; }
.login-brand { font-weight: 600; letter-spacing: .16em; color: var(--brand); font-size: 20px; }

@media (max-width: 760px) {
  .top { gap: 6px 12px; }
  .top nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .top nav a { white-space: nowrap; }
  .who { margin-left: auto; }
  .cols, .grid3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .vmeta .price { margin-left: 0; }
  h1 { font-size: 22px; }
}
.vrow { display: flex; gap: 14px; align-items: flex-start; }
.vbody { flex: 1; min-width: 0; }
.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: #fff; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.thumb.sm { width: 40px; height: 40px; vertical-align: middle; margin-right: 6px; }
.thumb.md { width: 56px; height: 56px; }
.thumb.nophoto { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--muted); cursor: default; background: #f3eee4; }
.lightbox { position: fixed; inset: 0; background: rgba(20,24,24,.82); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(92vw, 900px); max-height: 88vh; border-radius: 10px; background: #fff; }
.lb-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; }
.result { gap: 10px; }
.result .rinfo { flex: 1; min-width: 0; }
.line-head { display: flex; gap: 12px; align-items: center; }
@media (max-width: 760px) { .thumb { width: 72px; height: 72px; } }
.form-grid > label { min-width: 0; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.fb { position: relative; font-size: 13px; }
.fb summary { cursor: pointer; color: #e9efe9; list-style: none; padding: 4px 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; }
.fb summary::-webkit-details-marker { display: none; }
.fb-form { position: absolute; right: 0; top: 34px; width: min(320px, 90vw); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.fb-form textarea { width: 100%; }
.size input:disabled { background: #efeae0; color: #aaa; }
