/* Mutaba'a | مُتابَعة — black and orange, four colour modes. Fonts self-hosted (SIL OFL). */
@font-face { font-family: 'Familjen Grotesk'; src: url(fonts/familjen-grotesk.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Familjen Grotesk'; src: url(fonts/familjen-grotesk-ext.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/plex-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/plex-mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url(fonts/plex-arabic-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url(fonts/plex-arabic-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }

.m-noir{--bg:#0B0B0C;--card:#151517;--line:#2A2A2E;--chip:#222225;--ink:#F4F1EC;--muted:#A3A09A;--accent:#FF6A13;--accent-ink:#0B0B0C;--soft:rgba(255,106,19,.16);--atext:#FF8A45;--btn:#FF6A13;--btn-ink:#0B0B0C;--hi:#FF6A13;--hi-ink:#0B0B0C;--hi-muted:#3A1A05;--hi-tile:rgba(0,0,0,.12);--hi-line:transparent;--bar1:#F4F1EC;--bar2:#5A5754;--scrim:rgba(0,0,0,.65);--s-bg:#000000;--s-ink:#F4F1EC;--s-muted:#9C9993;--s-tile:rgba(255,255,255,.06);--s-act:#FF6A13;--s-act-ink:#0B0B0C}
.m-ivory{--bg:#F6F4F0;--card:#FFFFFF;--line:#E4E0D8;--chip:#F0EDE7;--ink:#111111;--muted:#5E5A54;--accent:#F25C05;--accent-ink:#111111;--soft:rgba(242,92,5,.12);--atext:#B04000;--btn:#111111;--btn-ink:#FFFFFF;--hi:#111111;--hi-ink:#F6F4F0;--hi-muted:#B5B0A8;--hi-tile:rgba(255,255,255,.08);--hi-line:transparent;--bar1:#111111;--bar2:#C9C4BB;--scrim:rgba(17,17,17,.5);--s-bg:#111111;--s-ink:#F6F4F0;--s-muted:#A19D96;--s-tile:rgba(255,255,255,.07);--s-act:#FF6A13;--s-act-ink:#111111}
.m-ember{--bg:#120A05;--card:#1E130B;--line:#3A2616;--chip:#2C1C10;--ink:#FFF3E8;--muted:#C4A992;--accent:#FF7A1A;--accent-ink:#120A05;--soft:rgba(255,122,26,.18);--atext:#FF9A52;--btn:#FF7A1A;--btn-ink:#120A05;--hi:#2C1C10;--hi-ink:#FFF3E8;--hi-muted:#C4A992;--hi-tile:rgba(255,122,26,.12);--hi-line:#FF7A1A;--bar1:#FFF3E8;--bar2:#6B4A31;--scrim:rgba(0,0,0,.65);--s-bg:#0A0603;--s-ink:#FFF3E8;--s-muted:#B89B84;--s-tile:rgba(255,122,26,.10);--s-act:#FF7A1A;--s-act-ink:#120A05}
.m-orange{--bg:#FFF1E6;--card:#FFFFFF;--line:#F2D9C4;--chip:#FFE6D3;--ink:#111111;--muted:#5C4636;--accent:#FF6A13;--accent-ink:#111111;--soft:rgba(255,106,19,.16);--atext:#A63C00;--btn:#111111;--btn-ink:#FFF1E6;--hi:#111111;--hi-ink:#FFF1E6;--hi-muted:#C9B4A3;--hi-tile:rgba(255,255,255,.08);--hi-line:transparent;--bar1:#111111;--bar2:#F5B98F;--scrim:rgba(17,17,17,.5);--s-bg:#FF6A13;--s-ink:#111111;--s-muted:#3A1A05;--s-tile:rgba(0,0,0,.10);--s-act:#111111;--s-act-ink:#FF9A5C}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: 'Familjen Grotesk', 'IBM Plex Sans Arabic', system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--atext); } a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.ar { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.muted { color: var(--muted); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--s-bg); color: var(--s-ink); padding: 28px 18px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: inherit; text-decoration: none; }
.brand .mark { width: 40px; height: 40px; border-radius: 11px; background: var(--s-act); display: grid; place-items: center; flex: none; }
.brand .mark svg path { stroke: var(--s-act-ink); }
.brand b { display: block; font-weight: 600; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.brand span { font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 14px; color: var(--s-muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--s-ink); text-decoration: none; transition: background .15s; }
.nav a:hover { background: var(--s-tile); color: var(--s-ink); }
.nav a[aria-current="page"] { background: var(--s-act); color: var(--s-act-ink); font-weight: 600; }
.nav .count { font-family: 'IBM Plex Mono', monospace; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--s-act); color: var(--s-act-ink); font-weight: 500; }
.nav a[aria-current="page"] .count { background: var(--s-act-ink); color: var(--s-act); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.side-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .06em; color: var(--s-muted); padding: 0 6px; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.modes button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--s-ink); font-size: 13px; cursor: pointer; }
.modes button[aria-pressed="true"] { border-color: var(--s-act); background: var(--s-tile); }
.sw { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid rgba(128,128,128,.5); }
.sw-noir { background: linear-gradient(135deg, #000 50%, #FF6A13 50%); } .sw-ivory { background: linear-gradient(135deg, #F6F4F0 50%, #FF6A13 50%); }
.sw-ember { background: linear-gradient(135deg, #24170E 50%, #FF7A1A 50%); } .sw-orange { background: linear-gradient(135deg, #FF6A13 50%, #111 50%); }
.who { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--s-tile); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--s-act); color: var(--s-act-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.who small { display: block; color: var(--s-muted); font-size: 12px; }
.side .link { background: none; border: 0; color: var(--s-muted); text-align: left; padding: 0 12px; min-height: 36px; cursor: pointer; font-size: 14px; }
.topbar { display: none; }
.main { flex: 1; min-width: 0; padding: 32px 40px 24px; display: flex; flex-direction: column; gap: 22px; }
.copy { margin-top: auto; padding-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }

/* type and blocks */
h1 { margin: 0; font-size: 40px; font-weight: 500; letter-spacing: -.035em; line-height: 1.06; }
h2 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.date { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hi { background: var(--hi); color: var(--hi-ink); border-color: var(--hi-line); }
.hi .tile { background: var(--hi-tile); color: var(--hi-ink); }
.hi .tile small { color: var(--hi-muted); }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 8px; text-decoration: none; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.c-main { flex: 3 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.c-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { gap: 4px; }
.kpi .n { font-size: 40px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.kpi .n.warn { color: var(--atext); }
.kpi small { color: var(--muted); font-size: 13px; }
.empty { padding: 22px 6px; color: var(--muted); }
.note { padding: 12px 14px; border-radius: 8px; background: var(--soft); font-size: 14px; line-height: 1.5; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .1s ease, filter .15s ease; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); color: var(--btn-ink); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { color: var(--ink); background: var(--chip); }
.btn.danger { background: transparent; color: var(--atext); border-color: var(--atext); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { position: relative; width: 44px; height: 44px; padding: 0; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: 'IBM Plex Mono', monospace; font-size: 11px; display: grid; place-items: center; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 14px; transition: transform .1s; }
.pill:active { transform: scale(.97); }
.pill[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-weight: 600; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.in, select.in, textarea.in { min-height: 46px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 400; width: 100%; }
textarea.in { padding: 12px; line-height: 1.5; resize: vertical; min-height: 110px; }
.in.bad { border-color: var(--accent); }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.hint.bad { color: var(--atext); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--muted); width: 260px; max-width: 100%; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }

/* chips */
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.st-new { background: var(--chip); color: var(--ink); } .st-prog { background: var(--soft); color: var(--atext); }
.st-review { box-shadow: inset 0 0 0 1px var(--atext); color: var(--atext); } .st-done { background: var(--chip); color: var(--muted); }
.st-late, .pr-high { background: var(--accent); color: var(--accent-ink); } .pr-normal { background: var(--chip); color: var(--ink); }
.pr-low { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* task table */
.table-wrap { overflow-x: auto; }
.trow { display: grid; grid-template-columns: 2.6fr 1.3fr 1fr .8fr 1fr; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; min-width: 760px; transition: background .15s; }
a.trow:hover { background: var(--chip); color: var(--ink); }
.trow.th { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); padding: 8px 12px; }
.trow b { font-weight: 600; display: block; }
.trow small { color: var(--muted); font-size: 12px; }
.late-txt { color: var(--atext); font-weight: 500; }

/* lift on hover */
.lift { transition: transform .15s ease; } .lift:hover { transform: translateY(-2px); }

/* board */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; min-width: 1040px; }
.col { background: var(--chip); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 560px; transition: box-shadow .15s; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.col-head h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-new { background: var(--muted); } .dot-prog { background: var(--accent); } .dot-review { background: var(--atext); } .dot-done { background: var(--ink); }
.kcard { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; color: var(--ink); cursor: grab; }
.kcard:hover { color: var(--ink); }
.kcard .t { font-size: 15px; font-weight: 600; line-height: 1.35; }
.kcard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.bar { height: 5px; border-radius: 999px; background: var(--chip); overflow: hidden; display: block; }
.kcard .bar { background: var(--bg); }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; }
.bar.full > span { background: var(--ink); }

/* calendar */
.cal { min-width: 840px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-days span { padding: 12px 14px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.cell { min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--card); min-width: 0; }
.cell.we { background: var(--bg); }
.cell .num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }
.cell.today .num { align-self: flex-start; padding: 2px 7px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); }
.ev { display: block; font-size: 12px; padding: 5px 7px; border-radius: 6px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--chip); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.ev.high, .ev.late { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 600; }
.ev.done { color: var(--muted); box-shadow: none; text-decoration: line-through; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* task page */
.steps-list { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 10px; }
.step .check { flex: 1; }
.step.done span.txt { color: var(--muted); text-decoration: line-through; }
.x { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.x:hover { background: var(--chip); color: var(--ink); }
.row-in { display: flex; gap: 10px; flex-wrap: wrap; }
.row-in .in { flex: 1 1 260px; width: auto; }
.comment { display: flex; gap: 12px; }
.comment .avatar { background: var(--ink); color: var(--bg); width: 36px; height: 36px; font-size: 12px; }
.comment .body { display: flex; flex-direction: column; gap: 3px; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.file { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px 0 12px; border-radius: 8px; background: var(--chip); color: var(--ink); font-size: 14px; }
.file a { color: var(--ink); text-decoration: none; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file a:hover { text-decoration: underline; }
.ext { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 3px 6px; text-transform: uppercase; }
.drop { border: 1px dashed var(--muted); border-radius: 12px; padding: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--soft); }
.up { display: flex; flex-direction: column; gap: 6px; }
.up small { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }
.details { margin: 0; white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }

/* reports */
.drow { display: grid; grid-template-columns: 180px 1fr 48px; gap: 12px; align-items: center; font-size: 14px; }
.stack { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--chip); }
.stack span { display: block; height: 100%; width: 0; border-radius: 3px; }
.s1 { background: var(--bar1); } .s2 { background: var(--bar2); } .s3 { background: var(--accent); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 400; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.print-head { display: none; }

/* accounts */
.urow { display: grid; grid-template-columns: 1.6fr 1.1fr 1.6fr 1.6fr .9fr auto; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 900px; }
.urow.th { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); padding: 8px 12px; }
.urow .mono { font-size: 12px; overflow-wrap: anywhere; }
.urow.off { opacity: .55; }
.log { display: flex; flex-direction: column; font-size: 13px; max-height: 420px; overflow-y: auto; }
.log div { padding: 8px 4px; border-bottom: 1px solid var(--line); }

/* alerts panel */
.panel { position: fixed; top: 76px; right: 24px; width: 380px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; z-index: 30; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.panel a, .panel div.al { display: block; padding: 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.panel a:hover { background: var(--chip); color: var(--ink); }
.panel .unread { box-shadow: inset 3px 0 0 var(--accent); }
.panel small { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }

/* dialogs, done mark, toast */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; animation: fade .15s ease; }
.dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 28px; width: 460px; max-width: 100%; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog.wide { width: 560px; }
.dialog h2 { font-size: 24px; }
.dialog p { margin: 0; color: var(--muted); line-height: 1.5; }
.dialog .acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.donebox { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 100%; }
.donebox svg { animation: pop .45s ease-out; }
.donebox path { stroke-dasharray: 40; animation: draw .5s .2s ease-out both; }
.donebox b { font-size: 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: calc(100vw - 32px); animation: fade .2s ease; }
.toast.err { background: var(--accent); color: var(--accent-ink); }
.busy { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 70; width: 30%; animation: busy 1s ease-in-out infinite; }
@keyframes busy { 0% { left: -30%; } 100% { left: 100%; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main > * { animation: enter .3s ease both; }

/* sign-in */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 20px; }
.auth .brand b { font-size: 26px; }
.auth .brand .mark { width: 48px; height: 48px; background: var(--accent); }
.auth .brand .mark svg path { stroke: var(--accent-ink); }
.auth .brand span { color: var(--muted); }
.auth form { width: 420px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.auth h1 { font-size: 30px; }
.auth .modes button { color: var(--ink); }
.auth .modes button[aria-pressed="true"] { border-color: var(--accent); background: var(--chip); }
.auth .modes { grid-template-columns: repeat(4, auto); }

/* phone */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { display: none; position: fixed; inset: 0; width: auto; height: auto; z-index: 40; }
  .side.open { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--s-bg); color: var(--s-ink); position: sticky; top: 0; z-index: 20; }
  .topbar .brand b { font-size: 18px; } .topbar .brand .mark { width: 34px; height: 34px; }
  .topbar .btn { background: transparent; color: var(--s-ink); border-color: var(--s-muted); }
  .main { padding: 20px 16px; }
  h1 { font-size: 30px; }
  .search { width: 100%; }
  .panel { top: 64px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* printed reports: no menu, no buttons, no copyright line */
@media print {
  .side, .topbar, .tools, .copy, .no-print, #layer { display: none !important; }
  html, body, .m-noir, .m-ember, .m-ivory, .m-orange { --bg:#fff; --card:#fff; --ink:#111; --muted:#444; --line:#ccc; --chip:#eee; --bar1:#111; --bar2:#bbb; --accent:#F25C05; --atext:#B04000; background: #fff; color: #111; }
  .main { padding: 0; }
  .main > * { animation: none; }
  .print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #F25C05; padding-bottom: 10px; }
  .card { break-inside: avoid; border-color: #ccc; }
  .stack span, .lg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* small pieces */
.hi p { margin: 0; line-height: 1.5; }
.hi .sub { color: var(--hi-muted); }
.card .tile { color: var(--ink); }
.card .tile:hover { background: var(--chip); color: var(--ink); }
.hi .tile:hover { background: var(--hi-tile); color: var(--hi-ink); }
.hi .hi-muted { color: var(--hi-muted); }
.f-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.f-set legend { margin-bottom: 8px; padding: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details[open] { display: flex; flex-direction: column; gap: 10px; }
.acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.trow .chip, .kcard .chip { justify-self: start; }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; } .kpi .n { font-size: 30px; }
  .trow { min-width: 0; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .trow > span:first-child { grid-column: 1 / -1; }
  .trow.th { display: none; }
  .tools .btn { flex: 1 1 auto; }
}
