/* Fonts are part of the app, so it looks the same without signal. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 400; font-display: swap; src: url(fonts/noto-sans-devanagari-devanagari-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 500; font-display: swap; src: url(fonts/noto-sans-devanagari-devanagari-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 600; font-display: swap; src: url(fonts/noto-sans-devanagari-devanagari-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #ECEEE9;
  --frame: #F6F7F3;
  --surface: #FFFFFF;
  --surface-2: #EEF0EA;
  --ink: #15171A;
  --muted: #5D625B;
  --line: #D7DAD2;
  --accent: #0D6B4F;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEEE6;
  --good: #1E7B45;   --good-soft: #E1F3E7;
  --work: #1D5FA8;   --work-soft: #E0ECFA;
  --warn: #9A5700;   --warn-soft: #FCEDD2;
  --bad: #B42318;    --bad-soft: #FDE4E1;
  --na: #6B6F68;     --na-soft: #ECEDEA;
  --shadow: 0 1px 2px rgba(20, 24, 20, .06), 0 8px 24px rgba(20, 24, 20, .06);
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", "Noto Sans Devanagari", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0D0C; --frame: #111412; --surface: #191C1A; --surface-2: #222623;
    --ink: #EBEEEA; --muted: #9CA39D; --line: #2F3430;
    --accent: #4CC49A; --accent-ink: #07130E; --accent-soft: #173A2D;
    --good: #7FD49D; --good-soft: #1B3324; --work: #8DB8F0; --work-soft: #1A2B40;
    --warn: #F0B55A; --warn-soft: #3A2C12; --bad: #F2877B; --bad-soft: #3E1D1A;
    --na: #9CA39D; --na-soft: #252926;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D0C; --frame: #111412; --surface: #191C1A; --surface-2: #222623;
  --ink: #EBEEEA; --muted: #9CA39D; --line: #2F3430;
  --accent: #4CC49A; --accent-ink: #07130E; --accent-soft: #173A2D;
  --good: #7FD49D; --good-soft: #1B3324; --work: #8DB8F0; --work-soft: #1A2B40;
  --warn: #F0B55A; --warn-soft: #3A2C12; --bad: #F2877B; --bad-soft: #3E1D1A;
  --na: #9CA39D; --na-soft: #252926;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.phone { max-width: 440px; margin: 0 auto; min-height: 100%; background: var(--frame); display: flex; flex-direction: column; position: relative; }
@media (min-width: 520px) { .phone { margin-block: 20px; min-height: calc(100% - 40px); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); } }

.demo { background: var(--ink); color: var(--frame); font-size: 12px; padding: 6px 16px; text-align: center; }

.top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.top h1 { font-size: 20px; margin: 0; font-weight: 600; flex: 1; text-wrap: balance; }
.top .sub { color: var(--muted); font-size: 13px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 20px; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); display: inline-block; }

.net { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; min-height: 36px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.net.off i { background: var(--warn); }

.content { flex: 1; overflow-y: auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 10px 8px; border-radius: 9px; font-weight: 500; font-size: 14px; color: var(--muted); min-height: 44px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; margin-inline-start: 4px; }

.search { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; min-height: 48px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-align: start; width: 100%; }
button.card:active { background: var(--surface-2); }
.card .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.job { font-family: var(--mono); font-size: 13px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.overdue, .pill.urgent { background: var(--bad-soft); color: var(--bad); }
.pill.due { background: var(--warn-soft); color: var(--warn); }
.pill.planned { background: var(--surface-2); color: var(--muted); }
.pill.sent { background: var(--good-soft); color: var(--good); }
.pill.waiting { background: var(--warn-soft); color: var(--warn); }
.stripe { border-inline-start: 4px solid var(--bad); }
.stripe.due { border-inline-start-color: var(--warn); }
.stripe.planned { border-inline-start-color: var(--line); }

.btn { border: 0; border-radius: 14px; min-height: 52px; padding: 12px 18px; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }

.nav { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav button { border: 0; background: none; padding: 10px 4px 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; }
.nav button span.ic { font-size: 20px; line-height: 1; }
.nav button[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* report */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 16px 8px; }
.steps div { height: 4px; border-radius: 4px; background: var(--line); }
.steps div.on { background: var(--accent); }
.steplabel { padding: 0 16px 8px; color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; min-height: 44px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.units { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.unit { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 14px; min-height: 48px; font-family: var(--mono); font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.unit[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.unit small { font-family: var(--font); color: var(--muted); font-size: 12px; }
.unit.done small { color: var(--good); }

.group h4 { margin: 8px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.item + .item { margin-top: 6px; }
.item .name { display: flex; gap: 8px; align-items: baseline; font-weight: 500; }
.item .ref { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 30px; direction: ltr; unicode-bidi: isolate; }
.marks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mark { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-height: 44px; font-size: 13px; font-weight: 500; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.mark b { font-size: 16px; }
.mark[aria-pressed="true"].good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.mark[aria-pressed="true"].work { background: var(--work-soft); border-color: var(--work); color: var(--work); }
.mark[aria-pressed="true"].check { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.mark[aria-pressed="true"].na { background: var(--na-soft); border-color: var(--na); color: var(--na); }
.item textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px; min-height: 60px; width: 100%; }
.item.needs textarea { border-color: var(--bad); }
.item.missing { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.req { color: var(--bad); }
.btn.blocked { opacity: .55; }
.field textarea.bad, .photos.bad .add { border-color: var(--bad); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar .btn { min-height: 44px; font-size: 14px; padding: 8px 14px; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos img, .photos .add { aspect-ratio: 1; width: 100%; max-width: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.photos .add { display: grid; place-items: center; background: var(--surface); color: var(--accent); font-weight: 600; font-size: 14px; text-align: center; padding: 6px; position: relative; }
.photos .add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.toggle { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.note { font-size: 13px; color: var(--muted); }
.warnbox { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }

.footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; }
.footer .btn { flex: 1; }

.done { text-align: center; align-items: center; padding-top: 32px; }
.done .big { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: var(--good-soft); color: var(--good); }
.done.q .big { background: var(--warn-soft); color: var(--warn); }
.done h2 { margin: 8px 0 0; font-size: 22px; }

.langs { display: grid; gap: 8px; }
.lang { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 16px; min-height: 56px; font-size: 17px; }
.lang[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.lang small { color: var(--muted); font-size: 13px; }

.codebox { font-family: var(--mono); letter-spacing: .5em; text-align: center; font-size: 22px; }
.brandmark { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 22px; }


/* working app */
body { margin: 0; }
.grow { flex: 1; }
.clip { min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start { text-align: start; }
.content.center { align-items: center; justify-content: center; text-align: center; padding-top: 48px; }
.content.login { padding-top: 28px; }
h1.big { margin: 8px 0 4px; font-size: 26px; }
.lead { margin: 0; font-size: 15px; max-width: 34ch; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.note { margin: 0; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.pill.work { background: var(--work-soft); color: var(--work); }
.notice { display: flex; align-items: center; gap: 8px; justify-content: space-between; background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 14px; font-weight: 500; }
.notice button { border: 0; background: none; color: inherit; min-width: 44px; min-height: 36px; }
.card.draft { border-color: var(--warn); background: var(--warn-soft); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.picklist { display: flex; flex-direction: column; gap: 6px; }
.pick { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; text-align: start; min-height: 48px; }
.field textarea.short { min-height: 64px; }
.photos .ph { position: relative; }
.photos .ph img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.photos .rm { position: absolute; top: 4px; inset-inline-end: 4px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done .note { max-width: 32ch; }
.btn.danger { background: var(--bad); color: #fff; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 440px; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.sheet p { margin: 0; font-size: 17px; font-weight: 500; }
.sheet .toolbar .btn { flex: 1; }
.pdfpages img { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
a.btn { text-decoration: none; }
.applogo { width: 200px; max-width: 70%; background: #fff; border-radius: 14px; padding: 10px 14px; border: 1px solid var(--line); }
