/* Request Desk: one phone-first stylesheet for the owner app, the customer status page and the request form.
   Light and calm for daytime use in a shop; one signal orange for the main action, semantic colors for status. */
:root {
  --bg: #F3EFE7; --card: #FFFFFF; --ink: #0E1012; --muted: #5A564F; --line: rgba(14, 16, 18, 0.12); --line-2: rgba(14, 16, 18, 0.22);
  --signal: #FF5B1F; --signal-hot: #FF7440; --on-signal: #0E1012; --dark: #0E1012; --on-dark: #F3EFE7;
  --new: #B4430F; --new-bg: #FFE7DC; --ok: #1D6B42; --ok-bg: #DDF0E4; --wait: #7A5A00; --wait-bg: #FBEFC9; --bad: #A8261B; --bad-bg: #FBE3E0; --info: #24508F; --info-bg: #E1EAF7;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r: 14px; color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
p, h1, h2, h3, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 6rem max(16px, env(safe-area-inset-left, 0px)); }
.label { font: 500 0.72rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-bar { background: var(--dark); color: var(--on-dark); text-align: center; padding: 0.55rem 1rem; font: 500 0.75rem/1.4 var(--mono); letter-spacing: 0.05em; }
.demo-bar b { color: var(--signal); font-weight: 500; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: rgba(243, 239, 231, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 44rem; margin: 0 auto; display: flex; align-items: center; gap: 0.75rem; min-height: 3.6rem; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.top h1 { font-size: 1.1rem; font-weight: 600; margin-right: auto; display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.top h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--signal); flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--card); }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 0.4rem 0.65rem; font: 500 0.75rem/1 var(--mono); cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.icon-btn { white-space: nowrap; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 0.45rem 0.8rem; font-size: 0.85rem; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0 1.2rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn-main { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-main:hover { background: var(--signal-hot); border-color: var(--signal-hot); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-bad { color: var(--bad); border-color: rgba(168, 38, 27, 0.35); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-row .btn { flex: 1 1 8rem; }

/* Cards and lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; }
.stack { display: grid; gap: 1rem; }
.section-title { margin: 1.5rem 0 0.6rem; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 1.1rem; }
.count { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 0.8rem; display: grid; gap: 0.15rem; }
.count b { font: 500 1.8rem/1 var(--mono); }
.count.hot b { color: var(--new); }
.count .label { font-size: 0.66rem; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 0.4rem; overflow-x: auto; margin: 1.1rem 0 0.75rem; scrollbar-width: none; }
.tabs button { flex: none; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 0.5rem 0.9rem; font-size: 0.9rem; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.list { display: grid; gap: 0.5rem; }
.item { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 0.95rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.75rem; cursor: pointer; }
.item:hover { border-color: var(--line-2); }
.item .who { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .what { color: var(--muted); font-size: 0.92rem; grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { grid-column: 1 / -1; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--r); }

.pill { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.7rem/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 0.35rem 0.55rem; border-radius: 999px; white-space: nowrap; align-self: start; }
.pill::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.s-new, .s-accepted { color: var(--new); background: var(--new-bg); }
.s-approved, .s-done { color: var(--ok); background: var(--ok-bg); }
.s-quoted { color: var(--wait); background: var(--wait-bg); }
.s-in_progress, .s-ready { color: var(--info); background: var(--info-bg); }
.s-declined, .s-rejected { color: var(--bad); background: var(--bad-bg); }
.lang-tag { font: 500 0.7rem/1 var(--mono); border: 1px solid var(--line-2); border-radius: 4px; padding: 0.25rem 0.35rem; }

/* Detail */
.back { border: 0; background: transparent; padding: 0.9rem 0 0.4rem; font-weight: 600; cursor: pointer; }
.head-row { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.head-row h2 { font-size: 1.6rem; line-height: 1.15; }
.facts { display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.copy { margin-left: 0.4rem; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; font-size: 0.75rem; padding: 0.15rem 0.5rem; cursor: pointer; }
.quote-msg { background: var(--bg); border-radius: 10px; padding: 0.8rem; white-space: pre-wrap; font-size: 0.95rem; }
.choices { display: grid; gap: 0.5rem; }
.field { display: grid; gap: 0.35rem; }
.field label, .field legend { font-weight: 600; font-size: 0.92rem; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 10px; padding: 0.75rem 0.85rem; background: #fff; }
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 91, 31, 0.35); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.radio { display: flex; gap: 0.6rem; align-items: start; padding: 0.65rem 0.75rem; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--ink); background: #FFF6F1; }
.radio input { margin-top: 0.25rem; accent-color: var(--signal); }
.preview { border-left: 3px solid var(--signal); padding: 0.75rem 0.9rem; background: var(--bg); border-radius: 0 10px 10px 0; display: grid; gap: 0.4rem; }
.preview pre { margin: 0; white-space: pre-wrap; font: 400 0.9rem/1.5 var(--sans); }
.preview .subj { font-weight: 600; }
.timeline { display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline li::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink); margin-top: 0.4rem; }
.timeline li.priv::before { background: transparent; border: 1.5px solid var(--muted); }
.timeline .when { color: var(--muted); font: 400 0.78rem/1.4 var(--mono); white-space: nowrap; }
.timeline .n { display: block; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(40rem, calc(100% - 2rem)); background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 0.9rem 1rem; z-index: 20; display: grid; gap: 0.5rem; box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6); }
.toast .btn { min-height: 2.4rem; background: transparent; color: var(--bg); border-color: rgba(243,239,231,0.35); }
.err { color: var(--bad); font-weight: 600; }
.note { color: var(--muted); font-size: 0.9rem; }

/* Login */
.login { min-height: calc(100vh - 3rem); display: grid; place-items: center; padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px)); }
.login .card { width: min(26rem, 100%); padding: 1.6rem; display: grid; gap: 1rem; }
.login h1 { font-size: 1.6rem; line-height: 1.15; }
.code-input { font: 500 1.4rem/1 var(--mono) !important; letter-spacing: 0.35em; text-align: center; }

/* Customer status page */
.status-hero { padding: 2rem 0 1rem; display: grid; gap: 0.6rem; }
.status-hero h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); line-height: 1.1; }
.steps { display: grid; gap: 0; margin: 0.5rem 0; }
.steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.75rem; padding: 0.7rem 0; position: relative; color: var(--muted); }
.steps li::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card); margin-top: 0.15rem; z-index: 1; }
.steps li::after { content: ""; position: absolute; left: calc(0.5rem - 1px); top: 1.5rem; bottom: -0.6rem; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on::before { background: var(--ink); border-color: var(--ink); }
.steps li.now::before { background: var(--signal); border-color: var(--signal); }
.big-amount { font: 500 2.2rem/1 var(--mono); }
.footnote { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 2rem; }

@media (max-width: 420px) { .two { grid-template-columns: minmax(0, 1fr); } .facts div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.hp { position: absolute; left: -9999px; }

/* Sign-in extras: "create or reset password" link and the "link sent" message */
.link-btn { justify-self: center; background: none; border: 0; padding: 0.35rem 0.25rem; font: 500 0.92rem/1.3 var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.ok-note { color: var(--ok); font-weight: 600; }
