/* Per-screen styles for the daftar prototype. Tokens and components are in app.css. */

/* Today: one ranked queue */
.q-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; padding: 16px 24px; }
.q-row .t { font-size: 15px; color: var(--midnight); font-weight: 500; }
.q-row .s { font-size: 13px; color: var(--lucid); margin-top: 2px; }
.q-row .r { display: flex; align-items: center; gap: 8px; }
.hero-n { font: 500 44px/1.1 var(--inter); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-n small { font: 400 15px/1.3 var(--inter); letter-spacing: 0; color: var(--ash); margin-left: 8px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--lucid); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 4px; background: var(--c); display: inline-block; box-shadow: inset 0 0 0 1px rgba(173, 173, 173, .32); }
.card.dark .legend { color: var(--ash); }
.act { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.act + .act { border-top: 1px solid var(--line); }
.act .w { font-size: 14px; color: var(--night); }
.act .w b { font-weight: 500; color: var(--midnight); }
.act .w small { display: block; color: var(--lucid); font-size: 12px; margin-top: 2px; }

/* Compliance matrix */
.month-h { display: flex; align-items: baseline; gap: 12px; margin: 32px 0 12px; }
.month-h:first-child { margin-top: 0; }
.month-h h2 { font-size: 18px; }
.cm { display: grid; grid-template-columns: 1fr 112px 56px 200px 96px; gap: 24px; align-items: center; padding: 16px 24px; }
.cm.h { padding: 12px 24px; font-size: 12px; color: var(--lucid); font-weight: 500; }
.cm .t { font-weight: 500; color: var(--midnight); display: flex; align-items: center; gap: 12px; }
.cm .p { font-size: 13px; color: var(--lucid); }
.cm .ext { font-size: 12px; color: var(--lucid); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.cm .ext s { color: var(--ash); }
.cm .n { font-variant-numeric: tabular-nums; color: var(--midnight); font-weight: 500; }
.cm .n small { color: var(--lucid); font-weight: 400; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Task list and board */
.tr { display: grid; grid-template-columns: 24px 1fr 180px 112px 120px 32px 40px; gap: 16px; align-items: center; padding: 12px 24px; }
.tr.h { padding: 12px 24px; font-size: 12px; color: var(--lucid); font-weight: 500; }
.tr .t { font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .c { font-size: 13px; color: var(--lucid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .kd { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lucid); white-space: nowrap; overflow: hidden; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-bottom: 16px; align-items: start; }
.col-more { font-size: 12px; color: var(--lucid); padding: 12px 8px 4px; }
.col { background: rgba(255, 255, 255, .5); border-radius: 16px; padding: 8px; min-height: 320px; transition: background .16s var(--ease), box-shadow .16s var(--ease); border: 1px solid transparent; }
.col.over { background: var(--white); border-color: var(--line-strong); }
.col-h { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--midnight); }
.col-h .col-n { margin-left: auto; color: var(--lucid); font-weight: 400; font-variant-numeric: tabular-nums; }
.col-b { display: flex; flex-direction: column; gap: 8px; min-height: 64px; }
.kcard { background: var(--white); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: grab; border: 1px solid var(--line); transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease); }
.kcard:hover { border-color: var(--line-strong); box-shadow: 0 4px 16px rgba(33, 33, 33, .06); }
.kcard.lift { opacity: .6; transform: rotate(1deg); }
.kcard.dropped { animation: drop .4s var(--ease); }
@keyframes drop { from { transform: translateY(-8px); opacity: .4; } }
.kcard .t { font-size: 14px; font-weight: 500; color: var(--midnight); line-height: 1.35; }
.kcard .c { font-size: 12px; color: var(--lucid); display: flex; align-items: center; gap: 8px; }
.kcard .f { display: flex; align-items: center; gap: 8px; }
.kcard .f .av { margin-left: auto; }
.kcard .chip { height: 20px; font-size: 11px; padding: 0 8px; }
.kcard .bar { margin-top: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dh { font-size: 12px; font-weight: 500; color: var(--lucid); padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.cal .d { min-height: 112px; min-width: 0; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); display: flex; flex-direction: column; gap: 4px; }
.cal .d.off { background: transparent; }
.cal .d .n { font-size: 13px; color: var(--lucid); font-variant-numeric: tabular-nums; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 128px; }
.cal .d.today .n { background: var(--midnight); color: var(--white); font-weight: 500; }
.cal .ev { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: color-mix(in srgb, var(--c) 10%, var(--white)); border-left: 2px solid var(--c); color: var(--night); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; }
.cal .ev b { font-weight: 500; }
.cal .ev.late { background: color-mix(in srgb, var(--danger) 10%, var(--white)); border-left-color: var(--danger); }
.wl { display: grid; grid-template-columns: 220px 1fr 120px; gap: 24px; align-items: center; padding: 16px 24px; }
.wl .bar { height: 12px; }
.wl .lo { font-size: 13px; color: var(--lucid); display: flex; justify-content: space-between; margin-top: 6px; }
.chk { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.chk.on .lbl { color: var(--lucid); text-decoration: line-through; }
.cmt { display: flex; gap: 12px; padding: 12px 0; }
.cmt .w { font-size: 14px; color: var(--night); line-height: 1.5; }
.cmt .w b { font-weight: 500; color: var(--midnight); margin-right: 8px; }
.cmt .w small { color: var(--lucid); font-size: 12px; }
.cmt .w p { margin-top: 4px; }
.compose { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.compose .textarea { min-height: 64px; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters .field { width: 260px; }

/* Clients */
.cl-row { display: grid; grid-template-columns: 40px 1fr 140px 152px 180px 112px; gap: 16px; align-items: center; padding: 12px 24px; }
.cl-row.h { font-size: 12px; color: var(--lucid); font-weight: 500; }
.cl-row .t { font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-row .s { font-size: 12px; color: var(--lucid); }
.ids { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.id { background: var(--white); border-radius: 16px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.id .l { font-size: 12px; color: var(--lucid); }
.id .v { font-family: var(--mono); font-size: 14px; color: var(--midnight); display: flex; align-items: center; gap: 8px; }
.id .v .ic { color: var(--lucid); width: 16px; height: 16px; }
.cred { display: grid; grid-template-columns: 160px 1fr 1fr 40px; gap: 16px; align-items: center; padding: 12px 24px; }
.cred .m { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--lucid); }
.svc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc .card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.svc .card b { display: block; font-weight: 500; color: var(--midnight); margin-bottom: 4px; }
.svc .card small { font-size: 13px; color: var(--lucid); display: block; line-height: 1.45; }

/* Assignments */
.stages { display: flex; gap: 8px; align-items: stretch; }
.stage { flex: 1; background: var(--white); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--mist); min-width: 0; }
.stage.done { border-top-color: var(--night); }
.stage.doing { border-top-color: var(--night); background: var(--white); }
.stage.doing::before { content: 'Now'; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--lucid); }
.stage b { font-size: 14px; font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage small { font-size: 12px; color: var(--lucid); }
.stage.done b { color: var(--lucid); }
.job-row { display: grid; grid-template-columns: 1fr 200px 160px 120px; gap: 24px; align-items: center; padding: 16px 24px; }

/* Billing and invoices */
.age { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.age .a { background: var(--white); border-radius: 16px; padding: 16px 20px; }
.age .a .l { font-size: 12px; color: var(--lucid); }
.age .a .v { font-size: 22px; font-weight: 500; color: var(--midnight); font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.01em; }
.age .a.attn .v { color: var(--danger); }
.age .a small { font-size: 12px; color: var(--lucid); }
.sheet { background: var(--white); border-radius: 16px; padding: 48px; max-width: 840px; }
.sheet .top { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; }
.sheet .firm b { font: 500 20px/1.3 var(--inter); color: var(--midnight); display: block; }
.sheet .firm small, .sheet .meta small { display: block; font-size: 13px; color: var(--lucid); line-height: 1.5; }
.sheet .meta { text-align: right; }
.sheet .meta .no { font: 500 16px/1.3 var(--inter); color: var(--midnight); }
.sheet .title { font: 500 12px/1 var(--inter); letter-spacing: .12em; text-transform: uppercase; color: var(--lucid); margin: 40px 0 16px; }
.sheet .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.sheet .parties b { display: block; font-weight: 500; color: var(--midnight); margin-bottom: 4px; }
.sheet .parties small { display: block; font-size: 13px; color: var(--lucid); line-height: 1.5; }
.sheet .tbl th:first-child, .sheet .tbl td:first-child { padding-left: 0; }
.sheet .tbl th:last-child, .sheet .tbl td:last-child { padding-right: 0; }
.tot { margin-left: auto; width: 320px; margin-top: 16px; }
.tot div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--night); border-bottom: 1px solid var(--line); }
.tot div.g { font-weight: 500; color: var(--midnight); font-size: 16px; border-bottom: 0; padding-top: 12px; }
.tot div.net { color: var(--lucid); font-size: 13px; border-bottom: 0; }
.sheet .foot { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.sheet .foot small { display: block; font-size: 13px; color: var(--lucid); line-height: 1.6; }
.sheet .foot b { font-weight: 500; color: var(--midnight); }
.sig { margin-top: 24px; font-family: var(--lora); font-size: 20px; color: var(--midnight); }
.inv-row { display: grid; grid-template-columns: 140px 1fr 120px 120px 120px 112px; gap: 16px; align-items: center; padding: 12px 24px; }
.inv-row.h { font-size: 12px; color: var(--lucid); font-weight: 500; }
.inv-row .no { font-family: var(--mono); font-size: 13px; color: var(--midnight); }
.prof { display: grid; grid-template-columns: 1fr 100px 100px 100px 160px; gap: 16px; align-items: center; padding: 12px 24px; }
.prof.h { font-size: 12px; color: var(--lucid); font-weight: 500; }

/* Team */
.pp { display: grid; grid-template-columns: 40px 1fr 160px 200px 100px; gap: 16px; align-items: center; padding: 12px 24px; }
.pp.h { font-size: 12px; color: var(--lucid); font-weight: 500; }
.pp .t { font-weight: 500; color: var(--midnight); }
.pp .s { font-size: 12px; color: var(--lucid); }
.alloc { overflow-x: auto; }
.alloc table { border-collapse: collapse; min-width: 100%; }
.alloc th { font-size: 12px; font-weight: 500; color: var(--lucid); padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.alloc th:first-child { padding-left: 24px; }
.alloc td { padding: 8px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; }
.alloc td:first-child { text-align: left; padding-left: 24px; font-weight: 500; color: var(--midnight); white-space: nowrap; }
.alloc .m { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: 11px; font-weight: 500; }
.alloc .m.p { background: var(--midnight); color: var(--white); }
.alloc .m.g { background: var(--night); color: var(--white); }
.alloc .m.s { background: var(--mist); color: var(--night); }
.ts { width: 100%; border-collapse: collapse; }
.ts th { font-size: 12px; font-weight: 500; color: var(--lucid); padding: 12px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.ts th:first-child { text-align: left; padding-left: 24px; }
.ts th.today { color: var(--midnight); }
.ts td { padding: 8px; border-bottom: 1px solid var(--line); text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--night); }
.ts td:first-child { text-align: left; padding-left: 24px; }
.ts td.z { color: var(--ash); }
.ts td.tot, .ts tr.tot td { font-weight: 500; color: var(--midnight); }
.ts tr:last-child td { border-bottom: 0; }
.ts .cell { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px; border-radius: 8px; background: var(--mist); }
.ts .cell.z { background: transparent; }
.ts .cell.today { background: var(--white); border: 1px solid var(--line-strong); }
.wk { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.wk .dcol { background: var(--white); border-radius: 8px; padding: 12px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.wk .dcol.today { border: 1px solid var(--line-strong); }
.wk .dcol h4 { font-size: 12px; font-weight: 500; color: var(--lucid); display: flex; justify-content: space-between; }
.wk .dcol h4 b { color: var(--midnight); font-variant-numeric: tabular-nums; }
.wk .e { background: var(--mist); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--night); line-height: 1.35; }
.wk .e b { display: block; font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk .e small { color: var(--lucid); }
.wk .add { border: 1px dashed var(--line-strong); border-radius: 8px; height: 32px; display: grid; place-items: center; color: var(--lucid); font-size: 12px; margin-top: auto; }
.diary-d { display: grid; grid-template-columns: 56px 1fr 120px 40px; gap: 16px; align-items: center; padding: 12px 24px; }
.diary-d .dn { font-size: 13px; color: var(--lucid); } .diary-d .dn b { display: block; color: var(--midnight); font-weight: 500; font-size: 15px; }

/* Settings */
.perm { width: 100%; border-collapse: collapse; }
.perm th { font-size: 12px; font-weight: 500; color: var(--lucid); padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.perm th:first-child { text-align: left; padding-left: 24px; }
.perm td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--lucid); }
.perm td:first-child { text-align: left; padding-left: 24px; color: var(--night); }
.perm tr:last-child td { border-bottom: 0; }
.perm .y { color: var(--midnight); } .perm .n { color: var(--ash); } .perm .o { color: var(--lucid); font-size: 12px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 24px; }
.set-row .grow b { display: block; font-weight: 500; color: var(--midnight); }
.set-row .grow small { display: block; font-size: 13px; color: var(--lucid); margin-top: 2px; }

/* Notices */
.nt-row { display: grid; grid-template-columns: 40px 1fr 160px 140px 120px; gap: 16px; align-items: center; padding: 16px 24px; }
.nt-row .t { font-weight: 500; color: var(--midnight); }
.nt-row .s { font-size: 13px; color: var(--lucid); margin-top: 2px; }
.clock { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--mist); border-radius: 16px; }
.clock .big { font: 500 32px/1 var(--inter); color: var(--midnight); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .big.late { color: var(--danger); }
.clock small { font-size: 13px; color: var(--lucid); display: block; }

/* Files */
.fcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lucid); margin-bottom: 24px; flex-wrap: wrap; }
.fcrumb a { color: var(--night); font-weight: 500; }
.fcrumb .ic { width: 12px; height: 12px; color: var(--ash); }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.folder { background: var(--white); border-radius: 8px; padding: 16px; display: flex; gap: 12px; align-items: center; border: 1px solid transparent; transition: border-color .16s var(--ease); }
.folder:hover { border-color: var(--line-strong); }
.folder .ic { color: var(--lucid); }
.folder b { display: block; font-weight: 500; color: var(--midnight); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder small { font-size: 12px; color: var(--lucid); }
.fr { display: grid; grid-template-columns: 40px 1fr 160px 120px 100px 40px; gap: 16px; align-items: center; padding: 12px 24px; }
.fr.h { font-size: 12px; color: var(--lucid); font-weight: 500; }
.fr .t { font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fr .s { font-size: 12px; color: var(--lucid); }
.fr.pending .t { color: var(--lucid); font-weight: 400; }
.drop { border: 1px dashed var(--line-strong); border-radius: 16px; padding: 24px; text-align: center; color: var(--lucid); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: rgba(255, 255, 255, .5); }
.drop .ic { color: var(--ash); }

/* Docs: a Notion-like page */
.docs { display: grid; grid-template-columns: 256px 1fr; gap: 0; min-height: calc(100vh - 0px); }
.doc-side { border-right: 1px solid var(--line); padding: 32px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: rgba(255, 255, 255, .5); }
.doc-side .grp { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--lucid); padding: 16px 12px 4px; }
.doc-side a { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: var(--night); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-side a .ic { width: 16px; height: 16px; color: var(--lucid); flex-shrink: 0; }
.doc-side a:hover { background: var(--mist); }
.doc-side a.on { background: var(--mist); color: var(--midnight); font-weight: 500; }
.doc-side a.sub { padding-left: 32px; }
.doc-main { padding: 40px 64px 120px; max-width: 920px; animation: in .28s var(--ease); }
.doc-main .doc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lucid); margin-bottom: 32px; }
.doc-main .doc-top .spacer { flex: 1; }
.doc-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; color: var(--lucid); margin-bottom: 16px; background: var(--white); }
.doc-main h1 { font: 500 40px/1.15 var(--inter); letter-spacing: -.02em; margin-bottom: 8px; }
.doc-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--lucid); padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.doc-meta .flex { gap: 8px; }
.blk { font-size: 16px; line-height: 1.6; color: var(--night); padding: 4px 0; position: relative; }
.blk:hover::before { content: ''; position: absolute; left: -24px; top: 8px; width: 12px; height: 16px; background: var(--ash); opacity: .32; border-radius: 4px; mask: radial-gradient(circle, #000 1.5px, transparent 1.6px) 0 0 / 6px 6px; -webkit-mask: radial-gradient(circle, #000 1.5px, transparent 1.6px) 0 0 / 6px 6px; }
.blk.h1 { font: 500 28px/1.3 var(--inter); color: var(--midnight); padding-top: 32px; letter-spacing: -.01em; }
.blk.h2 { font: 500 20px/1.35 var(--inter); color: var(--midnight); padding-top: 24px; }
.blk.h3 { font: 500 16px/1.4 var(--inter); color: var(--midnight); padding-top: 16px; }
.blk.todo { display: flex; gap: 12px; align-items: flex-start; }
.blk.todo .box { margin-top: 4px; }
.blk.todo.on .w { color: var(--lucid); text-decoration: line-through; }
.blk.bul, .blk.numl { display: flex; gap: 12px; }
.blk.bul::after { display: none; }
.blk .mk { color: var(--lucid); flex-shrink: 0; width: 20px; text-align: center; }
.blk.quote { border-left: 3px solid var(--night); padding-left: 16px; color: var(--night); font-family: var(--lora); font-size: 18px; }
.blk.callout { display: flex; gap: 12px; padding: 16px 20px; border-radius: 8px; background: color-mix(in srgb, var(--k, var(--ash)) 10%, var(--white)); border: 1px solid color-mix(in srgb, var(--k, var(--ash)) 32%, transparent); margin: 8px 0; font-size: 15px; }
.blk.callout > .ic { color: var(--k, var(--lucid)); flex-shrink: 0; margin-top: 2px; }
.blk.code { font-family: var(--mono); font-size: 13px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; white-space: pre-wrap; }
.blk.hr { height: 1px; background: var(--line); margin: 16px 0; padding: 0; }
.blk.tog summary { cursor: pointer; font-weight: 500; color: var(--midnight); list-style: none; display: flex; align-items: center; gap: 8px; }
.blk.tog summary .ic { width: 16px; height: 16px; color: var(--lucid); transition: transform .2s var(--ease); }
.blk.tog[open] summary .ic { transform: rotate(90deg); }
.blk.tog .tog-b { padding: 8px 0 0 24px; font-size: 15px; color: var(--night); }
.blk.tbl-w { padding: 8px 0; }
.blk .tbl { background: var(--white); border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
.blk .tbl th, .blk .tbl td { padding: 8px 12px; } .blk .tbl th:first-child, .blk .tbl td:first-child { padding-left: 12px; }
.blk .tbl th:last-child, .blk .tbl td:last-child { padding-right: 12px; }
.blk.img { background: var(--white); border-radius: 8px; border: 1px solid var(--line); padding: 24px; display: flex; align-items: center; gap: 16px; color: var(--lucid); font-size: 14px; }
.blk.empty { color: var(--ash); }
.mn { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; margin: 0 -1px; border-radius: 4px; color: var(--midnight); font-weight: 500; background: transparent; border-bottom: 1px solid var(--line-strong); transition: background .16s var(--ease); white-space: nowrap; cursor: pointer; }
.mn:hover { background: var(--mist); }
.mn .ic { width: 16px; height: 16px; color: var(--lucid); }
.mn.date { font-weight: 400; color: var(--night); }
.mn.task.done { color: var(--lucid); text-decoration: line-through; }
.doc-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc-foot h3 { font-size: 13px; color: var(--lucid); font-weight: 500; margin-bottom: 8px; }
.bl { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--night); margin-left: -12px; }
.bl:hover { background: var(--white); }
.bl .ic { color: var(--lucid); width: 16px; height: 16px; }
.bl small { color: var(--lucid); font-size: 12px; margin-left: auto; white-space: nowrap; }
.slash { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ash); padding: 4px 0; }
.slash .kbd { border-color: var(--line); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.doc-card { background: var(--white); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; transition: border-color .16s var(--ease); min-height: 128px; }
.doc-card:hover { border-color: var(--line-strong); }
.doc-card .ic { color: var(--lucid); }
.doc-card b { font-weight: 500; color: var(--midnight); font-size: 15px; line-height: 1.35; }
.doc-card small { font-size: 12px; color: var(--lucid); margin-top: auto; }
.hov { position: fixed; z-index: 70; width: 320px; background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; font-size: 13px; animation: pop .16s var(--ease); pointer-events: none; }
.hov b { display: block; font-size: 14px; color: var(--midnight); font-weight: 500; margin-bottom: 4px; }
.hov .kv { grid-template-columns: 88px 1fr; gap: 8px 12px; font-size: 13px; margin-top: 8px; }
.hov .kv dd { min-height: 0; }

/* Portal */
.req { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 24px; align-items: center; }
.req .t { font-weight: 500; color: var(--midnight); }
.req .s { font-size: 13px; color: var(--lucid); margin-top: 4px; line-height: 1.45; }
.req .u { display: flex; align-items: center; gap: 8px; }
.msg { display: flex; gap: 12px; padding: 16px 0; }
.msg + .msg { border-top: 1px solid var(--line); }
.msg .w { font-size: 14px; color: var(--night); line-height: 1.5; max-width: 640px; }
.msg .w b { font-weight: 500; color: var(--midnight); margin-right: 8px; }
.msg .w small { color: var(--lucid); font-size: 12px; }
.msg .w p { margin-top: 4px; }
.msg.me { flex-direction: row-reverse; text-align: right; }
.msg.me .w { background: var(--mist); border-radius: 16px 4px 16px 16px; padding: 12px 16px; }
.filing { display: grid; grid-template-columns: minmax(0, 1.4fr) 88px minmax(0, 1.3fr) 96px; gap: 16px; align-items: center; padding: 16px 24px; }
.filing .t { font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filing .ack { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filing .ack { font-family: var(--mono); font-size: 12px; color: var(--lucid); }

/* Client meeting, November 11: Action parchi, fee before closing, billing queue, recurring rules, duplicates */
.g16 { gap: 16px; }
.form { display: flex; flex-direction: column; gap: 24px; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.seg.pick { align-self: flex-start; }
.fld.covered .field { opacity: .48; pointer-events: none; }
.set-row.inline { padding: 12px 0 0; }
.kv.tight { grid-template-columns: 64px 1fr; gap: 8px 12px; font-size: 13px; }

.star { width: 32px; height: 32px; border-radius: 128px; display: inline-grid; place-items: center; color: var(--ash); cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease); }
.star:hover { background: var(--mist); color: var(--lucid); }
.star.on { color: var(--night); }
.star.on .ic { animation: pop .24s var(--ease); }
.star.lab { width: auto; display: inline-flex; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; color: var(--lucid); }
.star.lab.on { color: var(--midnight); }

.slip { padding: 24px 32px; }
.slip-h { display: flex; justify-content: space-between; align-items: flex-end; }
.slip-h b { display: block; font: 500 20px/1.3 var(--lora); color: var(--midnight); }
.slip-h small { font-size: 13px; color: var(--lucid); }
.pc { display: grid; grid-template-columns: 24px 20px 1fr auto 32px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line-strong); }
.pc:last-child { border-bottom: 0; }
.pc .no { font: 400 18px/1 var(--lora); color: var(--lucid); text-align: right; }
.pc .t { font-weight: 500; color: var(--midnight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .c { font-size: 13px; color: var(--lucid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .grow { min-width: 0; }
.pc.on .t { text-decoration: line-through; color: var(--lucid); }
.pc.slot { grid-template-columns: 24px 1fr; min-height: 56px; }

.rr { display: grid; grid-template-columns: 1fr 200px 200px 120px 56px; gap: 16px; align-items: center; padding: 12px 24px; }
.rr.h { font-size: 12px; color: var(--lucid); font-weight: 500; }
.rr.off .strong { color: var(--lucid); }
.rr .toggle { display: inline-block; vertical-align: middle; }

.bq-h { background: rgba(242, 242, 242, .48); }
.bq { display: grid; grid-template-columns: 32px 1fr 160px 72px; gap: 16px; align-items: center; padding: 12px 24px; border-top: 1px solid var(--line); }
.bq > a { min-width: 0; }
.bq-fee .field { width: 100%; }

.dup-pair { display: grid; grid-template-columns: 1fr 32px 1fr; gap: 16px; align-items: stretch; }
.dup-side { border: 1px solid var(--line-strong); border-radius: 16px; padding: 16px; cursor: pointer; transition: border-color .16s var(--ease); }
.dup-side input { position: absolute; opacity: 0; pointer-events: none; }
.dup-side.on { border-color: var(--night); }
.dup-arrow { display: grid; place-items: center; color: var(--lucid); }
.radio { width: 16px; height: 16px; border-radius: 128px; border: 1px solid var(--field); background: var(--white); transition: border .16s var(--ease); }
.dup-side.on .radio { border: 4px solid var(--night); }

@media print {
  .app { display: block; }
  .side, .head .actions, .cols > div + div, .slip + p { display: none; }
  .cols { display: block; }
  .slip { box-shadow: none; }
}

/* ---- The working app: sign in, forms, imports, the trail ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 40px; border-radius: 24px; display: flex; flex-direction: column; }
.auth-card .wordmark { font-size: 28px; margin-bottom: 32px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { margin-top: 8px; color: var(--lucid); }
.auth-card > .ic { color: var(--danger); margin-bottom: 16px; }
.auth-card > .btn { margin-top: 24px; align-self: flex-start; }
.btn.wide { width: 100%; }
.card.narrow { max-width: 480px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ev { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 8px; font-size: 13px; color: var(--lucid); }
.ev .ic { color: var(--ash); flex-shrink: 0; }
.ev small { margin-left: auto; font-size: 12px; white-space: nowrap; }
.cmt .w { min-width: 0; flex: 1; }
.opt { height: 32px; padding: 0 12px; border-radius: 32px; border: 1px solid var(--line-strong); background: var(--white); font-size: 13px; font-weight: 500; color: var(--night); transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease); }
.opt:hover { border-color: var(--field); }
.opt.on { background: var(--night); border-color: var(--night); color: var(--white); }
.wl.h { font-size: 12px; color: var(--lucid); font-weight: 500; padding: 12px 24px; }
.copy { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: var(--lucid); }
.copy:hover { background: var(--mist); color: var(--midnight); }
.ck { display: inline-flex; justify-content: flex-end; cursor: pointer; }
.ck input { position: absolute; opacity: 0; }
.ck span { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--field); background: var(--white); display: grid; place-items: center; transition: background .16s var(--ease), border-color .16s var(--ease); }
.ck input:checked + span { background: var(--night); border-color: var(--night); }
.ck input:checked + span::after { content: ''; width: 8px; height: 4px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(-45deg) translateY(-1px); }
.ck input:focus-visible + span { outline: 2px solid var(--night); outline-offset: 2px; }
.bq { grid-template-columns: 32px 1fr 200px 136px; }
.bq .fld { gap: 4px; }
.bq .fld .help:empty, .bq-f .fld .help:empty { display: none; }
.bq-f { border-top: 1px solid var(--line); background: rgba(242, 242, 242, .48); align-items: flex-start; }
.bq-f .fld { gap: 4px; }
.bq-f .field { width: 100%; }
.bq-f > .field { width: 160px; flex-shrink: 0; }
.fld .help:empty { display: none; }
.cred-pw { display: flex; align-items: center; gap: 12px; }
.cred-pw .code { font-size: 18px; color: var(--midnight); letter-spacing: .04em; user-select: all; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; border: 1px dashed var(--field); border-radius: 16px; cursor: pointer; text-align: center; transition: background .16s var(--ease), border-color .16s var(--ease); }
.drop:hover, .drop:focus-within { background: var(--mist); border-color: var(--night); }
.drop .ic { color: var(--ash); }
.drop b { font-weight: 500; color: var(--midnight); }
.drop input { position: absolute; opacity: 0; width: 0; height: 0; }
.map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 24px; }
.map .field { width: 100%; }
.scroll-x { overflow-x: auto; }
.tbl tr.dim td { color: var(--ash); }
.tbl tr.dim td.strong { color: var(--lucid); }
.star[tabindex]:focus-visible, .toggle:focus-visible, .opt:focus-visible, .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--night); outline-offset: 2px; }
.toggle { cursor: pointer; }
.toggle.busy { opacity: .4; pointer-events: none; }
.field:focus-within { border-color: var(--night); }
.field select:disabled, .field input:disabled, .textarea:disabled { color: var(--lucid); }
.filters .field select { width: 100%; }
.drawer .df { flex-wrap: wrap; }

/* ---- UX audit, November 30 ---- */
.cols > * { min-width: 0; }
.tr { grid-template-columns: 1fr 180px 112px 120px 32px 40px; }
.pc { grid-template-columns: 24px 1fr auto 32px; }
.filters .field.pick { width: 184px; }
.still-page .page, .still-drawer .drawer, .still-drawer .scrim { animation: none; }
.ask .scrim { z-index: 60; }
.ask .dialog-wrap { z-index: 61; padding: 96px 24px 24px; }
.ask .dialog { width: 100%; max-width: 440px; }
.ask .dialog .db { padding: 24px; }
.scroll-x .tbl th, .scroll-x .tbl td { white-space: nowrap; }
.row.tight .chip { flex-shrink: 0; }

/* ---- Phones and small tablets: the sidebar becomes a top bar, lists keep only what matters ---- */
@media (max-width: 900px) {
  .app { display: block; }
  .side { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px 0; box-shadow: 0 1px 0 var(--line); }
  .brand { flex: 1; min-width: 0; margin: 0; height: 40px; padding: 0; }
  .me-wrap { order: 1; margin: 0; border: 0; padding: 0; }
  .me { width: auto; padding: 4px; }
  .me .grow, .me > .ic { display: none; }
  .switch { left: auto; right: 0; top: calc(100% + 8px); bottom: auto; width: 220px; }
  .search { order: 2; width: 100%; margin: 0; }
  .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; height: 36px; font-size: 14px; gap: 8px; }
  .nav a .n { margin-left: 4px; }
  .nav hr { display: none; }
  .page, .page.wide { padding: 24px 16px 96px; }
  h1 { font-size: 26px; }
  .head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
  .head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .cols { grid-template-columns: minmax(0, 1fr) !important; gap: 24px; }
  .cols.g16, .cols.g24 { gap: 16px; }
  .stats { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .stat { padding: 16px; }
  .field input, .field select, .textarea { font-size: 16px; }
  .filters .field, .filters .field.pick { width: 100%; }
  .filters .spacer { display: none; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg a, .seg button { flex-shrink: 0; }
  .tabs { overflow-x: auto; }
  .tabs a { flex-shrink: 0; }
  .row, .row.tight { padding: 12px 16px; gap: 12px; }
  .tr { grid-template-columns: minmax(0, 1fr) auto 32px; padding: 12px 16px; gap: 12px; }
  .tr > :nth-child(2), .tr > :nth-child(4), .tr > :nth-child(6) { display: none; }
  .cl-row { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px 16px; gap: 12px; }
  .cl-row > :nth-child(3), .cl-row > :nth-child(4), .cl-row > :nth-child(6), .cl-row.h { display: none; }
  .pp { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 12px 16px; gap: 12px; }
  .pp > :nth-child(4), .pp > :nth-child(5), .pp.h { display: none; }
  .rr { grid-template-columns: minmax(0, 1fr) auto auto; padding: 12px 16px; gap: 12px; }
  .rr > :nth-child(2), .rr > :nth-child(3), .rr.h { display: none; }
  .wl { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; gap: 8px 12px; }
  .wl > :nth-child(2) { grid-column: 1 / -1; order: 3; }
  .wl.h { display: none; }
  .q-row { grid-template-columns: 40px minmax(0, 1fr); padding: 12px 16px; gap: 12px; }
  .q-row .r { grid-column: 2; }
  .bq { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px 16px; gap: 8px 12px; }
  .bq > .fld, .bq > .flex { grid-column: 2 / -1; }
  .bq-f { flex-wrap: wrap; }
  .bq-f .fld { flex-basis: 100%; }
  .board { grid-template-columns: repeat(5, 240px); overflow-x: auto; }
  .ids, .map { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dup-pair { grid-template-columns: minmax(0, 1fr); }
  .dup-arrow { display: none; }
  .kv { grid-template-columns: 112px minmax(0, 1fr); }
  .card { padding: 16px; }
  .card.flush { overflow-x: auto; }
  .card.flush > .tbl, .card.flush > .perm, .scroll-x > .tbl { min-width: 640px; }
  .slip { padding: 16px; }
  .drawer { width: 100%; }
  .drawer .dh, .drawer .df { padding: 12px 16px; }
  .drawer .db { padding: 16px; }
  .auth { padding: 16px; }
  .auth-card { padding: 24px; }
  .toast { left: 16px; right: 16px; bottom: 16px; transform: none; height: auto; min-height: 48px; padding: 12px 16px; }
  .ask .dialog-wrap { padding: 48px 16px 16px; }
  .wide-only, .star.lab .lbl { display: none; }
  .star.lab { padding: 0 8px; }
}
.field.code { height: 56px; }
.field.code input { font: 500 24px/1 var(--mono); letter-spacing: .3em; text-align: center; }
