/* Andito Printing - shared base. Colours come from /theme.css (editable in staff Settings). */
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/Poppins-Bold.ttf") format("truetype"); }

:root {
  --brand: #ab420f; --brand-dark: #85310b; --paper: #fdf8ed; --ink: #1a1a1a; --jet: #272829;
  --card: #ffffff; --line: #e6dccb; --line-strong: #cdbfa7; --muted: #5f5a52; --soft: #f5ecda;
  --ok: #1f6b3a; --ok-bg: #e3f3e7; --warn: #8a5a00; --warn-bg: #fff1cf; --bad: #a3231a; --bad-bg: #fde5e2; --info-bg: #efe6d4;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(26,26,26,.06), 0 4px 14px rgba(26,26,26,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Poppins", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; }
body.modal-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand); } a:hover { color: var(--brand-dark); }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.noscript { padding: 24px; max-width: 32rem; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* header */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 920px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); min-width: 0; }
.brand img { width: 34px; height: 34px; display: block; }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; color: var(--brand); line-height: 1; }
.brand-sub { font-size: .8rem; color: var(--jet); font-weight: 600; letter-spacing: .02em; padding-left: 10px; border-left: 2px solid var(--line-strong); line-height: 1.1; }
.topbar .spacer { flex: 1; }
.page { max-width: 920px; margin: 0 auto; padding: 16px 16px 120px; }
.page-narrow { max-width: 640px; }
.footer { max-width: 920px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: .85rem; }

/* surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.section-title { font-family: var(--display); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 2px 8px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* hero */
.hero { padding: 22px 18px; border-radius: var(--radius); background: var(--brand); color: #fff; margin: 0 0 14px; }
.hero h1 { color: #fff; font-size: 1.7rem; margin-bottom: .35em; }
.hero p { color: #fdf3e1; max-width: 34rem; }
.hero .btn-primary { background: var(--paper); color: var(--brand-dark); border-color: var(--paper); }
.hero .btn-primary:hover { background: #fff; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.steps-list li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--display); }

/* buttons */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--card); color: var(--ink); font: 600 1rem var(--font); cursor: pointer; text-decoration: none; text-align: center; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn-danger:hover { background: #7e1b14; border-color: #7e1b14; color: #fff; }
.btn-quiet-danger { color: var(--bad); border-color: transparent; background: transparent; } .btn-quiet-danger:hover { color: #7e1b14; border-color: var(--bad); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn.is-busy { cursor: progress; }
.icon-btn { appearance: none; border: 0; background: transparent; width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }

/* forms */
.field { display: block; margin: 0 0 14px; }
.field-label { display: block; font-weight: 600; margin-bottom: 4px; }
.field-hint { display: block; color: var(--muted); font-size: .875rem; margin-top: 3px; }
.field-error { color: var(--bad); font-size: .9rem; margin: 4px 0 0; font-weight: 600; }
input[type=text], input[type=tel], input[type=password], input[type=search], input[type=number], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 1rem var(--font); }
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(171,66,15,.2); }
input[aria-invalid=true] { border-color: var(--bad); }
.seg { display: inline-flex; border: 2px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: #fff; max-width: 100%; }
.seg button { appearance: none; border: 0; background: transparent; padding: 8px 14px; min-height: 40px; font: 600 .92rem var(--font); color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 2px solid var(--line-strong); }
.seg button[aria-pressed=true] { background: var(--brand); color: #fff; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line-strong); border-radius: 999px; background: #fff; }
.stepper button { appearance: none; border: 0; background: transparent; width: 42px; height: 40px; cursor: pointer; color: var(--ink); display: grid; place-items: center; border-radius: 999px; }
.stepper button:hover { background: var(--soft); } .stepper button[disabled] { opacity: .35; }
.stepper input { width: 52px; min-height: 40px; border: 0; text-align: center; padding: 0; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.choice { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 12px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; margin-bottom: 10px; align-items: start; }
.choice:has(input:checked) { border-color: var(--brand); background: #fff7ee; }
.choice input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--brand); }
.choice[aria-disabled=true] { opacity: .6; cursor: not-allowed; }

/* badges + alerts */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--info-bg); color: var(--jet); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); } .badge-bad { background: var(--bad-bg); color: var(--bad); } .badge-brand { background: var(--brand); color: #fff; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--info-bg); margin: 0 0 14px; display: flex; gap: 10px; }
.alert > :last-child { margin-bottom: 0; }
.alert-warn { background: var(--warn-bg); border-color: #e2c27a; } .alert-bad { background: var(--bad-bg); border-color: #e3a49d; } .alert-ok { background: var(--ok-bg); border-color: #a5d3b2; }
.alert .icon { margin-top: 2px; }

/* file cards */
.file { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.thumb { width: 76px; height: 100px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; color: var(--muted); overflow: hidden; position: relative; }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
button.thumb { cursor: pointer; padding: 0; font: inherit; }
.file-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.file-meta { color: var(--muted); font-size: .875rem; }
.file-opts { grid-column: 1 / -1; display: grid; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); margin-top: 4px; }
.opt { display: grid; gap: 4px; }
.opt-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.opt-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.progress { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.dropzone { display: grid; gap: 8px; place-items: center; text-align: center; padding: 26px 16px; border: 2px dashed var(--brand); border-radius: var(--radius); background: #fff7ee; margin-bottom: 14px; }
.dropzone.is-over { background: #ffe9d2; }

/* quote bar */
.quote-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--card); border-top: 2px solid var(--brand); box-shadow: 0 -6px 20px rgba(26,26,26,.1); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.quote-bar-in { max-width: 920px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.quote-total { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; color: var(--brand-dark); }
.quote-lines { width: 100%; border-collapse: collapse; font-size: .92rem; }
.quote-lines td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; } .quote-lines td:last-child { text-align: right; white-space: nowrap; }
.quote-lines tr:last-child td { border-bottom: 0; }

/* order tracker */
.track { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.track li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.track li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-strong); }
.track li:last-child::before { display: none; } .track li:last-child { padding-bottom: 0; }
.track .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; display: grid; place-items: center; color: #fff; }
.track li.done .dot { background: var(--ok); border-color: var(--ok); } .track li.done::before { background: var(--ok); }
.track li.now .dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(171,66,15,.2); }
.track li.todo { color: var(--muted); }
.track .t-title { font-weight: 700; } .track .t-sub { font-size: .875rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { padding-left: 14px; border-left: 3px solid var(--line-strong); }
.timeline time { display: block; font-size: .78rem; color: var(--muted); }
.big-ref { font-family: var(--display); font-size: 1.5rem; letter-spacing: .05em; color: var(--brand-dark); }
.status-pill { font-family: var(--display); font-size: .95rem; padding: 6px 14px; border-radius: 999px; background: var(--brand); color: #fff; display: inline-block; }
.price-big { font-family: var(--display); font-size: 2rem; color: var(--brand-dark); line-height: 1.1; }
.link-box { word-break: break-all; padding: 10px 12px; background: var(--soft); border-radius: var(--radius-sm); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; user-select: all; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(26,26,26,.55); display: grid; place-items: end center; padding: 0; }
.modal { background: var(--paper); width: min(100%, 560px); max-height: 92vh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
.modal-wide { width: min(100%, 860px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 18px; } .modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 8px 18px 14px; overflow: auto; }
.modal-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1 1 140px; }
.preview { display: grid; justify-items: center; gap: 10px; }
.preview canvas, .preview img { max-width: 100%; height: auto; border: 1px solid var(--line-strong); background: #fff; box-shadow: var(--shadow); }
.preview-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.toasts { position: fixed; left: 12px; right: 12px; bottom: 90px; z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--jet); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; max-width: 100%; box-shadow: var(--shadow); }
.toast-error { background: var(--bad); } .toast-ok { background: var(--ok); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; gap: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

@media (min-width: 700px) {
  .overlay { place-items: center; padding: 20px; } .modal { border-radius: 18px; }
  .page { padding-top: 24px; } h1 { font-size: 1.9rem; } .hero { padding: 32px 28px; } .hero h1 { font-size: 2.1rem; }
  .file { grid-template-columns: 96px 1fr; } .thumb { width: 96px; height: 128px; }
  .file-opts { grid-template-columns: 1fr 1fr; }
  .toasts { bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
