:root {
  /* 24 Sep 2026 redesign: paper ground, white only for the conversation, one teal accent, colour = state only */
  --ground:#F4F5F1; --panel:#FBFBF9; --card:#FFFFFF; --ink:#1A1F24; --ink-2:#4B5560; --muted:#6B737C; --faint:#8A929B;
  --line:#E6E8E3; --fill:#EEF0EA; --acc:#1D7A6C; --acc-ink:#FFFFFF; --acc-soft:#E3F1EC; --acc-text:#0F5A4E;
  --red:#B4433A; --red-soft:#F8E6E3; --amber:#A06A12; --amber-soft:#F7ECD8;
  --blue:#2F6FD6; --blue-soft:#E1EBFA; --green:#2E7D4F; --green-soft:#E3F2E8; --you:#E9F0FF;
  --shadow:0 1px 2px rgba(26,31,36,.05), 0 12px 32px rgba(26,31,36,.08);
  --sheet:0 -10px 40px rgba(26,31,36,.16);
  --renuka:#2B5C8A; --renuka-soft:#E8EFF6;
  --serif:"Instrument Serif", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:#14181C; --panel:#181D22; --card:#1E242A; --ink:#EDEFF1; --ink-2:#B7BEC6; --muted:#9AA2AB; --faint:#7F8891;
    --line:#2A3138; --fill:#242B32; --acc:#3FB39E; --acc-ink:#0B1F1B; --acc-soft:#173A33; --acc-text:#9BE0CF;
    --red:#E07A70; --red-soft:#3A2321; --amber:#E0A85A; --amber-soft:#3A2E1A;
    --blue:#6FA8FF; --blue-soft:#1E2C44; --green:#6CC48F; --green-soft:#1E3327; --you:#22304A;
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35); --sheet:0 -10px 40px rgba(0,0,0,.7);
    --renuka:#8DB6DD; --renuka-soft:#1D2733; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font: 15px/1.45 "Instrument Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 208px minmax(360px, 1fr) minmax(420px, 520px); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.shell > * { min-height: 0; }
.shell.wide { grid-template-columns: 208px 1fr; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; }
.brand { font-weight: 600; font-size: 15px; padding: 4px 10px 14px; display: flex; align-items: center; gap: 8px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px; border: 0;
  background: none; text-align: left; width: 100%; color: var(--ink); }
.nav:hover { background: var(--fill); }
.nav.on { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 500; }
.nav .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.rail .spacer { flex: 1; }
.practice { font-size: 12px; color: var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.me { border-top: 1px solid var(--line); padding: 10px; margin-top: 6px; font-size: 13px; }
.me button { border: 0; background: none; color: var(--acc); padding: 0; font-size: 13px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.chat-head { height: 52px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.chat-head h1 { font-size: 15px; font-weight: 600; margin: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 640px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--ground); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.app { align-self: flex-start; }
.msg.app p { margin: 0 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.chip:hover { border-color: var(--acc); color: var(--acc); }
.chip.acc { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.chip .id { color: var(--muted); font-size: 12px; margin-left: 6px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.q .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 2px; }
.empty { margin: auto; max-width: 520px; text-align: left; padding: 20px; }
.empty h2 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; background: var(--ground); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; min-height: 44px; max-height: 180px; outline: none; }
.composer textarea:focus { border-color: var(--acc); }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; height: 40px; padding: 0 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.primary:disabled { background: var(--fill); color: var(--faint); border-color: var(--fill); cursor: not-allowed; }
.btn.quiet { border-color: transparent; background: none; color: var(--acc); padding: 0 8px; }
.btn.sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
.typing { color: var(--muted); font-size: 13px; }

/* ---------- order card ---------- */
.card { display: flex; flex-direction: column; min-width: 0; background: var(--card); }
.card-head { padding: 12px 18px 0; border-bottom: 1px solid var(--line); }
.card-title { display: flex; align-items: baseline; gap: 8px; }
.card-title h2 { font-size: 19px; margin: 0; font-weight: 600; }
.pill { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.tabs { display: flex; gap: 18px; margin-top: 10px; }
.tab { border: 0; background: none; padding: 8px 0 10px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tab.on { color: var(--ink); border-color: var(--ink); }
.card-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; }
.sec { margin-top: 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.eyebrow .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.f { display: grid; grid-template-columns: 132px 1fr; align-items: center; min-height: 34px; gap: 8px; border-bottom: 1px solid var(--line); }
.f:last-child { border-bottom: 0; }
.f > label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: transparent; }
.dot.user { background: var(--green); }
.dot.derived { background: var(--blue); }
.dot.assumed { background: var(--amber); }
.dot.missing { background: var(--red); }
.fv { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fv input, .fv select { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 6px; width: 100%; min-width: 0; outline: none; height: 30px; }
.fv input:hover, .fv select:hover { border-color: var(--line); }
.fv input:focus, .fv select:focus { border-color: var(--acc); background: var(--card); }
.f.missing .fv input, .f.missing .fv select { border-color: var(--red); background: var(--red-soft); }
.f.missing .fv input::placeholder { color: var(--red); }
.f.assumed .fv input, .f.assumed .fv select { background: var(--amber-soft); }
.src { font-size: 12px; color: var(--amber); white-space: nowrap; }
.static { padding: 4px 6px; }
.seg { display: inline-flex; background: var(--fill); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; border-radius: 6px; padding: 3px 10px; font-size: 13px; height: 28px; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 500; }
.f.missing .seg { outline: 1px solid var(--red); background: var(--red-soft); }

.line { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 6px; margin-bottom: 10px; }
.line-head { display: flex; align-items: center; gap: 8px; }
.line-no { font-size: 13px; color: var(--muted); width: 16px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--ink); text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.code:hover { background: var(--fill); }
.why { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; margin: 6px 0; font-size: 13px; }
.why table { border-collapse: collapse; }
.why td { padding: 2px 10px 2px 0; }
.why td:first-child { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
.yield { font-size: 13px; padding: 6px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run { border-left: 2px solid var(--line); padding-left: 12px; margin: 10px 0 14px; }
.run-title { font-weight: 500; }
.steps { font-size: 13px; margin: 6px 0; }
.steps div { padding: 2px 0; }
.reel { display: grid; grid-template-columns: 1fr 86px 130px; gap: 8px; align-items: center; min-height: 34px; border-bottom: 1px solid var(--line); font-size: 14px; }
.reel input { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; height: 30px; width: 100%; background: var(--card); }
.reel.missing input { border-color: var(--red); background: var(--red-soft); }
.issue { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 14px; align-items: flex-start; }
.issue.block { background: var(--red-soft); }
.issue.warn { background: var(--amber-soft); }
.issue.info { background: var(--fill); }
.issue b { font-weight: 600; white-space: nowrap; }
.issue .acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; background: var(--card); }
.need { color: var(--red); font-size: 14px; border: 0; background: none; padding: 0; text-align: left; }
.ready { color: var(--green); font-size: 14px; }

/* ---------- Renuka view ---------- */
.rk { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rk-h { background: var(--renuka-soft); color: var(--renuka); font-weight: 600; font-size: 13px; padding: 7px 10px; display: flex; gap: 8px; }
.rk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.rk-grid div { padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rk-grid span { display: block; color: var(--muted); font-size: 12px; }
.tbl-wrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); }
table.t td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); }

/* ---------- release ---------- */
.progress { padding: 18px; }
.pstep { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; opacity: .35; transition: opacity .2s; }
.pstep.done { opacity: 1; }
.tick { width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 12px; flex: none; margin-top: 1px; }
.done-box { background: var(--green-soft); border-radius: 12px; padding: 14px; margin-top: 12px; }
.done-box h3 { margin: 0; font-size: 19px; }
pre.wa { white-space: pre-wrap; font: 13px/1.45 ui-monospace, Menlo, monospace; background: var(--fill); padding: 10px; border-radius: 8px; }

/* ---------- pages ---------- */
.page { overflow-y: auto; padding: 18px 28px 40px; }
.page h1 { font-size: 22px; margin: 4px 0 4px; font-weight: 600; }
.search { display: flex; gap: 8px; margin: 14px 0 10px; max-width: 760px; }
.search input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; background: var(--card); outline: none; }
.search input:focus { border-color: var(--acc); }
.stock-note { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-top: 6px; line-height: 1.45; }
.stock-note .dot { transform: translateY(-1px); }
.stock-note b { font-weight: 600; }
.banner { font-size: 13px; color: var(--amber); margin: 6px 0; }
.olist .item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.olist .sub { border-left: 2px solid var(--line); margin: 6px 0 0 4px; padding-left: 12px; font-size: 14px; }
.olist .sub div { padding: 2px 0; }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.who { max-width: 420px; margin: 12vh auto; padding: 24px; }
.who button { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 8px; height: 48px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }
.newcust { display: grid; gap: 8px; margin-top: 10px; max-width: 420px; }
.newcust input { border: 1px solid var(--line); border-radius: 8px; height: 38px; padding: 0 10px; background: var(--card); }

/* ---------- smaller screens ---------- */
.mob-bar, .sheet-close { display: none; }
.order-btn { display: none !important; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 60px minmax(320px, 1fr) minmax(380px, 440px); }
  .shell.wide { grid-template-columns: 60px 1fr; }
  .nav span, .brand span, .nav .cnt, .practice, .me { display: none; }
  .nav { justify-content: center; }
}
@media (max-width: 760px) {
  .shell, .shell.wide { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; padding: 6px 8px; gap: 2px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .brand, .rail .spacer, .rail .practice, .rail .me { display: none; }
  .nav { width: auto; height: 36px; padding: 0 10px; flex: none; }
  .nav span { display: inline; }
  .nav .cnt { display: inline; margin-left: 4px; }
  .chat { border-right: 0; }
  .card { position: fixed; inset: 8vh 0 0 0; border-radius: 16px 16px 0 0; box-shadow: var(--sheet); z-index: 30; transform: translateY(110%); transition: transform .25s; }
  .card.open { transform: none; }
  .sheet-close { display: inline-flex; margin-left: auto; }
  .mob-bar { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .chat-head { padding: 0 12px; }
  .msgs { padding: 14px 12px; }
  .page { padding: 12px 16px 40px; }
  .f { grid-template-columns: 112px 1fr; }
  .reel { grid-template-columns: 1fr 76px 110px; }
  .order-btn { display: inline-flex !important; align-items: center; margin-left: auto; }
}
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; margin-left: 6px; line-height: 20px; }

/* ---- WhatsApp desk: see desk.css ---- */
.wa-pi { margin-top: 10px; }
.wa-pi-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.wa-pi-row:last-of-type { border-bottom: 0; }
.wa-pi-btns { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.wa-pi-btns a.btn { text-decoration: none; }
.wa-pi-send { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.wa-pi-send textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--card); resize: vertical; }
.wa-pi-warn { display: inline-block; margin-bottom: 6px; white-space: normal; }
.wa-pi-line { display: grid; grid-template-columns: minmax(120px, 2fr) 56px 62px 62px 52px 72px 64px 60px minmax(88px, 1fr) 24px; gap: 4px; align-items: center; padding: 3px 0; font-size: 13px; }
.wa-pi-line input, .wa-pi-line select { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: var(--card); font-size: 13px; }
.wa-pi-line input:focus, .wa-pi-line select:focus { border-color: var(--acc); outline: none; }
.wa-pi-line .r { text-align: right; }
.wa-pi-head { border-bottom: 1px solid var(--line); }
.wa-pi-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.wa-pi-gst { width: 52px; height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; background: var(--card); }
.wa-pi-cust { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 6px; }
.wa-pi-cust input { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); }
.wa-pi-cust input:focus { border-color: var(--acc); outline: none; }
.wa-pi-terms { margin-top: 6px; }
.wa-pi-terms summary { cursor: pointer; }
.wa-pi-terms textarea { width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card); resize: vertical; }
@media (max-width: 760px) {
  .wa-pi-line { grid-template-columns: repeat(5, 1fr); }
  .wa-pi-head { display: none; }
  .wa-pi-cust { grid-template-columns: 1fr; }
}

/* ---- Sign in, People, Activity ---- */
.who.login { display: grid; gap: 10px; }
.login-f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login-f input, .login-f select { border: 1px solid var(--line); border-radius: 8px; height: 40px; padding: 0 10px; background: var(--card); color: var(--ink); width: 100%; }
.login-f input:focus, .login-f select:focus { border-color: var(--acc); outline: none; }
.login-err { color: var(--red); font-size: 14px; }
.person-form { display: grid; gap: 8px; max-width: 460px; margin: 10px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.person .acts { display: none; white-space: nowrap; }
.person:hover .acts, .person:focus-within .acts { display: inline-flex; }
.temp-pw { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--amber-soft); font-size: 14px; max-width: 640px; }
.temp-pw code { font-family: ui-monospace, Menlo, monospace; }
.temp-pw .pw { font-size: 20px; letter-spacing: .06em; padding: 4px 10px; background: var(--card); border-radius: 8px; }
.act-filter { border: 1px solid var(--line); border-radius: 8px; height: 34px; padding: 0 8px; background: var(--card); color: var(--ink); max-width: 220px; }
.act-row { min-height: 36px; padding: 6px 0; font-size: 14px; }
.act-when { width: 118px; white-space: nowrap; }
.act-who { width: 150px; }
.act-what { white-space: nowrap; }
.act-what.red { color: var(--red); }
.act-what.amber { color: var(--amber); }
.act-ip { width: 110px; text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
  .person .acts { display: inline-flex; }
  .act-ip { display: none; }
  .act-who { width: 100px; }
  .act-when { width: 92px; }
}
