/* Zonetide Desk: the team's back office. Desktop-first: sidebar + main + slide-in shop panel.
   Colors come from tokens.css (same as the app). Below 900px the sidebar becomes a bottom bar
   and the shop panel covers the screen. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
[hidden] { display: none !important; }
body { background: var(--soft); color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 800; font-size: 17px; }
.side .brand .mk { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; flex: none; }
.side .brand small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { width: 100%; min-height: 40px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; gap: 10px; padding: 0 10px; font-weight: 600; color: var(--muted); text-align: left; }
.nav:hover { background: var(--soft); color: var(--fg); }
.nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .ct { margin-left: auto; min-width: 22px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.nav .ct:empty { display: none; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); width: 100%; text-align: left; }
.me .m { display: flex; flex-direction: column; min-width: 0; }
.me .m span { font-size: 12px; color: var(--muted); }
.proto { font-size: 11px; color: var(--muted); padding: 8px 8px 0; }

.main { min-width: 0; padding: 24px 28px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.head .sub { color: var(--muted); margin-top: 2px; }

/* Shared bits */
.btn { height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-fg); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.btn.ghost { background: var(--bg); color: var(--fg); border: 1.5px solid var(--line); }
.btn.quiet { background: var(--soft); color: var(--fg); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 36px; border: 0; border-radius: 7px; background: transparent; padding: 0 12px; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.new { background: var(--accent-soft); color: var(--accent); }
.pill.stuck { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); color: var(--warn); }
.pill.help { background: color-mix(in srgb, var(--bad) 12%, var(--bg)); color: var(--bad); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.open { background: color-mix(in srgb, var(--bad) 12%, var(--bg)); color: var(--bad); }
.pill.waiting { background: var(--soft); color: var(--muted); }
.pill.solved { background: var(--good-soft); color: var(--good); }
.who { width: 28px; height: 28px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; color: #fff; }
.who.none { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.who.p { background: #1D4ED8; } .who.s { background: #0F766E; } .who.j { background: #B45309; }
.dot { width: 9px; height: 9px; border-radius: 5px; display: inline-block; flex: none; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.new { background: var(--accent); }
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.empty { border: 1.5px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); background: var(--bg); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; }

/* Needs you */
.queue { display: flex; flex-direction: column; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.qrow:first-child { border-radius: 14px 14px 0 0; } .qrow:last-child { border-bottom: 0; border-radius: 0 0 14px 14px; } .qrow:only-child { border-radius: 14px; }
.qrow .m { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qrow .t1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qrow .t1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .t1 .pill { flex: none; }
.qrow .sb { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .acts { display: flex; gap: 8px; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.nfbar { margin: -6px 0 14px; justify-content: space-between; align-items: flex-start; }
.nfsel { display: flex; gap: 8px; flex: none; }
.frow2 { display: flex; gap: 6px; flex-wrap: wrap; }
.tchip { height: 36px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 12px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.tchip span { color: var(--muted); font-weight: 700; font-size: 12px; }
.tchip[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.tchip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.nfbar select { height: 36px; }

/* Onboarding board */
.board { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)) minmax(140px, .8fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.colm { background: var(--track); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.colm.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.colm h2 { font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.colm h2 span { color: var(--muted); }
.ocard { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; cursor: grab; }
.ocard:hover { border-color: var(--accent); }
.ocard .t { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ocard .t b { display: block; }
.ocard .t .st { color: var(--muted); font-size: 12px; display: block; }
.ocard .f { display: flex; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ocard .f > span:first-child { white-space: nowrap; }
.ocard .nx { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .nx.late { color: var(--warn); font-weight: 700; }
.ocard.live { gap: 2px; padding: 8px 10px; }
.ocard.live .st { display: flex; align-items: center; gap: 5px; }

/* Onboarding Today list */
.ostrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ostrip .card { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ostrip b { font-size: 22px; }
.olist { overflow: hidden; margin-bottom: 12px; }
.oitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.oitem:last-child { border-bottom: 0; }
.oitem .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.olink { color: var(--fg); font-weight: 700; font-size: 15px; text-align: left; }
.olink:hover { color: var(--accent); }
.oitem .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.oitem a.btn { text-decoration: none; }
.sdots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; }
.sdots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); display: block; }
.sdots i.d { background: var(--good); }
.oauto { padding: 12px 16px; margin-bottom: 12px; }
.dayin { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.dayin.ok { background: var(--good-soft); color: var(--good); }
.dayin.warn { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); color: var(--warn); }
.dayin.bad { background: color-mix(in srgb, var(--bad) 12%, var(--bg)); color: var(--bad); }
.otime { padding: 12px 16px; }
.otime .r { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.otime td:nth-child(2) { width: 30%; padding: 0 12px; }
.otime td:last-child { width: 1%; }
.tbar { display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.tbar i { display: block; height: 100%; border-radius: 3px; }
.tbar i.ok { background: var(--good); } .tbar i.warn { background: var(--warn); } .tbar i.bad { background: var(--bad); }
.oauto .r { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.oauto ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.head .toolbar { flex-wrap: wrap; }

/* Inbox */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 560px; }
.tlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.tlist .toolbar { padding: 10px; border-bottom: 1px solid var(--line); }
.trow { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); text-align: left; width: 100%; }
.trow:hover { background: var(--soft); }
.trow[aria-current="true"] { background: var(--accent-soft); }
.trow .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.trow .r1 b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .r2 { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .r3 { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thead { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.thead h2 { font-size: 17px; }
.ctx { margin: 14px 18px 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 12px; }
.ctx div { display: flex; flex-direction: column; min-width: 0; }
.ctx b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx span { color: var(--muted); }
.msgs { flex: 1; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 52vh; }
.msg { max-width: 78%; padding: 10px 12px; border-radius: 14px; background: var(--soft); align-self: flex-start; }
.msg.team { background: var(--accent); color: var(--accent-fg); align-self: flex-end; }
.msg.note { background: color-mix(in srgb, var(--warn) 12%, var(--bg)); border: 1px dashed var(--warn); align-self: stretch; max-width: none; }
.msg .by { font-size: 11px; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.reply { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.reply textarea { width: 100%; min-height: 70px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); resize: vertical; }
.reply .row { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.reply select, .toolbar select, .toolbar input { height: 34px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 8px; }
.toolbar input { min-width: 220px; flex: 1; height: 38px; }
.access { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }

/* Calls */
.calls { display: grid; grid-template-columns: 300px minmax(0, 1fr) 220px; gap: 12px; align-items: start; }
.clistp { overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 130px); }
.clistp > .toolbar { flex-direction: column; align-items: stretch; }
.clistp .toolbar input { min-width: 0; flex: none; height: 38px; }
.clistp .frow2 { gap: 4px; }
.clistp .tchip { height: 32px; font-size: 12px; padding: 0 10px; }
.clistp { overflow-y: auto; }
.lrow { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); text-align: left; width: 100%; }
.lrow:hover { background: var(--soft); }
.lrow[aria-current="true"] { background: var(--accent-soft); }
.lrow .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lrow .r1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .r2 { color: var(--muted); font-size: 12px; }
.cscreen { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.chead h2 { font-size: 22px; }
.cdial { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.calbtn { height: 48px; font-size: 18px; padding: 0 18px; text-decoration: none; border-radius: 12px; }
.scrwrap { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.scrwrap > summary { font-weight: 800; cursor: pointer; padding: 4px 0; }
.scr p { margin: 6px 0; line-height: 1.5; }
.scr details { border-top: 1px solid var(--line); padding: 6px 0; }
.scr details summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 13px; }
.cscreen textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); resize: vertical; }
.cbform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; background: var(--soft); border-radius: 12px; padding: 10px; }
.cbform label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.cbform input { height: 38px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--bg); }
.cfoot { position: sticky; bottom: 0; background: var(--bg); margin: 0 -18px -16px; padding: 10px 18px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; border-radius: 0 0 14px 14px; box-shadow: 0 -6px 14px -10px rgba(0,0,0,.25); }
.outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ob { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 700; padding: 6px; }
.ob:hover { border-color: var(--accent); }
.ob.main { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.ob.bad { color: var(--bad); }
.ob:disabled { opacity: .4; cursor: not-allowed; }
.cstats { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cstats h2 { font-size: 16px; }
.cgoal, .cnum { display: flex; flex-direction: column; gap: 4px; }
.cgoal b, .cnum b { font-size: 24px; }
.cgoal .link { align-self: flex-start; font-size: 12px; }
.cweek { display: flex; gap: 6px; align-items: flex-end; height: 64px; border-top: 1px solid var(--line); padding-top: 8px; }
.cweek span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; }
.cweek i { width: 100%; max-width: 18px; background: var(--accent); border-radius: 3px 3px 0 0; display: block; }
.cweek em { font-style: normal; font-size: 10px; color: var(--muted); }
.mapgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mapgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.mapgrid select { height: 38px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 6px; color: var(--fg); min-width: 0; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Centered dialog */
.dlg { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--bg); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; }
#dlgScrim { z-index: 30; }
.dlghead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.dlghead h2 { font-size: 19px; }
.dlgbody { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 12px; }

/* Shops table */
.tbl { width: 100%; border-collapse: collapse; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--soft); }
.tbl .num { text-align: right; }
.tblwrap { overflow-x: auto; border-radius: 14px; }

/* Shops by category */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.catcard { text-align: left; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.catcard:hover { border-color: var(--accent); }
.catcard .cname { display: flex; flex-direction: column; gap: 2px; }
.catcard .cname b { font-size: 16px; }
.cic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.cbreak { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cb { border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; font-size: 11px; font-weight: 700; background: var(--soft); color: var(--muted); }
.cb b { font-size: 18px; color: var(--fg); }
.cb.risk:not(.zero) { background: color-mix(in srgb, var(--warn) 12%, var(--bg)); color: var(--warn); }
.cb.risk:not(.zero) b { color: var(--warn); }
.cb.live:not(.zero) { background: var(--good-soft); color: var(--good); }
.cb.live:not(.zero) b { color: var(--good); }
.cb.onb:not(.zero) { background: var(--accent-soft); color: var(--accent); }
.cb.onb:not(.zero) b { color: var(--accent); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumbs .link { font-size: 13px; }
.shsec { margin-bottom: 18px; }
.shh { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.shh span { font-size: 12px; color: var(--muted); }
.shh::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: var(--accent); }
.shh.live::before { background: var(--good); } .shh.risk::before { background: var(--warn); }

/* Shop panel */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); z-index: 21; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
.phead { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.phead .r { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.phead h2 { font-size: 20px; }
.phead .meta { color: var(--muted); }
.x { width: 38px; height: 38px; border-radius: 19px; border: 0; background: var(--soft); display: grid; place-items: center; flex: none; }
.ptabs { display: flex; gap: 2px; overflow-x: auto; }
.ptabs button { height: 40px; border: 0; background: none; padding: 0 12px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.ptabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.pbody { flex: 1; overflow-y: auto; padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { background: var(--soft); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.facts span { font-size: 11px; color: var(--muted); }
.facts b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant { border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grant.on { background: var(--good-soft); color: var(--good); }
.grant.off { background: var(--soft); color: var(--muted); }
.grant b { color: inherit; }
.steps { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .ck { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; color: transparent; font-size: 13px; font-weight: 800; }
.step.done .ck { background: var(--good); border-color: var(--good); color: #fff; }
.step .m { flex: 1; min-width: 0; }
.step .m span { display: block; font-size: 12px; color: var(--muted); }
.tl { display: flex; flex-direction: column; }
.tli { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tli .ic { width: 28px; height: 28px; border-radius: 14px; background: var(--soft); display: grid; place-items: center; flex: none; font-size: 13px; }
.tli .m { flex: 1; min-width: 0; }
.tli time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notebox { display: flex; gap: 8px; }
.notebox input { flex: 1; min-width: 0; height: 38px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--bg); }
.ro { border: 2px solid var(--warn); border-radius: 14px; overflow: hidden; }
.ro .rohead { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); color: var(--warn); padding: 8px 12px; font-weight: 700; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.ro .robody { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pat { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.pat div { border-radius: 8px; padding: 6px 2px; text-align: center; font-size: 11px; font-weight: 700; background: var(--soft); }
.pat div b { display: block; font-size: 10px; color: var(--muted); }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.mini td:last-child { text-align: right; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.form input, .form textarea, .form select { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); font-weight: 500; color: var(--fg); font-size: 14px; }
.err { color: var(--bad); font-size: 13px; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ink-fg); border-radius: 12px; padding: 10px 16px; font-weight: 600; z-index: 40; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* Phones and small windows */
/* New shops dropdown */
.grph .chev { margin-left: 4px; transition: transform .15s; flex: none; }
.grph .ct + .chev { margin-left: 6px; }
.grph[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.grph[aria-expanded="false"] + .grpitems { display: none; }
.grph .ct { margin-left: auto; }
.grph .ct:empty + .chev { margin-left: auto; }
.grph.has-current { background: var(--accent-soft); color: var(--accent); }
.grpitems { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.grpitems .nav { padding-left: 38px; }
.navgrp { display: flex; flex-direction: column; }

/* Tablets and small laptop windows: keep the sidebar, tighten the busy pages */
@media (min-width: 700px) and (max-width: 1099px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .main { padding: 20px 18px 60px; }
  .calls { grid-template-columns: minmax(0, 1fr); }
  .calls.reading .clistp, .calls.reading .cstats { display: none; }
  .calls:not(.reading) .cscreen { display: none; }
  .calls .mobonly { display: inline-flex !important; align-self: flex-start; }
  .cstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .cstats h2, .cweek { display: none; }
  .clistp { max-height: none; }
  .ostrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 260px minmax(0, 1fr); }
  .ctx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); z-index: 10; gap: 2px; }
  .side .brand, .side .spacer, .me, .proto, #teamBtn, #signOut, .grph { display: none; }
  .navgrp, .grpitems { display: contents !important; }
  .grpitems .nav { padding-left: 2px; }
  .nav { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; font-size: 11px; padding: 0 2px; position: relative; }
  .nav .ct { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; }
  .main { padding: 16px 16px 96px; }
  .head h1 { font-size: 22px; }
  .qrow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .qrow .sb { white-space: normal; }
  .nfsel { width: 100%; }
  .nfsel select { flex: 1; min-width: 0; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.reading .tlist { display: none; }
  .inbox:not(.reading) .thread { display: none; }
  .ctx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg { max-width: 90%; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; }
  .colm { scroll-snap-align: start; }
  .mobhide { display: none; }
  .ostrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .otime td:nth-child(2) { display: none; }
  .oitem { grid-template-columns: minmax(0, 1fr); }
  .oitem .acts { justify-content: flex-start; }
  .calls { grid-template-columns: minmax(0, 1fr); }
  .cfoot { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .calls.reading .clistp, .calls.reading .cstats { display: none; }
  .calls:not(.reading) .cscreen { display: none; }
  .clistp { max-height: none; }
  .outs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapgrid { grid-template-columns: minmax(0, 1fr); }
  .toolbar input { flex-basis: 100%; min-width: 0; }
}
@media (min-width: 700px) { .mobonly { display: none !important; } }

/* ---------- Workshops ---------- */
.wsh2 { font-size: 15px; font-weight: 800; margin: 22px 0 10px; }
.wssess { margin-bottom: 14px; overflow: hidden; }
.wssess.soon { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wshd { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--soft); border-bottom: 1px solid var(--line); }
.wshd > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.wshd .acts { display: flex; gap: 8px; align-items: center; }
.wssoon { color: var(--accent); }
.wssess .qrow { border-radius: 0 !important; }
.wssess .qrow .acts { flex-wrap: wrap; justify-content: flex-end; }
.wslist { display: flex; align-items: center; gap: 6px; }
.wslist .dot { flex: none; }
.wsprep { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.wsprep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.wsprep li { display: flex; gap: 8px; align-items: baseline; }
.wsprep li .dot { flex: none; transform: translateY(-1px); }
.wspast { margin-top: 18px; }
.wspast summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.wsslotrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .wssess .qrow { grid-template-columns: 1fr; } .wssess .qrow .acts { justify-content: flex-start; } }

/* ---------- Team sign-in ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #E6F5FA 0%, var(--soft) 60%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gate { background: var(--soft); } }
.gatecard { width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 20px 50px -30px rgba(0, 43, 92, .45); }
.gbrand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.gbrand .mk { width: 36px; height: 36px; border-radius: 10px; background: #002B5C; color: #fff; display: grid; place-items: center; }
.gbrand small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.gatecard h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.gatecard .gsub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.gatecard .form input { height: 46px; font-size: 16px; }
.gbtn { height: 48px; border-radius: 12px; border: 0; background: #002B5C; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.gbtn.alt { background: var(--bg); color: var(--fg); border: 1.5px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gbtn:not(.alt) { background: #3DBEE6; color: #001A38; } }
.gor { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.gor::before, .gor::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gfoot { font-size: 13px; color: var(--muted); margin: 0; text-align: center; }
.gnote { font-size: 12px; color: var(--muted); margin: 0; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.gsent { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.gsent .ic { width: 52px; height: 52px; border-radius: 50%; background: #E6F5FA; color: #0077A0; display: grid; place-items: center; }
.shell[hidden] { display: none !important; }

.acctbtn { display: none; }
@media (max-width: 699px) {
  .acctbtn { display: grid; place-items: center; position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); z-index: 5; padding: 0; }
  .main { position: relative; }
  .main .head { padding-right: 52px; }
}
.acctrow { display: flex; align-items: center; gap: 12px; }
.acctrow .m { display: flex; flex-direction: column; min-width: 0; }
.acctrow .m span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
