:root {
  --ink: #23272B; --ink-2: #4A4C4F; --muted: #6B6D70; --line: #E3DDCC; --line-2: #EFEBE0;
  --cream: #F4F1E8; --cell: #FAF8F2; --paper: #FFFFFF; --gold: #B0984E; --gold-ink: #7A6420; --gold-lt: #D9C07A;
  --side: #1B1E21; --side-2: #2C3036; --side-text: #C9C5B9; --side-mute: #8C8A83;
  --blue: #2F5D8A; --blue-bg: #E6EEF6; --green: #2F5A37; --green-bg: #E3EDDF; --amber: #7A5A12; --amber-bg: #F4ECDA;
  --red: #9B3B32; --red-bg: #F6E3DF; --grey-bg: #EFEBE0;
  --serif: 'Newsreader', Georgia, serif; --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --side-w: 244px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.flip svg { transform: scaleX(-1); } .flip { display: inline-flex; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--gold-ink); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.dim { color: #8E8C85; } .small { margin: 0; font-size: 13px; } .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.od { color: var(--red); font-weight: 600; } .soon { color: var(--amber); font-weight: 600; }

.app { display: flex; min-height: 100vh; }
/* ---------- sidebar ---------- */
.sidebar { width: var(--side-w); flex-shrink: 0; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 22px 12px 12px; position: sticky; top: 0; height: 100vh; z-index: 40; }
.logo { width: 108px; height: auto; margin: 0 0 16px 12px; display: block; }
.gsearch input { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--side-2); background: var(--side-2); color: #fff; padding: 0 12px; font-size: 13px; outline: 0; margin-bottom: 10px; }
.gsearch input::placeholder { color: var(--side-mute); }
.nav-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--side-2) transparent; margin: 0 -4px; padding: 0 4px; }
.nav-sec { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--side-mute); padding: 14px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 13.5px; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.nav-item svg { width: 17px; height: 17px; stroke: var(--side-mute); }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-item.active { background: var(--side-2); color: #fff; font-weight: 600; }
.nav-item.active svg { stroke: var(--gold-lt); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--side-2); margin-top: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--gold); color: var(--side); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.me-text #me-name { color: #fff; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--side-mute); font-size: 11.5px; }
.link { background: none; border: 0; padding: 0; color: var(--side-mute); font-size: 12px; text-align: left; cursor: pointer; }
.link:hover { color: #fff; }
.mnav, .menu-scrim { display: none; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 26px 32px 60px; }
.view { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.main.wide .view { max-width: none; }
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.topbar, .rec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 16px; flex-wrap: wrap; }
.rec-head { align-items: flex-start; }
.rec-head > .btn.ghost { margin-top: 4px; }
.rec-head .title-block { flex: 1; min-width: 220px; }
.title-block .badge { margin-top: 6px; margin-right: 6px; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; color: var(--gold-ink); font-weight: 600; }
h1 { margin: 2px 0 0; font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.01em; line-height: 1.15; }
.intro { margin: -6px 0 0; color: var(--ink-2); font-size: 14px; max-width: 760px; line-height: 1.5; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; width: 300px; max-width: 100%; color: var(--muted); }
.search.wide { width: 100%; }
.search.big { width: 520px; height: 48px; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 14px; color: var(--ink); background: transparent; }
.select select { height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 10px; font-size: 14px; max-width: 220px; }
.btn { height: 42px; min-width: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.sm { height: 34px; min-width: 34px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark svg { stroke: var(--gold-lt); }
.btn.ghost { padding: 0; }
.btn.ghost-t { border-color: transparent; background: none; color: var(--red); }
.btn.on { background: var(--green-bg); border-color: #BCD3B7; color: var(--green); }
.btn.bad { background: var(--red-bg); border-color: #E3BFB8; color: var(--red); }
.btn:hover { border-color: #CFC6AE; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold-ink); text-decoration: underline; cursor: pointer; font-size: 13px; }
.linkbtn:hover { color: var(--ink); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 9px; background: var(--amber-bg); color: var(--amber); margin-left: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 12px; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center; text-decoration: none; }
.tab .n { font-size: 12px; min-width: 20px; padding: 1px 6px; border-radius: 9px; background: var(--grey-bg); color: var(--ink-2); text-align: center; }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab[aria-selected="true"] .n { background: var(--ink); color: #fff; }
.tabs.hub { margin-top: -4px; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 11px; white-space: nowrap; background: var(--grey-bg); color: var(--ink-2); }
.t-blue { background: var(--blue-bg); color: var(--blue); } .t-amber { background: var(--amber-bg); color: var(--amber); }
.t-green { background: var(--green-bg); color: var(--green); } .t-red { background: var(--red-bg); color: var(--red); } .t-grey { background: var(--grey-bg); color: var(--ink-2); }

/* ---------- project list (keeps its own columns) ---------- */
.list { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: 150px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr) 110px 110px; gap: 12px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; text-decoration: none; color: var(--ink); }
.row:hover { background: #FBF7EC; }
.row.head { background: var(--cell); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.row.head:hover { background: var(--cell); }
.row:last-child { border-bottom: 0; }
.ref, .c-ref { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pname { font-weight: 600; }
.row.empty:hover { background: none; }
/* ---------- generic register list ---------- */
.grid-row { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--line-2); background: none; width: 100%; text-align: left; font-size: 14px; cursor: pointer; color: var(--ink); }
.grid-row:hover { background: #FBF7EC; }
.grid-row.head { cursor: default; background: var(--cell); font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.grid-row.head:hover { background: var(--cell); }
.grid-row.empty { cursor: default; display: block; }
.grid-row.archived { opacity: .55; }
.grid-row:last-child { border-bottom: 0; }
.gc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gc.first { font-weight: 600; }
.gc.c-ref.first { font-weight: 500; }
.grid-row.mk { grid-template-columns: 170px minmax(0,1fr) auto auto auto; cursor: default; }
.updated { margin: 0; font-size: 12px; color: var(--muted); }
.arch { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- record page ---------- */
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.rec-main, .rec-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rec-side { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.sec h3, .panel h3, .dw-legend h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sec-h h3 { margin: 0; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; margin: 0; background: var(--paper); }
.kv dt { background: var(--cell); padding: 10px 12px; color: var(--ink-2); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.kv dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 18px; padding: 7px 12px; font-size: 13px; cursor: pointer; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--gold); }
.note { background: var(--cell); border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.mini { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); font-size: 13.5px; background: none; width: 100%; text-align: left; cursor: pointer; }
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: #FBF7EC; }
.mini-row > .ellip { flex: 1; }
.mini-c { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.act { padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; line-height: 1.45; }
.act:last-child { border-bottom: 0; }
.act.money { border-left: 3px solid var(--gold); padding-left: 8px; }
.day-sep { margin: 14px 0 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.doc { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.doc b { display: block; } .doc span { color: var(--muted); }
.life { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.life i { height: 6px; border-radius: 3px; background: var(--line); } .life i.on { background: var(--gold); }
.life-l { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.life-l b { color: var(--ink); }
.ptab-body { display: flex; flex-direction: column; gap: 18px; }
.warnbox { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; font: inherit; }
.tile:hover { border-color: #CFC6AE; }
.tile-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile-v { font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; }
.tile-v.sm { font-size: 22px; }
.tile-s { font-size: 12.5px; color: var(--muted); }
.tile.t-red { border-color: #E8C9C2; background: #FDF6F4; } .tile.t-red .tile-v { color: var(--red); }
.tile.t-amber { border-color: #EAD9B4; background: #FDFAF2; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-cols > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.attn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 9px; text-decoration: none; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.attn svg { transform: scaleX(-1); width: 15px; height: 15px; }
.notice { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.notice b { display: block; font-size: 14px; }
.notice.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--gold); margin-right: 6px; vertical-align: middle; }
.job { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.job-t { font-weight: 700; font-size: 13px; width: 94px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.job-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar { display: grid; grid-template-columns: 200px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.bar-t { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; } .bar-t i { display: block; height: 100%; background: var(--gold); }

/* ---------- diary ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-height: 360px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.day.bank { background: var(--cell); }
.day-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 2px 4px 6px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.day-h span { color: var(--muted); }
.hol { font-size: 12px; background: var(--grey-bg); border-radius: 7px; padding: 5px 7px; color: var(--ink-2); }
.jb { display: flex; flex-direction: column; gap: 1px; border-radius: 9px; padding: 7px 8px; text-decoration: none; font-size: 12.5px; border-left: 3px solid currentColor; }
.jb b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jb-t { font-weight: 700; } .jb-s { color: var(--ink-2); opacity: .85; }
.jb.clash { box-shadow: 0 0 0 2px var(--red) inset; }
.jb-w { color: var(--red); font-weight: 700; font-size: 11.5px; }
.add-day { margin-top: auto; border: 1px dashed var(--line); background: none; border-radius: 8px; height: 30px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.add-day:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- service desk ---------- */
.call-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.call-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.site-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.st-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; background: var(--paper); }
.st-card.t-green { background: var(--green-bg); border-color: #BCD3B7; } .st-card.t-amber { background: var(--amber-bg); border-color: #EAD9B4; }
.guide { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.guide summary { cursor: pointer; }
.steps { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; margin: 8px 0; }
.outcomes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn.out-green { background: var(--green-bg); border-color: #BCD3B7; color: var(--green); }
.btn.out-amber { background: var(--amber-bg); border-color: #EAD9B4; color: var(--amber); }

/* ---------- forms and drawers ---------- */
.scrim { position: fixed; inset: 0; background: rgba(27,30,33,.3); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 540px; max-width: 100%; background: var(--paper); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(35,39,43,.1);
  overflow-y: auto; z-index: 51; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; outline: 0; }
.drawer.wide { width: 100%; padding: 0; gap: 0; background: var(--cream); }
.d-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d-head-t { flex: 1; min-width: 0; }
.d-ref { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.d-title { margin: 4px 0 6px; font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.15; }
.close { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld input, .fld select, .fld textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 9px 11px; font-size: 15px; min-height: 42px; }
.fld textarea { resize: vertical; line-height: 1.45; }
.fld.chk { justify-content: flex-end; }
.fld.chk label { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 42px; }
.fld.chk input, .tick input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.fld.err input, .fld.err select, .fld.err textarea { border-color: var(--red); background: #FFF8F6; }
.hint { font-size: 12px; color: var(--muted); }
.multi { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mc { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 400 !important; }
.form-bar { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -40px; background: var(--paper); padding: 12px 0 4px; border-top: 1px solid var(--line-2); margin-top: auto; }
.restored { font-size: 12.5px; background: var(--amber-bg); color: var(--amber); padding: 8px 10px; border-radius: 8px; }
.tick { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.chk-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.chk-row > span { flex: 1; }
.chk-row.pass > span { color: var(--green); } .chk-row.fail > span { color: var(--red); font-weight: 600; }
canvas.sig { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; }
.qtable { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.qrow { display: grid; grid-template-columns: 130px minmax(0,1fr) 60px 100px 110px 70px; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); width: 100%; background: none; text-align: left; font-size: 13.5px; cursor: pointer; align-items: center; }
.qrow.head { background: var(--cell); font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: default; }
.qrow.total { cursor: default; background: var(--cell); }

/* ---------- toast, sync ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 100; transition: .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.sync { position: fixed; right: 16px; bottom: 16px; z-index: 60; border: 0; border-radius: 20px; padding: 9px 14px; background: var(--amber-bg); color: var(--amber); font-weight: 700; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.12); cursor: pointer; }
.sync.bad { background: var(--red); color: #fff; }

.card-msg { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 560px; }
.card-msg h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 24px; }
.card-msg p { margin: 0 0 16px; line-height: 1.5; color: var(--ink-2); }
.card-msg.err { border-color: #E8C9C2; }
.skel { height: 48px; border-bottom: 1px solid var(--line-2); background: linear-gradient(90deg, #fff 0, #F7F4EC 50%, #fff 100%); background-size: 200% 100%; animation: sh 1.2s infinite; }
.skel-page { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 60px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- files and viewer ---------- */
.drawer.files, .drawer.viewer { display: flex; flex-direction: column; }
.drawer.viewer { background: var(--side); }
.f-head, .v-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--line); padding-top: max(14px, env(safe-area-inset-top)); flex-shrink: 0; }
.f-title { flex: 1; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 15px; }
.crumbs b { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.crumb { background: none; border: 0; padding: 2px 0; color: var(--gold-ink); cursor: pointer; font-size: 14px; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--muted); }
.f-tools { padding: 14px 24px 0; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.f-tools .search { width: 360px; }
.f-prog { font-size: 13px; color: var(--gold-ink); font-weight: 600; }
.f-list { margin: 14px 24px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.f-list.drop { outline: 3px dashed var(--gold); outline-offset: -8px; }
.f-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 130px 90px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--line-2); background: none; cursor: pointer; font-size: 14px; }
.f-row:hover { background: #FBF7EC; }
.f-row:last-child { border-bottom: 0; }
.f-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.f-meta { font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-row .f-meta { display: none; }
.f-date, .f-size { font-size: 13px; color: var(--muted); } .f-size { text-align: right; }
.fk { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; background: var(--grey-bg); color: var(--ink-2); }
.fk-folder { background: #F3EDDC; color: var(--gold-ink); } .fk-folder svg { width: 22px; height: 22px; }
.fk-pdf { background: var(--red-bg); color: var(--red); } .fk-img { background: var(--green-bg); color: var(--green); }
.fk-doc, .fk-dwg { background: var(--blue-bg); color: var(--blue); } .fk-xls { background: #E2EFE6; color: #2B6B45; }
.fk-ppt, .fk-vid { background: var(--amber-bg); color: var(--amber); }
.f-empty { padding: 36px 24px; text-align: center; color: var(--ink-2); }
.f-empty p { margin: 0 0 14px; }
.v-head { background: var(--side); border-bottom-color: var(--side-2); color: #fff; }
.v-head .close { background: var(--side-2); border-color: var(--side-2); color: #fff; }
.v-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-title b { font-size: 15px; }
.v-title .f-meta { color: var(--side-mute); }
.v-acts { display: flex; gap: 8px; align-items: center; }
.v-acts .btn { background: var(--side-2); border-color: var(--side-2); color: #fff; }
.v-acts .btn svg { stroke: var(--gold-lt); }
.v-acts .dim { color: var(--side-mute); }
.v-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.v-body .f-empty { color: var(--side-text); }
.v-wait { color: var(--side-mute); font-size: 14px; }
.v-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.v-img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- drawings ---------- */
.drawer.drawing { background: var(--side); display: flex; flex-direction: column; }
.dw-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px; background: var(--side-2); flex-shrink: 0; }
.dw-tools .btn { background: var(--side); border-color: var(--side); color: #fff; }
.dw-tools .btn.on { background: var(--gold); border-color: var(--gold); color: var(--side); }
.dw-sym { display: flex; align-items: center; gap: 6px; margin-left: 8px; } .dw-sym .dim { color: var(--side-mute); }
.dw-sym input { height: 34px; border-radius: 8px; border: 0; padding: 0 10px; width: 150px; }
.dw-cols { display: flex; gap: 4px; margin-left: 4px; }
.dw-col { width: 24px; height: 24px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.dw-col.on { border-color: #fff; }
.dw-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.dw-stage { overflow: auto; padding: 12px; background: #3A3E44; }
.dw-wrap { position: relative; display: inline-block; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,.3); }
.dw-canvas { display: block; }
.dw-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; }
.dw-wrap.placing .dw-svg { cursor: crosshair; }
.dw-svg .mk { cursor: pointer; }
.dw-legend { background: var(--paper); padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dw-lg { display: flex; align-items: center; gap: 8px; font-size: 13.5px; } .dw-lg span { flex: 1; }
.dot { width: 12px; height: 12px; border-radius: 6px; display: inline-block; }
.dw-status { padding: 8px 16px; color: var(--side-text); font-size: 13px; background: var(--side); flex-shrink: 0; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .rec-grid { grid-template-columns: minmax(0, 1fr); }
  .rec-side { position: static; max-height: none; }
  .week { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
  .dash-cols, .call-grid { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- phone ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s; width: 280px; padding-top: max(22px, env(safe-area-inset-top)); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .menu-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--side); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .mnav .nav-item { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 4px; width: auto; flex: 1; align-items: center; }
  .mnav .nav-item svg { width: 21px; height: 21px; }
  .main { padding: 16px 14px 90px; padding-top: max(16px, env(safe-area-inset-top)); }
  h1 { font-size: 26px; }
  .tools { width: 100%; }
  .search { flex: 1; width: auto; } .search.big { width: 100%; }
  .row.head, .grid-row.head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name badge" "ref ref" "client client"; gap: 4px 10px; padding: 13px 14px; }
  .row .c-ref { grid-area: ref; } .row .c-name { grid-area: name; } .row .c-status { grid-area: badge; }
  .row .c-client { grid-area: client; color: var(--ink-2); font-size: 13px; }
  .row .c-site, .row .c-sector { display: none; }
  .grid-row { grid-template-columns: minmax(0, 1fr) auto !important; gap: 3px 10px; padding: 12px 14px; }
  .grid-row .gc { grid-column: 1; font-size: 13px; color: var(--ink-2); }
  .grid-row .gc.first { font-size: 14.5px; color: var(--ink); }
  .grid-row .gc:nth-child(n+4) { display: none; }
  .grid-row .gc:last-child { display: block; grid-column: 2; grid-row: 1; }
  .grid-row.mk { grid-template-columns: 1fr !important; }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
  .drawer { width: 100%; border-left: 0; padding: 16px 14px 40px; padding-top: max(16px, env(safe-area-inset-top)); }
  .drawer.wide { padding: 0; }
  .form { grid-template-columns: 1fr; }
  .f-head, .v-head { padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
  .crumbs b { font-size: 19px; }
  .f-tools { padding: 12px 14px 0; } .f-tools .search { width: 100%; }
  .f-list { margin: 12px 14px 14px; }
  .f-row { grid-template-columns: 40px minmax(0, 1fr); padding: 11px 14px; }
  .f-row .f-meta { display: block; }
  .c-hide { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-v { font-size: 28px; }
  .dw-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .dw-legend { max-height: 30vh; }
  .dw-sym input { width: 110px; }
  .qrow { grid-template-columns: minmax(0,1fr) 50px 90px; } .qrow > :nth-child(1), .qrow > :nth-child(4), .qrow > :nth-child(6) { display: none; }
  .bar { grid-template-columns: 110px 1fr 50px; }
  .sync { bottom: 80px; }
  .toast { bottom: 84px; }
}

/* ---------- people picker ---------- */
.pp { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 5px 8px; min-height: 42px; }
.pp:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.pp input { border: 0 !important; outline: 0; flex: 1; min-width: 120px; padding: 4px 2px !important; min-height: 30px !important; font-size: 15px; background: transparent; }
.pp-chips { display: contents; }
.pp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--grey-bg); border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 600; }
.pp-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 5px; color: var(--muted); }
.pp-menu { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 5; overflow: hidden; }
.pp-opt { display: flex; flex-direction: column; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.pp-opt span { font-size: 12.5px; color: var(--muted); }
.pp-opt.on, .pp-opt:hover { background: #FBF7EC; }

/* ---------- sandbox ---------- */
.sandbox-bar { position: sticky; top: 0; z-index: 70; background: #9B3B32; color: #fff; text-align: center; font-weight: 700; font-size: 13px; padding: 7px 12px; letter-spacing: .02em; }
.sandbox-bar a { color: #fff; }
body.sandbox .sidebar { border-top: 4px solid #9B3B32; }

/* ---------- hours ---------- */
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.hday { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.hday.today { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.hday.t-saturday, .hday.t-bank { background: #FDFAF2; } .hday.t-sunday { background: #FDF6F4; }
.hday-h { display: flex; align-items: center; gap: 8px; } .hday-h b { flex: 1; } .hday-tot { font-weight: 700; }
.hjob, .hrow { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.hjob > .ellip, .hrow > .ellip { flex: 1; }
.hchoice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hbreak { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { font-size: 12px; background: var(--grey-bg); border-radius: 10px; padding: 3px 8px; font-weight: 600; }

/* ---------- welcome ---------- */
.wl-hero { background: var(--side); color: #fff; border-radius: 18px; padding: 34px 36px 30px; position: relative; overflow: hidden; }
.wl-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(217,192,122,.25); box-shadow: 0 0 0 40px rgba(217,192,122,.05), 0 0 0 80px rgba(217,192,122,.03); }
.wl-logo { width: 120px; display: block; margin-bottom: 26px; }
.wl-eyebrow { margin: 0; font-size: 12px; letter-spacing: .14em; color: var(--gold-lt); font-weight: 700; }
.wl-title { margin: 6px 0 10px; font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.15; color: #fff; max-width: 720px; }
.wl-lead { margin: 0; color: var(--side-text); font-size: 15.5px; line-height: 1.55; max-width: 640px; }
.wl-prog { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-size: 13px; color: var(--side-text); font-weight: 600; }
.wl-bar { width: 220px; height: 8px; background: var(--side-2); border-radius: 4px; overflow: hidden; } .wl-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.wl-h { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 24px; }
.wl-steps, .wl-how, .wl-rules, .wl-help { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.wl-step { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.wl-step:first-of-type { border-top: 0; }
.wl-num { width: 34px; height: 34px; border-radius: 17px; background: var(--cream); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.wl-step.is-done .wl-num { background: var(--green-bg); border-color: #BCD3B7; color: var(--green); }
.wl-step-b { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; } .wl-step-b span { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.wl-step.is-done .wl-step-b b { color: var(--muted); }
.wl-done { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 700; font-size: 13px; }
.wl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wl-tile { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--cell); }
.wl-tile:hover { border-color: var(--gold); }
.wl-tile span:last-child { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.wl-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--side); display: flex; align-items: center; justify-content: center; } .wl-ic svg { stroke: var(--gold-lt); }
.wl-rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; font-size: 14.5px; line-height: 1.5; }
.wl-help { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; } .wl-help p { margin: 0; color: var(--ink-2); max-width: 560px; }
.wl-help-b { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .wl-hero { padding: 24px 20px; border-radius: 14px; } .wl-title { font-size: 28px; } .wl-bar { width: 140px; }
  .wl-steps, .wl-how, .wl-rules, .wl-help { padding: 18px 16px; }
  .wl-step { flex-wrap: wrap; } .wl-step .btn, .wl-done { margin-left: 48px; }
}

/* ---- roles & access ---- */
.preview-bar { position: sticky; top: 0; z-index: 71; background: #1F4E79; color: #fff; text-align: center; font-weight: 600; font-size: 13px; padding: 8px 12px; }
.preview-bar .linkbtn { color: #fff; text-decoration: underline; font-weight: 700; }
.feat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.feat { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); cursor: pointer; }
.feat input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--ink); }
.feat > span { display: flex; flex-direction: column; gap: 2px; }
.feat.from-role { background: var(--cell); cursor: default; }
.feat-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-ink); background: #F3EBD2; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.feat-tag.extra { color: #1F4E79; background: #E3ECF5; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- tutorials ---- */
.tt-block { position: fixed; inset: 0; z-index: 9000; background: transparent; }
.tt-hole { position: fixed; z-index: 9001; border-radius: 10px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 9999px rgba(20,22,25,.55); pointer-events: none; transition: left .3s, top .3s, width .3s, height .3s; }
.tt-cursor { position: fixed; left: 0; top: 0; z-index: 9002; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(176,152,78,.45); border: 2px solid #fff; display: none; transition: transform .45s ease; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.tt-cursor.tap { background: rgba(176,152,78,.9); }
.tt-card { position: fixed; z-index: 9003; width: 380px; max-width: calc(100vw - 32px); background: var(--paper); color: var(--ink); border-radius: 14px; padding: 14px 16px 12px; box-shadow: 0 16px 48px rgba(0,0,0,.35); transition: left .3s, top .3s; }
.tt-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tt-card.dock { left: 12px !important; right: 12px; top: auto !important; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; max-width: none; }
.tt-card.dock.dock-top { top: max(12px, env(safe-area-inset-top)) !important; bottom: auto; }
.tt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tt-count { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--gold-ink); }
.tt-x { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.tt-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.tt-say { margin: 6px 0 10px; font-size: 15px; line-height: 1.5; }
.tt-bar { height: 3px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.tt-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.tt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tt-dots { display: flex; gap: 4px; }
.tt-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tt-dots i.done { background: var(--gold-lt); } .tt-dots i.on { background: var(--gold); width: 16px; border-radius: 3px; }
.tt-btns { display: flex; gap: 6px; }
.tt-btns .btn { height: 36px; }
.tt-pause { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; }
.tt-typing { box-shadow: 0 0 0 2px var(--gold) inset; }
.btn svg[viewBox] { flex-shrink: 0; }
.tt-watch .tt-watch-l { font-size: 13px; }
@media (max-width: 700px) { .tt-watch .tt-watch-l { display: none; } }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tt-item { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tt-item p { margin: 0; }
.tt-item-h { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; font-size: 15px; }
.tt-item-b { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tt-item-b .btn { height: 36px; }
.tt-progress { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.practice-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 45; width: min(720px, calc(100% - 24px)); background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.practice-bar b { color: var(--gold-lt); letter-spacing: .06em; font-size: 12px; }
.practice-bar .btn { height: 34px; }
.practice-bar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }
.practice-bar .linkbtn { color: #fff; }
@media (max-width: 900px) { .practice-bar { bottom: calc(70px + env(safe-area-inset-bottom)); } }

/* ---- defects import ---- */
.di-pick { position: relative; overflow: hidden; align-self: flex-start; cursor: pointer; }
.di-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.di-body { display: flex; flex-direction: column; gap: 12px; }
.di-sum { margin: 0; font-size: 14px; }
.di-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.di-row { display: grid; grid-template-columns: 24px minmax(0,1fr) minmax(200px, 300px); gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.di-row:first-child { border-top: 0; }
.di-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.di-row.dup { opacity: .55; }
.di-row.need { background: #FBF1EF; }
.di-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.di-main .small { overflow-wrap: anywhere; }
.di-proj { display: flex; align-items: center; gap: 6px; }
.di-proj select { width: 100%; max-width: none; }
.di-opts { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 700px) { .di-row { grid-template-columns: 24px minmax(0,1fr); } .di-proj { grid-column: 2; } }
.drawer.di-drawer { width: 880px; }

/* ---- my to-dos ---- */
.td-add { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.td-add-row { display: flex; gap: 8px; }
.td-input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 15px; background: var(--cell); color: var(--ink); }
.td-input:focus { outline: 2px solid var(--gold); outline-offset: -1px; background: var(--paper); }
.td-mic { gap: 8px; }
.td-mic-i { width: 10px; height: 16px; border: 2px solid currentColor; border-radius: 6px; position: relative; box-sizing: border-box; }
.td-mic-i::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 2px; height: 4px; background: currentColor; transform: translateX(-50%); }
.td-mic.on { background: #9B3B32; border-color: #9B3B32; color: #fff; }
.td-mic.on .td-mic-i { animation: tdpulse 1s infinite; }
@keyframes tdpulse { 50% { opacity: .35; } }
.td-preview { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.td-preview:empty { display: none; }
.td-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; background: #F3EBD2; color: var(--gold-ink); border-radius: 8px; padding: 3px 8px; }
.td-chip.dim { background: var(--line-2); color: var(--muted); font-weight: 500; }
.td-chip svg, .td-meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.td-group { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.td-group h3 { margin: 0; padding: 10px 14px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.td-group h3.err { color: #9B3B32; }
.td-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.td-group h3 + .td-row, .td-dash .td-row:first-of-type { border-top: 0; }
.td-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.td-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.td-title { font-size: 15px; overflow-wrap: anywhere; }
.td-row.done .td-title { text-decoration: line-through; color: var(--muted); }
.td-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.td-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.td-acts { display: flex; gap: 4px; }
.td-acts .btn { height: 34px; }
.td-dash { gap: 8px; }
.td-dash .td-row { padding: 8px 2px; }
.td-badge { margin-left: auto; background: #9B3B32; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.td-empty { margin: 4px 2px; }
@media (max-width: 700px) { .td-mic-l { display: none; } .td-add-row .btn.dark { padding: 0 12px; } .td-row { grid-template-columns: 24px minmax(0,1fr); } .td-acts { grid-column: 2; } }
.td-mail { display: inline-flex; align-items: center; gap: 4px; }
