:root{--bg:#f4f6f8;--panel:#fff;--text:#111827;--muted:#667085;--line:#e5e7eb;--line2:#d0d5dd;--accent:#111827;--green:#16835b;--green-bg:#eaf8f1;--red:#b42318;--red-bg:#fff0ee;--amber:#b54708;--amber-bg:#fff6e8;--blue:#175cd3;--blue-bg:#eef4ff;--shadow:0 1px 2px rgba(16,24,40,.04),0 8px 24px rgba(16,24,40,.04);--radius:14px;--sidebar:248px;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}[hidden]{display:none!important}
a{color:var(--blue)}code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.muted{color:var(--muted)}.small{font-size:12px}.pre{white-space:pre-wrap}.grow{flex:1;min-width:0}.pad{padding:10px}
.top-gap{margin-top:14px}.span-2{grid-column:span 2}.span-all{grid-column:1/-1}

/* ---------- buttons, badges, chips ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line2);background:#fff;color:#344054;border-radius:9px;padding:9px 13px;font-weight:600;font-size:13px;text-decoration:none;line-height:1.2;white-space:nowrap}
.btn:hover{background:#f9fafb}.btn:disabled{opacity:.55;cursor:default}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}.btn-primary:hover{background:#1f2937}
.btn-danger{color:var(--red);border-color:#fecdca}.btn-danger:hover{background:var(--red-bg)}
.btn-danger-solid{background:var(--red);color:#fff;border-color:var(--red)}.btn-danger-solid:hover{background:#9f1d15;border-color:#9f1d15;color:#fff}
.btn-large{width:100%;padding:12px 14px}.btn-small{padding:6px 10px;font-size:12px}
.icon-btn{width:34px;height:34px;border:0;background:#f2f4f7;color:#475467;border-radius:8px;font-size:20px;display:inline-grid;place-items:center}
.link-btn{border:0;background:transparent;padding:0;color:inherit;font:inherit;cursor:pointer;text-decoration:none}.link-btn.danger{color:var(--red);font-size:12px;font-weight:600}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:700;border:1px solid transparent;white-space:nowrap}
.badge-success{color:var(--green);background:var(--green-bg);border-color:#abefc6}.badge-error{color:var(--red);background:var(--red-bg);border-color:#fecdca}
.badge-warn{color:var(--amber);background:var(--amber-bg);border-color:#fedf89}.badge-info{color:var(--blue);background:var(--blue-bg);border-color:#c7d7fe}.badge-neutral{color:#475467;background:#f2f4f7;border-color:#e4e7ec}
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;border:1px solid var(--tone-border,#e4e7ec);background:var(--tone-bg,#f2f4f7);color:var(--tone-text,#344054);white-space:nowrap;line-height:1.3}
.chip i{width:7px;height:7px;border-radius:50%;background:var(--tone,#98a2b3);flex:0 0 auto}.chip-small{padding:2px 7px;font-size:12px}
.status-dot{width:8px;height:8px;border-radius:50%;background:#94a3b8;display:inline-block;flex:0 0 auto}.status-dot.healthy{background:#12b76a}.status-dot.warn{background:#f79009}.status-dot.error{background:#f04438}

/* ---------- login ---------- */
.login-body{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top left,#eef2ff 0,transparent 35%),radial-gradient(circle at bottom right,#ecfdf3 0,transparent 30%),#f7f8fa;padding:16px}
.login-shell{width:min(100%,460px)}.login-card{background:#fff;border:1px solid var(--line);border-radius:24px;padding:34px;box-shadow:0 24px 80px rgba(17,24,39,.1)}
.login-brand{margin-bottom:30px}.login-copy h1{margin:0 0 8px;font-size:28px;letter-spacing:-.03em}.login-copy p{margin:0 0 24px;color:var(--muted);line-height:1.6}
.login-form{display:grid;gap:14px}.check{display:flex;align-items:center;gap:8px;font-size:13px;color:#344054}
.login-footer{margin-top:24px;padding-top:18px;border-top:1px solid var(--line);color:var(--muted);font-size:12px;display:flex;gap:8px;align-items:center}
.form-error{color:var(--red);background:var(--red-bg);border:1px solid #fecdca;border-radius:9px;padding:10px 12px;font-size:13px}

/* ---------- fields and forms ---------- */
.field{display:grid;gap:6px;color:#344054;font-weight:600;font-size:13px}.field>span{display:flex;justify-content:space-between;align-items:center}
.field input,.field select,.field textarea,.task-form input,.task-form select,.task-form textarea{border:1px solid var(--line2);border-radius:10px;padding:10px 12px;color:var(--text);background:#fff;outline:none;font-weight:400;width:100%;font-family:inherit}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#98a2b3;box-shadow:0 0 0 3px rgba(17,24,39,.06)}
.task-form{display:grid;grid-template-columns:1fr 1fr;gap:14px}.stack-form{display:grid;gap:12px}.two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:4px}.stack{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.file-input{display:block;width:100%;border:1px dashed var(--line2);border-radius:10px;padding:14px;background:#f9fafb}.file-btn{position:relative}

/* ---------- app shell ---------- */
.app-body{height:100vh;overflow:hidden}.app-shell{display:grid;grid-template-columns:var(--sidebar) 1fr;height:100vh}
.sidebar{background:#0f172a;color:#fff;padding:18px 14px 14px;display:flex;flex-direction:column;min-width:0}
.brand-lockup{display:flex;align-items:center;gap:11px;padding:4px 6px 18px}
.brand-mark{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#fff;color:#111827;font-weight:900;font-size:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);overflow:hidden;flex:0 0 auto}
.brand-mark img{width:100%;height:100%;object-fit:cover}
.brand-text{min-width:0}.brand-text strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand-text span{display:block;font-size:12px;color:#94a3b8;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu-toggle{display:none;margin-left:auto;background:rgba(255,255,255,.08);color:#fff}
.nav-list{display:flex;flex-direction:column;gap:3px}
.nav-item{width:100%;border:0;background:transparent;color:#cbd5e1;border-radius:9px;padding:9px 10px;display:flex;align-items:center;gap:10px;text-align:left;font-size:13px;transition:.15s}
.nav-item>span{width:18px;text-align:center;color:#94a3b8}.nav-item b{margin-left:auto;min-width:25px;text-align:center;font-size:12px;color:#94a3b8;background:rgba(255,255,255,.06);padding:2px 6px;border-radius:999px}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}.nav-item.active{background:#fff;color:#111827}.nav-item.active>span,.nav-item.active b{color:#475467}.nav-item.active b{background:#f2f4f7}
.nav-item b.count-error{background:#f04438;color:#fff}
.nav-divider{height:1px;background:rgba(255,255,255,.08);margin:10px 8px}
.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding-top:12px}
/* On desktop the drawer wrapper is transparent to the layout; on phones it becomes the slide-in menu. */
.sidebar-drawer{display:contents}.drawer-top{display:none}.nav-backdrop{display:none}
.sync-mini{display:flex;gap:9px;align-items:center;padding:8px 10px 10px}.sync-mini strong{display:block;font-size:12px;color:#e2e8f0}.sync-mini span:not(.status-dot){display:block;color:#94a3b8;font-size:12px;margin-top:2px}
.main-panel{min-width:0;display:flex;flex-direction:column;overflow:hidden}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 24px 14px}.topbar h1{margin:0;font-size:22px;letter-spacing:-.025em}.topbar p{margin:3px 0 0;color:var(--muted);font-size:13px}
.stats-row{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:10px;padding:0 24px 14px}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 14px;box-shadow:var(--shadow)}.stat-card span{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}.stat-card strong{font-size:22px}
.content-card{margin:0 24px 20px;min-height:0;flex:1;overflow:auto;position:relative}
.panel{min-width:0;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow)}
.panel-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:12px}.panel-head h2{margin:0;font-size:15px}.panel-head p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.panel-head .actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.panel-row{display:flex;gap:14px;margin-bottom:14px}.grid-page{display:grid;gap:14px}
.page-note{color:var(--muted);font-size:12px;padding:0 2px}
.empty-state,.loading{min-height:260px;display:grid;place-items:center;text-align:center;color:var(--muted);padding:40px}.empty-state strong{color:#344054;display:block;margin-bottom:5px}

/* ---------- data grid ---------- */
.grid-host{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);display:flex;flex-direction:column;min-height:0;overflow:hidden}
.grid-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}
.search-wrap{display:flex;align-items:center;gap:7px;height:36px;padding:0 11px;background:#fff;border:1px solid var(--line);border-radius:9px;min-width:220px;flex:1;max-width:360px}.search-wrap span{color:#98a2b3}.search-wrap input{width:100%;border:0;outline:none;background:transparent}
.filter-wrap{position:relative}.filter-btn{height:34px;border:1px solid var(--line2);background:#fff;border-radius:999px;padding:0 12px;font-size:12px;font-weight:600;color:#344054;display:inline-flex;align-items:center;gap:6px}
.filter-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}.filter-btn .caret{opacity:.6;display:inline-flex}.caret .icon{width:14px;height:14px}.filter-btn b{font-weight:700}
.filter-pop{position:absolute;top:40px;left:0;z-index:30;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 50px rgba(15,23,42,.18);padding:8px;min-width:220px;display:grid;gap:2px}
.filter-opt{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:8px;font-size:13px;cursor:pointer}.filter-opt:hover{background:#f8fafc}
.filter-pop-dates{gap:8px;padding:12px}.filter-pop-dates label{display:grid;gap:4px;font-size:12px;font-weight:600;color:#344054}.filter-pop-dates input{border:1px solid var(--line2);border-radius:8px;padding:7px 9px}
.filter-pop-actions{display:flex;justify-content:flex-end;padding:4px 6px 0;font-size:12px}
.sort-note{font-size:12px;color:var(--muted);display:inline-flex;gap:6px;align-items:center}
.grid-bulk{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px;background:#0f172a;color:#fff;font-size:13px}.grid-bulk .btn{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.15);color:#fff}.grid-bulk .btn-danger{color:#fda29b}.grid-bulk .link-btn{color:#cbd5e1;font-size:12px;margin-left:auto}
.grid-body{overflow:auto;min-height:0;flex:1}.grid-footer{display:flex;justify-content:space-between;padding:8px 12px;border-top:1px solid var(--line);color:var(--muted);font-size:12px}
.table-scroll{overflow:auto;min-height:0}
.data-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
.data-table th{position:sticky;top:0;z-index:3;background:#f8fafc;color:#475467;font-weight:700;text-align:left;padding:9px 9px;border-bottom:1px solid var(--line2);border-right:1px solid var(--line);white-space:nowrap;user-select:none}
.data-table th.sortable{cursor:pointer}.data-table th.sortable:hover{background:#eef2f6}.data-table th i{display:inline-flex;margin-left:4px;font-style:normal;color:#475467;vertical-align:-2px}.data-table th i .icon{width:13px;height:13px}
.data-table td{padding:0;border-bottom:1px solid var(--line);border-right:1px solid #f0f1f3;background:#fff;vertical-align:middle;max-width:420px}
.data-table tr:hover td{background:#fcfcfd}.data-table tr.selected td{background:#eef4ff}
.data-table td:not(.cell-editable):not(.col-select):not(.col-actions){padding:0 9px;height:40px}.data-table td .chip{margin:0}
.data-table.compact td{padding:7px 9px;height:auto;vertical-align:top}
.col-select{width:36px;text-align:center;padding:0 8px!important}.col-select input{width:15px;height:15px;accent-color:var(--accent)}.col-actions{width:1%;white-space:nowrap}
.data-table th.col-select,.data-table td.col-select{position:sticky;left:0;z-index:2}.data-table th.col-select{z-index:4}
.data-table th.col-sticky,.data-table td.col-sticky{position:sticky;left:36px;z-index:2;box-shadow:2px 0 0 var(--line)}.data-table th.col-sticky{z-index:4}
.data-table tr:hover td.col-select,.data-table tr:hover td.col-sticky{background:#fcfcfd}.data-table tr.selected td.col-select,.data-table tr.selected td.col-sticky{background:#eef4ff}
th.col-xs,td.col-xs{min-width:70px}th.col-s,td.col-s{min-width:120px}th.col-m,td.col-m{min-width:170px}th.col-l,td.col-l{min-width:240px}th.col-xl,td.col-xl{min-width:300px}
.code-cell{color:#667085;white-space:nowrap}
.cell-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px;line-height:40px}.cell-text.pre{white-space:pre-line;line-height:1.4;max-height:60px;overflow:hidden;padding:6px 0}
.cell-input,.cell-select{width:100%;min-height:40px;border:0;outline:none;background:transparent;padding:8px 9px;color:#101828;font-size:12.5px}
.cell-input:focus,.cell-select:focus,.cell-area:focus{background:#fff;box-shadow:inset 0 0 0 2px #98a2b3;position:relative;z-index:2}
.cell-select{font-weight:600;color:var(--tone-text,#101828);background:var(--tone-bg,transparent);border-left:3px solid var(--tone,transparent);cursor:pointer;appearance:none;padding-right:22px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23667085' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}
.cell-area{display:block;width:100%;min-height:40px;height:40px;border:0;outline:none;background:transparent;padding:11px 9px;color:#101828;font-size:12.5px;line-height:1.4;resize:none;overflow:hidden;font-family:inherit;white-space:pre-wrap}
.cell-area:focus{overflow:auto}
.row-actions{display:flex;align-items:center;gap:3px;padding:0 6px}.row-actions button{border:0;background:transparent;color:#667085;border-radius:6px;padding:6px 7px;font-size:13px}.row-actions button:hover{background:#f2f4f7;color:#111827}

/* cards (phones) */
.card-list{display:grid;gap:10px;padding:10px}
.row-card{position:relative;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 12px 12px 44px}.row-card.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.card-select{position:absolute;left:12px;top:12px}.card-select input{width:18px;height:18px;accent-color:var(--accent)}
.card-body{cursor:pointer}.card-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;margin-bottom:4px}
.card-title{font-weight:700;font-size:14px;line-height:1.35;margin-bottom:8px}.card-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.card-meta{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:#475467}.card-meta b{color:var(--muted);font-weight:600}
.card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}

/* ---------- attention, preview, progress ---------- */
.attention h3{margin:0 0 4px;font-size:14px;color:var(--red)}.attention p{margin:0 0 10px;color:var(--muted);font-size:12px}
.attention-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.attention-list li{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid #fecdca;background:var(--red-bg);border-radius:10px;padding:10px 12px;font-size:12px;flex-wrap:wrap}
.error-text{color:var(--red);margin-top:4px;word-break:break-word}
.progress{height:6px;background:#eef0f2;border-radius:999px;overflow:hidden;margin:4px 0 12px}.progress-bar{height:100%;background:var(--accent);border-radius:999px;transition:width .2s}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.kv{display:grid;grid-template-columns:130px 1fr;gap:8px 14px;margin:0;font-size:13px}.kv dt{color:var(--muted)}.kv dd{margin:0;word-break:break-word}
.load-more{display:flex;justify-content:center;padding:4px}

/* ---------- plan page ---------- */
.plan-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:14px;align-items:start}
.plan-form{display:grid;gap:14px}
.picked-list{list-style:none;margin:0;padding:0;display:grid;gap:6px;align-content:start;counter-reset:pick}
.picked-list li{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;font-size:13px;font-weight:400}
.picked-list li:not(.empty)::before{counter-increment:pick;content:counter(pick);width:20px;height:20px;border-radius:50%;background:var(--accent);color:#fff;font-size:12px;font-weight:700;display:grid;place-items:center;flex:0 0 auto}
.picked-list li.empty{border-style:dashed;color:var(--muted)}.picked-list .drag{cursor:grab;color:#98a2b3;letter-spacing:-2px}
.picked-actions{display:flex;gap:2px}.picked-actions button{border:0;background:transparent;color:#667085;border-radius:6px;padding:4px 6px}.picked-actions button:hover:not(:disabled){background:#f2f4f7;color:#111827}.picked-actions button:disabled{opacity:.3}
.option-list{display:grid;gap:4px;align-content:start;max-height:320px;overflow:auto;margin-top:8px;border:1px solid var(--line);border-radius:10px;padding:6px}
.option{display:flex;align-items:center;gap:10px;border:0;background:#fff;border-radius:8px;padding:8px 10px;text-align:left;font-size:13px;font-weight:400}.option:hover{background:#f2f4f7}

/* ---------- system page ---------- */
.system-page{display:grid;gap:14px}.system-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.logo-row{display:flex;gap:14px;align-items:center}.logo-preview{width:64px;height:64px;border-radius:14px;border:1px solid var(--line);display:grid;place-items:center;overflow:hidden;background:#f8fafc}.logo-preview img{width:100%;height:100%;object-fit:cover}.logo-preview .brand-mark{width:44px;height:44px}
.color-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-width:0}.color-groups h4{margin:0 0 6px;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.color-row{display:flex;align-items:center;gap:8px;font-size:13px;padding:4px 0}.color-row span{flex:1}.color-row input{width:34px;height:26px;border:1px solid var(--line2);border-radius:6px;padding:0;background:#fff}.color-row code{color:var(--muted)}
.api-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.api-grid h4{margin:0 0 6px;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.api-grid code{display:block;padding:3px 0;word-break:break-all}
.choice-list{display:grid;gap:6px}.choice{border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px 12px;text-align:left;display:flex}.choice:hover{background:#f8fafc}

/* ---------- modal and toasts ---------- */
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.52);z-index:40;display:grid;place-items:center;padding:16px;backdrop-filter:blur(4px)}
.modal{width:min(560px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 28px 90px rgba(15,23,42,.24);display:flex;flex-direction:column}.modal-wide{width:min(760px,100%)}
.modal-header{display:flex;justify-content:space-between;gap:20px;padding:18px 22px 14px;border-bottom:1px solid var(--line)}.modal-header h2{margin:0;font-size:18px}.modal-header p{margin:5px 0 0;color:var(--muted);font-size:12px}
.modal-body{padding:18px 22px}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 22px 18px;border-top:1px solid var(--line)}
.confirm-text{margin:0;line-height:1.55;color:#344054}
body.modal-open{overflow:hidden}
.toast-wrap{position:fixed;right:20px;bottom:20px;z-index:60;display:grid;gap:8px;width:min(360px,calc(100vw - 40px))}
.toast{background:#101828;color:#fff;border-radius:10px;padding:12px 14px;box-shadow:0 10px 30px rgba(16,24,40,.22);font-size:13px;opacity:0;transform:translateY(8px);transition:.2s}.toast.show{opacity:1;transform:none}.toast.error{background:#7a271a}.toast.success{background:#05603a}

/* ---------- responsive ---------- */
@media(max-width:1100px){.system-grid,.plan-layout{grid-template-columns:minmax(0,1fr)}.api-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.color-groups{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:768px){
  .app-body{height:auto;overflow:auto}.app-shell{display:flex;flex-direction:column;height:auto;min-height:100vh}
  .sidebar{position:sticky;top:0;z-index:20;padding:10px 12px;gap:8px}
  .brand-lockup{padding:0}.menu-toggle{display:inline-grid}
  .sidebar-drawer{display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;width:min(300px,86vw);background:#0f172a;padding:14px 14px 18px;transform:translateX(-104%);visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s;z-index:60;overflow:auto;box-shadow:12px 0 40px rgba(2,6,23,.45)}
  body.nav-open .sidebar-drawer{transform:none;visibility:visible;transition:transform .25s ease,visibility 0s}
  .drawer-top{display:flex;align-items:center;justify-content:space-between;padding:2px 6px 14px;font-size:15px;color:#fff}.menu-close{background:rgba(255,255,255,.08);color:#fff}
  .nav-list{display:flex;padding-top:0}.sidebar-footer{display:block;margin-top:auto;padding-top:12px}
  .nav-backdrop{display:block;position:fixed;inset:0;background:rgba(2,6,23,.55);z-index:59;opacity:0;pointer-events:none;transition:opacity .2s}body.nav-open .nav-backdrop{opacity:1;pointer-events:auto}
  body.nav-open{overflow:hidden}
  .main-panel{overflow:visible}.topbar{padding:16px 14px 10px;gap:10px}.topbar h1{font-size:19px}.topbar p{display:none}
  .stats-row{grid-template-columns:repeat(3,1fr);padding:0 14px 10px;gap:8px}.stat-card{padding:10px 12px}.stat-card strong{font-size:18px}.stat-card:nth-child(5){display:none}
  .content-card{margin:0 12px 16px;overflow:visible}
  .grid-toolbar{padding:8px 10px}.search-wrap{min-width:0;max-width:none;flex-basis:100%}.filter-btn{height:32px;padding:0 10px}
  .grid-bulk{position:sticky;bottom:0;z-index:15}
  .task-form,.two-col{grid-template-columns:1fr}.span-2{grid-column:auto}
  .modal-backdrop{padding:0;align-items:end}.modal{width:100%;max-height:96vh;border-radius:18px 18px 0 0}
  .color-groups{grid-template-columns:1fr}.api-grid{grid-template-columns:1fr}.panel-head{flex-direction:column}.panel-head .actions{justify-content:flex-start}
  .toast-wrap{right:12px;bottom:12px;width:calc(100vw - 24px)}
}

/* ---------- 1.3: drawer, tabs, pills, timeline, pager, owners, team ---------- */
.pills{display:inline-flex;flex-wrap:wrap;gap:4px}.pill{display:inline-flex;align-items:center;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:600;padding:2px 8px;border-radius:999px;background:#eef2f6;color:#344054;border:1px solid #e4e7ec;cursor:default;white-space:nowrap}
.pill:hover{background:#e4e7ec}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;padding:10px 0 2px;color:var(--muted);font-size:12px}.pager-inline{display:inline-flex;align-items:center;gap:8px}
.grid-footer .btn-small{padding:2px 8px}
.row-actions button.danger:hover{background:var(--red-bg);color:var(--red)}
.user-pill{margin-left:auto;font-size:12px;max-width:90px;overflow:hidden;text-overflow:ellipsis}
.col-sticky-0{position:sticky;left:0;z-index:2;box-shadow:2px 0 0 var(--line);background:#fff}.data-table th.col-sticky-0{z-index:4;background:#f8fafc}
.data-table td.col-sticky{background:#fff}

/* drawer */
.drawer-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:30;opacity:0;pointer-events:none;transition:.2s}
body.drawer-open #drawer-backdrop{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(520px,100%);background:#fff;z-index:35;transform:translateX(100%);transition:transform .25s ease;box-shadow:-20px 0 60px rgba(15,23,42,.18);overflow:auto}
.drawer.open{transform:none}.drawer-inner{padding:20px 22px 30px;display:grid;gap:16px}
.drawer-head{display:grid;gap:8px;position:relative}.drawer-head .icon-btn{position:absolute;right:0;top:0}
.drawer-code{font-size:12px}.drawer-title{margin:4px 0 2px;font-size:19px;line-height:1.3;padding-right:44px}
.cu-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:#f8fafc;display:grid;gap:10px}
.cu-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.cu-title{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.cu-state{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.cu-actions{display:flex;flex-wrap:wrap;gap:6px}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line)}.tab{border:0;background:transparent;padding:10px 12px;font-weight:600;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}.tab.active{color:var(--text);border-bottom-color:var(--accent)}
.tab-body{display:grid;gap:12px}
.milestone-add{display:flex;gap:8px}.milestone-add input{flex:1;border:1px solid var(--line2);border-radius:10px;padding:10px 12px;outline:none}.milestone-add input:focus{border-color:#98a2b3}
.ms-label{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.ms-card{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#fff}.ms-card.current{border-color:var(--accent);background:#f8fafc}.ms-card.cleared{opacity:.7}
.ms-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:4px}.ms-text{font-size:14px;line-height:1.4;white-space:pre-wrap}
.text-form textarea{width:100%;border:1px solid var(--line2);border-radius:10px;padding:10px 12px;font-family:inherit;resize:none;outline:none;line-height:1.5}.text-form textarea:focus{border-color:#98a2b3}

/* change log */
.changes-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:14px;align-items:start}
.task-picker{display:grid;gap:6px;margin-top:10px;max-height:60vh;overflow:auto}
.picker-row{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 11px;text-align:left;display:grid;gap:4px}.picker-row:hover{background:#f8fafc}.picker-row.active{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.picker-top{display:flex;justify-content:space-between;gap:8px;align-items:center}.picker-name{font-weight:600;font-size:13px;line-height:1.3}.picker-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}
.tl-day{margin-bottom:14px}.tl-date{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700;color:var(--muted);padding:6px 0;border-bottom:1px solid var(--line);margin-bottom:6px}
.tl-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;padding:8px 0;border-bottom:1px dashed #eef0f2;align-items:start}.tl-time{font-size:12px;color:var(--muted);padding-top:2px}
.tl-head{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:3px}.tl-val{font-size:13px;line-height:1.45;white-space:pre-wrap;word-break:break-word}

/* owners and team */
.owner-list{display:grid;gap:12px}
.owner-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:grid;gap:12px;background:#fff}.owner-card.disabled{opacity:.7}
.owner-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.owner-head input[type=color]{width:34px;height:30px;border:1px solid var(--line2);border-radius:8px;padding:0;background:#fff}
.owner-name{border:1px solid var(--line2);border-radius:9px;padding:8px 10px;font-weight:600;min-width:200px}
.owner-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.status-map{grid-column:1/-1}
.list-pick{display:flex;gap:6px}.list-pick select{flex:1;min-width:0}
.map-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.map-grid label{display:grid;gap:6px;font-weight:400}.map-grid select{border:1px solid var(--line2);border-radius:8px;padding:7px 8px;font-size:12px;background:#fff}
.color-groups.two{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.team-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:18px;min-width:0}.team-grid h4{margin:0 0 8px;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.invite-list{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:13px}.invite-list li{display:flex;justify-content:space-between;gap:10px;border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.invite-box{margin-top:10px;border:1px solid #abefc6;background:var(--green-bg);border-radius:10px;padding:10px 12px;display:grid;gap:6px}.invite-link{display:block;word-break:break-all;font-size:12px;background:#fff;padding:8px;border-radius:6px}
tr.muted td{color:var(--muted)}

@media(max-width:1100px){.changes-layout{grid-template-columns:minmax(0,1fr)}.task-picker{max-height:40vh}.team-grid{grid-template-columns:minmax(0,1fr)}.map-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.owner-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:768px){.drawer{width:100%}.drawer-inner{padding:16px 14px 40px}.map-grid{grid-template-columns:minmax(0,1fr)}.color-groups.two{grid-template-columns:minmax(0,1fr)}.two-col{grid-template-columns:minmax(0,1fr)}}

/* ---------- 1.4: Lucide icons, task references, full-height plan page, integration and team tables ---------- */
.icon{width:18px;height:18px;flex:0 0 auto;vertical-align:-4px;display:inline-block}
.btn .icon{width:16px;height:16px;vertical-align:-3px}.btn-small .icon{width:15px;height:15px}
.icon-btn .icon{width:18px;height:18px}.nav-item .icon{width:18px;height:18px;color:#94a3b8}.nav-item.active .icon{color:#475467}.nav-item>span{display:inline-flex;align-items:center;justify-content:center}
.panel-head h2 .icon,.attention h3 .icon{width:17px;height:17px;vertical-align:-3px;margin-right:6px;color:#667085}
.row-actions{gap:4px}.row-actions button{width:34px;height:34px;display:inline-grid;place-items:center;border-radius:9px;color:#475467}
.row-actions button .icon{width:19px;height:19px}.row-actions button:hover{background:#eef2f6;color:#111827}
.row-actions button.danger{color:var(--red)}.row-actions button.danger:hover{background:var(--red-bg);color:var(--red)}.row-actions button:disabled{opacity:.35;cursor:default}
.row-btn{border:0;background:transparent;width:30px;height:30px;border-radius:8px;display:inline-grid;place-items:center;color:#667085}.row-btn.danger{color:var(--red)}.row-btn:hover{background:#f2f4f7}
.card-actions .btn-danger{color:var(--red)}
.search-wrap>span{display:inline-flex}.search-wrap .icon{width:16px;height:16px;color:#98a2b3}
.option-add{margin-left:auto;color:#98a2b3}.option:hover .option-add{color:#111827}
.picked-actions button{width:28px;height:28px;display:inline-grid;place-items:center}.picked-actions button .icon{width:15px;height:15px}.picked-actions button.danger{color:var(--red)}
.picked-list .drag{display:inline-flex;color:#98a2b3;cursor:grab}.picked-list .drag .icon{width:16px;height:16px}
.task-refs{display:flex;flex-direction:column;gap:3px;padding:5px 0}
.task-ref{display:inline-flex;align-items:center;gap:8px;border:0;background:transparent;padding:2px 6px 2px 2px;border-radius:8px;text-align:left;font:inherit;cursor:pointer;max-width:100%;color:inherit}
.task-ref:hover:not(:disabled){background:#eef2f6}.task-ref:disabled{cursor:default}
.task-ref-name{font-size:12.5px;color:#344054;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:360px}
.task-ref.missing .task-ref-name{color:var(--muted);font-style:italic}
.data-table td .task-refs{padding:6px 2px}
.file-pick{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.file-btn{cursor:pointer}
.switch{position:relative;display:inline-block;width:40px;height:22px}.switch input{opacity:0;width:0;height:0}
.switch i{position:absolute;inset:0;background:#d0d5dd;border-radius:999px;transition:.15s}.switch i::after{content:"";position:absolute;width:18px;height:18px;left:2px;top:2px;background:#fff;border-radius:50%;transition:.15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch input:checked+i{background:#12b76a}.switch input:checked+i::after{transform:translateX(18px)}
.owner-table td,.team-table td{vertical-align:middle}.owner-table .inline-input{border:1px solid var(--line2);border-radius:8px;min-height:34px;padding:6px 9px;width:200px;font-weight:600}
.color-input{width:34px;height:30px;border:1px solid var(--line2);border-radius:8px;padding:0;background:#fff;vertical-align:middle;margin-right:8px}
.inline-select{border:1px solid var(--line2);border-radius:8px;padding:6px 8px;font-size:12px;background:#fff;margin-left:6px;max-width:320px}
.list-label{font-size:12.5px}
.log-table th{white-space:nowrap}
/* plan page fills the window */
.plan-layout{height:100%;min-height:0;grid-template-rows:minmax(0,1fr);align-items:stretch}
.plan-editor,.plan-saved{display:flex;flex-direction:column;min-height:0}
.plan-form{flex:1;display:flex;flex-direction:column;gap:14px;min-height:0}
.plan-picked-wrap{flex:0 1 auto;min-height:0;display:flex;flex-direction:column}.plan-picked-wrap .picked-list{overflow:auto;max-height:38vh}
.plan-options-wrap{flex:1;min-height:0;display:flex;flex-direction:column}.plan-options-wrap .search-wrap{flex:0 0 auto;max-width:none}.plan-options-wrap .search-wrap input{padding:6px 0}.plan-options-wrap .option-list{flex:1;min-height:120px;max-height:none}
.plan-saved .plan-grid{flex:1;min-height:0;display:flex;flex-direction:column}.plan-saved .grid-host{flex:1;min-height:0}
@media(max-width:1100px){.plan-layout{height:auto;grid-template-rows:none}.plan-options-wrap .option-list{max-height:320px}}
@media(max-width:768px){.row-actions button{width:38px;height:38px}.task-ref-name{max-width:220px}.owner-table .inline-input{width:140px}}
/* actions column stays visible while the grid scrolls sideways */
.data-table th.col-actions,.data-table td.col-actions{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-2px 0 0 var(--line)}.data-table th.col-actions{z-index:4;background:#f8fafc}
.data-table tr:hover td.col-actions{background:#fcfcfd}.data-table tr.selected td.col-actions{background:#eef4ff}
/* 1.5: settings tables, import box, full-height change log */
.table-box{border:1px solid var(--line);border-radius:10px;overflow:auto;background:#fff}
.table-box .data-table th:last-child,.table-box .data-table td:last-child{border-right:0}
.table-box .data-table tr:last-child td{border-bottom:0}
.data-table.settings-table td:not(.cell-editable):not(.col-select):not(.col-actions){padding:7px 10px;height:auto;vertical-align:middle}
.settings-table th{padding:9px 10px}.settings-table .row-actions{padding:0;justify-content:flex-end}.settings-table .inline-select{margin-left:0}
.owner-table .list-label{display:inline-block;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.import-box{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid var(--line2);border-radius:12px;padding:12px 14px;background:#f8fafc}.import-box .file-pick{flex:1;min-width:0}
.field-hint{font-weight:400;font-size:12px}.field select{border:1px solid var(--line2);border-radius:10px;padding:10px 12px;background:#fff;font-weight:400;width:100%}
#state-grid{margin-top:12px}
.changes-layout{height:100%;min-height:0;grid-template-rows:minmax(0,1fr);align-items:stretch}
.changes-list,.changes-timeline{display:flex;flex-direction:column;min-height:0}
.changes-list .search-wrap{flex:0 0 auto;max-width:none}.changes-list .task-picker{flex:1;min-height:120px;max-height:none}
.changes-timeline #changes-body{flex:1;min-height:0;overflow:auto}
@media(max-width:1100px){.changes-layout{height:auto;grid-template-rows:none}.changes-list .task-picker{max-height:40vh}}
/* 1.5.1: centred settings tables, list id input */
.settings-table th,.settings-table td{text-align:center}
.settings-table .row-actions{justify-content:center}.settings-table .inline-input{text-align:center}
.owner-table .list-input{width:150px;font-weight:500}
.settings-table .switch,.settings-table .color-input{vertical-align:middle}
/* 1.6: change-log event types, drawer change log, centred grid columns, migration buttons */
.data-table th.col-center,.data-table td.col-center{text-align:center}
.type-dots{display:inline-flex;gap:9px;align-items:center}.type-dot{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;color:var(--tone-text,#475467)}
.type-dot i{width:8px;height:8px;border-radius:50%;background:var(--tone,#98a2b3);display:inline-block}
.changes-toolbar{justify-content:space-between;margin-bottom:10px}
.migration-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.migration-actions .btn{justify-content:center;width:100%;text-align:center;white-space:normal;height:auto;min-height:38px;padding:8px 10px;line-height:1.25}
@media(max-width:768px){.migration-actions{grid-template-columns:minmax(0,1fr)}}
/* 1.8: the queue: drag handles with row numbers, drop markers, add to plan */
.data-table th.col-drag,.data-table td.col-drag{width:56px;min-width:56px;padding:0 4px!important;text-align:center;white-space:nowrap;position:sticky;left:36px;z-index:2;background:#fff}
.data-table th.col-drag{z-index:4;background:#f8fafc}.data-table tr:hover td.col-drag{background:#fcfcfd}.data-table tr.selected td.col-drag{background:#eef4ff}
.data-table.has-drag th.col-sticky,.data-table.has-drag td.col-sticky{left:92px}
.drag-handle{display:inline-flex;align-items:center;gap:3px;cursor:grab;color:#98a2b3;touch-action:none;user-select:none;padding:6px 4px;border-radius:6px}
.drag-handle:hover{background:#eef2f6;color:#475467}.drag-handle .icon{width:16px;height:16px}
.queue-no{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:600;color:#667085;min-width:16px;text-align:right}
body.is-dragging{cursor:grabbing;user-select:none}body.is-dragging .drag-handle{cursor:grabbing}
.data-table tr.dragging td{opacity:.45}.data-table tr.drop-before td{box-shadow:inset 0 3px 0 0 var(--accent)}.data-table tr.drop-after td{box-shadow:inset 0 -3px 0 0 var(--accent)}
.row-card.has-drag{padding-right:58px}.row-card .card-drag{position:absolute;right:0;top:0;bottom:0;width:46px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0;border-left:1px solid var(--line);border-radius:0 12px 12px 0;background:#f8fafc;color:#98a2b3}
.row-card .card-drag .queue-no{font-size:12px;color:#475467}.row-card .card-drag .icon{width:18px;height:18px}.row-card .card-select{top:13px}.row-card.dragging{opacity:.5}.row-card.drop-before{box-shadow:0 -3px 0 0 var(--accent)}.row-card.drop-after{box-shadow:0 3px 0 0 var(--accent)}
.toast-action{margin-left:12px;border:1px solid rgba(255,255,255,.4);background:transparent;color:inherit;border-radius:8px;padding:4px 10px;font-size:12px;font-weight:600;cursor:pointer}
.plan-dialog{display:grid;gap:12px}.plan-dialog input[type=date]{max-width:220px}
.plan-existing{font-size:13px;line-height:1.5;color:var(--muted);background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:10px 12px}.plan-existing b{color:var(--text)}
.check-row{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:400}.check-row input{width:15px;height:15px;accent-color:var(--accent)}
/* 1.9: AI integration, side panel, auto plans */
.side-panel{z-index:45}.side-backdrop{z-index:44}body.panel-open .side-backdrop{opacity:1;pointer-events:auto}
.side-panel .panel-body{display:grid;gap:14px}.side-panel .panel-subtitle{margin:0;line-height:1.5;padding-right:44px}
.switch-row{display:inline-flex;align-items:center;gap:10px;font-size:13px;font-weight:600}
.model-row{display:flex;gap:8px;align-items:center}.model-row select{flex:1;min-width:0;border:1px solid var(--line2);border-radius:10px;padding:10px 12px;background:#fff;font-weight:400}
.field>span small{font-weight:400;margin-left:6px}
.inline-field{display:inline-grid}.inline-field select{border:1px solid var(--line2);border-radius:10px;padding:8px 10px;background:#fff;font-weight:400}
.ai-plan-state{margin-top:4px}
.pricing-table td input{width:110px;border:1px solid var(--line2);border-radius:8px;padding:6px 8px;text-align:right;font-weight:400}
.usage-summary{display:flex;flex-wrap:wrap;gap:8px 22px;margin-bottom:12px;font-size:12px;color:var(--muted)}.usage-summary b{font-size:17px;display:block;color:var(--text)}
.usage-table .usage-detail{max-width:260px;white-space:normal;margin-top:2px}
.ai-result{display:grid;gap:12px;font-size:13px}.ai-result h4{margin:0 0 4px;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.ai-result p{margin:0}
.ai-list{margin:0;padding-left:18px;display:grid;gap:4px}
.ai-pre{white-space:pre-wrap;word-break:break-word;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:12px;max-height:280px;overflow:auto;margin:0}
.plan-note{margin-top:3px;max-width:260px;white-space:normal;line-height:1.35}
/* 1.10: check in now, key reveal, aligned plan row */
.key-row{display:flex;gap:6px;align-items:center}.key-row input{flex:1;min-width:0}.key-eye{flex:0 0 auto;width:38px;height:38px;background:#f2f4f7}
.auto-row{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;margin-top:14px}.auto-row .inline-field select{height:38px}.auto-row .btn{height:38px}
.pill-btn{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--accent);background:var(--accent);color:#fff;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700;cursor:pointer;margin-top:6px}.pill-btn .icon{width:13px;height:13px}.pill-btn:hover{opacity:.9}
.workday-cell{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
#check-in-now{background:var(--green-bg);border-color:#abefc6;color:var(--green)}#check-in-now:hover{background:#d1fadf}
/* 1.10.1: top bar button group, prompt preview */
.topbar-actions{display:flex;align-items:center;gap:8px}.topbar-actions .btn{height:38px}
.ai-prompt summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:6px}
.cell-text.pre{max-height:none} /* the whole message, however long: the row grows */
/* 1.11: work statistics and off days */
.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.stat-grid .stat-card strong{font-size:24px}
.stat-grid .stat-card small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.segmented{display:inline-flex;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.segmented button{border:0;background:transparent;padding:7px 12px;font:inherit;font-size:13px;font-weight:600;color:var(--muted);cursor:pointer}
.segmented button+button{border-left:1px solid var(--line)}
.segmented button.active{background:var(--accent);color:#fff}
.stats-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin:0 0 12px}
.stats-controls .search-wrap{flex:1 1 240px;min-width:200px}
.stats-controls .field-inline{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.stats-controls .field-inline input{height:36px;border:1px solid var(--line);border-radius:8px;padding:0 8px;font:inherit;color:var(--text);background:#fff}
.stats-controls .btn-small{height:36px}
.daily-search{max-width:420px;margin-bottom:10px}
.weekend-grid{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 12px}
.weekend-grid label{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-size:13px;cursor:pointer;background:#fff}
.weekend-grid label.on{background:var(--accent);border-color:var(--accent);color:#fff}
.weekend-grid input{margin:0}
.off-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:10px;align-items:end}
.off-today{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:10px 12px;border-radius:10px;background:var(--green-bg);color:var(--green);font-size:13px;font-weight:600}
.off-today.is-off{background:var(--red-bg);color:var(--red)}
.off-today .icon{width:16px;height:16px}
@media(max-width:768px){.stat-grid{grid-template-columns:1fr}.off-form{grid-template-columns:1fr}.stats-controls .field-inline{flex:1 1 45%}}
/* 1.11.1: search buttons, the ai pill */
.search-form{display:flex;gap:8px;align-items:center}.search-form .search-wrap{flex:1 1 220px;min-width:0}.search-form .btn-small{height:36px;flex:0 0 auto}
.search-clear{border:0;background:transparent;color:#98a2b3;cursor:pointer;display:inline-flex;padding:0;margin-left:auto}.search-clear .icon{width:14px;height:14px}.search-clear:hover{color:var(--text)}
.daily-search{max-width:560px;margin-bottom:10px}.plans-search{margin:0 0 10px}
.by-cell{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.ai-pill{display:inline-flex;align-items:center;border:1px solid #b2ccff;background:var(--blue-bg);color:var(--blue);border-radius:999px;padding:2px 9px;font-size:12px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;cursor:pointer;font-family:inherit}.ai-pill:hover{background:#dbe7ff}
.ai-said{margin:0;font-size:14px;line-height:1.55;white-space:pre-wrap}
.stats-controls .btn-primary.btn-small{height:36px}
/* 1.12: check out now */
#check-out-now{background:var(--amber-bg);border-color:#fedf89;color:var(--amber)}#check-out-now:hover{background:#feefc6}
.pill-btn.pill-out{background:var(--amber);border-color:var(--amber)}
/* 1.13: integrations */
.int-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}
.int-card{text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);cursor:pointer;font:inherit;color:var(--text)}
.int-card:hover{border-color:var(--line2)}.int-card.is-on{border-color:#abefc6}
.int-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.int-card-head strong{font-size:16px}
.int-card p{margin:0 0 6px;color:var(--muted);font-size:13px;line-height:1.4}
.group-list{margin-top:8px;display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto}
.group-option{text-align:left;border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;font:inherit;font-size:13px;cursor:pointer;display:flex;justify-content:space-between;gap:8px;color:var(--text)}.group-option:hover{background:#f8fafc}.group-option .mono{color:var(--muted);font-size:12px}
.msg-text{max-width:360px;white-space:pre-line;font-size:12.5px;line-height:1.35}
.dir-in{color:var(--blue);font-weight:700}.dir-out{color:var(--muted);font-weight:700}
@media(max-width:768px){.int-cards{grid-template-columns:1fr}}
/* Today's plan: its rows are tinted green in the task tables and on the phone cards. The coloured Priority / Owner /
   Status cells keep their own colours; a selected row keeps the selection blue. */
.data-table tr.planned td:not(.col-enum){background:#eaf8f1}
.data-table tr.planned:hover td:not(.col-enum){background:#e0f3ea}
.data-table tr.planned.selected td:not(.col-enum){background:#eef4ff}
.row-card.planned{background:#eaf8f1;border-color:#bfe3cf}
/* Team members: a read-only Task Plan is one column; permissions sit as checkboxes in the Team table. */
.plan-layout.plan-readonly{grid-template-columns:minmax(0,1fr)}
.perm-checks{display:flex;gap:6px 14px;flex-wrap:wrap}.perm-checks .check-row{white-space:nowrap}
.cu-card.cu-member{padding-top:10px;padding-bottom:10px}
/* Clock settings */
.clock-page{display:grid;gap:14px;align-content:start}
.clock-usual-row{display:grid;grid-template-columns:repeat(2,minmax(0,220px)) auto;justify-content:start;gap:12px;align-items:end}
.clock-usual-row .btn{height:38px}
.clock-note{margin:10px 0 0;font-size:12.5px;color:var(--muted)}.clock-today{margin:6px 0 0;font-size:13px}
.clock-pair{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}.clock-pair .check-row{padding-bottom:9px;white-space:nowrap}
.clock-cell{display:flex;gap:6px;align-items:baseline;white-space:nowrap}
@media(max-width:768px){.clock-usual-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.clock-usual-row .btn{grid-column:1/-1}.clock-pair{grid-template-columns:minmax(0,1fr)}}
/* Hold: the reason in the task drawer */
.hold-reason{font-size:13px;color:#93370d;background:var(--amber-bg);border:1px solid #fedf89;border-radius:8px;padding:6px 10px;line-height:1.4}
/* Filter menus are never cut off by their table's frame */
.grid-host.has-toolbar{overflow:visible}
/* The Needs attention card keeps its labelled buttons at their normal size; table action rows are icon squares */
.attention-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
/* The ClickUp list of a company: a pill in the table, a popup with the workspace's lists by space */
.list-pick{display:inline-flex;align-items:center;gap:6px;max-width:320px;padding:4px 11px 4px 9px;border:1px solid #c7d7fe;border-radius:999px;background:var(--blue-bg);color:var(--blue);font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;cursor:pointer}
.list-pick:hover{background:#e0eaff;border-color:#a4bcfd}.list-pick .icon{flex:0 0 auto;width:14px;height:14px}
.list-pick-name{min-width:0;overflow:hidden;text-overflow:ellipsis}.list-pick-id{flex:0 0 auto;font-weight:500;opacity:.7}
.list-pick.empty{border:1px dashed var(--line2);background:#fff;color:var(--muted)}.list-pick.empty:hover{border-color:#98a2b3;color:var(--text)}
.lp-more{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px}
.list-picker,.list-picker-step{display:grid;gap:12px}.list-picker-step[hidden]{display:none}
.list-picker-bar{display:flex;gap:8px;align-items:center}.list-picker-bar .search-wrap{max-width:none}
.list-picker-lists{max-height:min(46vh,420px);overflow:auto;border:1px solid var(--line);border-radius:10px;padding:4px}
.lp-space{padding:10px 10px 4px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.lp-item{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;text-align:left;cursor:pointer}
.lp-item:hover{background:#f2f4f7}.lp-item.current{background:var(--blue-bg)}
.list-picker-manual{display:flex;gap:8px;align-items:flex-end}.list-picker-manual .field{flex:1;margin:0}.list-picker-manual .btn{height:38px}
.lp-saved{display:flex;gap:8px;align-items:flex-start;margin:0}.lp-saved .icon{flex:0 0 auto;width:18px;height:18px;color:var(--green)}
.lp-status{list-style:none;margin:0;padding:0;display:grid;gap:6px}.lp-status li{display:flex;align-items:center;gap:8px;font-size:13px}
/* People: a coloured pill with a round avatar, the people picker, Manage people and the crop popup */
.avatar{position:relative;display:inline-block;flex:0 0 auto;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--tone-bg,#eef2f6);color:var(--tone,#98a2b3);box-shadow:inset 0 0 0 1px var(--tone-border,rgba(15,23,42,.06))}
.avatar svg,.avatar img{position:absolute;inset:0;display:block;width:100%;height:100%}.avatar img{object-fit:cover}
.avatar-xs{width:18px;height:18px}.avatar-sm{width:24px;height:24px}.avatar-md{width:32px;height:32px}.avatar-lg{width:56px;height:56px}.avatar-xl{width:96px;height:96px}
.person-pill{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:2px 10px 2px 3px;border:1px solid var(--tone-border,var(--line));border-radius:999px;background:var(--tone-bg,#f2f4f7);color:var(--tone-text,var(--text));font-size:12px;font-weight:600;line-height:1.5;white-space:nowrap;vertical-align:middle}
.person-pill .person-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
button.person-pill{font:inherit;font-size:12px;font-weight:600;cursor:pointer}button.person-pill:hover{box-shadow:0 0 0 2px var(--tone-border,var(--line2))}
.person-picker{position:fixed;z-index:65;display:grid;gap:6px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 50px rgba(15,23,42,.22)}
.person-picker .search-wrap{min-width:0;max-width:none}
.pp-list{display:grid;gap:2px;align-content:start;max-height:min(320px,50vh);overflow:auto}
.pp-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:8px;background:transparent;font-size:13px;text-align:left;cursor:pointer}
.pp-item:hover,.pp-item.active{background:#f2f4f7}.pp-item.current{font-weight:600}.pp-item>.icon{width:16px;height:16px;margin-left:auto;color:var(--green)}
.pp-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pp-create{color:var(--blue)}.pp-create>.icon{margin-left:0;color:var(--blue)}.pp-more{margin:4px 8px}
.person-field{display:flex;align-items:center;min-height:38px;padding:4px 8px;border:1px solid var(--line2);border-radius:9px;background:#fff;text-align:left;cursor:pointer}
.meta-assignee{display:inline-flex;align-items:center;gap:6px}
.people-page{display:grid;gap:14px}
.people-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.people-bar .search-form{flex:1 1 280px}
.me-card{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.me-text{display:grid;gap:4px;flex:1;min-width:200px}.me-name{font-size:16px;font-weight:700}
.me-names{display:flex;flex-wrap:wrap;align-items:center;gap:4px;font-size:12px;color:var(--muted)}
.person-cell{display:flex;align-items:center;gap:10px;min-width:0}.person-cell-name{overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.person-swatch{display:inline-block;width:14px;height:14px;margin-right:6px;border-radius:4px;background:var(--tone);vertical-align:-2px}
.person-photo{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.photo-actions{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.cropper{display:grid;justify-items:center;gap:12px}
.crop-frame{position:relative;width:min(300px,78vw);aspect-ratio:1;overflow:hidden;border-radius:12px;background:#0f172a;touch-action:none;user-select:none;cursor:grab}.crop-frame:active{cursor:grabbing}
.crop-frame img{position:absolute;left:0;top:0;max-width:none;transform-origin:0 0;pointer-events:none;user-select:none}
.crop-zoom{display:flex;align-items:center;gap:8px;width:min(300px,78vw)}.crop-zoom input{flex:1}.crop-zoom .icon{width:16px;height:16px;color:var(--muted)}
/* A popup opened from the side panel (the crop step of a person's picture) sits above it */
body.panel-open .modal-backdrop{z-index:50}
/* The Current assignee cell: the same coloured dropdown as Priority and Owner, with the person's avatar */
.person-select{display:flex;align-items:center;gap:7px;font-family:inherit;text-align:left}
.person-select .person-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Manage people pages through the server: the pager shows the total, so the table's own count stays hidden */
#people-grid .grid-footer{display:none}
/* Keyboard focus is always visible: one blue ring on buttons, links and controls, a matching glow on fields */
:where(button,a,[tabindex],summary,input[type="checkbox"],input[type="radio"],input[type="color"],input[type="range"]):focus-visible{outline:2px solid #2e90fa;outline-offset:2px}
.data-table :where(button,a,input,select):focus-visible,.pp-item:focus-visible,.lp-item:focus-visible{outline-offset:-2px}
.field input:focus,.field select:focus,.field textarea:focus,.milestone-add input:focus,.text-form textarea:focus{border-color:#2e90fa;box-shadow:0 0 0 3px rgba(46,144,250,.2)}
.search-wrap:focus-within{border-color:#2e90fa;box-shadow:0 0 0 3px rgba(46,144,250,.2)}
.cell-input:focus,.cell-select:focus,.cell-area:focus{box-shadow:inset 0 0 0 2px #2e90fa}
.sort-note .link-btn .icon{width:14px;height:14px;vertical-align:-3px}.pager-inline .icon{width:14px;height:14px}
/* Phones: every tap target at least 44 px (small pills get an invisible larger hit area), and form text at 16 px so
   iPhone Safari does not zoom in while typing */
@media(max-width:768px){
  .row-actions button{width:44px;height:44px}
  .btn,.btn-small,.filter-btn,.nav-item,.pp-item,.lp-item{min-height:44px}
  .card-select{left:0;top:0;width:44px;height:44px;display:grid;place-items:center}
  button.person-pill{position:relative}button.person-pill::after{content:'';position:absolute;inset:-10px -4px}
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea{font-size:16px}
}
/* The device asks for less motion: panels and drawers appear without sliding */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* Notes and issues in the drawer: one card per entry, blue for notes, red for issues */
.tabs{overflow-x:auto;scrollbar-width:none}.tabs::-webkit-scrollbar{display:none}.tab{white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.tab-count{display:inline-flex;min-width:18px;height:18px;padding:0 5px;align-items:center;justify-content:center;border-radius:999px;background:#eef2f6;color:#475467;font-size:11px;font-weight:700}
.entry-add textarea{min-height:76px}.entry-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:8px}
.entry-card{border:1px solid var(--line);border-left:3px solid #2e90fa;border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#fff}.entry-card.entry-issue{border-left-color:#d92d20}
.entry-label{font-size:12px;font-weight:700;letter-spacing:.02em;color:var(--blue)}.entry-issue .entry-label{color:var(--red)}
.entry-delete{margin-left:auto;width:30px;height:30px}
/* The Email (SMTP) box */
.email-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,.7fr) minmax(0,1fr);gap:12px}
@media(max-width:768px){.email-grid{grid-template-columns:minmax(0,1fr)}}
/* Leave approval: the AI draft, where a request goes, the result, the recipient picker */
.model-row>input{flex:1;min-width:0;border:1px solid var(--line2);border-radius:10px;padding:10px 12px;font:inherit;background:#fff;color:var(--text);outline:none}
.ai-draft{background:#f8f7ff;border:1px solid #e4e0ff;border-radius:12px;padding:12px}.ai-draft .field>span{color:#5b47d6;display:flex;align-items:center;justify-content:flex-start;gap:6px}
.approval-dest{font-size:13px;color:#344054;display:flex;gap:8px;align-items:center;padding:10px 12px;border-radius:10px;background:var(--blue-bg)}.approval-dest.is-missing{background:var(--amber-bg);color:var(--amber)}
.approval-result{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:8px}.approval-result li{display:flex;gap:8px;align-items:center;font-size:14px}
.chat-list{display:flex;flex-direction:column;gap:6px;max-height:320px;overflow:auto}
.group-option.is-chosen{border-color:#2e90fa;background:var(--blue-bg)}
.leave-current{font-size:14px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
/* The rich text editor: a toolbar over an editable box. .rich-content is how saved rich text reads everywhere */
.rich{border:1px solid var(--line2);border-radius:10px;background:#fff;overflow:hidden}
.rich:focus-within{border-color:#2e90fa;box-shadow:0 0 0 3px rgba(46,144,250,.2)}
.rich-toolbar{display:flex;flex-wrap:wrap;gap:2px;align-items:center;padding:4px 6px;border-bottom:1px solid var(--line);background:#f8fafc}
.rich-tool{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#475467;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.rich-tool:hover{background:#eef2f6;color:var(--text)}.rich-tool.active{background:#e0eaff;color:var(--blue)}.rich-tool:disabled{opacity:.4;cursor:default}
.rich-tool svg{width:16px;height:16px}
.rich-sep{width:1px;height:18px;background:var(--line2);margin:0 4px}
.rich-link{display:flex;gap:6px;align-items:center;padding:6px;border-bottom:1px solid var(--line);background:#f8fafc;flex-wrap:wrap}
.rich-link input{flex:1;min-width:160px;border:1px solid var(--line2);border-radius:8px;padding:6px 9px;font:inherit;outline:none}
.rich-body{position:relative;padding:10px 12px;outline:none;font-size:14px;line-height:1.5;color:var(--text);max-height:360px;overflow:auto;cursor:text;font-weight:400}
.rich-body.is-empty::before{content:attr(data-placeholder);position:absolute;left:12px;top:10px;color:#98a2b3;pointer-events:none}
.rich-body[contenteditable="false"]{background:#f8fafc;color:var(--muted);cursor:default}
.rich-content{white-space:normal;overflow-wrap:anywhere}.rich-content>:first-child{margin-top:0}.rich-content>:last-child{margin-bottom:0}
.rich-content p{margin:0 0 6px}.rich-content ul,.rich-content ol{margin:0 0 6px;padding-left:22px}.rich-content li{margin:2px 0}
.rich-content a{color:var(--blue);text-decoration:underline}
.rich-content code{background:#eef2f6;border-radius:4px;padding:1px 5px;font-size:12.5px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.rich-content pre{background:#eef2f6;border-radius:8px;padding:8px 10px;white-space:pre-wrap;font-size:12.5px;line-height:1.5;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;margin:0 0 6px}
.rich-content blockquote{margin:0 0 6px;padding-left:10px;border-left:3px solid var(--line2);color:#475467}
.rich-content h4{margin:6px 0;font-size:14px}
@media(max-width:768px){.rich-tool{width:36px;height:36px}.rich-body{font-size:16px}}
