/* VS Wear HQ. Tokens follow the China Trip Notebook (black and amber, Jost and Barlow, owner 28 Oct 2026). */
@font-face { font-family: "Barlow"; src: url(/fonts/Barlow-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/Barlow-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/Barlow-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/Barlow-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jost"; src: url(/fonts/Jost-700.woff2) format("woff2"); font-weight: 500 800; font-display: swap; }

:root {
  --bg: #f4f5f3; --card: #ffffff; --ink: #141715; --muted: #5f6661; --line: #dde2dd; --hover: #eceeeb;
  --accent: #f59e0b; --accent-wash: #fdf3e1; --on-accent: #14161a; --accent-ink: #b45309;
  --ok: #1d7a3e; --ok-wash: #e3f2e8; --warn: #9a6200; --warn-wash: #fbf0d9; --bad: #b3261e; --bad-wash: #fbe6e4;
  --side: #101211; --side-ink: #eef1ee; --side-muted: #98a09a; --side-line: #262b28; --side-hover: #1d211f;
  --display: "Jost", "Century Gothic", Arial, sans-serif; --body: "Barlow", Arial, sans-serif;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --tabs-h: 64px; --add-h: 56px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101211; --card: #1a1d1b; --ink: #eef1ee; --muted: #9aa29c; --line: #2c312e; --hover: #222624;
    --accent-wash: #33260c; --accent-ink: #f8b84a; --ok: #5fd18a; --ok-wash: #143222; --warn: #f2b54b; --warn-wash: #3a2c10;
    --bad: #ff8a80; --bad-wash: #3d1714; --side: #0b0c0b; --side-line: #1f2321; --side-hover: #171a18;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101211; --card: #1a1d1b; --ink: #eef1ee; --muted: #9aa29c; --line: #2c312e; --hover: #222624;
  --accent-wash: #33260c; --accent-ink: #f8b84a; --ok: #5fd18a; --ok-wash: #143222; --warn: #f2b54b; --warn-wash: #3a2c10;
  --bad: #ff8a80; --bad-wash: #3d1714; --side: #0b0c0b; --side-line: #1f2321; --side-hover: #171a18;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd { font: 600 11px var(--body); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .6; }
.link { background: none; border: 0; color: var(--accent-ink); font-weight: 600; padding: 8px; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 14px; font-weight: 600; min-height: 44px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.btn.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100dvh; }
.app.with-detail { grid-template-columns: 248px minmax(0, 1fr) minmax(360px, 440px); }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 16px 12px; gap: 8px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font: 700 20px var(--display); letter-spacing: .04em; }
.brand .mono { height: 26px; }
.brand span { color: var(--accent); }
.side-search { display: flex; align-items: center; gap: 8px; background: var(--side-hover); border: 1px solid var(--side-line); color: var(--side-muted); border-radius: 10px; padding: 9px 12px; text-align: left; }
.side-search kbd { margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; overflow: auto; }
.nav button { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--side-ink); padding: 10px 12px; border-radius: 10px; text-align: left; font-weight: 500; }
.nav button:hover { background: var(--side-hover); }
.nav button[aria-current="page"] { background: var(--side-hover); box-shadow: inset 3px 0 0 var(--accent); }
.nav .n { margin-left: auto; color: var(--side-muted); font-size: 14px; }
.nav .n.hot { color: var(--accent); font-weight: 700; }
.nav .ico, .tabs .ico { width: 22px; text-align: center; font-size: 17px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.side-foot .link { color: var(--side-muted); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; padding: 28px 32px 12px; gap: 12px; }
.top h1 { font: 700 30px/1.1 var(--display); margin: 0; letter-spacing: .01em; }
.sub { margin: 4px 0 0; color: var(--muted); }
.top-r { display: flex; align-items: center; gap: 4px; }
.icon-btn { background: none; border: 0; width: 44px; height: 44px; border-radius: 22px; font-size: 22px; }
.search-bar { display: flex; gap: 8px; padding: 0 32px 8px; }
.search-bar input { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.list { flex: 1; overflow: auto; padding: 4px 24px 24px; outline: none; }

.sync { background: none; border: 0; color: var(--side-muted); font-size: 13px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--ok); flex: none; }
.sync.wait::before { background: var(--accent); }
.sync.off::before { background: var(--muted); }
.sync.err::before { background: var(--bad); }
.top .sync { color: var(--muted); }

/* ---------- add bar ---------- */
.add { display: flex; align-items: center; gap: 8px; margin: 0 24px 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 6px 4px 14px; box-shadow: var(--shadow); }
.add-plus { color: var(--accent); font: 700 24px var(--display); }
.add input { flex: 1; border: 0; background: none; padding: 12px 4px; min-height: 44px; outline: none; }
.add-go { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 700; min-height: 40px; }
.add-hint { margin: 0 32px 14px; font-size: 13px; color: var(--muted); min-height: 18px; }

/* ---------- sections and rows ---------- */
.sec { margin: 18px 0 6px; }
.sec-h { display: flex; align-items: center; gap: 8px; background: none; border: 0; width: 100%; padding: 6px 8px; color: var(--muted); font: 700 13px var(--body); text-transform: uppercase; letter-spacing: .08em; text-align: left; }
.sec-h .c { font-weight: 600; }
.sec-h .chev { margin-left: auto; transition: transform .15s; }
.sec.closed .chev { transform: rotate(-90deg); }
.sec.closed .rows { display: none; }
.rows { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: flex-start; gap: 4px; background: var(--card); border-radius: 10px; padding: 2px 10px 2px 2px; min-height: 52px; border: 1px solid transparent; cursor: default; }
.row:hover { border-color: var(--line); }
.row.sel { border-color: var(--accent); }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.check { flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.check i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; transition: background .12s, border-color .12s; }
.check:hover i { border-color: var(--accent); }
.check.on i, .row.done .check i { background: var(--accent); border-color: var(--accent); }
.check.on i::after, .row.done .check i::after { content: "✓"; color: var(--on-accent); font-weight: 700; font-size: 14px; }
.check.sq i { border-radius: 6px; }
.body { flex: 1; min-width: 0; padding: 12px 0 10px; cursor: pointer; }
.t { display: block; overflow-wrap: anywhere; }
.row.prog .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.meta .late { color: var(--bad); font-weight: 600; }
.meta .soon { color: var(--accent-ink); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.chip.amber { background: var(--accent-wash); color: var(--accent-ink); }
.chip.red { background: var(--bad-wash); color: var(--bad); }
.chip.green { background: var(--ok-wash); color: var(--ok); }
.star { flex: none; background: none; border: 0; width: 40px; height: 48px; color: var(--muted); font-size: 18px; opacity: .45; }
.star.on { color: var(--accent); opacity: 1; }
.row:hover .star { opacity: 1; }

/* order card */
.order { flex-direction: column; align-items: stretch; padding: 10px 14px 12px; gap: 6px; cursor: pointer; }
.order-top { display: flex; align-items: baseline; gap: 10px; }
.order-ref { font: 700 15px var(--display); color: var(--accent-ink); }
.order-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bar { height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; display: flex; gap: 2px; }
.bar b { flex: 1; background: var(--line); }
.bar b.on { background: var(--accent); }
.next { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.next .check { width: 40px; height: 40px; }
.next .lbl { font-size: 15px; }
.next .lbl small { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* summary card on Today */
.card-note { background: var(--card); border-radius: var(--r); padding: 14px 16px; border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; cursor: pointer; }
.card-note b { font-weight: 700; }
.card-note .go { margin-left: auto; color: var(--accent-ink); font-weight: 700; }
.empty { color: var(--muted); padding: 18px 10px; }
.empty b { color: var(--ink); }
.banner { background: var(--accent-wash); color: var(--ink); border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin: 8px 0; }
.more { background: none; border: 0; color: var(--accent-ink); font-weight: 600; padding: 12px 8px; }
.day-h { margin: 18px 8px 6px; font: 700 13px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- detail ---------- */
.detail { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.d-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 0; }
.d-head .sp { flex: 1; }
.d-scroll { overflow: auto; padding: 4px 20px 32px; flex: 1; }
.d-title { display: flex; gap: 4px; align-items: flex-start; margin-left: -12px; }
.d-title textarea { flex: 1; border: 0; background: none; resize: none; font: 600 21px/1.3 var(--display); padding: 10px 4px; outline: none; field-sizing: content; min-height: 48px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.d-tags a { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.d-actions input[type=date] { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 8px; min-height: 36px; }
.d-sec { margin: 18px 0 6px; font: 700 13px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: flex-start; gap: 2px; margin-left: -12px; border-radius: 8px; }
.step:hover { background: var(--hover); }
.step .check { width: 44px; height: 44px; }
.step .check i { width: 20px; height: 20px; }
.step .st { flex: 1; padding: 11px 0 8px; overflow-wrap: anywhere; }
.step.done .st > span:first-child { text-decoration: line-through; color: var(--muted); }
.step .when { display: block; font-size: 12px; color: var(--muted); }
.step .x { background: none; border: 0; color: var(--muted); width: 36px; height: 44px; opacity: 0; }
.step:hover .x, .step:focus-within .x { opacity: 1; }
.inline-add { display: flex; gap: 6px; margin-top: 4px; }
.inline-add input, .d-notes, .log-add input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
.d-notes { resize: vertical; min-height: 90px; font: inherit; line-height: 1.45; field-sizing: content; }
.log { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.log li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 14px; }
.log time { color: var(--muted); font-size: 12px; padding-top: 2px; }
.log .by { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-right: 6px; }
.log-add { display: flex; gap: 6px; }
.d-foot { color: var(--muted); font-size: 13px; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.prog-text { white-space: pre-wrap; line-height: 1.5; }
.copybox { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }

/* settings */
.settings { max-width: 640px; }
.settings h2 { font: 700 18px var(--display); margin: 24px 0 8px; }
.settings p { color: var(--muted); }
.tpl-row { display: flex; gap: 6px; margin-bottom: 6px; }
.tpl-row input { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px; min-height: 44px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #141715; color: #eef1ee; border-radius: 12px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 50; max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 8px 10px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; background: #101211; padding: 16px; }
.login-card { width: min(360px, 100%); background: #1a1d1b; color: #eef1ee; border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.login-mono { height: 40px; align-self: flex-start; }
.login h1 { font: 700 24px var(--display); margin: 6px 0 10px; }
.login label { font-weight: 600; font-size: 14px; color: #c9cfca; }
.login input { border: 1px solid #2c312e; background: #101211; color: #eef1ee; border-radius: 10px; padding: 12px; min-height: 48px; }
.login-err { color: #ff8a80; min-height: 20px; margin: 0; }
.login-note { color: #98a09a; font-size: 13px; margin: 0; }

.tabs { display: none; }
.only-phone { display: none; }

/* ---------- phone ---------- */
@media (max-width: 899px) {
  .app, .app.with-detail { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
  .side { display: none; }
  .only-phone { display: inline-flex; }
  .top { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
  .top h1 { font-size: 26px; }
  .search-bar { padding: 0 16px 8px; }
  .list { padding: 0 8px calc(var(--tabs-h) + var(--add-h) + 40px + var(--safe-b)); overflow: visible; }
  .add { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabs-h) + 8px + var(--safe-b)); margin: 0; z-index: 10; }
  .add-hint { position: fixed; left: 20px; right: 20px; bottom: calc(var(--tabs-h) + var(--add-h) + 14px + var(--safe-b)); margin: 0; z-index: 10; pointer-events: none; }
  .add-hint:empty { display: none; }
  .add-hint:not(:empty) { background: var(--card); border-radius: 8px; padding: 4px 8px; box-shadow: var(--shadow); }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--side); z-index: 11; }
  .tabs button { flex: 1; background: none; border: 0; color: var(--side-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; position: relative; }
  .tabs button[aria-current="page"] { color: var(--accent); }
  .tabs .badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 18px; padding: 0 5px; line-height: 18px; }
  .detail { position: fixed; inset: 0; z-index: 30; border-left: 0; padding-top: env(safe-area-inset-top, 0px); }
  .d-scroll { padding: 4px 16px calc(40px + var(--safe-b)); }
  .row .star { display: none; }
  .row.important .t::before { content: "★ "; color: var(--accent); }
  .toast { bottom: calc(var(--tabs-h) + var(--add-h) + 20px + var(--safe-b)); }
  .log li { grid-template-columns: 78px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 29 Oct 2026: Waiting on you by what to do, Quick answers, customer on order cards */
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 8px 4px; scrollbar-width: none; }
.filters .btn { flex: none; }
.filters .c, .btn .c { color: var(--muted); font-weight: 600; margin-left: 2px; }
.sec-hint { margin: 0 8px 6px; font-size: 13px; }
.row.qa { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
.row.qa .body { padding: 0; }
.row.qa .t { font-weight: 600; }
.qa-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-opts .btn { min-height: 40px; }
.btn.ghost { border-style: dashed; color: var(--muted); }
.more-link { color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.prog-ask { margin: 2px 0 8px; font-weight: 600; }
.cust { margin-bottom: 8px; }
.cust-who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.cust-who span { color: var(--muted); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.on-crm { font-size: 12px; color: var(--ok); font-weight: 600; white-space: nowrap; }

/* 29 Oct 2026: Tell a folder, and folder replies */
.instr { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.instr-h { font-weight: 700; }
.instr textarea { border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 10px; padding: 10px 12px; font: inherit; line-height: 1.45; resize: vertical; min-height: 64px; field-sizing: content; }
.instr-row { display: flex; gap: 8px; }
.instr select { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 10px; padding: 8px 10px; min-height: 44px; font: inherit; }
.instr .sub { margin: 0; font-size: 13px; }
.reply { margin-top: 6px; font-size: 14px; line-height: 1.4; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.reply.muted { color: var(--muted); background: none; padding: 0; }
.log .by.to { color: var(--muted); }
