:root {
  --side: #1E1F21;
  --side-2: #2A2B2D;
  --side-3: #393A3C;
  --side-text: #E0DEDD;
  --side-mute: #9C9A99;
  --ink: #1E1F21;
  --ink-2: #3F4043;
  --slate: #6D6E6F;
  --mist: #9CA0A4;
  --bg: #FFFFFF;
  --soft: #F9F8F8;
  --line: #EDEAE9;
  --line-2: #E0DDDB;
  --hover: #F5F3F2;
  --sel: #EEF3FD;
  --green: #14855A;
  --green-2: #5DA283;
  --green-wash: #E5F3EC;
  --amber: #A15C00;
  --amber-wash: #FFF0D9;
  --red: #C92F2F;
  --red-wash: #FCEAEA;
  --blue: #1F5FD6;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --side-w: 248px;
  --pane-w: 560px;
  --shadow: 0 1px 2px rgba(30, 31, 33, .06);
  --shadow-2: 0 18px 50px -18px rgba(30, 31, 33, .35), 0 2px 6px rgba(30, 31, 33, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--slate); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: padding-right .2s var(--ease); }
body.pane-open .shell { padding-right: var(--pane-w); }
.side { background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 14px 10px 10px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 12px; font-weight: 700; font-size: 16px; color: #fff; }
.hq { width: 28px; height: 28px; border-radius: 7px; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: -.04em; flex: none; }
.newtask { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; height: 34px; border-radius: 17px; border: 1px solid var(--side-3); background: transparent; color: #fff; font-weight: 600; font-size: 13.5px; padding: 0 14px; width: fit-content; }
.newtask:hover { background: var(--side-2); }
.newtask svg { width: 15px; height: 15px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--side-text); font-size: 14px; min-height: 32px; }
.nav a:hover { background: var(--side-2); }
.nav a.on { background: var(--side-3); color: #fff; }
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--side-mute); }
.nav a.on svg { color: #fff; }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: #F06A6A; color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav .count.zero { display: none; }
.nav .pc { margin-left: auto; font-size: 12px; color: var(--side-mute); }
.group { margin-top: 14px; }
.group-h { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px; font-size: 12.5px; font-weight: 600; color: var(--side-mute); }
.group-h .mark { width: 18px; height: 18px; border-radius: 5px; }
.group-h button { margin-left: auto; border: 0; background: none; color: var(--side-mute); padding: 2px; border-radius: 4px; display: grid; place-items: center; opacity: 0; }
.group:hover .group-h button { opacity: 1; }
.group-h button:hover { color: #fff; background: var(--side-2); }
.group .nav a { padding-left: 14px; font-size: 13.5px; }
.pdot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.side .foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 2px; font-size: 13.5px; border-top: 1px solid var(--side-2); margin-top: 6px; }
.me button { margin-left: auto; background: none; border: 0; color: var(--side-mute); font-size: 12.5px; }
.me button:hover { color: #fff; }

.mark { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; overflow: hidden; flex: none; }
.mark img { width: 78%; height: 78%; object-fit: contain; }
.mark.sm { width: 18px; height: 18px; border-radius: 5px; }
.mark.lg { width: 36px; height: 36px; border-radius: 9px; }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: #6D6E6F; flex: none; }
.av.xs { width: 20px; height: 20px; font-size: 9px; }
.av.none { background: transparent; border: 1.5px dashed #C7C4C2; }
.ini { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11.5px; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.head { padding: 18px 28px 0; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.head .row1 { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.head h1 input { font: inherit; letter-spacing: inherit; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; min-width: 120px; max-width: 60vw; }
.head h1 input:hover { border-color: var(--line-2); }
.head h1 input:focus { outline: none; border-color: var(--ink); }
.tabs { display: flex; gap: 2px; margin-top: 10px; }
.tabs a, .tabs button { border: 0; background: none; padding: 8px 10px 10px; font-size: 14px; color: var(--slate); border-bottom: 2px solid transparent; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs svg { width: 15px; height: 15px; }
.burger { display: none !important; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 28px; flex-wrap: wrap; }
.content { padding: 0 28px 80px; flex: 1; min-width: 0; }
.search { position: relative; width: min(260px, 100%); }
.search input { width: 100%; height: 32px; border: 1px solid var(--line-2); background: var(--soft); border-radius: 16px; padding: 0 12px 0 32px; font-size: 13.5px; }
.search input:focus { outline: none; border-color: var(--ink); background: #fff; }
.search > svg { position: absolute; left: 11px; top: 9px; width: 15px; height: 15px; color: var(--mist); }
.search .res { position: absolute; top: 38px; right: 0; width: min(420px, 90vw); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; max-height: 70vh; overflow-y: auto; z-index: 30; }
.search .res h6 { margin: 8px 8px 4px; font-size: 12px; color: var(--mist); font-weight: 600; }
.search .res button { display: flex; gap: 9px; align-items: center; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 6px; text-align: left; }
.search .res button:hover { background: var(--hover); }

/* ---------- controls ---------- */
.btn { height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #3A3B3D; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--red); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.done-btn { border-radius: 6px; }
.done-btn.on { background: var(--green-wash); border-color: #B8DDCB; color: var(--green); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 10px; height: 30px; font-size: 13px; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; border-left: 1px solid var(--line-2); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--hover); color: var(--ink); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--slate); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 34px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; padding: 6px 10px; }
textarea { resize: none; overflow: hidden; line-height: 1.5; }
.field textarea { min-height: 70px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px 2px 6px; border-radius: 4px; background: var(--hover); color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.plain { padding: 2px 8px; }
.chip.green { background: var(--green-wash); color: var(--green); }
.chip.amber { background: var(--amber-wash); color: var(--amber); }
.chip .x { border: 0; background: none; padding: 0; margin-left: 2px; color: var(--mist); }
.tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--line); color: var(--slate); font-size: 10px; font-weight: 700; cursor: help; margin-left: 4px; }

/* ---------- task list (Asana) ---------- */
.tlist { border-top: 1px solid var(--line); }
.thead, .trow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 200px 40px; align-items: stretch; }
.thead > div { font-size: 12px; color: var(--slate); padding: 8px 10px; border-left: 1px solid var(--line); }
.thead > div:first-child { border-left: 0; padding-left: 36px; }
.trow { min-height: 38px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; background: #fff; transition: background .1s, opacity .35s, max-height .35s; }
.trow:hover { background: var(--hover); }
.trow.sel { background: var(--sel); }
.trow > div { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line); min-width: 0; font-size: 13.5px; }
.trow > div:first-child { border-left: 0; gap: 8px; padding-left: 8px; }
.trow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.done .name { color: var(--mist); }
.trow.leaving { opacity: 0; }
.trow .meta { display: inline-flex; gap: 8px; align-items: center; color: var(--mist); font-size: 12px; margin-left: 2px; flex: none; }
.trow .meta span { display: inline-flex; gap: 3px; align-items: center; }
.trow .meta svg { width: 12px; height: 12px; }
.trow.dragging { opacity: .4; }
.trow.drop-above { box-shadow: inset 0 2px 0 var(--blue); }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #9CA0A4; background: #fff; display: grid; place-items: center; padding: 0; color: transparent; flex: none; transition: all .15s var(--ease); }
.check svg { width: 11px; height: 11px; }
.check:hover { border-color: var(--green); color: var(--green); background: var(--green-wash); }
.check.on { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.check.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } }
.due { font-size: 13px; color: var(--slate); white-space: nowrap; }
.due.over { color: var(--red); }
.due.today { color: var(--green); }
.sec { display: flex; align-items: center; gap: 6px; padding: 22px 4px 8px; font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; border-bottom: 1px solid var(--line); }
.sec .car { width: 16px; height: 16px; color: var(--slate); transition: transform .15s; flex: none; }
.sec.closed .car { transform: rotate(-90deg); }
.sec .n { font-size: 12.5px; color: var(--mist); font-weight: 400; }
.sec.over { color: var(--red); }
.sec input { font-size: 15px; font-weight: 600; border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 2px 5px; margin-left: -6px; field-sizing: content; min-width: 40px; }
.sec input:hover { border-color: var(--line-2); }
.sec input:focus { outline: none; border-color: var(--ink); }
.sec .secmenu { margin-left: auto; opacity: 0; }
.sec:hover .secmenu { opacity: 1; }
.addrow { display: flex; align-items: center; gap: 8px; padding: 0 8px; min-height: 38px; border-bottom: 1px solid var(--line); color: var(--mist); }
.addrow svg { width: 15px; height: 15px; flex: none; margin: 0 2px; }
.addrow input { border: 0; background: transparent; flex: 1; height: 36px; font-size: 13.5px; }
.addrow input:focus { outline: none; }
.addrow input::placeholder { color: var(--mist); }
.addrow.top { border-bottom: 1px solid var(--line); }
.empty { padding: 26px 8px; color: var(--mist); font-size: 13.5px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.ghost { display: flex; gap: 10px; align-items: center; padding: 0 8px; min-height: 38px; border-bottom: 1px solid var(--line); }
.ghost .b { height: 8px; border-radius: 4px; background: var(--line); }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding: 14px 0 16px; align-items: start; }
.board.narrow { grid-auto-columns: minmax(214px, 1fr); }
.col { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.col.drop { background: #EEF3FD; border-color: #A9C1F1; }
.col > header { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; font-weight: 600; font-size: 13.5px; }
.col > header .n { font-weight: 400; color: var(--mist); font-size: 12.5px; }
.col .slot { border: 1.5px dashed var(--line-2); border-radius: 8px; height: 70px; }
.col .add { border: 0; background: none; color: var(--slate); text-align: left; padding: 6px; border-radius: 6px; display: flex; gap: 6px; align-items: center; font-size: 13px; }
.col .add:hover { background: var(--hover); color: var(--ink); }
.col .add svg { width: 14px; height: 14px; }
.card { background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.card:hover { border-color: #C7C4C2; }
.card.dragging { opacity: .4; }
.card .top { display: flex; gap: 9px; align-items: flex-start; }
.card .ttl { font-weight: 500; line-height: 1.3; font-size: 13.5px; }
.card .sub { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.card .step { display: flex; gap: 8px; align-items: center; font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 8px; }
.card .step .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .step .check { width: 17px; height: 17px; }
.card .nostep { font-size: 12.5px; color: var(--amber); border-top: 1px solid var(--line); padding-top: 8px; display: flex; align-items: center; gap: 6px; }
.card .foot { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--mist); white-space: nowrap; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--slate); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl .who { display: flex; gap: 10px; align-items: center; }
.tbl .who .s { font-size: 12.5px; color: var(--slate); }
.rels { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- inbox ---------- */
.ibx { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); }
.item .who b { font-weight: 600; }
.item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--slate); margin-top: 3px; }
.item .meta select { width: auto; min-height: 26px; height: 26px; padding: 2px 6px; font-size: 12.5px; }
.item .msg { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; margin-top: 8px; max-height: 4.5em; overflow: hidden; cursor: pointer; }
.item .msg.open { max-height: none; }
.item .acts { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- pane ---------- */
.pane { position: fixed; top: 0; right: 0; bottom: 0; width: var(--pane-w); max-width: 100vw; background: #fff; border-left: 1px solid var(--line-2); z-index: 40; display: flex; flex-direction: column; box-shadow: var(--shadow-2); animation: slide .2s var(--ease); }
.pane > .pbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 52px; }
.pane > .pbody { flex: 1; overflow-y: auto; padding: 18px 24px 0; display: flex; flex-direction: column; gap: 18px; }
.ptitle { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 7px; margin-left: -8px; font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; background: transparent; min-height: 38px; }
.ptitle:hover { border-color: var(--line-2); }
.ptitle:focus { outline: none; border-color: var(--ink); }
.ptitle.done { color: var(--mist); }
.crumb { font-size: 12.5px; color: var(--slate); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumb a:hover { text-decoration: underline; }
.props { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 2px 12px; align-items: center; }
.props > label { font-size: 13px; color: var(--slate); }
.props .pv { min-height: 34px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.props select, .props input { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 8px; margin-left: -9px; min-height: 32px; max-width: 100%; font-size: 13.5px; }
.props select:hover, .props input:hover { border-color: var(--line-2); }
.props select:focus, .props input:focus { outline: none; border-color: var(--ink); }
.desc { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 8px 9px; margin-left: -10px; min-height: 64px; background: transparent; font-size: 13.5px; }
.desc:hover { border-color: var(--line-2); }
.desc:focus { outline: none; border-color: var(--ink); }
.psec h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.psec h3 .n { color: var(--mist); font-weight: 400; font-size: 12.5px; }
.sub-row { display: flex; align-items: center; gap: 9px; padding: 0 4px; min-height: 36px; border-bottom: 1px solid var(--line); }
.sub-row .name { flex: 1; min-width: 0; cursor: pointer; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-row.done .name { color: var(--mist); }
.sub-row.link { cursor: pointer; }
.sub-row.link:hover { background: var(--hover); }
.sub-add { display: flex; align-items: center; gap: 9px; padding: 0 4px; min-height: 36px; color: var(--mist); border-bottom: 1px solid var(--line); }
.sub-add input { border: 0; flex: 1; padding: 6px 0; background: transparent; font-size: 13.5px; }
.sub-add input:focus { outline: none; }
.sub-add svg { width: 15px; height: 15px; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stages button { border: 1px solid var(--line-2); background: #fff; border-radius: 14px; padding: 4px 11px; font-size: 12.5px; color: var(--slate); }
.stages button:hover { color: var(--ink); border-color: #C7C4C2; }
.stages button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.stages button.won.on { background: var(--green); border-color: var(--green); }
.stages button.lost.on { background: var(--slate); border-color: var(--slate); }
.thread { background: var(--soft); margin: 0 -24px; padding: 14px 24px 22px; border-top: 1px solid var(--line); flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; gap: 10px; padding: 8px 0; }
.ev.log { padding: 2px 0 2px 34px; font-size: 12.5px; color: var(--slate); }
.ev .b { flex: 1; min-width: 0; }
.ev .h { font-size: 13px; }
.ev .h b { font-weight: 600; }
.ev .h .w { color: var(--mist); margin-left: 6px; font-size: 12px; }
.ev p { margin: 3px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; line-height: 1.5; }
.ev .x { border: 0; background: none; color: var(--mist); visibility: hidden; }
.ev:hover .x { visibility: visible; }
.ev .tag { font-size: 11.5px; color: var(--slate); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 6px; background: #fff; }
.composer { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; }
.composer .box { flex: 1; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.composer .box:focus-within { border-color: var(--ink); }
.composer textarea { border: 0; width: 100%; min-height: 38px; background: transparent; padding: 2px; font-size: 13.5px; }
.composer textarea:focus { outline: none; }
.composer .r { display: flex; gap: 6px; align-items: center; }

/* ---------- connect ---------- */
.connect { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 16px; }
.connect .wide { grid-column: span 2; }
.cp { border: 1px solid var(--line); border-radius: 10px; }
.cp > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.cbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.cfield label { font-size: 12.5px; color: var(--slate); display: flex; align-items: center; margin-bottom: 4px; }
.cval { display: flex; align-items: flex-start; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 7px 6px 7px 10px; }
.cval code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; line-height: 1.5; }
.newkey { padding: 12px 14px 0; }
.newkey .cval { background: var(--green-wash); border-color: #B8DDCB; }
.krow { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.krow:first-child { border-top: 0; }
.krow code { font-family: var(--mono); font-size: 12px; color: var(--slate); }

/* ---------- modal / menu / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(30, 31, 33, .35); z-index: 45; animation: fade .15s ease; }
.modal { position: fixed; z-index: 46; top: 10vh; left: 50%; transform: translateX(-50%); width: min(540px, calc(100vw - 32px)); background: #fff; border-radius: 12px; box-shadow: var(--shadow-2); animation: rise .16s ease; max-height: 82vh; overflow-y: auto; }
.modal > header { padding: 18px 20px 4px; display: flex; align-items: center; }
.modal > header h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.modal form { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.menu { position: absolute; right: 0; top: 36px; background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-2); padding: 4px; min-width: 190px; z-index: 30; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 5px; text-align: left; font-size: 13.5px; color: var(--ink); }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 15px; height: 15px; color: var(--slate); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 10px 9px 16px; border-radius: 8px; z-index: 60; font-size: 13.5px; box-shadow: var(--shadow-2); animation: rise .16s ease; display: flex; gap: 14px; align-items: center; }
.toast.err { background: var(--red); padding-right: 16px; }
.toast button { background: none; border: 0; color: #9FC3FF; font-weight: 600; padding: 2px 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .l { background: var(--side); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login .l .big { font-size: clamp(72px, 10vw, 140px); font-weight: 800; letter-spacing: -.06em; line-height: .85; }
.login .l .marks { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: var(--side-text); }
.login .l .marks span { display: inline-flex; gap: 10px; align-items: center; }
.login .r { display: grid; place-items: center; padding: 32px 20px; }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.03em; }
.login .msg { font-size: 13.5px; padding: 10px 12px; border-radius: 8px; background: var(--green-wash); color: var(--green); }
.login .msg.err { background: var(--red-wash); color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1599px) { body.pane-open .shell { padding-right: 0; } }
@media (max-width: 1000px) {
  .thead, .trow { grid-template-columns: minmax(0, 1fr) 100px 40px; }
  .thead .ctx, .trow .ctx { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: var(--shadow-2); }
  .burger { display: inline-flex !important; }
  .head { padding: 12px 14px 0; }
  .head .row1 { flex-wrap: wrap; }
  .head .search { order: 9; width: 100%; }
  .toolbar { padding: 10px 14px; }
  .content { padding: 0 14px 80px; }
  .board { grid-auto-columns: 82vw; }
  .tbl .hide-m { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .l { padding: 28px 20px; gap: 26px; }
  .login .l .big { font-size: 72px; }
  .pane { width: 100vw; }
  .pane > .pbody { padding: 16px 16px 0; }
  .thread { margin: 0 -16px; padding: 14px 16px 20px; }
  .item { grid-template-columns: 30px minmax(0, 1fr); }
  .item .acts { grid-column: 2; justify-content: flex-start; }
  .connect { grid-template-columns: 1fr; }
  .connect .wide { grid-column: auto; }
  .props { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ---------- CRM ---------- */
.sublabel { font-size: 11.5px; color: var(--side-mute); padding: 8px 14px 2px; }
.btn.on-filter { background: var(--sel); border-color: #B9CCF3; color: var(--blue); }
.tblwrap { overflow-x: auto; }
.tbl.crm th { cursor: pointer; user-select: none; }
.tbl.crm th:hover { color: var(--ink); }
.tbl.crm th.sorted { color: var(--ink); font-weight: 600; }
.tbl.crm td { white-space: nowrap; }
.tbl.crm td.wide { white-space: normal; min-width: 220px; }
.tbl .nm { font-weight: 500; }
.quiet { color: var(--amber); }
.nextcell { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.nextcell .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nextcell .check { width: 17px; height: 17px; }
.stagepill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.stagepill.won { background: var(--green-wash); color: var(--green); }
.stagepill.lost { color: var(--mist); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); }
.crumbs a { display: inline-flex; gap: 7px; align-items: center; }
.crumbs a:hover { color: var(--ink); }
.rec-title { display: flex; gap: 14px; align-items: center; padding: 10px 0 16px; }
.rec-title .ini { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }
.rtitle { font-size: 24px; font-weight: 600; letter-spacing: -.02em; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; width: 100%; background: transparent; }
.rtitle:hover { border-color: var(--line-2); }
.rtitle:focus { outline: none; border-color: var(--ink); }
.rsub { font-size: 13px; color: var(--slate); margin-top: 2px; }
.rsub a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.stagebar { display: flex; gap: 2px; margin: 16px 0 18px; overflow-x: auto; }
.stagebar button { flex: 1; min-width: 92px; border: 0; background: var(--hover); color: var(--slate); font-size: 12.5px; font-weight: 500; height: 32px; padding: 0 12px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); white-space: nowrap; }
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stagebar button:hover { background: var(--line-2); color: var(--ink); }
.stagebar button.past { background: #DCE7DF; color: var(--green); }
.stagebar button.on { background: var(--ink); color: #fff; }
.stagebar button.won.on { background: var(--green); }
.stagebar button.lost { flex: 0 0 auto; min-width: 0; clip-path: none; border-radius: 6px; margin-left: 8px; }
.stagebar button.lost.on { background: var(--slate); }
.record { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 16px; }
.stagebar + .record { padding-top: 0; }
.rp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.rcard h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rcard h3 .n { color: var(--mist); font-weight: 400; font-size: 12.5px; }
.rcard .props { grid-template-columns: 104px minmax(0, 1fr); }
.rcard .desc { margin-left: -10px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); min-height: 40px; }
.prow:last-of-type { border-bottom: 0; }
.prow.link:hover { background: var(--hover); }
.prow .who { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.prow .who > div { min-width: 0; }
.prow .nm { font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .s { font-size: 12px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .x { border: 0; background: none; color: var(--mist); padding: 2px; }
.prow .x:hover { color: var(--red); }
.rolesel { width: auto !important; min-height: 26px !important; height: 26px; padding: 2px 6px !important; font-size: 12px !important; flex: none; }
.rp-main { min-width: 0; }
.logbox { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.logbox:focus-within { border-color: var(--ink); }
.logbox textarea { border: 0; min-height: 56px; padding: 2px; font-size: 13.5px; background: transparent; }
.logbox textarea:focus { outline: none; }
.logbox .r { display: flex; align-items: center; gap: 8px; }
.logbox .seg button svg { color: var(--slate); }
.tl-filter { display: flex; gap: 4px; margin: 16px 0 6px; flex-wrap: wrap; }
.tl-filter button { border: 1px solid transparent; background: none; padding: 4px 10px; border-radius: 14px; font-size: 12.5px; color: var(--slate); }
.tl-filter button:hover { background: var(--hover); }
.tl-filter button.on { border-color: var(--line-2); color: var(--ink); background: #fff; font-weight: 500; }
.tl { display: flex; flex-direction: column; }
.tl-i { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-i .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; flex: none; color: var(--slate); }
.tl-i .ic svg { width: 14px; height: 14px; }
.tl-i.call .ic { background: #E5F0FB; color: #2C6CB8; }
.tl-i.email .ic { background: #F1E9FB; color: #7B4BC2; }
.tl-i.meeting .ic { background: #E5F3EC; color: var(--green); }
.tl-i .b { flex: 1; min-width: 0; }
.tl-i .h { display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.tl-i .h b { font-weight: 600; }
.tl-i .h .tag { font-size: 11.5px; color: var(--slate); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.tl-i .h .w { color: var(--mist); font-size: 12px; margin-left: auto; }
.tl-i .h .x { border: 0; background: none; color: var(--mist); visibility: hidden; }
.tl-i:hover .h .x { visibility: visible; }
.tl-i p { margin: 4px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tl-u { display: flex; gap: 10px; align-items: center; padding: 7px 0 7px 9px; font-size: 12.5px; color: var(--slate); border-bottom: 1px solid var(--line); }
.tl-u .w { margin-left: auto; color: var(--mist); font-size: 12px; }
.dotsm { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; margin-right: 6px; }
@media (max-width: 1000px) { .record { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .rec-title .ini { width: 40px; height: 40px; } .rtitle { font-size: 20px; } .stagebar button { min-width: 80px; } }

.group-h { cursor: pointer; user-select: none; }
.group-h .car { width: 13px; height: 13px; flex: none; margin-left: -4px; transition: transform .15s; }
.group.folded .group-h .car { transform: rotate(-90deg); }
.group.folded > .nav { display: none; }
.group-h:hover { color: #fff; }
.tbl.crm td.wide { max-width: 380px; }
.tbl.crm td.wide .nextcell { align-items: flex-start; }
.tbl.crm td.wide .nextcell .t { white-space: normal; line-height: 1.35; }
.tbl.crm td.wide .nextcell .check { margin-top: 1px; }

/* ---------- admin ---------- */
.bizpick { display: flex; gap: 8px; flex-wrap: wrap; }
.bizopt { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13.5px; }
.bizopt:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.bizopt:has(input:disabled) { cursor: default; opacity: .8; }
.bizopt input { margin: 0; }
.bizopt .mark { width: 22px; height: 22px; }
tr.inactive td { color: var(--mist); }
tr.inactive .av { opacity: .5; }
.seg button:disabled { opacity: .5; cursor: default; }
