:root{
  --bg:#F4F5F7; --surface:#FFFFFF; --surface-2:#F8F9FB; --surface-3:#EEF0F3; --border:#E3E6EB; --border-2:#CED3DB;
  --text:#111827; --text-2:#4A5565; --text-3:#8A93A3;
  --brand:#0B6B83; --brand-strong:#08546A; --brand-soft:#E3F2F6; --brand-line:#9BCFDD; --on-brand:#FFFFFF;
  --s-active:#0B6B83; --s-active-bg:#E3F2F6;
  --s-paused:#5B6474; --s-paused-bg:#EEF0F3;
  --s-suspended:#A45A06; --s-suspended-bg:#FDF0D9;
  --s-returned:#B4233F; --s-returned-bg:#FCE7EB;
  --s-done:#167245; --s-done-bg:#DFF4E8;
  --s-queued:#3F4BC1; --s-queued-bg:#E9ECFC;
  --s-draft:#6B7280; --s-draft-bg:#F3F4F6;
  --danger:#C62828; --warn:#A45A06; --good:#167245;
  --shadow-1:0 1px 2px rgba(17,24,39,.06); --shadow-2:0 4px 16px rgba(17,24,39,.08); --shadow-3:0 18px 48px rgba(17,24,39,.18);
  --font:"Manrope","Segoe UI",system-ui,-apple-system,sans-serif;
  --r-s:6px; --r-m:8px; --r-l:12px;
  --side:248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0E121A; --surface:#161B24; --surface-2:#1B212C; --surface-3:#232A36; --border:#2A3240; --border-2:#3A4352;
    --text:#ECEEF2; --text-2:#A9B1BE; --text-3:#717B8B;
    --brand:#4FB7D1; --brand-strong:#7ACBDF; --brand-soft:#153340; --brand-line:#2C6577; --on-brand:#0E121A;
    --s-active:#4FB7D1; --s-active-bg:#153340; --s-paused:#A9B1BE; --s-paused-bg:#232A36; --s-suspended:#F0A84A; --s-suspended-bg:#3A2A12;
    --s-returned:#F2738B; --s-returned-bg:#3D1A23; --s-done:#5CC98E; --s-done-bg:#16301F; --s-queued:#8E98F2; --s-queued-bg:#1F2445; --s-draft:#A9B1BE; --s-draft-bg:#232A36;
    --danger:#F2736A; --warn:#F0A84A; --good:#5CC98E; --shadow-1:0 1px 2px rgba(0,0,0,.3); --shadow-2:0 4px 16px rgba(0,0,0,.35); --shadow-3:0 18px 48px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0E121A; --surface:#161B24; --surface-2:#1B212C; --surface-3:#232A36; --border:#2A3240; --border-2:#3A4352;
  --text:#ECEEF2; --text-2:#A9B1BE; --text-3:#717B8B;
  --brand:#4FB7D1; --brand-strong:#7ACBDF; --brand-soft:#153340; --brand-line:#2C6577; --on-brand:#0E121A;
  --s-active:#4FB7D1; --s-active-bg:#153340; --s-paused:#A9B1BE; --s-paused-bg:#232A36; --s-suspended:#F0A84A; --s-suspended-bg:#3A2A12;
  --s-returned:#F2738B; --s-returned-bg:#3D1A23; --s-done:#5CC98E; --s-done-bg:#16301F; --s-queued:#8E98F2; --s-queued-bg:#1F2445; --s-draft:#A9B1BE; --s-draft-bg:#232A36;
  --danger:#F2736A; --warn:#F0A84A; --good:#5CC98E; --shadow-1:0 1px 2px rgba(0,0,0,.3); --shadow-2:0 4px 16px rgba(0,0,0,.35); --shadow-3:0 18px 48px rgba(0,0,0,.5); color-scheme: dark;
}
*{box-sizing:border-box}
:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px);height:100%}
body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;font-feature-settings:"tnum" 0}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--brand)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
h1,h2,h3,h4{margin:0;font-weight:700;letter-spacing:-.01em}
h1{font-size:24px;line-height:1.25;letter-spacing:-.02em}
h2{font-size:18px;line-height:1.3}
h3{font-size:15px;line-height:1.35}
h4{font-size:13px;color:var(--text-2);font-weight:600}
p{margin:0}
.muted{color:var(--text-2)}.faint{color:var(--text-3)}.small{font-size:13px}.tiny{font-size:12px}.num{font-variant-numeric:tabular-nums}
.strong{font-weight:600}.mono-key{font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-2);font-size:12px;letter-spacing:.01em}

/* ---------- shell ---------- */
.shell{display:grid;grid-template-columns:var(--side) minmax(0,1fr);min-height:100vh}
.side{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--border);padding:14px 12px;overflow-y:auto}
.ws{display:flex;align-items:center;gap:10px;padding:6px 8px 14px;border-bottom:1px solid var(--border);margin-bottom:10px}
.ws .logo{width:34px;height:34px;border-radius:9px;background:var(--brand);color:var(--on-brand);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;flex:none}
.ws .nm{font-weight:700;line-height:1.2}
.ws .pl{font-size:11.5px;color:var(--text-3)}
.navgroup{margin:10px 0 4px;padding:0 10px;font-size:11.5px;font-weight:600;color:var(--text-3)}
.navitem{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:var(--r-m);background:none;color:var(--text-2);cursor:pointer;font-weight:500;text-align:left}
.navitem:hover{background:var(--surface-2);color:var(--text)}
.navitem[aria-current="page"]{background:var(--brand-soft);color:var(--brand-strong);font-weight:600}
.navitem .count{margin-left:auto;min-width:20px;padding:0 6px;height:20px;border-radius:10px;background:var(--surface-3);color:var(--text-2);font-size:11.5px;line-height:20px;text-align:center;font-weight:600}
.navitem .count.alert{background:var(--s-returned);color:#fff}
.side .foot{margin-top:auto;padding-top:12px;border-top:1px solid var(--border)}
.userbtn{display:flex;align-items:center;gap:10px;width:100%;padding:8px;border:0;border-radius:var(--r-m);background:none;cursor:pointer;text-align:left}
.userbtn:hover{background:var(--surface-2)}
.main{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:env(safe-area-inset-top,0px);z-index:30;display:flex;align-items:center;gap:12px;height:60px;padding:0 24px;background:color-mix(in srgb,var(--bg) 85%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.topbar .title{font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .crumb{color:var(--text-3);font-weight:500}
.topbar .spacer{flex:1}
.search{position:relative;width:min(320px,34vw)}
.search input{padding-left:34px;height:36px;min-height:36px;background:var(--surface)}
.search svg{position:absolute;left:10px;top:9px;color:var(--text-3)}
.results{position:absolute;top:42px;left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow-2);z-index:40;padding:6px;max-height:60vh;overflow:auto}
.viewas{display:flex;align-items:center;gap:8px;padding:4px 4px 4px 10px;border:1px dashed var(--border-2);border-radius:var(--r-m);background:var(--surface)}
.viewas select{border:0;background:transparent;min-height:28px;height:28px;padding:0 4px;font-weight:600;width:auto}
.viewas select:focus{outline:none}
.content{padding:24px;max-width:1360px;width:100%}
.menubtn{display:none}
.banner{padding:9px 24px;background:var(--s-suspended-bg);color:var(--text);font-size:13px;border-bottom:1px solid var(--border)}
@media (max-width: 900px){
  .shell{grid-template-columns:1fr}
  .side{position:fixed;left:0;top:0;bottom:0;width:280px;z-index:80;transform:translateX(-100%);transition:transform .2s;box-shadow:var(--shadow-3)}
  .side.open{transform:none}
  .menubtn{display:inline-flex}
  .search{display:none}
  .content{padding:16px}
  .topbar{padding:0 12px}
  .hide-sm{display:none !important}
}

/* ---------- controls ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;padding:0 14px;border-radius:var(--r-m);border:1px solid var(--border-2);background:var(--surface);color:var(--text);cursor:pointer;font-weight:600;font-size:13.5px;white-space:nowrap;box-shadow:var(--shadow-1)}
.btn:hover{background:var(--surface-2)}
.btn.primary{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.btn.primary:hover{background:var(--brand-strong);border-color:var(--brand-strong)}
.btn.danger{background:var(--surface);border-color:var(--danger);color:var(--danger)}
.btn.danger.solid{background:var(--danger);color:#fff}
.btn.ghost{border-color:transparent;background:transparent;box-shadow:none}
.btn.ghost:hover{background:var(--surface-3)}
.btn.sm{height:30px;padding:0 10px;font-size:12.5px}
.btn.lg{height:44px;padding:0 20px;font-size:14.5px}
.btn.icon{width:36px;padding:0}
.btn.icon.sm{width:30px}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.row.nowrap{flex-wrap:nowrap}
.row.end{justify-content:flex-end}.row.between{justify-content:space-between}.row.top{align-items:flex-start}
.stack{display:flex;flex-direction:column;gap:12px}.stack.sm{gap:6px}.stack.lg{gap:20px}.stack.xl{gap:28px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}.g5{grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width: 1100px){.g4,.g5{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 640px){.g2,.g3,.g4,.g5{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:6px}
.field>.lbl{font-size:12.5px;font-weight:600;color:var(--text-2)}
.field .hint{font-size:12px;color:var(--text-3)}
input[type=text],input[type=email],input[type=number],input[type=search],input[type=date],input:not([type]),select,textarea{width:100%;height:36px;min-height:36px;padding:0 11px;border:1px solid var(--border-2);border-radius:var(--r-m);background:var(--surface);color:var(--text);box-shadow:var(--shadow-1)}
textarea{height:auto;min-height:88px;padding:9px 11px;resize:vertical;line-height:1.5}
input:focus,select:focus,textarea:focus{outline:2px solid var(--brand-line);outline-offset:0;border-color:var(--brand)}
input[disabled],select[disabled],textarea[disabled]{background:var(--surface-2);color:var(--text-3)}
input[type=checkbox],input[type=radio]{accent-color:var(--brand);width:16px;height:16px;margin:0}
.check{display:flex;gap:10px;align-items:flex-start;padding:5px 0;cursor:pointer}
.check input{margin-top:2px;flex:none}
.switch{position:relative;display:inline-flex;align-items:center;width:36px;height:20px;border-radius:10px;background:var(--border-2);border:0;cursor:pointer;flex:none;transition:background .15s}
.switch::after{content:"";position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:var(--shadow-1);transition:transform .15s}
.switch[aria-checked="true"]{background:var(--brand)}
.switch[aria-checked="true"]::after{transform:translateX(16px)}
.seg{display:inline-flex;padding:3px;border-radius:var(--r-m);background:var(--surface-3);gap:2px}
.seg button{border:0;background:transparent;height:28px;padding:0 12px;border-radius:6px;cursor:pointer;color:var(--text-2);font-weight:600;font-size:12.5px}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--text);box-shadow:var(--shadow-1)}
.optcard{display:flex;gap:12px;align-items:flex-start;width:100%;text-align:left;padding:14px;border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);cursor:pointer}
.optcard:hover{border-color:var(--border-2);background:var(--surface-2)}
.optcard[aria-checked="true"]{border-color:var(--brand);background:var(--brand-soft)}
.radio-list{display:flex;flex-direction:column;gap:6px}
.radio-item{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r-m);cursor:pointer;background:var(--surface)}
.radio-item:hover{background:var(--surface-2)}
.radio-item.on{border-color:var(--brand);background:var(--brand-soft)}
.err-box{border:1px solid color-mix(in srgb,var(--danger) 35%,transparent);background:color-mix(in srgb,var(--danger) 8%,var(--surface));border-radius:var(--r-m);padding:10px 12px;color:var(--text)}
.err-box strong{color:var(--danger)}
.err-box ul{margin:6px 0 0;padding-left:18px}
.callout{border:1px solid var(--border);background:var(--surface-2);border-radius:var(--r-m);padding:10px 12px;font-size:13px;color:var(--text-2)}
.callout.brand{background:var(--brand-soft);border-color:var(--brand-line);color:var(--text)}
.callout.warn{background:var(--s-suspended-bg);border-color:color-mix(in srgb,var(--warn) 40%,transparent);color:var(--text)}
.callout.bad{background:var(--s-returned-bg);border-color:color-mix(in srgb,var(--s-returned) 40%,transparent);color:var(--text)}

/* ---------- surfaces ---------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow-1)}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border)}
.card-b{padding:16px}
.card-b.tight{padding:0}
.kpi{padding:14px 16px}
.kpi .k{font-size:12.5px;color:var(--text-2);font-weight:600}
.kpi .v{font-size:26px;font-weight:800;letter-spacing:-.02em;line-height:1.15;margin-top:4px;font-variant-numeric:tabular-nums}
.kpi .s{font-size:12px;color:var(--text-3);margin-top:2px}
.pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.pagehead p{margin-top:4px}
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);overflow-x:auto}
.tab{border:0;background:none;padding:10px 12px;cursor:pointer;color:var(--text-2);font-weight:600;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;display:inline-flex;gap:6px;align-items:center}
.tab:hover{color:var(--text)}
.tab[aria-selected="true"]{color:var(--brand-strong);border-bottom-color:var(--brand)}
.tab .c{font-size:11.5px;background:var(--surface-3);border-radius:9px;padding:0 6px;color:var(--text-2)}
.badge{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 8px;border-radius:11px;font-size:12px;font-weight:600;white-space:nowrap;background:var(--surface-3);color:var(--text-2)}
.badge .d{width:6px;height:6px;border-radius:50%;background:currentColor}
.badge.active{background:var(--s-active-bg);color:var(--s-active)}
.badge.paused{background:var(--s-paused-bg);color:var(--s-paused)}
.badge.suspended{background:var(--s-suspended-bg);color:var(--s-suspended)}
.badge.returned{background:var(--s-returned-bg);color:var(--s-returned)}
.badge.done{background:var(--s-done-bg);color:var(--s-done)}
.badge.queued{background:var(--s-queued-bg);color:var(--s-queued)}
.badge.draft{background:var(--s-draft-bg);color:var(--s-draft);border:1px dashed var(--border-2)}
.badge.cancelled{background:var(--surface-3);color:var(--text-3)}
.badge.idle{background:var(--surface-3);color:var(--text-3)}
.badge.outline{background:transparent;border:1px solid var(--border-2)}
.prio{display:inline-block;width:8px;height:8px;border-radius:2px;background:var(--danger);transform:rotate(45deg);flex:none}
.avatar{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--brand-soft);color:var(--brand-strong);font-weight:700;font-size:12px;flex:none}
.avatar.sm{width:24px;height:24px;font-size:10.5px}
.avatar.lg{width:40px;height:40px;font-size:14px}
.avatar.empty{background:transparent;border:1px dashed var(--border-2);color:var(--text-3)}
table.t{width:100%;border-collapse:separate;border-spacing:0;font-size:13.5px}
table.t th{position:sticky;top:0;background:var(--surface-2);text-align:left;font-weight:600;color:var(--text-2);font-size:12px;padding:9px 12px;border-bottom:1px solid var(--border);white-space:nowrap}
table.t td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:middle}
table.t tr:last-child td{border-bottom:0}
table.t tr.click{cursor:pointer}
table.t tr.click:hover td{background:var(--surface-2)}
table.t .r{text-align:right}
.scroll{overflow:auto}
.empty{padding:40px 16px;text-align:center;color:var(--text-2)}
.empty h3{color:var(--text);margin-bottom:4px}
.listrow{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border)}
.listrow:last-child{border-bottom:0}
.listrow.click{cursor:pointer}
.listrow.click:hover{background:var(--surface-2)}
.listrow .grow{flex:1;min-width:0}
.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.progress{height:6px;border-radius:3px;background:var(--surface-3);overflow:hidden;position:relative}
.progress>i{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--brand)}
.progress.over>i{background:var(--danger)}
.progress.good>i{background:var(--good)}
.progress.warn>i{background:var(--warn)}
.progress .tick{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--text-3);opacity:.6}

/* ---------- drawer, modal, toasts, popover ---------- */
.overlay{position:fixed;inset:0;background:rgba(15,20,30,.38);z-index:70;display:flex;justify-content:flex-end}
.overlay.center{justify-content:center;align-items:center;padding:20px}
.drawer{width:min(640px,100%);height:100%;background:var(--surface);box-shadow:var(--shadow-3);display:flex;flex-direction:column;animation:dr .2s ease-out}
.drawer.wide{width:min(980px,100%)}
.modal{width:min(520px,100%);max-height:90vh;background:var(--surface);border-radius:var(--r-l);box-shadow:var(--shadow-3);display:flex;flex-direction:column;animation:mo .16s ease-out}
.modal.wide{width:min(720px,100%)}
.d-head{display:flex;align-items:flex-start;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--border)}
.d-head .grow{flex:1;min-width:0}
.d-body{flex:1;overflow-y:auto;padding:18px 20px 24px}
.d-foot{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--border);background:var(--surface-2)}
@keyframes dr{from{transform:translateX(30px);opacity:.3}to{transform:none;opacity:1}}
@keyframes mo{from{transform:translateY(8px) scale(.98);opacity:.3}to{transform:none;opacity:1}}
@media (prefers-reduced-motion: reduce){.drawer,.modal,.side{animation:none;transition:none}}
.toasts{position:fixed;right:20px;bottom:20px;z-index:95;display:flex;flex-direction:column;gap:8px;max-width:min(420px,calc(100vw - 40px))}
.toast{display:flex;gap:10px;align-items:flex-start;background:var(--text);color:var(--surface);padding:11px 14px;border-radius:var(--r-m);box-shadow:var(--shadow-3);font-size:13.5px;font-weight:500}
.toast.error{background:var(--danger);color:#fff}
.toast ul{margin:4px 0 0;padding-left:18px;font-weight:400}
.pop{position:absolute;right:0;top:44px;width:min(400px,92vw);max-height:70vh;overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow-2);z-index:60}
.menu{position:absolute;z-index:60;min-width:220px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow-2);padding:6px}
.menu button{display:flex;gap:10px;align-items:flex-start;width:100%;padding:9px 10px;border:0;background:none;border-radius:var(--r-s);cursor:pointer;text-align:left}
.menu button:hover{background:var(--surface-2)}

/* ---------- focus (my board) ---------- */
.focus{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
@media (max-width: 1180px){.focus{grid-template-columns:1fr}}
.focuscard{padding:22px 24px}
.focus-main{display:grid;grid-template-columns:220px minmax(0,1fr);gap:28px;align-items:center}
@media (max-width: 720px){.focus-main{grid-template-columns:1fr;justify-items:center;text-align:center}}
.ring text{font-family:var(--font)}
.timer{font-size:40px;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums;line-height:1}
.timer.over{color:var(--danger)}
.meta-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px 18px}
.meta-grid .k{font-size:12px;color:var(--text-3);font-weight:600}
.meta-grid .v{font-weight:600;margin-top:2px}
.daybar{position:relative;height:26px;border-radius:6px;background:var(--surface-3);overflow:hidden}
.daybar .seg-a{position:absolute;top:0;bottom:0;background:var(--s-active)}
.daybar .seg-p{position:absolute;top:6px;bottom:6px;background:repeating-linear-gradient(135deg,var(--border-2) 0 4px,transparent 4px 8px)}
.daybar .seg-s{position:absolute;top:0;bottom:0;background:var(--s-suspended);opacity:.75}
.daybar .now{position:absolute;top:-3px;bottom:-3px;width:2px;background:var(--danger)}
.dropzone{border:2px dashed var(--border-2);border-radius:var(--r-l);padding:28px;text-align:center;background:var(--surface-2);transition:border-color .15s,background .15s}
.dropzone.over{border-color:var(--brand);background:var(--brand-soft)}

/* ---------- kanban ---------- */
.kanban{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,1fr);gap:12px;overflow-x:auto;padding-bottom:8px;align-items:start}
.kcol{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-l);display:flex;flex-direction:column;max-height:calc(100vh - 250px);min-height:180px}
.kcol-h{display:flex;align-items:center;gap:8px;padding:11px 12px;border-bottom:1px solid var(--border)}
.kcol-h .n{font-weight:700}
.kcol-h .c{margin-left:auto;font-size:12px;color:var(--text-3);font-weight:600}
.kcol-b{padding:8px;display:flex;flex-direction:column;gap:8px;overflow-y:auto}
.kcol.returned{background:var(--s-returned-bg)}
.kcard{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-m);padding:10px 11px;cursor:pointer;box-shadow:var(--shadow-1);display:flex;flex-direction:column;gap:8px}
.kcard:hover{border-color:var(--border-2);box-shadow:var(--shadow-2)}
.kcard.active{border-left:3px solid var(--s-active)}
.kcard.paused{border-left:3px solid var(--s-paused)}
.kcard.suspended{border-left:3px solid var(--s-suspended)}
.kcard .ttl{font-weight:600;font-size:13.5px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- tracking timeline ---------- */
.tl{position:relative}
.tl-axis{display:grid;grid-template-columns:200px 1fr;align-items:end}
.tl-hours{position:relative;height:22px}
.tl-hours span{position:absolute;transform:translateX(-50%);font-size:11.5px;color:var(--text-3);font-variant-numeric:tabular-nums}
.tl-row{display:grid;grid-template-columns:200px 1fr;align-items:center;border-top:1px solid var(--border);min-height:52px}
.tl-who{display:flex;gap:10px;align-items:center;padding:8px 12px 8px 0;min-width:0}
.tl-lane{position:relative;height:52px;background-image:linear-gradient(to right,var(--border) 1px,transparent 1px);background-size:var(--hour) 100%}
.tl-seg{position:absolute;top:13px;height:26px;border-radius:5px;font-size:11px;font-weight:700;color:#fff;padding:0 6px;display:flex;align-items:center;overflow:hidden;white-space:nowrap;cursor:pointer;border:0}
.tl-seg.active{background:var(--s-active)}
.tl-seg.paused{background:repeating-linear-gradient(135deg,var(--surface-3) 0 5px,var(--border) 5px 10px);color:var(--text-2);top:18px;height:16px}
.tl-seg.suspended{background:var(--s-suspended);opacity:.85}
.tl-seg.open{box-shadow:inset -3px 0 0 rgba(255,255,255,.55)}
.tl-now{position:absolute;top:0;bottom:0;width:2px;background:var(--danger);z-index:2}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--text-2)}
.legend i{display:inline-block;width:14px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}

/* ---------- status lifecycle strip ---------- */
.strip{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--surface-3)}
.strip i{height:100%}
.st-queued{background:var(--s-queued)}.st-active{background:var(--s-active)}.st-paused{background:var(--border-2)}.st-suspended{background:var(--s-suspended)}.st-returned{background:var(--s-returned)}.st-draft{background:var(--s-draft)}

/* ---------- settings ---------- */
.settings{display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start}
@media (max-width: 900px){.settings{grid-template-columns:1fr}}
.subnav{display:flex;flex-direction:column;gap:2px;position:sticky;top:80px}
@media (max-width: 900px){.subnav{flex-direction:row;overflow-x:auto;position:static}}
.subnav button{border:0;background:none;text-align:left;padding:8px 10px;border-radius:var(--r-m);cursor:pointer;color:var(--text-2);font-weight:500;white-space:nowrap}
.subnav button:hover{background:var(--surface-3);color:var(--text)}
.subnav button[aria-current="page"]{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow-1);border:1px solid var(--border)}
.subnav .grp{font-size:11.5px;font-weight:600;color:var(--text-3);padding:12px 10px 4px}
.setrow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:20px;padding:16px 0;border-bottom:1px solid var(--border)}
.setrow:last-child{border-bottom:0}
@media (max-width: 760px){.setrow{grid-template-columns:1fr}}

/* ---------- demo tools ---------- */
.demo{position:fixed;right:20px;bottom:20px;z-index:65}
.demo-panel{position:fixed;right:20px;bottom:72px;z-index:65;width:min(380px,calc(100vw - 24px));max-height:calc(100vh - 120px);overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow-3)}
.demo-panel .log{font-size:12px;max-height:180px;overflow:auto;border:1px solid var(--border);border-radius:var(--r-m)}
.demo-panel .log div{display:flex;justify-content:space-between;gap:8px;padding:4px 8px;border-bottom:1px solid var(--border)}
.demo-pill{display:inline-flex;align-items:center;gap:8px;height:36px;padding:0 14px;border-radius:18px;border:1px solid var(--border-2);background:var(--surface);box-shadow:var(--shadow-2);cursor:pointer;font-weight:600;font-size:13px}
.demo-pill .live{width:8px;height:8px;border-radius:50%;background:var(--good)}

/* ---------- registration ---------- */
.reg{position:fixed;inset:0;z-index:90;background:var(--bg);overflow:auto;display:flex;justify-content:center;padding:48px 18px}
.reg-inner{width:min(560px,100%)}
.steps{display:flex;gap:6px;margin:18px 0 24px}
.steps i{flex:1;height:4px;border-radius:2px;background:var(--border)}
.steps i.on{background:var(--brand)}

/* ---------- charts ---------- */
.hbar{display:grid;grid-template-columns:140px 1fr 60px;gap:10px;align-items:center;padding:5px 0;font-size:13px}
.chart-cell{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;border-radius:6px;font-weight:700;font-size:12.5px}

.tl-ci{position:absolute;top:0;bottom:0;width:0;border-left:2px dashed var(--good);z-index:1;pointer-events:auto}
.tl-ci.end{border-left-color:var(--text-3)}
.tl-ci span{position:absolute;top:1px;left:3px;font-size:10px;font-weight:700;color:var(--good);background:var(--surface);padding:0 2px;border-radius:3px}
.tl-ci.end span{color:var(--text-3)}
