:root {
  --bg: #111213;
  --panel: #1c1d1f;
  --surface: #2c2c2e;
  --surface-hover: #37373a;
  --surface-alt: #232325;
  --border: #48484c;
  --border-soft: #333336;
  --text: #d8dae0;
  --text-strong: #ffffff;
  --text-dim: #9a9ca6;
  --primary: #0073ea;
  --primary-hover: #0060c2;
  --link: #6db1ff;
  --empty-status: #5f6377;
  --tag-bg: #12356e;
  --tag-text: #dbe9ff;
  --danger: #df2f4a;
  --row-h: 36px;
  --left-w: 446px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.4 Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { display: inline-flex; flex: none; }
.ico svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #4a4a4f; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; }
.login-card { width: 380px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 36px 32px; }
.login-card h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: .08em; color: var(--text-strong); font-weight: 600; }
.login-card p { margin: 0 0 24px; color: var(--text-dim); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.input { width: 100%; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; outline: none; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); }
.btn { height: 32px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--surface-hover); }
.btn.primary { background: var(--primary); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: #ff7f92; }
.btn.outline { border: 1px solid var(--border); }
.btn.big { height: 40px; width: 100%; justify-content: center; }
.btn.active { background: #0d2c57; color: #cfe4ff; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: #ff7f92; min-height: 20px; font-size: 13px; margin: 2px 0 10px; }

/* ---------- shell ---------- */
.shell { height: 100%; display: grid; grid-template-columns: 250px 1fr; grid-template-rows: 48px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; padding: 0 16px; gap: 12px; border-bottom: 1px solid var(--border-soft); }
.brand { font-weight: 700; letter-spacing: .14em; color: var(--text-strong); font-size: 16px; }
.brand small { font-weight: 400; letter-spacing: 0; color: var(--text-dim); margin-left: 8px; font-size: 13px; }
.spacer { flex: 1; }
.side { border-right: 1px solid var(--border-soft); padding: 12px 8px; overflow: auto; background: var(--panel); }
.side h6 { margin: 14px 10px 6px; font-size: 12px; font-weight: 500; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.nav { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px; border-radius: 6px; text-align: left; color: var(--text); }
.nav span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav:hover { background: var(--surface); text-decoration: none; }
.nav.on { background: #0d2c57; color: #fff; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; border: 2px solid var(--surface); }
.avatar.lg { width: 32px; height: 32px; font-size: 12px; border-color: transparent; }
.avatar.none { background: transparent; border: 1.5px solid var(--text-dim); color: var(--text-dim); }

/* ---------- board header ---------- */
.bhead { padding: 18px 32px 0; }
.btitle { display: flex; align-items: center; gap: 8px; }
.btitle h1 { margin: 0; font-size: 24px; font-weight: 500; color: var(--text-strong); padding: 2px 6px; margin-left: -6px; border-radius: 4px; border: 1px solid transparent; cursor: text; }
.btitle h1:hover { border-color: var(--border); }
.tabs { display: flex; gap: 4px; margin-top: 10px; border-bottom: 1px solid var(--border-soft); }
.tab { height: 34px; padding: 0 12px; border-bottom: 2px solid transparent; color: var(--text); }
.tab.on { border-color: var(--primary); color: var(--text-strong); }
.toolbar { display: flex; align-items: center; gap: 4px; padding: 14px 0; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid transparent; }
.search:focus-within, .search.has { border-color: var(--primary); }
.search input { background: none; border: 0; outline: 0; width: 70px; transition: width .15s; }
.search:focus-within input, .search.has input { width: 200px; }
.count-note { color: var(--text-dim); font-size: 13px; margin-left: 8px; }

/* ---------- table ---------- */
.scroll { flex: 1; overflow: auto; margin-left: 32px; padding: 0 32px 120px 0; min-height: 0; }
.group { width: max-content; min-width: 100%; margin-bottom: 28px; }
.ghead { position: sticky; left: 0; width: max-content; display: flex; align-items: center; gap: 6px; height: 40px; padding-left: 4px; }
.ghead .chev { width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; transition: transform .12s; }
.ghead .chev:hover { background: var(--surface); }
.ghead .chev.closed { transform: rotate(-90deg); }
.gtitle { font-size: 18px; font-weight: 500; padding: 1px 6px; border-radius: 4px; border: 1px solid transparent; cursor: text; }
.gtitle:hover { border-color: var(--border); }
.gcount { color: var(--text-dim); font-size: 13px; margin-left: 4px; }
.gmenu { opacity: 0; width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; }
.ghead:hover .gmenu, .gmenu:focus { opacity: 1; }
.gmenu:hover { background: var(--surface); }
.row { display: flex; height: var(--row-h); }
.left { position: sticky; left: 0; z-index: 2; display: flex; width: var(--left-w); flex: none; background: var(--bg); }
.bar { width: 6px; flex: none; }
.chk { width: 34px; flex: none; display: grid; place-items: center; background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.cell, .hcell, .fcell { flex: none; height: var(--row-h); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 0 8px; overflow: hidden; position: relative; white-space: nowrap; }
.row.item:hover .cell, .row.item:hover .chk { background: var(--surface-hover); }
.row.item.sel .cell, .row.item.sel .chk { background: #16314f; }
.name { flex: 1; min-width: 0; justify-content: flex-start; gap: 6px; padding-left: 4px; }
.name .grip { width: 14px; color: var(--text-dim); opacity: 0; cursor: grab; flex: none; }
.row.item:hover .grip { opacity: 1; }
.name .txt { overflow: hidden; text-overflow: ellipsis; padding: 3px 5px; border: 1px solid transparent; border-radius: 4px; cursor: text; min-width: 20px; }
.name .txt:hover { border-color: var(--border); }
.name .open { display: none; align-items: center; gap: 4px; margin-left: auto; padding: 0 8px; height: 24px; border-radius: 4px; color: var(--text-dim); font-size: 12px; flex: none; }
.row.item:hover .open { display: inline-flex; }
.name .open:hover { background: var(--border); color: var(--text-strong); }
.bubble { margin-left: auto; width: 58px; height: 100%; display: grid; place-items: center; color: var(--text-dim); position: relative; flex: none; border-left: 1px solid var(--border); margin-right: -8px; }
.row.item:hover .open + .bubble { margin-left: 0; }
.bubble:hover, .bubble.has:hover { color: var(--link); }
.bubble.has { color: #c5c7d0; }
/* count sits on the lower-right of the icon, which stays centred in its cell */
.bubble b { position: absolute; left: calc(50% + 1px); top: calc(50% - 1px); background: #c5c7d0; color: #323338; font-size: 10px; font-weight: 500; min-width: 15px; height: 15px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; line-height: 1; }
.hrow { position: sticky; top: 0; z-index: 4; }
.hrow .left { z-index: 5; }
.hcell { color: var(--text); font-weight: 400; font-size: 13.5px; background: var(--surface); border-top: 1px solid var(--border); cursor: default; }
.hrow .chk { border-top: 1px solid var(--border); }
.hrow .bar { border-top-left-radius: 6px; }
.hcell .title { overflow: hidden; text-overflow: ellipsis; padding: 2px 6px; border: 1px solid transparent; border-radius: 4px; }
.hcell .title:hover { border-color: var(--border); cursor: text; }
.hcell .cmenu { position: absolute; right: 6px; top: 7px; width: 22px; height: 22px; border-radius: 4px; display: none; place-items: center; background: var(--surface); }
.hcell:hover .cmenu { display: grid; }
.hcell .cmenu:hover { background: var(--border); }
.hcell .rz { position: absolute; right: -3px; top: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.hcell .rz:hover, .hcell .rz.on { background: var(--primary); }
.addcol { width: 44px; cursor: pointer; color: var(--text-dim); }
.addcol:hover { color: var(--text-strong); background: var(--surface-hover); }
.fill { flex: 1; min-width: 44px; border-right: 0; }
.cell.fill { cursor: default; }
.row.add .cell { justify-content: flex-start; }
.row.add input { background: none; border: 1px solid transparent; outline: 0; height: 26px; width: 100%; padding: 0 6px; border-radius: 4px; }
.row.add input:hover { border-color: var(--border); }
.row.add input:focus { border-color: var(--primary); }
.row.add .bar { opacity: .5; border-bottom-left-radius: 6px; }
.row.foot .left { background: var(--bg); }
.fcell { background: var(--bg); border-color: transparent; flex-direction: column; gap: 0; font-size: 13px; }
.fcell.on { background: var(--surface); border-color: var(--border); border-top: 0; }
.fcell small { font-size: 10px; color: var(--text-dim); line-height: 1; }
.battery { display: flex; width: 100%; height: 22px; gap: 0; }
.battery i { display: block; height: 100%; min-width: 3px; transition: transform .08s; position: relative; }
.battery i:first-child { border-radius: 3px 0 0 3px; }
.battery i:last-child { border-radius: 0 3px 3px 0; }
.battery i:only-child { border-radius: 3px; }
.battery i:hover { transform: scaleY(1.3); border-radius: 3px; z-index: 1; }
.fcell:has(.battery), .ccell .cv:has(.battery) { overflow: visible; }
.btip { position: fixed; z-index: 85; background: #fff; color: #323338; border-radius: 6px; padding: 8px 14px; font-size: 14px; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.45); pointer-events: none; }
.btip span { margin-left: 14px; }
.btip::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.row.drop-before .cell, .row.drop-before .chk { box-shadow: inset 0 2px 0 var(--primary); }
.row.drop-after .cell, .row.drop-after .chk { box-shadow: inset 0 -2px 0 var(--primary); }
.empty-note { position: sticky; left: 0; width: max-content; color: var(--text-dim); padding: 8px 46px; font-size: 13px; }

/* collapsed group */
.group.closed .cbox { display: flex; height: 58px; }
.group.closed .left { background: var(--surface); border: 1px solid var(--border); border-left: 0; border-radius: 6px 0 0 6px; overflow: hidden; }
.group.closed .ghead { position: static; display: grid; grid-template-columns: 24px auto 24px; align-items: center; column-gap: 6px; height: auto; align-self: center; padding-left: 8px; min-width: 0; }
.group.closed .gtitle { grid-area: 1 / 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group.closed .gmenu { grid-area: 1 / 3; }
.group.closed .gcount { grid-area: 2 / 2 / 3 / 4; margin: -2px 0 0 7px; }
.group.closed .ccell { flex: none; height: 58px; border: 1px solid var(--border); border-left: 0; background: var(--surface); display: flex; flex-direction: column; }
.group.closed .ccell .ct { height: 22px; display: grid; place-items: center; font-size: 13px; border-bottom: 1px solid var(--border); }
.group.closed .ccell.on .ct { background: #1f4b3a; color: #fff; }
.group.closed .ccell .cv { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 6px; font-size: 13px; }
.group.closed .ccell .cv small { font-size: 10px; color: var(--text-dim); line-height: 1; }
.group.closed .ccell .battery { height: 20px; }

/* ---------- cell types ---------- */
.cell.editable { cursor: pointer; }
.cell.t-status { padding: 0; color: #fff; }
.status-fill { width: 100%; height: 100%; display: grid; place-items: center; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.cell.t-text, .cell.t-email, .cell.t-phone, .cell.t-link, .cell.t-location, .cell.t-tags, .cell.t-connect { justify-content: flex-start; }
.cell.t-tags, .cell.t-connect, .cell.t-link, .cell.t-email, .cell.t-phone { justify-content: center; gap: 4px; }
.cell.t-email { justify-content: flex-start; overflow: hidden; }
.email-chip { display: inline-block; min-width: 0; max-width: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; color: var(--link); background: #202b3a; text-decoration: none; }
.email-chip:hover { background: #26374d; text-decoration: none; }
.email-count { flex: none; padding: 2px 6px; border-radius: 5px; background: #3b3b40; color: var(--text); font-size: 11px; }
.email-add-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--link); white-space: nowrap; font-size: 12px; }
.cell.t-mirror { cursor: default; }
.detail .cell.t-longtext { height: auto; min-height: var(--row-h); padding: 6px 8px; white-space: pre-line; align-items: flex-start; }
.cell.t-longtext { justify-content: flex-start; }
.cell.t-longtext .multi, .detail .cell.t-longtext .one { display: none; }
.detail .cell.t-longtext .multi { display: block; }
.cell.t-mirror.t-file { cursor: pointer; }
.clip { overflow: hidden; text-overflow: ellipsis; }
.cell.t-location .pin { color: var(--text-dim); margin-right: 6px; }
.cell.t-location .pin:hover { color: var(--link); }
.chip { background: var(--tag-bg); color: var(--tag-text); border-radius: 4px; padding: 2px 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; white-space: nowrap; }
.chip.more { background: #3b3b40; color: var(--text); flex: none; }
.chip.conn { cursor: pointer; }
.chip.conn:hover { background: #1b4a97; }
.check-on { color: #00c875; }
.people { display: flex; }
.people .avatar + .avatar { margin-left: -8px; }
.pageico { display: inline-flex; flex: none; }
.pageico svg { display: block; }
.cell.t-file { gap: 4px; }
.cell .fileico:hover { filter: brightness(1.15); }
.fileico { color: #a99bff; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.cell .plus { opacity: 0; color: var(--text-dim); position: absolute; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
.cell.editable:hover .plus { opacity: 1; }
.timeline { width: 100%; height: 22px; border-radius: 11px; color: #fff; font-size: 13px; display: grid; place-items: center; overflow: hidden; }
.timeline.none { background: #4a4a4f; color: var(--text-dim); }
.inline-input { width: 100%; height: 28px; background: var(--bg); border: 1px solid var(--primary); border-radius: 4px; outline: 0; padding: 0 6px; }
.cell.editing { padding: 0 3px; overflow: visible; }

/* ---------- popups ---------- */
.pop { position: fixed; z-index: 50; background: #26272b; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.55); padding: 8px; min-width: 180px; max-width: 420px; max-height: 70vh; overflow: auto; }
.pop h5 { margin: 4px 8px 8px; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.mi { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border-radius: 4px; text-align: left; }
.mi:hover { background: var(--surface-hover); }
.mi.on { background: #0d2c57; }
.mi.danger { color: #ff7f92; }
.mi .end { margin-left: auto; color: var(--text-dim); }
.sep { height: 1px; background: var(--border); margin: 6px 0; }
.labels { display: grid; gap: 6px; width: 200px; }
.labels .lab { height: 32px; border-radius: 4px; color: #fff; text-align: center; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.labels .lab:hover { filter: brightness(1.12); }
.labedit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 4px; flex: none; }
.swatches { display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 4px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; }
.pop .input { height: 32px; }
.pop textarea.input { height: auto; line-height: 1.5; }
.email-editor { display: grid; gap: 8px; width: min(380px, calc(100vw - 40px)); }
.email-editor-title { margin: 0 !important; color: var(--text-strong) !important; font-size: 14px !important; }
.email-editor-help { margin: 0 2px 2px; color: var(--text-dim); font-size: 12px; line-height: 1.45; white-space: normal; }
.email-editor-list { display: grid; gap: 6px; max-height: min(40vh, 260px); overflow: auto; }
.email-editor-row { display: flex; align-items: center; gap: 6px; }
.email-editor-row .input { flex: 1; min-width: 0; }
.email-remove { width: 34px; padding: 0; justify-content: center; color: var(--text-dim); }
.email-remove:hover { color: #ff7f92; }
.email-add { justify-content: center; }
.email-editor-actions { justify-content: flex-end; }
.pop-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.cal { width: 252px; user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 36px); }
.cal > .cal-grid > span { height: 26px; display: grid; place-items: center; font-size: 11px; color: var(--text-dim); }
.cal > .cal-grid > button { height: 32px; border-radius: 50%; }
.cal > .cal-grid > button:hover { background: var(--surface-hover); }
.cal > .cal-grid > button.out { color: #6c6e77; }
.cal > .cal-grid > button.today { box-shadow: inset 0 0 0 1px var(--text-dim); }
.cal > .cal-grid > button.sel { background: var(--primary); color: #fff; }
.filelist { min-width: 280px; }
.filelist .mi a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; color: var(--text-dim); flex: none; }
.x:hover { background: var(--border); color: #fff; }
.typegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 320px; }

/* ---------- bulk bar, toast ---------- */
.bulk { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 20; background: #26272b; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.6); display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 0; overflow: hidden; }
.bulk .n { background: var(--primary); color: #fff; font-size: 22px; font-weight: 500; align-self: stretch; margin: -8px 10px -8px 0; padding: 0 18px; display: grid; place-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: #3a1820; border: 1px solid var(--danger); color: #ffd7dd; padding: 10px 16px; border-radius: 8px; }
.toast.ok { background: #14301f; border-color: #00c875; color: #d9ffe9; }

/* ---------- item panel ---------- */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 640px; max-width: 100vw; z-index: 31; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0,0,0,.5); }
.panel header { padding: 14px 20px 0; }
.panel header .top { display: flex; align-items: flex-start; gap: 8px; }
.panel h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text-strong); flex: 1; padding: 2px 6px; border: 1px solid transparent; border-radius: 4px; cursor: text; }
.panel h2:hover { border-color: var(--border); }
.panel .body { flex: 1; overflow: auto; padding: 16px 20px 40px; }
.avatar.xl { width: 46px; height: 46px; font-size: 15px; border-color: transparent; }
.avatar.auto { background: #fff; color: var(--primary); }
.panel { width: 760px; background: #111213; }
.panel header { padding: 18px 28px 0; border-bottom: 1px solid var(--border-soft); }
.panel header .tabs { border-bottom: 0; margin-top: 12px; gap: 6px; }
.panel header .tab { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; height: 38px; }
.panel h2 { font-size: 26px; }
.panel .body { padding: 22px 28px 60px; }
.composer { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.composer:focus-within { border-color: var(--primary); }
.composer textarea { width: 100%; background: none; border: 0; outline: 0; resize: none; font-size: 15px; display: block; }
.composer .cbar { display: none; align-items: center; justify-content: space-between; margin-top: 10px; }
.composer.open .cbar { display: flex; }
.upd { border: 1px solid var(--border); border-radius: 10px; margin-top: 20px; }
.uhd { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.uhd b { font-weight: 600; color: var(--text-strong); font-size: 15px; }
.uhd time, .ureply time { color: var(--text-dim); font-size: 14px; margin-left: 2px; }
.uhd .spacer { flex: 1; }
.ucontent { padding: 14px 30px 8px; font-size: 15px; line-height: 1.55; }
.ucontent.long { max-height: 290px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.ubody { white-space: pre-wrap; overflow-wrap: anywhere; }
.uhead { font-weight: 700; text-decoration: underline; color: var(--text-strong); margin: 6px 0 44px; }
.umeta { margin-bottom: 26px; }
.umeta b { font-weight: 700; color: var(--text-strong); }
.usubject { font-weight: 700; text-decoration: underline; color: #c7cad6; margin-bottom: 26px; }
.more-btn { color: var(--text); font-size: 15px; margin: 0 0 14px 38px; }
.more-btn:hover { color: var(--link); }
.uacts { display: flex; gap: 8px; padding: 8px 18px; border-top: 1px solid var(--border); }
.uacts .btn { color: var(--text-dim); height: 36px; font-size: 14px; }
.uacts .btn.liked { color: var(--link); }
.ureplies { border-top: 1px solid var(--border); padding: 14px 18px 2px; display: grid; gap: 12px; }
.ureply { display: flex; gap: 10px; align-items: flex-start; }
.bubbletext { background: var(--surface); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.bubbletext > div:first-child { display: flex; align-items: center; gap: 8px; }
.bubbletext b { font-weight: 600; color: var(--text-strong); }
.bubbletext time { font-size: 12px; }
.ureplybox { display: flex; gap: 12px; align-items: center; padding: 16px 18px 18px; border-top: 1px solid var(--border); }
.ureplybox .input { height: 46px; border-radius: 8px; background: none; }
.frow { gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px; margin-bottom: 8px; }
.frow .fname { display: grid; gap: 2px; text-align: left; min-width: 0; }
.frow .fname b { font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { display: grid; grid-template-columns: 180px 1fr; gap: 6px 10px; align-items: center; }
.detail label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail .cell { width: 100% !important; border: 1px solid var(--border-soft); border-radius: 4px; }

/* ---------- dashboard ---------- */
.dash { flex: 1; overflow: auto; padding: 0 32px 60px; }
.dgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.w { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
.w h3 { margin: 0; padding: 12px 20px; font-size: 14px; font-weight: 500; letter-spacing: .02em; border-bottom: 1px solid var(--border); color: var(--text-strong); text-transform: uppercase; }
.w .wb { padding: 20px; }
.w.s2 { grid-column: span 2; }
.w.s1 { grid-column: span 1; }
.bignum { font-size: 34px; text-align: center; padding: 26px 8px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.donut { display: flex; align-items: center; gap: 28px; justify-content: center; flex-wrap: wrap; min-height: 240px; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend span { color: var(--text-dim); margin-left: auto; padding-left: 16px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 16px; height: 240px; border-bottom: 1px solid var(--border); padding: 0 8px; }
.barcol { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.barcol .v { font-size: 13px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.barcol .b { width: 100%; max-width: 56px; border-radius: 4px 4px 0 0; min-height: 2px; }
.barcol:hover .b { filter: brightness(1.15); }
.barlabels { display: flex; justify-content: space-around; gap: 16px; padding: 8px 8px 0; }
.barlabels span { flex: 1; max-width: 110px; text-align: center; font-size: 12px; color: var(--text-dim); }
.tip { position: fixed; z-index: 80; pointer-events: none; background: #000; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.sel-year { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; height: 32px; padding: 0 8px; }
@media (max-width: 1100px) { .dgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .bhead, .dash { padding-left: 12px; padding-right: 12px; }
  .scroll { margin-left: 12px; padding-right: 12px; }
  :root { --left-w: 300px; }
}

/* ---------- map view ---------- */
.mapwrap { flex: 1; min-height: 0; padding: 0 32px 24px; display: flex; position: relative; }
#mapbox { flex: 1; border: 1px solid var(--border); border-radius: 8px; background: #0b1622; position: relative; z-index: 0; isolation: isolate; display: grid; place-items: center; color: var(--text-dim); }
#mapbox.leaflet-container { font: inherit; background: #17232e; }
/* Grey basemap tinted blue-teal, like Google Maps at night; labels brightened to white */
.gm-tiles { filter: sepia(1) hue-rotate(148deg) saturate(1.35) brightness(.98) contrast(1.08); }
.gm-labels { filter: brightness(1.9) contrast(1.1); }
.pin-ico { background: none; border: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
#mapbox .leaflet-popup-content-wrapper, #mapbox .leaflet-popup-tip { background: #26272b; color: var(--text); box-shadow: 0 8px 28px rgba(0,0,0,.6); }
#mapbox .leaflet-popup-content-wrapper { border: 1px solid var(--border); border-radius: 8px; }
#mapbox.leaflet-container a.leaflet-popup-close-button { color: var(--text-dim); }
#mapbox .leaflet-bar a, #mapbox .leaflet-bar a:hover { background: #26272b; color: var(--text); border-bottom-color: var(--border); }
.leaflet-control-attribution { background: rgba(17,18,19,.75) !important; color: var(--text-dim); }
#mapbox .leaflet-control-attribution a { color: var(--text-dim); }
.mpop { display: grid; gap: 8px; justify-items: start; font-size: 13px; }
.mpop b { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.mpop .mstatus { color: #fff; border-radius: 4px; padding: 2px 10px; }
.mpop .maddr { color: var(--text-dim); white-space: pre-line; }
.maplegend { position: absolute; left: 44px; bottom: 36px; z-index: 1; background: rgba(28,29,31,.92); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; font-size: 13px; }
.maplegend:empty { display: none; }
.maplegend div { display: flex; align-items: center; gap: 8px; }
.maplegend i { width: 10px; height: 10px; border-radius: 50%; }
.maplegend span { margin-left: auto; padding-left: 14px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .mapwrap { padding: 0 12px 12px; } .maplegend { left: 20px; bottom: 24px; } }
#mapbox .marker-cluster { color: #111213; font-weight: 600; }
#mapbox .marker-cluster span { font-size: 12px; }
img.avatar { object-fit: cover; object-position: 50% 25%; background: var(--surface); }

/* ---------- automations ---------- */
.bell { position: relative; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: var(--text); }
.bell:hover { background: var(--surface); }
.bell b { position: absolute; top: 1px; right: 0; background: var(--danger); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.btitle .spacer { flex: 1; }
.switch { width: 34px; height: 20px; border-radius: 10px; background: #55575f; position: relative; flex: none; transition: background .12s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #16171a; transition: left .12s; }
.switch.on { background: var(--primary); }
.switch.on i { left: 17px; background: #fff; }
.mailbar { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 10px 14px; border-radius: 8px; background: #2b2410; border: 1px solid #6b5514; }
.mailbar.live { background: #10261b; border-color: #1c6b45; }
.mailbar b { color: var(--text-strong); font-weight: 600; }
.atable { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.arow { display: grid; grid-template-columns: 40px 64px minmax(260px, 2.2fr) minmax(120px, 1fr) 70px 90px 110px; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border-top: 1px solid var(--border); cursor: pointer; }
.arow:hover { background: var(--surface-alt); }
.arow.ahead { border-top: 0; cursor: default; background: var(--surface-alt); color: var(--text-strong); font-weight: 500; }
.asent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asent b, .arow b { font-weight: 600; color: var(--text-strong); }
.anote { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.pct { display: inline-block; min-width: 48px; text-align: center; border-radius: 4px; padding: 2px 6px; font-size: 13px; }
.pct.good { background: #0b5c3a; color: #d9ffe9; } .pct.bad { background: #6b1f2a; color: #ffd7dd; } .pct.none { background: #4a4a4f; min-width: 22px; }
.abar { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.aedit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.aleft { overflow: auto; padding: 28px 32px 80px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.aright { border-left: 1px solid var(--border-soft); overflow: auto; padding: 20px; }
.aright h3 { margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.sline { font-size: 24px; line-height: 1.7; color: var(--text-strong); display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.sline.small { font-size: 17px; }
.usel { background: none; border: 0; border-bottom: 2px solid var(--text-dim); border-radius: 0; font: inherit; color: inherit; padding: 0 2px; max-width: 420px; outline: 0; cursor: pointer; }
.usel:hover, .usel:focus { border-color: var(--primary); }
.usel.dim { color: var(--link); }
.usel.num { width: 70px; text-align: center; }
.usel option { font-size: 14px; background: #26272b; color: var(--text); }
.arrow { color: #00c875; font-size: 28px; line-height: 1; margin: 6px 0; }
.abox { align-self: stretch; max-width: 760px; border: 1px solid var(--border-soft); background: var(--surface-alt); border-radius: 8px; padding: 12px 16px 16px; display: grid; gap: 10px; }
.afield { display: grid; gap: 4px; align-self: stretch; max-width: 760px; }
.afield span { font-size: 13px; color: var(--text-dim); }
.afield select.input, .maprow select.input { padding: 0 8px; }
.acheck { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-dim); }
.chips .chip { cursor: pointer; }
.chips .chip:hover { background: #1b4a97; }
.maprow { display: flex; align-items: center; gap: 8px; }
.run { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.run time { color: var(--text-dim); font-size: 12px; margin-left: 8px; }
.run .anote { white-space: normal; overflow-wrap: anywhere; }
.run .bad { color: #ff7f92; }
@media (max-width: 1000px) { .aedit { grid-template-columns: 1fr; overflow: auto; } .aright { border-left: 0; border-top: 1px solid var(--border-soft); } }

/* ---------- file preview ---------- */
.pv { position: fixed; inset: 0; z-index: 70; background: rgba(8,9,10,.86); display: flex; flex-direction: column; padding: 28px 44px 36px; }
.pv-head { display: flex; align-items: center; gap: 12px; background: #1c1d1f; border: 1px solid var(--border-soft); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 14px 18px; }
.pv-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pv-title b { font-weight: 600; color: var(--text-strong); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-title span { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head a.btn:hover { text-decoration: none; }
.pv-body { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 10px; background: #26272b; border: 1px solid var(--border-soft); border-radius: 0 0 12px 12px; padding: 14px; }
.pv-frame { flex: 1; border: 0; border-radius: 6px; background: #fff; min-width: 0; }
.pv-img { flex: 1; min-width: 0; object-fit: contain; }
.pv-none { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-dim); }
.pv-nav { width: 44px; border-radius: 8px; display: grid; place-items: center; color: var(--text); flex: none; }
.pv-nav:hover:not(:disabled) { background: var(--surface-hover); }
.pv-nav:disabled { opacity: .25; cursor: default; }
.cell .fileico { cursor: zoom-in; }
@media (max-width: 800px) { .pv { padding: 0; } .pv-head, .pv-body { border-radius: 0; } }
.mapswitch { position: absolute; right: 44px; top: 12px; z-index: 1; display: flex; background: rgba(28,29,31,.94); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.mapswitch button { padding: 7px 14px; font-size: 13px; color: var(--text); }
.mapswitch button + button { border-left: 1px solid var(--border); }
.mapswitch button:hover { background: var(--surface-hover); }
.mapswitch button.on { background: var(--primary); color: #fff; }
#mapbox[data-base="map"].leaflet-container { background: #aad3df; }
#mapbox[data-base="satellite"].leaflet-container { background: #0b1a2a; }
#mapbox .leaflet-control-attribution { font-size: 10px; }
@media (max-width: 800px) { .mapswitch { right: 20px; } }

/* ---------- connect (linked item) column ---------- */
.cell.t-connect { padding: 4px 8px; gap: 6px; }
.linkchip { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; background: #0f1011; color: #fff; border-left: 5px solid var(--bar); border-radius: 3px; padding: 0 10px; font-size: 14px; }
.linkchip:hover { background: #1a1c20; }
.linkedit { display: none; width: 22px; height: 22px; border-radius: 4px; place-items: center; color: var(--text-dim); flex: none; }
.cell.t-connect:hover .linkedit { display: grid; }
.linkedit:hover { background: var(--border); color: #fff; }
.pick { width: 400px; max-width: 100%; padding: 8px 6px 4px; }
.pop:has(.pick) { max-width: 440px; }
.picktitle { font-size: 17px; color: var(--text-strong); margin-bottom: 14px; }
.pickboard { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--text-strong); margin: 0 0 8px 8px; }
.picksearch { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 1px solid var(--primary); border-radius: 6px; color: var(--text-dim); }
.picksearch input { flex: 1; background: none; border: 0; outline: 0; }
.picklist { margin-top: 10px; max-height: 46vh; overflow: auto; }
.picklist h5 { margin: 14px 0 8px; font-size: 14px; }
.pickgroup { font-size: 15px; margin: 4px 0 8px; }
.pickrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; margin-bottom: 4px; border: 1px solid var(--border); border-left: 6px solid var(--bar, var(--primary)); border-radius: 4px; cursor: pointer; text-align: left; }
.pickrow:hover { background: var(--surface-hover); }
.pickrow input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.pickrow.add { color: var(--link); border-style: dashed; border-left-style: solid; }
.lveil { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; }
.lcard { width: 640px; max-width: 100%; max-height: 88vh; overflow: auto; background: #111213; border-radius: 6px; padding: 14px 20px 32px 64px; box-shadow: 0 16px 48px rgba(0,0,0,.7); position: relative; }
.ltop { display: flex; justify-content: flex-end; gap: 6px; }
.lcard h2 { margin: 6px 0 12px; font-size: 26px; font-weight: 700; color: var(--text-strong); }
.lin { font-size: 16px; margin: 0 0 26px 2px; color: var(--text-strong); }
.lgrid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 12px; align-items: center; padding-right: 64px; }
.lrow { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-strong); min-width: 0; }
.ltile { width: 22px; height: 22px; border-radius: 5px; background: #ffcb00; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.lgrid .cell { width: auto !important; height: 40px; border: 0; background: var(--surface); cursor: default; }
.lgroup { justify-content: flex-start; gap: 12px; padding-left: 16px; }
.lgroup i { width: 9px; height: 9px; border-radius: 50%; }
@media (max-width: 700px) { .lcard { padding-left: 20px; } .lgrid { padding-right: 0; grid-template-columns: 120px minmax(0, 1fr); } }
.filelist { min-width: 400px; }
.filelist .mi a.x { flex: none; }
.filelist .mi { gap: 4px; }
.filelist .mi .fileico { margin-right: 6px; }
.filelist a.x:hover, .frow a.x:hover { text-decoration: none; }
.frow { cursor: pointer; }
.frow .fname { flex: 1; }
.cell.t-rollup { cursor: default; font-variant-numeric: tabular-nums; }
.hcell .cfit { position: absolute; left: 6px; top: 7px; width: 22px; height: 22px; border-radius: 4px; display: none; place-items: center; background: var(--surface); color: var(--text-dim); }
.hcell:hover .cfit { display: grid; }
.hcell .cfit:hover { background: var(--border); color: #fff; }

/* ---------- recycle bin and backups ---------- */
.binrow { grid-template-columns: 84px minmax(220px, 2fr) minmax(120px, 1fr) 170px 90px 250px; cursor: default; }
.binacts { display: flex; gap: 8px; justify-content: flex-end; }
.binrow .bad { color: #ff7f92; }
.kind { justify-self: start; font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #3b3b40; color: #fff; }
.kind.k-board { background: #5559df; } .kind.k-group { background: #0086c0; } .kind.k-column { background: #a25ddc; }
.baksrow { grid-template-columns: 170px 80px 90px 110px 90px 90px minmax(120px, 1fr); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: 32px; display: block; }
.brand span { font-weight: 600; letter-spacing: .14em; font-size: 15px; color: var(--text-strong); }
.brand small { margin-left: 0; padding-left: 12px; border-left: 1px solid var(--border); letter-spacing: .08em; }
.login-logo { height: 64px; width: 64px; display: block; margin: 0 0 16px; }
.login-card h1 { font-size: 22px; letter-spacing: .14em; }

/* Files dropped directly onto an editable attachment cell. */
.cell.attachment-drop { background: rgba(0,174,239,.18); box-shadow: inset 0 0 0 2px #00aeef; }
.cell.attachment-uploading { position: relative; pointer-events: none; }
.cell.attachment-uploading::after { content: attr(data-upload-label); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #202329; color: #fff; font-size: 12px; z-index: 2; }

.file-drop-hint { color: #a7a9b5; font-size: 11px; white-space: nowrap; }

/* ---------- read-only Projects calendar ---------- */
.project-calendar { flex: 1; min-height: 0; overflow: auto; margin: 8px 32px 24px; padding: 4px 0 32px; }
.cal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 8px 0 18px; }
.cal-heading h2 { margin: 0; font-size: 21px; font-weight: 600; color: var(--text-strong); }
.cal-heading p { margin: 4px 0 0; color: var(--text-dim); }
.cal-stats { display: flex; gap: 8px; flex: none; }
.cal-stat { padding: 5px 10px; border: 1px solid var(--border-soft); border-radius: 3px; color: var(--text-dim); font-size: 12px; }
.cal-stat.past { border-color: #58434a; color: #e5a9b5; }
.cal-stat.upcoming { border-color: #285748; color: #8be1ba; }
.cal-controls { display: flex; align-items: center; gap: 8px; min-height: 38px; margin-bottom: 12px; }
.cal-controls strong { min-width: 150px; text-align: center; color: var(--text-strong); font-size: 16px; }
.cal-nav { border: 1px solid var(--border-soft); background: var(--panel); justify-content: center; }
.cal-nav:hover { border-color: var(--border); }
.cal-arrow { width: 36px; padding: 0; font-size: 23px; }
.cal-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-height: 34px; margin-bottom: 8px; color: var(--text-dim); font-size: 12px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend-item i, .cal-dot { width: 8px; height: 8px; border-radius: 50%; background: #58a6ff; flex: none; }
.cal-legend-item.timeline i, .cal-dot.timeline { background: #50c8ae; }
.cal-dot.deadline { background: #f2ae52; }
.cal-month-count { margin-left: auto; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); }
.cal-weekdays { border-bottom: 0; }
.cal-weekdays > div { padding: 7px 10px; background: var(--panel); color: var(--text-dim); font-size: 12px; font-weight: 600; }
.cal-month-grid { border: 1px solid var(--border-soft); border-top: 0; background: var(--border-soft); }
.cal-week { border-top: 1px solid var(--border-soft); background: var(--bg); }
.cal-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); }
.cal-day { min-width: 0; min-height: 62px; padding: 6px; background: var(--bg); overflow: hidden; }
.cal-day.outside { background: #171819; }
.cal-day.outside .cal-day-number { color: #686a72; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day.selected { background: #19232c; box-shadow: inset 0 0 0 1px #4a88c2; }
.cal-day-number { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 4px; border: 0; border-radius: 4px; color: var(--text); font-size: 12px; }
.cal-day-number:hover { background: var(--surface-hover); color: var(--text-strong); }
.cal-day.today .cal-day-number { background: var(--primary); color: #fff; border-radius: 50%; }
.cal-day-events { display: grid; gap: 3px; }
.cal-event { appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; height: 22px; padding: 0 5px; border: 1px solid #294360; border-radius: 4px; background: #14263a; color: #b8d9ff; text-align: left; font-size: 10px; }
.cal-event.deadline { border-color: #66502e; background: #302518; color: #f3c783; }
.cal-event:hover { filter: brightness(1.25); }
.cal-event i { width: 6px; height: 6px; border-radius: 50%; background: #58a6ff; flex: none; }
.cal-event.deadline i { background: #f2ae52; }
.cal-event span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-week-timelines { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 1px; row-gap: 3px; padding: 3px 0 5px; background: var(--bg); }
.cal-timeline { appearance: none; -webkit-appearance: none; align-self: stretch; min-width: 0; margin: 0 3px; padding: 0 7px; overflow: hidden; border: 1px solid #28584f; border-left: 3px solid #50c8ae; border-radius: 4px; background: #15302d; color: #b5eadf; text-align: left; font-size: 10px; line-height: 20px; white-space: nowrap; cursor: pointer; }
.cal-timeline.continues-before { margin-left: 0; border-left-color: transparent; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-timeline.continues-after { margin-right: 0; border-right-color: transparent; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-timeline:hover { filter: brightness(1.25); }
.cal-timeline span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda { margin: 18px 0 0; padding: 16px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel); }
.cal-agenda h3 { margin: 0 0 10px; color: var(--text-strong); font-size: 15px; font-weight: 600; }
.cal-agenda-list { display: grid; gap: 6px; }
.cal-agenda-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 9px; border-radius: 5px; text-align: left; }
.cal-agenda-item:hover { background: var(--surface-hover); }
.cal-agenda-item.survey .cal-dot { background: #58a6ff; }
.cal-agenda-item.deadline .cal-dot { background: #f2ae52; }
.cal-agenda-item.timeline .cal-dot { background: #50c8ae; }
.cal-agenda-kind { width: 125px; color: var(--text-dim); font-size: 12px; flex: none; }
.cal-agenda-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.cal-agenda-dates { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.cal-open { margin-left: auto; color: var(--link); font-size: 12px; white-space: nowrap; }
.cal-empty { margin: 5px 0; color: var(--text-dim); }
@media (max-width: 900px) {
  .project-calendar { margin-left: 16px; margin-right: 16px; }
  .cal-day { min-height: 56px; padding: 4px; }
  .cal-event { font-size: 10px; padding: 0 3px; }
}
@media (max-width: 600px) {
  .project-calendar { margin: 6px 8px 18px; }
  .cal-heading { display: block; }
  .cal-stats { margin-top: 10px; }
  .cal-weekdays > div { padding: 6px 2px; text-align: center; font-size: 10px; }
  .cal-day { min-height: 48px; padding: 3px 2px; }
  .cal-day-number { width: 22px; height: 22px; margin: 0 auto 3px; }
  .cal-event { width: 22px; height: 16px; justify-content: center; margin: 0 auto; padding: 0; }
  .cal-event i { width: 7px; height: 7px; }
  .cal-event span { display: none; }
  .cal-timeline { margin: 0 1px; padding: 0 3px; font-size: 9px; }
  .cal-month-count { margin-left: 0; }
  .cal-agenda { padding: 11px; }
  .cal-agenda-item { gap: 7px; }
  .cal-agenda-kind { width: 90px; font-size: 11px; }
  .cal-agenda-dates { display: none; }
  .cal-open { font-size: 0; }
  .cal-open::after { content: '›'; font-size: 17px; }
}

/* Automation process trees */
.process-view{overflow:auto;flex:1;padding:28px 36px 60px;background:var(--bg)}
.process-intro h2{font-size:28px;letter-spacing:-.5px;margin:6px 0 8px}.process-intro p,.process-note{color:var(--text-dim);line-height:1.6;max-width:920px}
.process-eyebrow{color:var(--link);font-size:11px;font-weight:700;letter-spacing:2px}
.process-options{display:flex;gap:10px;margin:22px 0}.process-content{max-width:1100px}.process-rule-head{display:flex;align-items:center;gap:20px;justify-content:space-between}
.process-card{border:1px solid var(--border-soft);border-radius:12px;background:var(--panel);margin:12px 0;overflow:hidden}.process-card summary{cursor:pointer;padding:20px;display:list-item;list-style-position:inside}.process-card summary strong{margin-left:6px}.process-card summary>span{color:var(--text-dim);font-size:12px;margin-left:16px}.process-card[open] summary{border-bottom:1px solid var(--border-soft)}
.process-tree{list-style:none;padding:0 0 0 26px;margin:0 0 0 13px;border-left:1px solid var(--border)}.process-root{border:0;margin:0;padding:22px}.process-branch{position:relative;padding:10px 0}.process-tree:not(.process-root)>.process-branch:before{content:'';position:absolute;left:-26px;top:35px;width:26px;border-top:1px solid var(--border)}
.process-node{border:1px solid var(--border-soft);border-left:3px solid var(--primary);border-radius:8px;padding:14px 18px;background:var(--surface-alt);max-width:820px}.process-node strong{display:block;font-size:15px}.process-node p{font-size:13px;line-height:1.55;margin:7px 0 0;color:var(--text-dim)}.process-kind{display:block;text-transform:uppercase;font-size:10px;letter-spacing:1.4px;color:var(--link);margin-bottom:6px}.process-decision{border-left-color:#b69afb}.process-review,.process-hold{border-left-color:#d9ac64}.process-start{border-left-color:#55c7b0}.process-disabled{opacity:.72}.process-queue{border:1px solid #245676;border-radius:12px;padding:20px;background:#112430}.process-queue p{margin-bottom:0;line-height:1.6;color:var(--text-dim)}
@media(max-width:700px){.process-view{padding:20px 12px}.process-root{padding:12px}.process-tree:not(.process-root){padding-left:15px;margin-left:5px}.process-tree:not(.process-root)>.process-branch:before{left:-15px;width:15px}.process-card summary>span{display:block;margin:8px 0 0 22px}.process-rule-head{display:block}}
