/* Tradie Drive Desktop, Phase 1 components. Tokens live in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  min-width: 1280px;
}
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--orange-text); text-decoration: none; }
svg { display: block; flex: none; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }
.ico.xl { width: 32px; height: 32px; }
:focus-visible { outline: none; box-shadow: var(--focus); }   /* the ring follows each element's own radius; --focus is the brand ring, defined in desk.css */

/* ---------- Shell ---------- */
.app { display: flex; }
.railwrap { width: var(--rail); flex: none; align-self: stretch; background: var(--surface); border-right: 1px solid var(--border); position: relative; z-index: 40; }
.rail {
  position: sticky; top: 0; height: 100vh; width: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s2) 0; gap: var(--s1);
}
.rail .logo { width: 40px; height: 40px; margin-bottom: var(--s2); }
.rail .logo img { width: 40px; height: 40px; display: block; }
.rail .gap { flex: 1; }
.rail .sep { width: 32px; height: 1px; background: var(--border); margin: var(--s1) 0; }
.nav {
  position: relative; width: 48px; height: 48px; border-radius: var(--r-md);
  display: grid; place-items: center; color: var(--text-2); background: transparent; border: 0; padding: 0;
}
.nav:hover { background: var(--surface-hover); color: var(--text); }
.nav.active, .nav.active:hover { background: var(--orange); color: var(--on-orange); }
.nav .ico { width: 24px; height: 24px; }
.nav .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange-hover); box-shadow: 0 0 0 2px var(--surface);
}
.nav.active .dot { background: var(--ink); box-shadow: 0 0 0 2px var(--orange); }
.tip {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--w-medium);
  padding: var(--s1) var(--s2); border-radius: var(--r-sm); white-space: nowrap; box-shadow: var(--sh-2);
  opacity: 0; pointer-events: none; transition: opacity 120ms; z-index: 60;
}
.tip::before {
  content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: var(--ink);
  transform: translateY(-50%) rotate(45deg);
}
.nav:hover .tip, .nav:focus-visible .tip, .nav.show-tip .tip { opacity: 1; }
.biz {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: var(--fs-sm); font-weight: var(--w-bold); letter-spacing: 0.02em;
  position: relative;
}
.biz .tip { left: calc(100% + 16px); }

.main { flex: 1; min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s4);
}
.topbar h1 { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--w-semibold); letter-spacing: -0.01em; }
.topbar .sub { color: var(--text-2); font-size: var(--fs-base); margin-left: var(--s2); }
.topbar .left { display: flex; align-items: baseline; }
.topbar .right { display: flex; align-items: center; gap: var(--s2); }
.bizname { color: var(--text-2); font-size: var(--fs-base); font-weight: var(--w-medium); }
.iconbtn {
  position: relative; width: var(--control); height: var(--control); border-radius: var(--r-sm);
  display: grid; place-items: center; background: transparent; border: 0; color: var(--text-2); padding: 0;
}
.iconbtn:hover { background: var(--surface-hover); color: var(--text); }
.iconbtn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange-hover); box-shadow: 0 0 0 2px var(--surface); }
.iconbtn.tipped:hover .tip, .iconbtn.tipped.show-tip .tip { opacity: 1; }
.iconbtn .tip { left: auto; right: 0; top: calc(100% + 8px); transform: none; }
.iconbtn .tip::before { left: auto; right: 16px; top: -4px; transform: rotate(45deg); }

/* ---------- Buttons ---------- */
.btn {
  height: var(--control); padding: 0 var(--s2); border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: var(--w-semibold); font-size: var(--fs-base);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.primary[disabled], .btn.primary.disabled { background: var(--surface-selected); border-color: var(--surface-selected); color: var(--text-3); cursor: default; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--surface-hover); }
.btn.danger { color: var(--red); border-color: #FDA29B; }
.btn.danger:hover { background: var(--red-bg); }
.btn.block { width: 100%; }
.btn.sm { height: var(--chip); padding: 0 var(--s2); font-size: var(--fs-sm); }
.link { color: var(--orange-text); font-weight: var(--w-semibold); background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

.chip {
  height: var(--chip); padding: 0 var(--s2); border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--w-semibold);
  display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; flex: none;
}
.chip:hover { background: var(--surface-hover); color: var(--text); }
.chip.on, .chip.on:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { color: var(--text-3); font-weight: var(--w-medium); }
.chip.on .n { color: #CBD5E1; }
.chip .ico { width: 16px; height: 16px; }
.chip.tight { padding: 0 12px; }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s1); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: var(--w-semibold); }
.badge.good { background: var(--green-bg); color: var(--green); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.neutral { background: var(--surface-hover); color: var(--text-2); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s1); border-radius: var(--r-sm); background: var(--surface-hover); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--w-medium); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: var(--w-bold); color: #1D2939; letter-spacing: 0.02em;
}
.avatar.lg { width: 48px; height: 48px; font-size: var(--fs-md); }
.avatar.sm { width: 32px; height: 32px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.t0 { background: #E0E7F1; } .t1 { background: #E3ECE6; } .t2 { background: #ECE5F0; }
.t3 { background: #F0E9DC; } .t4 { background: #DFEDF0; } .t5 { background: #EEE3E3; }

.input {
  height: var(--control); width: 100%; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; gap: var(--s1); padding: 0 var(--s2); color: var(--text-2);
}
.input:hover { border-color: #98A2B3; }
.input .ico { color: var(--text-3); }
.input span { color: var(--text-3); }
.input.filled span { color: var(--text); }

.seg { display: inline-flex; padding: var(--s-half); background: var(--surface-selected); border-radius: var(--r-sm); }
.seg button { height: 32px; padding: 0 var(--s2); border: 0; background: transparent; border-radius: 6px; font-weight: var(--w-semibold); font-size: var(--fs-base); color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr) var(--panel-w); height: calc(100vh - var(--topbar)); background: var(--surface); }
.inbox.no-panel { grid-template-columns: var(--list-w) minmax(0, 1fr); }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.list-pane { border-right: 1px solid var(--border); }
.panel-pane { border-left: 1px solid var(--border); background: var(--surface); }
.list-head { padding: var(--s2); display: flex; flex-direction: column; gap: var(--s1); border-bottom: 1px solid var(--border); }
.chiprow { display: flex; gap: var(--s1); position: relative; overflow: hidden; }
.chiprow.fade::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 32px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff); pointer-events: none; }
.list-scroll { flex: 1; min-height: 0; overflow: hidden; }
.row {
  position: relative; display: flex; align-items: center; gap: var(--s2); height: 72px; padding: 0 var(--s2);
  border-bottom: 1px solid var(--border);
}
.row:hover { background: var(--surface-muted); }
.row.sel, .row.sel:hover { background: var(--surface-selected); }
.row .body { flex: 1; min-width: 0; }
.row .top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s1); }
.row .name { font-weight: var(--w-semibold); font-size: var(--fs-base); line-height: var(--lh-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .prev { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row .time { color: var(--text-3); font-size: var(--fs-sm); flex: none; }
.row.unread .name { font-weight: var(--w-bold); }
.row.unread .prev { color: var(--text); font-weight: var(--w-medium); }
.row.unread .time { color: var(--orange-text); font-weight: var(--w-semibold); }
.row .udot { position: absolute; left: 4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--orange-hover); }
.row .ch { color: var(--text-3); }
.row .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0; flex: none; }
.listend { padding: var(--s3) var(--s2); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }

.thread-head { height: 72px; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); border-bottom: 1px solid var(--border); flex: none; }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .nm { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); }
.thread-head .ph { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.thread-head .acts { display: flex; gap: var(--s1); align-items: center; }
.msgs { flex: 1; min-height: 0; overflow: hidden; padding: var(--s2) var(--s4); display: flex; flex-direction: column; justify-content: flex-end; }
.day { display: flex; align-items: center; gap: var(--s2); color: var(--text-3); font-size: var(--fs-sm); margin: var(--s2) 0 var(--s1); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; flex-direction: column; max-width: 76%; }
.msg.in { align-items: flex-start; align-self: flex-start; }
.msg.out { align-items: flex-end; align-self: flex-end; }
.bub { padding: var(--s1) var(--s2); border-radius: var(--r-md); font-size: var(--fs-base); line-height: var(--lh-base); }
.in .bub { background: #EEF0F3; color: var(--text); border-bottom-left-radius: var(--s-half); }
.out .bub { background: var(--orange); color: var(--on-orange); border-bottom-right-radius: var(--s-half); }
.bub.photo { padding: var(--s-half); width: 240px; }
.bub.photo .cap { padding: var(--s1) var(--s1) var(--s-half); }
.bub.photo svg.pic { border-radius: var(--r-sm); }
.stamp { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); margin-top: var(--s-half); }
.callcard { align-self: center; width: min(100%, 600px); background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s2); }
.callcard .line { display: flex; align-items: center; gap: var(--s1); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.callcard .line .ico { color: var(--text-2); }
.callcard .line .grow { flex: 1; }
.callcard .sum { margin-top: var(--s1); padding-top: var(--s1); border-top: 1px solid var(--border); color: var(--text); }
.callcard .sum .eyebrow { display: block; color: var(--text-3); font-size: var(--fs-sm); font-weight: var(--w-semibold); margin-bottom: var(--s-half); }

.composer { border-top: 1px solid var(--border); padding: var(--s2) var(--s4) var(--s3); flex: none; background: var(--surface); }
.quick { display: flex; gap: var(--s1); margin-bottom: var(--s1); align-items: center; }
.quick .qs { flex: 1; min-width: 0; display: flex; gap: var(--s1); overflow: hidden; }
.box { border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); display: flex; align-items: center; gap: var(--s1); padding: var(--s1); min-height: 56px; }
.box:focus-within { box-shadow: var(--focus); }
.box .ta { flex: 1; padding: 0 var(--s1); font-size: var(--fs-base); line-height: var(--lh-base); }
.box .ta.empty { color: var(--text-3); }
.col { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s1); }

.panel-head { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s2) 0 var(--s3); border-bottom: 1px solid var(--border); flex: none; }
.panel-head h2 { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); }
.panel-body { flex: 1; min-height: 0; overflow: hidden; }
.psec { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); }
.psec:last-child { border-bottom: 0; }
.psec h3 { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--w-semibold); color: var(--text-2); margin-bottom: var(--s1); }
.ident { padding: var(--s2) var(--s3); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-half); border-bottom: 1px solid var(--border); }
.ident .nm { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); margin-top: var(--s1); }
.ident .ph { color: var(--text-2); }
.ident .acts { display: flex; gap: var(--s1); margin-top: var(--s1); width: 100%; }
.ident .acts .btn { flex: 1; padding: 0 var(--s1); }
.kv { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s-half) 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); text-align: right; font-weight: var(--w-medium); }
.note { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s1) var(--s2); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text); }
.job { display: flex; gap: var(--s1); padding: var(--s1) 0; align-items: flex-start; }
.job .jdw { height: 18px; display: flex; align-items: center; flex: none; }
.job .jd { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; }
.job .jd.up { background: var(--ink); }
.job .jw { font-weight: var(--w-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.job .jt { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.job .js { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); flex: none; }
.stage { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s2); }
.stage .st { font-weight: var(--w-semibold); font-size: var(--fs-base); display: flex; gap: var(--s1); align-items: center; }
.stage p { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); margin: var(--s1) 0 0; }
.cs { padding: var(--s1) 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.cs .cwhen { color: var(--text-3); margin-bottom: var(--s-half); }

/* ---------- States ---------- */
.center { display: flex; flex: 1; align-items: center; justify-content: center; padding: var(--s4); text-align: center; flex-direction: column; gap: var(--s1); }
.center img { width: 120px; height: 120px; object-fit: contain; margin-bottom: var(--s1); }
.center h2 { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); }
.center p { color: var(--text-2); max-width: 320px; }
.center .btn { margin-top: var(--s2); }
.center .ring { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-hover); display: grid; place-items: center; color: var(--text-2); margin-bottom: var(--s1); }
.center .ring.err { background: var(--red-bg); color: var(--red); }
.sk { background: linear-gradient(90deg, #E8EAEE 25%, #F2F4F7 50%, #E8EAEE 75%); background-size: 200% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: var(--r-sm); }
.sk.c { border-radius: 50%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .tip { transition: none; } }
.paused .sk { animation: none; }
.skrow { display: flex; gap: var(--s2); align-items: center; height: 72px; padding: 0 var(--s2); border-bottom: 1px solid var(--border); }
.skrow .lines { flex: 1; display: flex; flex-direction: column; gap: var(--s1); }

/* ---------- Calendar ---------- */
.cal { position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--topbar)); background: var(--surface); }
.cal-tools { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s3); border-bottom: 1px solid var(--border); flex: none; }
.cal-tools .l, .cal-tools .r { display: flex; align-items: center; gap: var(--s1); }
.cal-tools .range { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); margin-left: var(--s1); }
.cal-tools .count { color: var(--text-2); margin-right: var(--s1); }
.cal-grid { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.cal-head { display: grid; grid-template-columns: 80px repeat(7, minmax(0, 1fr)); height: 64px; border-bottom: 1px solid var(--border); }
.cal-head .d { border-left: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.cal-head .d b { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--w-semibold); color: var(--text); }
.cal-head .d.today b { background: var(--ink); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-md); line-height: 32px; }
.cal-head .d.today { color: var(--text); font-weight: var(--w-semibold); }
.cal-body { display: grid; grid-template-columns: 80px repeat(7, minmax(0, 1fr)); position: relative; }
.cal-gutter { position: relative; height: calc(var(--hour) * 11); }
.cal-gutter span { position: absolute; white-space: nowrap; right: var(--s1); transform: translateY(-50%); color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); background: var(--surface); padding: 0 var(--s-half); }
.cal-gutter span:first-child { transform: translateY(0); }
.cal-col { position: relative; border-left: 1px solid var(--border); height: calc(var(--hour) * 11);
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); background-size: 100% var(--hour); }
.cal-col.today { background-color: #FCFCFD; }
.blk {
  position: absolute; left: var(--s1); right: var(--s1); border-radius: var(--r-sm); padding: var(--s1) var(--s1) var(--s1) var(--s2);
  background: #EAEFF6; border: 1px solid #D5DEEB; overflow: hidden; color: var(--text);
}
.blk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #344054; }
.blk:hover { box-shadow: var(--sh-2); border-color: #B5C3D8; }
.blk .bn { font-weight: var(--w-semibold); font-size: var(--fs-base); line-height: var(--lh-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .bs { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.blk.long .bs { -webkit-line-clamp: 2; }
.blk .bt { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); white-space: nowrap; }
.blk.showed { background: var(--green-bg); border-color: #C3E6D2; } .blk.showed::before { background: var(--green-line); }
.blk.cancelled { background: var(--red-bg); border-color: #F8CFCB; } .blk.cancelled::before { background: var(--red-line); } .blk.cancelled .bn { text-decoration: line-through; color: var(--text-2); }
.blk.noshow { background: var(--amber-bg); border-color: #F5DFB0; } .blk.noshow::before { background: #F79009; }
.blk.active-sel { box-shadow: 0 0 0 2px var(--ink); border-color: var(--ink); }
.dayoff { position: absolute; left: var(--s1); right: var(--s1); top: var(--s1); bottom: var(--s1); border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  background: repeating-linear-gradient(135deg, #FAFAFB, #FAFAFB 8px, #F2F4F7 8px, #F2F4F7 16px); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: var(--s3); gap: var(--s1); color: var(--text-2); font-weight: var(--w-semibold); }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--red-line); z-index: 3; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red-line); }
.scrim { position: absolute; left: 0; top: 0; bottom: 0; right: var(--drawer-w); background: rgba(16, 24, 40, 0.24); z-index: 10; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: var(--drawer-w); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--sh-3); z-index: 20; display: flex; flex-direction: column; }
.drawer-head { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s2) 0 var(--s3); border-bottom: 1px solid var(--border); flex: none; }
.drawer-head h2 { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); }
.drawer-body { flex: 1; min-height: 0; overflow: hidden; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.drawer-foot { padding: var(--s2) var(--s3); border-top: 1px solid var(--border); display: flex; gap: var(--s1); flex: none; }
.drawer-foot .btn { flex: 1; }
.when { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--w-semibold); }
.whent { color: var(--text-2); margin-top: var(--s-half); display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.drow { display: flex; gap: var(--s2); padding: var(--s1) 0; align-items: flex-start; }
.drow .ico { color: var(--text-3); margin-top: 2px; }
.drow .k { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.drow .v { font-size: var(--fs-base); line-height: var(--lh-base); }
.drow .grow { flex: 1; }
.dacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.dacts .btn { flex-direction: column; height: 64px; gap: var(--s-half); font-size: var(--fs-sm); padding: 0; }
.fld { display: flex; flex-direction: column; gap: var(--s1); }
.fld > label, .lab { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--w-semibold); color: var(--text-2); }
.opts { display: flex; flex-wrap: wrap; gap: var(--s1); }
.hint { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0 var(--s-half); text-align: center; }
.mini .h { color: var(--text-3); font-size: var(--fs-sm); height: 24px; }
.mini .c { height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); font-size: var(--fs-base); color: var(--text); }
.mini .c.off { color: #98A2B3; }
.mini .c.sel { background: var(--ink); color: #fff; font-weight: var(--w-semibold); }
.mini .c.now { box-shadow: inset 0 0 0 1px var(--ink); font-weight: var(--w-semibold); }
.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.times .chip { justify-content: center; padding: 0; }
.times .chip.off { color: #98A2B3; background: var(--surface-muted); border-color: var(--border); text-decoration: line-through; cursor: default; }

/* ---------- Home ---------- */
.page { padding: var(--s4); max-width: 1440px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3); box-shadow: var(--sh-1); min-width: 0; }
.card .cardhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); min-height: 32px; }
.kicker { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--w-bold); color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; }
.card .big { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--w-bold); letter-spacing: -0.02em; }
.card .lead { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--w-semibold); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
.stat { padding: var(--s2); background: var(--surface-muted); border-radius: var(--r-md); border: 1px solid var(--border); }
.stat .big { margin-bottom: var(--s-half); }
.stat .l { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.foot-link { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); color: var(--text); font-weight: var(--w-medium); }
.pill { display: inline-flex; gap: var(--s1); align-items: center; height: 32px; padding: 0 var(--s2); border-radius: var(--r-pill); background: var(--surface-hover); font-size: var(--fs-base); }
.pill b { font-weight: var(--w-bold); }
.pill.unread b { color: var(--orange-text); }
.nextjob { display: flex; gap: var(--s1); align-items: center; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); color: var(--text); }
.nextjob .ico { color: var(--text-3); }
.days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.dcol .dh { font-size: var(--fs-sm); font-weight: var(--w-bold); color: var(--text-2); margin-bottom: var(--s1); padding-bottom: var(--s1); border-bottom: 1px solid var(--border); }
.dcol .dh.today { color: var(--text); }
.drw { display: flex; gap: var(--s1); align-items: stretch; padding: var(--s1) 0; }
.drw .tm { width: 64px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); flex: none; }
.drw .bar { width: 4px; border-radius: 2px; background: #344054; flex: none; }
.drw .tx .a { font-weight: var(--w-semibold); font-size: var(--fs-base); line-height: var(--lh-base); }
.drw .tx .b { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.nothing { color: var(--text-3); font-size: var(--fs-sm); padding: var(--s1) 0; }
.managed { color: var(--text-2); font-size: var(--fs-sm); margin: var(--s-half) 0 var(--s2); }
.rowlink { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0; border-bottom: 1px solid var(--border); min-height: var(--s6); }
.rowlink:last-child { border-bottom: 0; }
.rowlink .ico:first-child { color: var(--text-2); }
.rowlink .rt { flex: 1; min-width: 0; }
.rowlink .rt .a { font-weight: var(--w-semibold); }
.rowlink .rt .b { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.rowlink .ico:last-child { color: var(--text-3); }
.rangechip { display: inline-flex; align-items: center; gap: var(--s1); height: var(--chip); padding: 0 var(--s2); border: 1px solid var(--border-strong); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: var(--w-semibold); color: var(--text-2); background: var(--surface); }
.zero { color: var(--text-3); }

/* ---------- Contacts ---------- */
.ctools { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.ctools .input { max-width: 400px; }
.ctools .grow { flex: 1; }
.ctable { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.crow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) minmax(0, 2.6fr) minmax(0, 1fr) 32px; gap: var(--s2); align-items: center; min-height: var(--row); padding: var(--s1) var(--s3); border-bottom: 1px solid var(--border); }
.crow:last-child { border-bottom: 0; }
.crow.h { min-height: 48px; background: var(--surface-muted); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--w-semibold); }
.crow:not(.h):hover { background: var(--surface-muted); }
.crow .nm { display: flex; align-items: center; gap: var(--s2); font-weight: var(--w-semibold); min-width: 0; }
.crow .nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .tags { display: flex; gap: var(--s1); flex-wrap: nowrap; overflow: hidden; }
.crow .ph { color: var(--text-2); font-variant-numeric: tabular-nums; }
.crow .sp { color: var(--text-3); font-size: var(--fs-sm); }
.crow .go { color: var(--text-3); }
.cfoot { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) 0 0; color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Phone only ---------- */
.phonecard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5) var(--s4); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s1); box-shadow: var(--sh-1); }
.phonecard .ring { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-hover); display: grid; place-items: center; color: var(--text-2); margin-bottom: var(--s1); }
.phonecard h2 { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--w-semibold); }
.phonecard p { color: var(--text-2); max-width: 400px; }
.phonecard .tagline { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s1); }
.stage-center { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--topbar)); padding: var(--s4); }
.stage-center .phonecard { width: 560px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.gallery > div { display: flex; flex-direction: column; }
.gallery .phonecard { flex: 1; justify-content: center; }
.gallery .cap { font-size: var(--fs-sm); font-weight: var(--w-bold); color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--s1); }

/* ---------- Narrow window ---------- */
.too-small { display: none; min-height: 100vh; background: var(--bg); align-items: center; justify-content: center; padding: var(--s4); text-align: center; flex-direction: column; gap: var(--s2); }
.too-small .card { max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s5) var(--s4); }
.too-small img.mk { width: 64px; height: 64px; margin-bottom: var(--s2); }
.too-small h1 { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--w-semibold); }
.too-small p { color: var(--text-2); }
@media (max-width: 1279px) {
  body { min-width: 0; }
  .app { display: none !important; }
  .too-small { display: flex; }
}

.drawer.wide { width: 480px; }
.scrim.wide { right: 480px; }
.times.six { grid-template-columns: repeat(6, 1fr); }
.input.tall { height: auto; min-height: var(--control); }

.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
