/* ============================================================
   Lucent — monochrome glass with semantic color.
   Follows the OS appearance (light / dark).
   ============================================================ */
:root {
  color-scheme: light dark;
  --bg: #000;
  --fg: 255, 255, 255;
  --t1: #f5f5f7;
  --on-t1: #000;
  --t2: rgba(var(--fg), 0.64);
  --t3: rgba(var(--fg), 0.42);
  --t4: rgba(var(--fg), 0.24);
  --line: rgba(var(--fg), 0.08);
  --line-2: rgba(var(--fg), 0.13);
  --line-3: rgba(var(--fg), 0.22);
  --fill: rgba(var(--fg), 0.04);
  --fill-2: rgba(var(--fg), 0.07);
  --fill-3: rgba(var(--fg), 0.11);
  --surface: rgba(28, 28, 30, 0.8);
  --surface-solid: #1c1c1e;
  --glass-a: rgba(255, 255, 255, 0.055);
  --glass-b: rgba(255, 255, 255, 0.025);
  --rim: rgba(255, 255, 255, 0.2);
  --hi: rgba(255, 255, 255, 0.13);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.5), 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  --ambient: rgba(255, 255, 255, 0.07);
  --series-2: #48484a;
  --avatar-a: #3a3a3c; --avatar-b: #1c1c1e; --avatar-t: rgba(255,255,255,0.75);
  /* semantic (Apple system colors) */
  --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --purple: #bf5af2; --teal: #40c8e0; --pink: #ff375f; --indigo: #5e5ce6;
  --tint: 0.16;
  --accent: var(--blue);
  --r-lg: 18px; --r-xl: 22px;
  --blur: blur(30px) saturate(150%);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eceef1;
    --fg: 0, 0, 0;
    --t1: #1d1d1f;
    --on-t1: #fff;
    --t2: rgba(0, 0, 0, 0.62);
    --t3: rgba(0, 0, 0, 0.45);
    --t4: rgba(0, 0, 0, 0.26);
    --line: rgba(0, 0, 0, 0.07);
    --fill: rgba(0, 0, 0, 0.035);
    --fill-2: rgba(0, 0, 0, 0.055);
    --fill-3: rgba(0, 0, 0, 0.085);
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #fff;
    --glass-a: rgba(255, 255, 255, 0.78);
    --glass-b: rgba(255, 255, 255, 0.58);
    --rim: rgba(255, 255, 255, 0.95);
    --hi: rgba(255, 255, 255, 0.9);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 32px -14px rgba(0, 0, 0, 0.14);
    --ambient: rgba(255, 255, 255, 0.95);
    --series-2: #c7c7cc;
    --avatar-a: #e5e5ea; --avatar-b: #d1d1d6; --avatar-t: #3a3a3c;
    --blue: #0071e3; --green: #248a3d; --orange: #c75c00; --red: #d70015; --purple: #8944ab; --teal: #0e7c91; --pink: #d30f45; --indigo: #3634a3;
    --tint: 0.11;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--t1); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--t1); color: var(--on-t1); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(var(--fg), 0.1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* semantic color helpers: set --c, get tinted pills/dots */
.c-blue { --c: var(--blue); } .c-green { --c: var(--green); } .c-orange { --c: var(--orange); } .c-red { --c: var(--red); }
.c-purple { --c: var(--purple); } .c-teal { --c: var(--teal); } .c-pink { --c: var(--pink); } .c-indigo { --c: var(--indigo); } .c-grey { --c: var(--t3); }
.pos { color: var(--green); } .neg { color: var(--red); } .late { color: var(--red) !important; }

/* ---------- Ambient ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient .blob { position: absolute; border-radius: 50%; filter: blur(110px); }
.ambient .b1 { width: 900px; height: 900px; left: -240px; top: -420px; background: radial-gradient(circle, var(--ambient), transparent 65%); animation: drift1 40s ease-in-out infinite alternate; }
.ambient .b2 { width: 800px; height: 800px; right: -260px; bottom: -380px; background: radial-gradient(circle, var(--ambient), transparent 65%); opacity: 0.7; animation: drift2 48s ease-in-out infinite alternate; }
.ambient .grain { position: absolute; inset: -50%; opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift1 { to { transform: translate(160px, 120px); } }
@keyframes drift2 { to { transform: translate(-160px, -100px); } }

/* ---------- Glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass-a), var(--glass-b));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0.5px 0 var(--hi), var(--shadow);
  isolation: isolate;
}
.glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 0.5px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, var(--rim), var(--line) 40%, var(--line));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass.sheen::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, -20%), rgba(var(--fg), 0.035), transparent 45%); opacity: 0; transition: opacity 0.5s var(--ease); }
.glass.sheen:hover::after { opacity: 1; }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.sidebar { margin: 12px 0 12px 12px; padding: 22px 12px 12px; display: flex; flex-direction: column; gap: 2px; border-radius: var(--r-xl); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 28px; }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; background: var(--t1); position: relative; flex: none; overflow: hidden; }
.brand-mark::after { content: ''; position: absolute; inset: 0 0 0 50%; background: var(--bg); opacity: 0.85; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11.5px; color: var(--t3); }
.nav-label { font-size: 11px; font-weight: 500; color: var(--t4); padding: 0 10px 8px; }
.nav-item { display: flex; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--t2); font-weight: 500; font-size: 13.5px; transition: color .2s, background .2s; }
.nav-item:hover { color: var(--t1); background: var(--fill); }
.nav-item.active { color: var(--t1); background: var(--fill-3); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--t3); font-feature-settings: 'tnum'; }
.sidebar-foot { margin-top: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.user-chip .meta { line-height: 1.25; min-width: 0; }
.user-chip .meta div:first-child { font-weight: 500; font-size: 13px; }
.user-chip .meta div:last-child { font-size: 11.5px; color: var(--t3); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 32px 0 28px; }
.search { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px; border-radius: 11px; color: var(--t3); cursor: text; }
.search span { flex: 1; font-size: 13px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--t3); transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--t1); background: var(--fill); }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 32px 56px 28px; }
.view { animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Type ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 20px 0 28px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--t3); margin-bottom: 6px; }
h1 { font-family: var(--display); font-size: 44px; line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; margin: 0; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h4 { font-size: 12px; font-weight: 600; margin: 0 0 10px; color: var(--t2); }
.sub { color: var(--t3); margin-top: 10px; font-size: 14px; }
.muted { color: var(--t3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-feature-settings: 'tnum'; }
.link { color: var(--blue); }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 12px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.card { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; position: relative; z-index: 2; }
.card-head .muted { font-size: 12.5px; }
.card > *, .panel > * { position: relative; z-index: 2; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.section-gap { height: 12px; }

/* stat strip — one surface, hairline dividers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 0; overflow: hidden; }
.stat { padding: 16px 20px; position: relative; z-index: 2; }
.stat + .stat { box-shadow: inset 0.5px 0 0 var(--line-2); }
.stat-l { font-size: 12px; color: var(--t3); font-weight: 500; }
.stat-v { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; font-feature-settings: 'tnum'; white-space: nowrap; }
.stat-s { font-size: 12px; color: var(--t3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* panel = table container */
.panel { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 0.5px solid var(--line); position: relative; z-index: 2; flex-wrap: wrap; }
.toolbar h2 { margin-right: 8px; }
.toolbar .sel { height: 30px; width: auto; min-width: 140px; font-size: 13px; }

/* KPI */
.kpi { padding: 20px 22px; overflow: hidden; }
.kpi > * { position: relative; z-index: 2; }
.kpi-label { font-size: 12.5px; color: var(--t3); font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -0.045em; margin-top: 18px; font-feature-settings: 'tnum'; line-height: 1; }
.kpi-value small { font-size: 15px; color: var(--t3); font-weight: 500; letter-spacing: -0.01em; margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--t3); }
.delta { font-weight: 600; font-size: 12px; color: var(--green); font-feature-settings: 'tnum'; }
.delta.down { color: var(--red); }
.kpi.feature { background: linear-gradient(180deg, var(--glass-a), var(--glass-a)); }
.spark { position: absolute; right: 0; bottom: 0; width: 50%; height: 56px; pointer-events: none; z-index: 1 !important; opacity: 0.7; color: var(--t1); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 500; font-size: 13px; white-space: nowrap;
  background: var(--fill-2); color: var(--t1); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: background .2s, transform .15s; }
.btn:hover { background: var(--fill-3); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--t1); color: var(--on-t1); box-shadow: none; }
.btn.primary:hover { opacity: 0.9; }
.btn.primary kbd { background: rgba(var(--fg), 0.0); color: var(--on-t1); opacity: 0.55; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--t3); }
.btn.ghost:hover { background: var(--fill); color: var(--t1); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--red); }
kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--fill-2); color: var(--t3); box-shadow: inset 0 0 0 0.5px var(--line-2); }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line); gap: 2px; }
.seg a, .seg button { padding: 5px 13px; border-radius: 8px; color: var(--t3); font-weight: 500; font-size: 13px; transition: color .2s, background .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg.sm a, .seg.sm button { padding: 3px 10px; font-size: 12.5px; }
.seg a:hover, .seg button:hover { color: var(--t1); }
.seg .on { color: var(--t1); background: var(--surface-solid); box-shadow: 0 0.5px 0 var(--hi) inset, 0 1px 3px rgba(0,0,0,0.25); }
.seg-n { font-size: 11px; font-weight: 600; color: var(--orange); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--fill-2); color: var(--t2); }
.pill.dim { background: transparent; color: var(--t3); box-shadow: inset 0 0 0 0.5px var(--line-2); font-weight: 500; }
.pill.white { background: var(--t1); color: var(--on-t1); }
.pill.blue, .pill.good, .pill.warn, .pill.bad, .pill.purple, .pill.tint { background: color-mix(in srgb, var(--c) calc(var(--tint) * 100%), transparent); color: var(--c); }
.pill.blue { --c: var(--blue); } .pill.good { --c: var(--green); } .pill.warn { --c: var(--orange); } .pill.bad { --c: var(--red); } .pill.purple { --c: var(--purple); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--t3)); flex: none; display: inline-block; }
.sq { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--t3)); flex: none; display: inline-block; }

/* ---------- Avatars ---------- */
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--avatar-t);
  background: linear-gradient(180deg, var(--avatar-a), var(--avatar-b)); box-shadow: inset 0 0.5px 0 var(--hi); }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.ai { background: var(--t1); color: var(--on-t1); }
.avatars { display: flex; }
.avatars .avatar { margin-left: -5px; box-shadow: 0 0 0 2px var(--bg); }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Progress ---------- */
.bar { height: 4px; border-radius: 3px; background: var(--fill-3); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--c, var(--t1)); transition: width 1s var(--ease); }
.bar.grey > i { background: var(--t3); }
.bar.over > i { background: var(--red); }
.bar.good > i { background: var(--green); }
.bar.warn > i { background: var(--orange); }

/* ---------- Lists & tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 0.5px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .title { font-weight: 500; font-size: 13.5px; }
.list-item .meta { color: var(--t3); font-size: 12px; }
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; }
.table-wrap.flush { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--t3); font-size: 12px; padding: 10px 14px; border-bottom: 0.5px solid var(--line-2); white-space: nowrap; user-select: none; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td { padding: 13px 14px; border-bottom: 0.5px solid var(--line); white-space: nowrap; font-feature-settings: 'tnum'; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--fill); }
td.right, th.right { text-align: right; }
table.dense th:first-child, table.dense td:first-child { padding-left: 16px; }
table.dense th:last-child, table.dense td:last-child { padding-right: 16px; }
table.dense td { padding: 8px 12px; }
table.dense th { padding: 8px 12px; background: var(--fill); }
table.mini td { padding: 8px 0; }
table.mini td:first-child { padding-left: 0; } table.mini td:last-child { padding-right: 0; }
tr.click { cursor: pointer; }
tr.selected { background: var(--fill-2) !important; }
th.sortable { cursor: pointer; }
th.sortable:hover, th.sorted { color: var(--t1); }
.caret-s { margin-left: 4px; font-size: 10px; }
tfoot td { border-top: 0.5px solid var(--line-2); border-bottom: 0; background: var(--fill); }
.amount-pos { color: var(--green); font-weight: 600; }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 0; outline: 0; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: box-shadow .2s, background .2s; }
textarea.input { height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.input, select.cell { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888' stroke-width='1.5'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
select option { background: var(--surface-solid); color: var(--t1); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--t3); font-weight: 500; }
.filter-input { height: 30px; width: 240px; font-size: 13px; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
@media (prefers-color-scheme: dark) { input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } }

/* inline cells (spreadsheet editing) */
.cell { height: 26px; border: 0; outline: 0; border-radius: 6px; background-color: transparent; padding: 0 22px 0 8px; font-size: 12.5px; cursor: pointer; color: var(--t1); background-position: right 6px center; transition: background-color .15s; max-width: 100%; }
.cell:hover, .cell:focus { background-color: var(--fill-2); }
input.cell { padding: 0 6px; cursor: text; font-feature-settings: 'tnum'; }
input.cell.date { width: 118px; color: var(--t2); }
.cell.status { font-weight: 600; color: var(--c); background-color: color-mix(in srgb, var(--c) calc(var(--tint) * 100%), transparent); }
.cell.status:hover { background-color: color-mix(in srgb, var(--c) calc(var(--tint) * 160%), transparent); }
.cell.title { width: 100%; font-size: 13px; font-weight: 500; padding: 0 6px; cursor: text; }

/* ---------- Charts ---------- */
.chart { color: var(--t1); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--t3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.col:hover .bar-in, .col:hover .bar-out { opacity: 0.75; }
.tooltip { position: fixed; z-index: 1000; pointer-events: none; padding: 10px 12px; border-radius: 10px; font-size: 12px; min-width: 150px;
  background: var(--surface); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); box-shadow: inset 0 0 0 0.5px var(--line-2), 0 12px 30px rgba(0,0,0,0.25); opacity: 0; transition: opacity .12s; }
.tooltip.show { opacity: 1; }
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 18px; color: var(--t2); }
.tooltip .tt-row b { color: var(--t1); font-weight: 600; font-feature-settings: 'tnum'; }
.tooltip .tt-row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.ring { position: relative; flex: none; color: var(--t1); }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-label b { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.04em; }
.ring .ring-label span { font-size: 11px; color: var(--t3); }

/* ---------- Suggestions ---------- */
.insight { padding: 14px 4px; display: flex; gap: 12px; align-items: center; cursor: pointer; border-top: 0.5px solid var(--line); }
.stack > .insight:first-child { border-top: 0; padding-top: 0; }
.insight .t { font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.insight .d { color: var(--t3); font-size: 12.5px; margin-top: 3px; }
.insight .go { margin-left: auto; color: var(--t3); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: color .2s; }
.insight:hover .go { color: var(--blue); }
.card > .insight, .insight.boxed { border: 0; padding: 14px 16px; border-radius: 12px; background: var(--fill); }

/* ---------- Activity ---------- */
.feed-item { display: flex; gap: 12px; padding: 10px 0; }
.feed-item .txt { font-size: 13px; color: var(--t2); }
.feed-item .txt b { color: var(--t1); font-weight: 500; }
.feed-item .when { font-size: 11.5px; color: var(--t4); margin-top: 2px; }

/* ============================================================
   Work management (Wrike-style)
   ============================================================ */
.pm { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; align-items: start; }
.tree { padding: 14px 8px; position: sticky; top: 0; }
.tree-label { font-size: 11px; font-weight: 500; color: var(--t4); padding: 10px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
.tree-label button { color: var(--t3); font-size: 16px; line-height: 1; padding: 0 4px; }
.tree-label button:hover { color: var(--t1); }
.tree-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--t2); position: relative; z-index: 2; }
.tree-item:hover { background: var(--fill); color: var(--t1); }
.tree-item.on { background: var(--fill-3); color: var(--t1); font-weight: 500; }
.tree-item .n { margin-left: auto; font-size: 11.5px; color: var(--t3); font-feature-settings: 'tnum'; }
.tree-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-head { padding: 18px 20px 0; position: relative; z-index: 2; }
.ws-title { display: flex; align-items: center; gap: 12px; }
.ws-title h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.03em; }
.ws-meta { display: flex; align-items: center; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--t3); flex-wrap: wrap; }
.ws-meta b { color: var(--t1); font-weight: 500; }
.ws-tabs { display: flex; gap: 20px; margin-top: 16px; border-bottom: 0.5px solid var(--line); padding: 0 20px; position: relative; z-index: 2; }
.ws-tabs button { padding: 10px 0; font-size: 13px; font-weight: 500; color: var(--t3); box-shadow: inset 0 -2px 0 transparent; transition: color .2s, box-shadow .2s; }
.ws-tabs button:hover { color: var(--t1); }
.ws-tabs button.on { color: var(--t1); box-shadow: inset 0 -2px 0 var(--t1); }

.grp-head td { background: var(--fill); font-weight: 600; font-size: 12.5px; cursor: pointer; padding-top: 9px; padding-bottom: 9px; }
.grp-head td .row { gap: 8px; }
.grp-head .chev { display: inline-block; width: 10px; color: var(--t3); transition: transform .2s; font-size: 9px; }
.grp-head.collapsed .chev { transform: rotate(-90deg); }
.check { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-3); display: inline-grid; place-items: center; flex: none; transition: all .15s; }
.check:hover { box-shadow: inset 0 0 0 1.5px var(--green); }
.check.done { background: var(--green); box-shadow: none; }
.check.done::after { content: ''; width: 7px; height: 4px; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
tr.is-done .cell.title { color: var(--t3); text-decoration: line-through; }
.add-row td { padding-top: 4px; padding-bottom: 4px; }
.add-row input { width: 100%; height: 30px; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--t1); padding: 0 6px; border-radius: 6px; }
.add-row input::placeholder { color: var(--t4); }
.add-row input:focus { background: var(--fill-2); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); }
.prio i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; padding: 16px; overflow-x: auto; position: relative; z-index: 2; }
.col-k { border-radius: 14px; padding: 8px; min-height: 420px; background: var(--fill); transition: background .2s, box-shadow .2s; }
.col-k.drag-over { background: var(--fill-3); box-shadow: inset 0 0 0 1px var(--line-3); }
.col-k-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 12px; font-weight: 600; font-size: 13px; }
.col-k-head .n { color: var(--t3); font-weight: 500; }
.tcard { padding: 12px; border-radius: 10px; margin-bottom: 8px; cursor: grab; background: var(--surface-solid); box-shadow: 0 0 0 0.5px var(--line-2), 0 1px 2px rgba(0,0,0,0.08); border-left: 3px solid var(--c, var(--line-2)); transition: transform .2s var(--ease), opacity .2s, box-shadow .2s; }
.tcard:hover { box-shadow: 0 0 0 0.5px var(--line-3), 0 6px 16px -6px rgba(0,0,0,0.25); }
.tcard.dragging { opacity: 0.35; }
.tcard .tt { font-weight: 500; font-size: 13px; line-height: 1.4; }
.tcard .tp { font-size: 11.5px; color: var(--t3); margin-top: 4px; }
.tcard .tm { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--t3); }
.add-card { width: 100%; padding: 8px; border-radius: 8px; color: var(--t3); font-size: 12.5px; text-align: left; transition: color .2s, background .2s; }
.add-card:hover { color: var(--t1); background: var(--fill-2); }

/* gantt */
.gantt { display: grid; grid-template-columns: 300px minmax(0, 1fr); position: relative; z-index: 2; }
.g-left { border-right: 0.5px solid var(--line-2); }
.g-right { overflow-x: auto; }
.g-canvas { position: relative; min-width: 980px; }
.g-row { height: 36px; display: flex; align-items: center; border-bottom: 0.5px solid var(--line); position: relative; }
.g-left .g-row { padding: 0 14px 0 16px; gap: 10px; font-size: 13px; cursor: pointer; }
.g-left .g-row:hover { background: var(--fill); }
.g-left .g-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.g-row.g-proj { font-weight: 600; background: var(--fill); }
.g-head { height: 48px; border-bottom: 0.5px solid var(--line-2); position: relative; background: var(--fill); }
.g-left .g-head { display: flex; align-items: flex-end; padding: 0 16px 8px; font-size: 12px; color: var(--t3); font-weight: 500; }
.g-month { position: absolute; top: 6px; font-size: 12px; font-weight: 600; color: var(--t2); white-space: nowrap; }
.g-week { position: absolute; bottom: 8px; font-size: 11px; color: var(--t3); white-space: nowrap; }
.g-col { position: absolute; top: 0; bottom: 0; width: 0.5px; background: var(--line); }
.g-weekend { position: absolute; top: 48px; bottom: 0; background: var(--fill); }
.g-today { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--red); z-index: 3; }
.g-today::before { content: 'Today'; position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 600; color: var(--red); }
.g-bar { position: absolute; height: 20px; top: 8px; border-radius: 5px; background: var(--c); cursor: pointer; display: flex; align-items: center; padding: 0 8px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; transition: filter .15s; z-index: 2; }
.g-bar:hover { filter: brightness(1.1); }
.g-bar.summary { height: 8px; top: 14px; border-radius: 2px; background: var(--t3); padding: 0; }
.g-bar.done { opacity: 0.45; }
.g-bar.overdue { box-shadow: 0 0 0 1.5px var(--red); }
.g-label { position: absolute; top: 10px; font-size: 11.5px; color: var(--t3); white-space: nowrap; z-index: 2; pointer-events: none; }

/* ---------- People ---------- */
.cal { display: grid; grid-template-columns: 150px repeat(21, minmax(22px, 1fr)); gap: 3px; font-size: 11px; align-items: center; }
.cal .h { color: var(--t4); text-align: center; font-size: 10px; padding-bottom: 6px; font-feature-settings: 'tnum'; }
.cal .h.today { color: var(--red); font-weight: 600; }
.cal .who { font-size: 12.5px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .c { height: 20px; border-radius: 4px; background: var(--fill); }
.cal .c.wk { background: transparent; }
.cal .c.on { background: var(--blue); }
.cal .c.pend { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--orange) 70%, transparent) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 0.5px var(--orange); }

/* ---------- Slide-over record (people + tasks) ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.12); animation: fade .2s both; }
.sheet { position: fixed; z-index: 61; top: 12px; right: 12px; bottom: 12px; width: 460px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); animation: slideIn .35s var(--ease) both; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.sheet > * { position: relative; z-index: 2; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 14px; }
.sheet-title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.sheet-actions { display: flex; gap: 6px; padding: 0 20px 16px; border-bottom: 0.5px solid var(--line); flex-wrap: wrap; }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 20px 24px; }
.sheet-body section { padding: 16px 0; border-bottom: 0.5px solid var(--line); }
.sheet-body section:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--t3); }
.kv dd { margin: 0; }
.kv .cell, .kv input.cell.date { margin-left: -8px; }
.title-input { width: 100%; border: 0; outline: 0; background: transparent; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.025em; color: var(--t1); padding: 2px 6px; margin-left: -6px; border-radius: 6px; }
.title-input:focus, .title-input:hover { background: var(--fill-2); }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.status-row button { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--t3); background: var(--fill); display: inline-flex; align-items: center; gap: 6px; }
.status-row button.on { color: var(--c); background: color-mix(in srgb, var(--c) calc(var(--tint) * 100%), transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }

/* ---------- Agent drawer ---------- */
.agent { position: fixed; z-index: 50; top: 12px; right: 12px; bottom: 12px; width: 420px; display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden;
  transform: translateX(calc(100% + 24px)); transition: transform .5s var(--ease); background: var(--surface); backdrop-filter: blur(50px) saturate(160%); -webkit-backdrop-filter: blur(50px) saturate(160%); }
.agent.open { transform: none; }
.agent > * { position: relative; z-index: 2; }
.agent-head { display: flex; align-items: center; gap: 8px; padding: 18px 14px 14px 20px; border-bottom: 0.5px solid var(--line); }
.agent-head .t { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.agent-head .s { font-size: 11.5px; color: var(--t3); }
.agent-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; animation: msgIn .4s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--blue); color: #fff; border-radius: 18px 18px 4px 18px; max-width: 82%; }
.bubble { padding: 9px 14px; font-size: 13.5px; line-height: 1.55; }
.msg.ai .bubble { padding: 0; color: var(--t2); flex: 1; min-width: 0; }
.msg.ai .bubble b, .msg.ai .bubble strong { color: var(--t1); font-weight: 600; }
.msg.ai .bubble em { color: var(--t1); font-style: normal; }
.msg.ai .bubble p { margin: 0 0 8px; }
.msg.ai .bubble ul, .msg.ai .bubble ol { margin: 4px 0 10px; padding-left: 18px; }
.msg.ai .bubble li { margin: 3px 0; }
.msg.ai .bubble li::marker { color: var(--t4); }
.caret { display: inline-block; width: 6px; height: 14px; background: var(--t1); vertical-align: -2px; margin-left: 2px; border-radius: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.steps { display: flex; flex-direction: column; margin: 0 0 14px; border-left: 0.5px solid var(--line-2); }
.step { display: flex; align-items: center; gap: 8px; padding: 5px 0 5px 12px; font-size: 11.5px; font-family: var(--mono); animation: msgIn .3s var(--ease) both; overflow: hidden; }
.step .tool { color: var(--t1); white-space: nowrap; }
.step .args { color: var(--t4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.step .res { color: var(--t3); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.step .st { width: 14px; height: 14px; flex: none; display: grid; place-items: center; color: var(--green); }
.step .spin { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-2); border-top-color: var(--t1); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking-line { font-size: 12px; color: var(--t3); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.thinking-line span:empty { display: none; }
.thinking-line svg { color: var(--green); }
.shimmer { background: linear-gradient(90deg, var(--t4) 0%, var(--t1) 50%, var(--t4) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 10px; font-size: 12.5px; color: var(--t2); background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: all .2s; text-align: left; }
.chip:hover { color: var(--t1); background: var(--fill-3); }
.agent-foot { padding: 12px 14px 14px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 14px; border-radius: 14px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: box-shadow .2s; }
.composer:focus-within { box-shadow: inset 0 0 0 0.5px var(--line-3), 0 0 0 3px var(--fill-2); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 7px 0; max-height: 120px; line-height: 1.45; font-size: 13.5px; }
.composer textarea::placeholder { color: var(--t4); }
.send { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue); color: #fff; transition: opacity .2s; }
.send:disabled { opacity: 0.25; background: var(--t3); }
.agent-hint { font-size: 11px; color: var(--t4); margin-top: 8px; display: flex; justify-content: space-between; padding: 0 2px; }

/* ---------- Command palette / modal / toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: start center; padding-top: 14vh; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.cmdk { width: min(600px, 92vw); border-radius: 18px; overflow: hidden; animation: pop .25s var(--ease) both; background: var(--surface); backdrop-filter: blur(50px) saturate(160%); -webkit-backdrop-filter: blur(50px) saturate(160%); }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 0.5px solid var(--line); color: var(--t3); }
.cmdk-input input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 16px; color: var(--t1); }
.cmdk-input input::placeholder { color: var(--t4); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11px; color: var(--t4); padding: 10px 12px 4px; font-weight: 500; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--t2); cursor: pointer; font-size: 13.5px; }
.cmdk-item .k { margin-left: auto; font-size: 11.5px; color: var(--t4); }
.cmdk-item.sel { background: var(--fill-3); color: var(--t1); }
.modal { width: min(500px, 92vw); border-radius: 20px; padding: 26px; animation: pop .25s var(--ease) both; background: var(--surface); backdrop-filter: blur(50px) saturate(160%); -webkit-backdrop-filter: blur(50px) saturate(160%); }
.modal h3 { margin: 0 0 4px; font-family: var(--display); font-size: 20px; letter-spacing: -0.03em; font-weight: 600; }
.modal .form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 24px; }
.modal .form .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; animation: toastIn .35s var(--ease) both; background: var(--t1); color: var(--on-t1); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.toast.out { animation: toastOut .25s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.flash { animation: flash 2.4s var(--ease) both; }
@keyframes flash { 0%, 35% { box-shadow: inset 0 0 0 1.5px var(--blue); background-color: color-mix(in srgb, var(--blue) 10%, transparent); } }
tr.flash td { animation: flashRow 2.4s var(--ease) both; }
@keyframes flashRow { 0%, 35% { background: color-mix(in srgb, var(--blue) 12%, transparent); } }
.empty { text-align: center; padding: 36px 20px; color: var(--t3); }

@media (max-width: 1280px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .g-main, .g-3 { grid-template-columns: 1fr; } .pm { grid-template-columns: 1fr; } .tree { position: static; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .g-4, .g-2 { grid-template-columns: 1fr; }
  .content { padding: 8px 16px 60px; }
  .topbar { padding: 12px 16px 0; }
  .agent, .sheet { width: auto; left: 8px; right: 8px; top: 8px; bottom: 8px; }
  .gantt { grid-template-columns: 180px minmax(0, 1fr); }
  h1 { font-size: 34px; }
}

/* ---------- Workspace identity (customer) + platform mark ---------- */
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; margin: -8px 0 22px; border-radius: 12px; transition: background .2s; }
.ws-switch:hover { background: var(--fill); }
.ws-logo { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 0.5px var(--line-2), 0 1px 2px rgba(0,0,0,0.12); }
.ws-logo svg { width: 22px; height: auto; }
.ws-name { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; line-height: 1.2; }
.ws-sub { font-size: 11.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chev { margin-left: auto; color: var(--t3); flex: none; }
.powered { display: flex; align-items: center; gap: 6px; padding: 10px 10px 2px; margin-top: 6px; border-top: 0.5px solid var(--line); color: var(--t4); font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }
.powered svg { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Enterprise type scale + avatar colors ---------- */
:root { --yellow: #ffd60a; --graphite: #8e8e93; }
@media (prefers-color-scheme: light) { :root { --yellow: #b8860b; --graphite: #6e6e73; } }
h1 { font-size: 30px; letter-spacing: -0.03em; }
.page-head { margin: 16px 0 22px; align-items: center; }
.avatar.colored { background: var(--av); color: #fff; box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.3); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15); transition: transform .15s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.swatch.none { background: linear-gradient(180deg, var(--avatar-a), var(--avatar-b)); --c: var(--line-3); }
.user-chip { cursor: pointer; transition: background .2s; }
.user-chip:hover { background: var(--fill); }

/* ---------- Simple task list ---------- */
.tl-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 0.5px solid var(--line); cursor: pointer; position: relative; z-index: 2; transition: background .12s; }
.tl-row:hover { background: var(--fill); }
.tl-row.selected { background: var(--fill-2); }
.tl-row .tl-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row.is-done .tl-title { color: var(--t3); text-decoration: line-through; }
.tl-row .tl-meta { font-size: 12px; color: var(--t3); white-space: nowrap; }
.tl-row .tl-due { font-size: 12px; color: var(--t3); width: 78px; text-align: right; font-feature-settings: 'tnum'; }
.tl-group { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; position: relative; z-index: 2; user-select: none; }
.tl-group .n { color: var(--t3); font-weight: 500; }
.tl-group .chev { font-size: 9px; color: var(--t3); transition: transform .2s; display: inline-block; width: 10px; }
.tl-group.collapsed .chev { transform: rotate(-90deg); }
.tl-add { padding: 4px 16px 10px 44px; position: relative; z-index: 2; }
.tl-add input { width: 100%; height: 32px; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--t1); padding: 0 8px; border-radius: 8px; }
.tl-add input::placeholder { color: var(--t4); }
.tl-add input:focus { background: var(--fill-2); }
.proj-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t3); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* staffing matrix */
.alloc { width: 54px; height: 28px; border: 0; outline: 0; border-radius: 7px; background: transparent; text-align: right; padding: 0 8px; font-size: 12.5px; color: var(--t1); font-feature-settings: 'tnum'; }
.alloc:hover, .alloc:focus { background: var(--fill-2); }
.alloc:placeholder-shown { color: var(--t4); }
.alloc::-webkit-inner-spin-button { display: none; }
.load { font-weight: 600; font-feature-settings: 'tnum'; }

/* attachments / links / comments */
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--fill); margin-bottom: 6px; font-size: 13px; }
.att .ext { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--fill-3); color: var(--t2); flex: none; overflow: hidden; }
.att .ext img { width: 100%; height: 100%; object-fit: cover; }
.att a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att a:hover { color: var(--blue); }
.att .x { color: var(--t4); font-size: 16px; line-height: 1; padding: 2px 4px; }
.att .x:hover { color: var(--red); }
.inline-form { display: flex; gap: 6px; margin-top: 6px; }
.inline-form .input { height: 32px; font-size: 13px; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .who { font-size: 12.5px; font-weight: 600; }
.comment .who span { font-weight: 400; color: var(--t4); margin-left: 6px; }
.comment .txt { font-size: 13px; color: var(--t2); margin-top: 2px; line-height: 1.5; white-space: pre-wrap; }
.composer-c { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.composer-c textarea { height: 64px; }

/* ==========================================================================
   Glass v3 — cooler, softer, more minimal. Overrides the base layers above.
   ========================================================================== */
:root {
  --glass-a: rgba(255, 255, 255, 0.085);
  --glass-b: rgba(255, 255, 255, 0.025);
  --rim: rgba(255, 255, 255, 0.28);
  --hi: rgba(255, 255, 255, 0.16);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 30px 60px -28px rgba(0, 0, 0, 0.9);
  --ambient: rgba(255, 255, 255, 0.11);
  --ambient-2: rgba(160, 160, 175, 0.09);
  --r-lg: 24px; --r-xl: 28px;
  --blur: blur(40px) saturate(180%);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #e8eaee;
    --glass-a: rgba(255, 255, 255, 0.72);
    --glass-b: rgba(255, 255, 255, 0.42);
    --rim: rgba(255, 255, 255, 1);
    --hi: rgba(255, 255, 255, 0.95);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 24px 48px -24px rgba(30, 35, 50, 0.22);
    --ambient: rgba(255, 255, 255, 0.95);
    --ambient-2: rgba(120, 128, 150, 0.16);
  }
}

/* light to refract */
.ambient .b1 { width: 1100px; height: 1100px; left: -300px; top: -520px; }
.ambient .b2 { width: 1000px; height: 1000px; right: -320px; bottom: -480px; background: radial-gradient(circle, var(--ambient-2), transparent 62%); opacity: 1; }
.ambient::after { content: ''; position: absolute; width: 700px; height: 700px; left: 42%; top: 28%; border-radius: 50%; filter: blur(120px); background: radial-gradient(circle, var(--ambient-2), transparent 65%); animation: drift1 55s ease-in-out infinite alternate-reverse; }

/* deeper glass with a top gloss */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 38%), linear-gradient(160deg, var(--glass-a), var(--glass-b));
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--hi), inset 0 -1px 0 rgba(255,255,255,0.02), var(--shadow);
}
.glass::before { background: linear-gradient(160deg, var(--rim), rgba(255,255,255,0.05) 35%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0.12)); }

/* type + rhythm */
h1 { font-size: 40px; letter-spacing: -0.045em; font-weight: 600; }
.page-head { margin: 22px 0 26px; }
.card { padding: 26px 28px; }
.section-gap { height: 16px; }
.grid { gap: 16px; }

/* figures as glass tiles */
.stats { background: none !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; gap: 14px; overflow: visible; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-radius: 0; }
.stats::before, .stats::after { display: none !important; }
.stat, .stat + .stat {
  position: relative; padding: 20px 22px; border-radius: 22px; isolation: isolate;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 40%), linear-gradient(160deg, var(--glass-a), var(--glass-b));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow);
}
.stat::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 0.5px; pointer-events: none;
  background: linear-gradient(160deg, var(--rim), rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.stat-l { font-size: 12px; }
.stat-v { font-size: 30px; letter-spacing: -0.045em; margin-top: 14px; line-height: 1; }
.stat-s { margin-top: 8px; }

/* softer tables: no rules, floating rows */
.panel { border-radius: var(--r-lg); }
.toolbar { border-bottom: 0; padding: 20px 24px 8px; }
.table-wrap.flush { padding: 0 10px 10px; }
table.dense { border-collapse: separate; border-spacing: 0 2px; }
table.dense th { background: transparent; border-bottom: 0; color: var(--t4); font-size: 11.5px; font-weight: 500; padding: 10px 14px 6px; }
table.dense td { border-bottom: 0; padding: 12px 14px; }
table.dense tbody tr:hover { background: none; }
table.dense tbody tr:hover td, table.dense tr.selected td { background: var(--fill); }
table.dense td:first-child { border-radius: 14px 0 0 14px; }
table.dense td:last-child { border-radius: 0 14px 14px 0; }
table.dense th:first-child, table.dense td:first-child { padding-left: 14px; }
tfoot td { background: transparent; border-top: 0; color: var(--t3); }
tr.selected { background: none !important; }

/* pill controls */
.btn { border-radius: 999px; height: 36px; padding: 0 16px; }
.btn.sm { border-radius: 999px; height: 30px; padding: 0 12px; }
.seg { border-radius: 999px; padding: 4px; background: var(--fill-2); box-shadow: inset 0 0 0 0.5px var(--line); }
.seg a, .seg button { border-radius: 999px; padding: 6px 14px; }
.seg .on { box-shadow: 0 1px 0 var(--hi) inset, 0 2px 8px rgba(0,0,0,0.25); }
.pill { border-radius: 999px; padding: 0 10px; }
.input, select.input, textarea.input { border-radius: 14px; }
.search { border-radius: 999px; }
.nav-item { border-radius: 12px; padding: 9px 12px; }
.sidebar { padding: 22px 12px 12px; }
.bar { height: 5px; border-radius: 99px; }
.bar > i { border-radius: 99px; }

/* ---------- Projects ---------- */
.chip-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip-nav { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--t2);
  background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: all .2s var(--ease); white-space: nowrap; }
.chip-nav:hover { color: var(--t1); background: var(--fill-2); }
.chip-nav.on { background: var(--t1); color: var(--on-t1); box-shadow: 0 6px 20px -8px rgba(0,0,0,0.5); }
.chip-nav.on .n { color: inherit; opacity: 0.6; }
.chip-nav .n { font-size: 12px; color: var(--t3); font-feature-settings: 'tnum'; }
.chip-nav.ghost { background: transparent; box-shadow: inset 0 0 0 0.5px var(--line-2); color: var(--t3); }
.chip-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; padding: 28px 30px; margin-bottom: 16px; }
.hero > * { position: relative; z-index: 2; }
.hero .eyebrow { display: flex; align-items: center; gap: 8px; }
.hero-title { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.035em; display: flex; align-items: center; gap: 12px; }
.hero-desc { color: var(--t3); margin-top: 8px; max-width: 620px; font-size: 14px; }
.hero-team { display: flex; align-items: center; margin-top: 20px; }
.hero-team .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); width: 32px; height: 32px; }
.hero-team span:first-child .avatar { margin-left: 0; }
.hero-stats { display: flex; gap: 34px; align-items: flex-start; }
.hero-stats > div { min-width: 96px; }
.hs-l { font-size: 12px; color: var(--t3); }
.hs-v { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.04em; margin: 8px 0 8px; font-feature-settings: 'tnum'; }
.hs-s { font-size: 12px; color: var(--t3); }
.hero-actions { position: absolute !important; top: 18px; right: 18px; display: flex; gap: 4px; }
.hero { position: relative; padding-top: 34px; }

.tasklist { padding: 8px 10px 12px; }
.tasklist > * { position: relative; z-index: 2; }
.tl-group { padding: 16px 12px 8px; color: var(--t2); }
.tl-row { border-bottom: 0; border-radius: 14px; padding: 11px 12px; margin: 1px 0; }
.tl-row:hover { background: var(--fill-2); }
.tl-row.selected { background: var(--fill-3); }
.tl-due { width: 84px; }
.tl-add { padding: 4px 12px 8px 40px; }
.tl-add input { border-radius: 12px; }
.proj-chip { gap: 6px; }

.board { padding: 0; gap: 14px; }
.col-k { padding: 12px; border-radius: 22px; min-height: 460px; }
.col-k > * { position: relative; z-index: 2; }
.col-k-head { padding: 4px 6px 14px; }
.tcard { border-left: 0; border-radius: 16px; padding: 14px; background: linear-gradient(180deg, var(--glass-a), var(--glass-b)); box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 0.5px var(--line-2), 0 8px 20px -12px rgba(0,0,0,0.5); }
.tcard:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 0.5px var(--line-3), 0 14px 28px -12px rgba(0,0,0,0.55); }
.tcard .tp { display: flex; align-items: center; gap: 6px; }
.add-card { text-align: center; border-radius: 12px; }

.timeline { padding: 16px 10px 14px; }
.timeline > * { position: relative; z-index: 2; }
.tlx-head { display: grid; grid-template-columns: 260px 1fr; padding: 0 0 10px; }
.tlx-scale { position: relative; height: 18px; }
.tlx-scale span { position: absolute; font-size: 11px; color: var(--t4); white-space: nowrap; }
.tlx-body { position: relative; }
.tlx-today { position: absolute; top: -6px; bottom: 0; width: 1.5px; background: var(--red); border-radius: 2px; z-index: 3; opacity: 0.8; }
.tlx-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; height: 40px; border-radius: 12px; cursor: pointer; }
.tlx-row:hover { background: var(--fill); }
.tlx-proj { cursor: default; height: 36px; margin-top: 8px; }
.tlx-proj:hover { background: none; }
.tlx-label { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 13px; min-width: 0; }
.tlx-proj .tlx-label { font-weight: 600; font-size: 12.5px; color: var(--t2); }
.tlx-label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlx-track { position: relative; height: 100%; }
.tlx-bar { position: absolute; top: 12px; height: 16px; border-radius: 99px; background: color-mix(in srgb, var(--c) 75%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 4px 12px -4px color-mix(in srgb, var(--c) 60%, transparent); }
.tlx-bar.done { opacity: 0.4; }
.tlx-bar.late-bar { box-shadow: 0 0 0 1.5px var(--red); }
.load-pill { display: inline-block; min-width: 50px; text-align: center; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--fill-2); color: var(--t2); font-feature-settings: 'tnum'; }
.load-pill.good { color: var(--green); background: color-mix(in srgb, var(--green) calc(var(--tint) * 100%), transparent); }
.load-pill.bad { color: var(--red); background: color-mix(in srgb, var(--red) calc(var(--tint) * 100%), transparent); }
.alloc { border-radius: 99px; }

/* sheet + modals pick up the softer radii */
.sheet { border-radius: 28px; }
.att { border-radius: 14px; }
.status-row button { border-radius: 99px; height: 28px; padding: 0 12px; }

@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } .hero-actions { position: static !important; } }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hero { padding-top: 28px; align-items: start; }
.hero-team { gap: 0; }
.stat, .stat + .stat { padding: 18px 18px; }

/* ==========================================================================
   Major palette — derived from thiswasmajor.com: electric blue, ice, slate,
   forest, warm off-white. Earthy semantics instead of stock system colors.
   (Utility names are kept; values are remapped.)
   ========================================================================== */
:root {
  --font: 'Host Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --display: 'Host Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'Fragment Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --bg: #08090b;
  --t1: #f4f5f0;
  --blue:   #3d8bff;  /* Major blue (lifted for dark) */
  --teal:   #6cc4ff;  /* sky */
  --indigo: #a9bccb;  /* slate */
  --purple: #8f9cc4;  /* dusk */
  --green:  #8cc4a2;  /* moss */
  --orange: #e2b04f;  /* ochre */
  --yellow: #d8c28e;  /* sand */
  --pink:   #df9878;  /* clay */
  --red:    #ff6b4f;  /* vermilion */
  --graphite: #8b9096;
  --accent: var(--blue);
  --series-1: var(--blue);
  --series-2: #4a525b;
  --ambient: rgba(0, 104, 250, 0.10);
  --ambient-2: rgba(174, 194, 209, 0.08);
  --tint: 0.15;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f3;
    --t1: #0a0a0a;
    --blue:   #0068fa;
    --teal:   #0090e6;
    --indigo: #5f7686;
    --purple: #4f5b8a;
    --green:  #2f6b4f;
    --orange: #b07311;
    --yellow: #8f7535;
    --pink:   #a95a3b;
    --red:    #cf3b22;
    --graphite: #6b7177;
    --series-2: #b8c6d1;
    --ambient: rgba(229, 244, 255, 1);
    --ambient-2: rgba(174, 194, 209, 0.35);
    --tint: 0.11;
  }
}
.c-yellow { --c: var(--yellow); } .c-graphite { --c: var(--graphite); }
.mono, .stat-v, .kpi-value, .hs-v, td.right, .tl-due, .load-pill { font-feature-settings: 'tnum', 'ss01'; }
.step, .step .tool { font-family: var(--mono); }
h1, .hero-title, .stat-v, .hs-v, .ws-name { letter-spacing: -0.035em; }
.msg.user .bubble { background: var(--blue); }
.send { background: var(--blue); }
.link { color: var(--blue); }
.chip-nav.on { background: var(--t1); color: var(--on-t1); }
.cal .c.on { background: var(--blue); }
.tlx-bar { background: color-mix(in srgb, var(--c) 80%, transparent); }
@media (prefers-color-scheme: dark) { .avatar.colored { color: #0b0d10; } }

/* ---------- Overview widgets ---------- */
.widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; align-items: start; }
.widget { padding: 18px 20px 20px; min-width: 0; transition: transform .25s var(--ease), box-shadow .25s; }
.widget > * { position: relative; z-index: 2; }
.widget.size-S { grid-column: span 1; } .widget.size-M { grid-column: span 2; } .widget.size-L { grid-column: span 3; }
.w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 30px; }
.w-head h2 { font-size: 14px; }
.w-body { max-height: 420px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.widget.size-L .w-body { max-height: none; overflow: visible; }
.widgets.editing .widget { cursor: grab; outline: 1px dashed var(--line-3); outline-offset: -1px; }
.widgets.editing .widget .w-body { pointer-events: none; opacity: 0.75; }
.widget.dragging { opacity: 0.4; }
.widget.drop-target { box-shadow: inset 0 0 0 2px var(--blue), var(--shadow); }
.w-x { width: 28px; height: 28px; border-radius: 50%; color: var(--t3); font-size: 18px; line-height: 1; background: var(--fill); }
.w-x:hover { color: var(--red); background: var(--fill-2); }
.add-widget { min-height: 140px; border-radius: var(--r-lg); border: 1px dashed var(--line-3); color: var(--t3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; background: transparent; transition: all .2s; }
.add-widget span { font-size: 26px; font-weight: 300; }
.add-widget:hover { color: var(--t1); background: var(--fill); }
.w-hint { text-align: center; margin-top: 18px; }
.w-hint .link { background: none; cursor: pointer; color: var(--t3); }
.w-hint .link:hover { color: var(--blue); }

.w-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.w-tile { padding: 14px 16px; border-radius: 16px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line); }
.w-tile-l { font-size: 12px; color: var(--t3); }
.w-tile-v { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.04em; margin-top: 10px; line-height: 1; font-feature-settings: 'tnum'; }
.w-tile-s { font-size: 12px; color: var(--t3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-list { display: flex; flex-direction: column; gap: 2px; }
.w-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .15s; min-width: 0; }
.w-row:hover { background: var(--fill-2); }
.w-row.static { cursor: default; }
.w-row.static:hover { background: transparent; }
.w-row-main { flex: 1; min-width: 0; }
.w-row-t { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row-s { font-size: 11.5px; color: var(--t3); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row-d { font-size: 12px; color: var(--t3); white-space: nowrap; font-feature-settings: 'tnum'; }
.w-quote { font-weight: 400; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--t2); margin-top: 2px; }
.w-more, .w-empty { font-size: 12.5px; color: var(--t3); padding: 10px; }
.w-empty { padding: 24px 10px; text-align: center; }
.w-days { display: flex; flex-direction: column; gap: 14px; }
.w-day-h { font-size: 11.5px; font-weight: 600; color: var(--t3); margin: 0 4px 6px; }
.w-dl { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-dl:hover { background: var(--fill-2); }
.w-dl.proj { font-weight: 600; }
.w-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.w-proj { padding: 14px 16px; border-radius: 16px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line); transition: background .2s, transform .2s var(--ease); }
.w-proj:hover { background: var(--fill-2); transform: translateY(-1px); }
.w-proj-n { font-weight: 600; font-size: 13.5px; }
.w-proj-s { font-size: 12px; color: var(--t3); margin-top: 4px; }
.w-quick { display: flex; flex-direction: column; gap: 8px; }
.w-quick .input { height: 36px; font-size: 13px; }
.w-quick .btn { align-self: flex-start; }
.w-gal-h { font-size: 12px; font-weight: 600; color: var(--t3); margin: 20px 0 8px; }
.w-gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.w-gal-item { text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: all .2s; }
.w-gal-item:hover:not(.used) { background: var(--fill-3); transform: translateY(-1px); }
.w-gal-item.used { opacity: 0.45; cursor: default; }
.w-gal-t { font-weight: 600; font-size: 13.5px; }
.w-gal-d { font-size: 12px; color: var(--t3); margin-top: 4px; line-height: 1.4; }
@media (max-width: 1100px) { .widgets { grid-template-columns: 1fr; } .widget.size-S, .widget.size-M, .widget.size-L { grid-column: span 1; } }
.w-body { max-height: 340px; }

/* ---------- Home-screen style editing ---------- */
.widgets.editing .widget { outline: none; cursor: grab; touch-action: none; user-select: none; animation: jiggle var(--jd, .32s) ease-in-out infinite; }
.widgets.editing .widget .w-body { opacity: 1; pointer-events: none; }
.widget.size-S { --j: .55deg; } .widget.size-M { --j: .3deg; } .widget.size-L { --j: .12deg; }
.widgets.editing .widget:nth-child(2n) { --jd: .36s; animation-delay: -.12s; }
.widgets.editing .widget:nth-child(3n) { --jd: .29s; animation-delay: -.2s; }
@keyframes jiggle { 0%, 100% { rotate: calc(var(--j) * -1); } 50% { rotate: var(--j); } }
.widget.lifted { animation: none !important; rotate: 0deg; scale: 1.04; z-index: 40; cursor: grabbing; transition: scale .25s cubic-bezier(.2,.9,.25,1.12), box-shadow .25s;
  box-shadow: inset 0 1px 0 var(--hi), 0 40px 80px -24px rgba(0,0,0,0.65), 0 12px 24px -8px rgba(0,0,0,0.35); }
.widget.settling { animation: none !important; z-index: 40; transition: translate .46s cubic-bezier(.2,.9,.25,1.12), scale .3s ease; scale: 1; }
.w-del { position: absolute; top: -9px; left: -9px; z-index: 50; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-solid); box-shadow: 0 0 0 0.5px var(--line-3), 0 4px 12px rgba(0,0,0,0.3); animation: popIn .3s cubic-bezier(.2,.9,.25,1.3) both; }
.w-del::before { content: ''; width: 10px; height: 2px; border-radius: 2px; background: var(--t1); }
.w-del:hover { background: var(--red); } .w-del:hover::before { background: #fff; }
@keyframes popIn { from { scale: 0; } to { scale: 1; } }
.widgets.editing .add-widget { animation: popIn .35s cubic-bezier(.2,.9,.25,1.3) both; }
@media (prefers-reduced-motion: reduce) { .widgets.editing .widget { animation: none; } }

/* ---------- Fixed-header pages: header + figures pinned, table scrolls ---------- */
.content:has(> .view.fixed) { overflow: hidden; padding-bottom: 20px; }
.view.fixed { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.view.fixed > .page-head, .view.fixed > .stats, .view.fixed > .section-gap { flex: none; }
.panel.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel.fill > .toolbar { flex: none; }
.panel.fill > .table-wrap { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.panel.fill thead th { position: sticky; top: 0; z-index: 3; background: color-mix(in srgb, var(--surface-solid) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.panel.fill thead th:first-child { border-radius: 12px 0 0 12px; } .panel.fill thead th:last-child { border-radius: 0 12px 12px 0; }
.panel.fill > .table-wrap { mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
@media (max-width: 860px) { .content:has(> .view.fixed) { overflow: auto; } .view.fixed { height: auto; } .panel.fill > .table-wrap { overflow: visible; mask-image: none; -webkit-mask-image: none; } }
.panel.fill thead th { background: color-mix(in srgb, var(--surface-solid) 97%, var(--bg)); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 8px 12px -10px rgba(0,0,0,0.35); color: var(--t3); }
@media (prefers-color-scheme: dark) { .panel.fill thead th { background: #17191d; } }

/* ---------- Directory (Contacts-style) ---------- */
.dir { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
.dir-list, .dir-card { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dir-list > *, .dir-card > * { position: relative; z-index: 2; }
.dir-search { padding: 14px 14px 6px; flex: none; }
.dir-search .input { height: 36px; border-radius: 999px; padding: 0 16px; }
.dir-scroll { flex: 1; overflow: auto; padding: 0 8px 12px; overscroll-behavior: contain; }
.dir-letter { position: sticky; top: 0; z-index: 2; font-size: 11.5px; font-weight: 700; color: var(--blue); padding: 10px 12px 4px; background: linear-gradient(var(--surface-solid) 70%, transparent); }
@media (prefers-color-scheme: dark) { .dir-letter { background: linear-gradient(#15171b 70%, transparent); } }
.dir-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; transition: background .15s; min-width: 0; }
.dir-item:hover { background: var(--fill-2); }
.dir-item.on { background: var(--t1); color: var(--on-t1); }
.dir-item.on .dir-sub, .dir-item.on .dir-kind { color: var(--on-t1); opacity: 0.6; background: transparent; }
.dir-item-main { flex: 1; min-width: 0; }
.dir-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-sub { font-size: 12px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-kind { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--c, var(--t3)); background: color-mix(in srgb, var(--c, var(--t3)) calc(var(--tint) * 100%), transparent); white-space: nowrap; }
.k-team { --c: var(--blue); } .k-client { --c: var(--green); } .k-contractor { --c: var(--orange); } .k-vendor { --c: var(--indigo); }
.avatar.k-client, .avatar.k-contractor, .avatar.k-vendor { background: color-mix(in srgb, var(--c) 22%, var(--surface-solid)); color: var(--c); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--c) 40%, transparent); }
.avatar.org { border-radius: 30%; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.seg-c { font-size: 11px; color: var(--t4); margin-left: 2px; font-feature-settings: 'tnum'; }
.seg .on .seg-c { color: var(--t3); }
.dir-card { overflow: auto; }
.dir-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 24px 18px; gap: 6px; }
.dir-hero .avatar { margin-bottom: 8px; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.25); }
.dir-hero-name { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.035em; }
.dir-hero-sub { color: var(--t3); font-size: 14px; margin-bottom: 6px; }
.dir-acts { display: flex; justify-content: center; gap: 10px; padding: 6px 24px 22px; flex-wrap: wrap; }
.dir-act { min-width: 92px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--blue); background: var(--fill-2); box-shadow: inset 0 0 0 0.5px var(--line-2); transition: background .2s, transform .2s var(--ease); }
.dir-act:hover { background: var(--fill-3); transform: translateY(-1px); }
.dir-body { max-width: 640px; width: 100%; margin: 0 auto; padding: 0 28px 28px; }
.dir-body section { padding: 16px 18px; margin-bottom: 12px; border-radius: 18px; background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--line); }
.dir-body h4 { margin-bottom: 8px; }
.dir-field { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 7px 0; font-size: 13.5px; border-top: 0.5px solid var(--line); }
.dir-field:first-of-type { border-top: 0; }
.dir-k { color: var(--t3); }
.dir-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-foot { display: flex; gap: 8px; justify-content: center; padding-top: 6px; }
@media (max-width: 1000px) { .dir { grid-template-columns: 1fr; } .dir-list { max-height: 50vh; } }
.dir-letter, .dir-letter:is(*) { position: static; background: none !important; padding: 14px 12px 4px; }

/* ==========================================================================
   Light-mode polish: no inverted "black ink" blocks. Selection = Major-blue tint,
   primary = Major blue, transient UI = white glass.
   ========================================================================== */
.dir-item.on { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--t1); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--blue) 35%, transparent); }
.dir-item.on .dir-sub { color: var(--t2); opacity: 1; }
.dir-item.on .dir-kind { opacity: 1; color: var(--c, var(--t3)); background: color-mix(in srgb, var(--c, var(--t3)) calc(var(--tint) * 100%), transparent); }
@media (prefers-color-scheme: light) {
  .dir-item.on { background: color-mix(in srgb, var(--blue) 10%, rgba(255,255,255,0.7)); }
  .dir-item.on .dir-name { color: var(--blue); }
  .btn.primary { background: var(--blue); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 6px 18px -8px color-mix(in srgb, var(--blue) 70%, transparent); }
  .btn.primary:hover { opacity: 1; background: color-mix(in srgb, var(--blue) 88%, #000); }
  .btn.primary kbd { color: #fff; opacity: 0.7; }
  .chip-nav.on { background: rgba(255,255,255,0.95); color: var(--t1); box-shadow: inset 0 0 0 0.5px var(--line-2), 0 4px 14px -6px rgba(20,30,50,0.18); }
  .chip-nav.on .n { color: var(--blue); opacity: 1; }
  .toast { background: rgba(255,255,255,0.88); color: var(--t1); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); box-shadow: inset 0 0 0 0.5px var(--line-2), 0 12px 32px -10px rgba(20,30,50,0.25); }
  .avatar.ai { background: var(--blue); color: #fff; }
  .pill.white { background: rgba(0,0,0,0.75); color: #fff; }
  .seg .on { background: #fff; box-shadow: 0 1px 2px rgba(20,30,50,0.08), 0 4px 10px -4px rgba(20,30,50,0.12); }
  .nav-item.active { background: rgba(255,255,255,0.75); box-shadow: inset 0 0 0 0.5px var(--line-2), 0 2px 8px -4px rgba(20,30,50,0.12); }
  .w-del { background: #fff; }
}
/* subtle, rounded scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--fg), 0.14) transparent; }
/* row-level primaries are soft tints; one solid primary per page */
.btn.sm.primary { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--blue) 30%, transparent); }
.btn.sm.primary:hover { background: color-mix(in srgb, var(--blue) 22%, transparent); opacity: 1; }
@media (prefers-color-scheme: dark) { .btn.sm.primary { color: color-mix(in srgb, var(--blue) 70%, #fff); } }
/* Ask Lucent: quiet glass, brand-blue label */
.btn.ask { height: 40px; padding: 0 16px; color: var(--blue); background: var(--glass-a); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: inset 0 0 0 0.5px var(--line-2), inset 0 1px 0 var(--hi), 0 6px 18px -10px rgba(0,0,0,0.3); font-weight: 600; }
.btn.ask:hover { background: var(--fill-3); }
.btn.ask .ask-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
@media (prefers-color-scheme: dark) { .btn.ask { color: color-mix(in srgb, var(--blue) 65%, #fff); } }

/* ---------- Resizable slide-over panels ---------- */
.sheet { width: var(--sheet-w, 460px); max-width: 90vw; transition: box-shadow .2s; }
.sheet-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; z-index: 10; cursor: ew-resize; touch-action: none; }
.sheet-resize::before { content: ''; position: absolute; left: 5px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 4px; background: var(--line-3); opacity: 0; transition: opacity .2s, height .2s, background .2s; }
.sheet:hover .sheet-resize::before { opacity: 1; }
.sheet-resize:hover::before, .sheet.resizing .sheet-resize::before { opacity: 1; height: 72px; margin-top: -36px; background: var(--blue); }
.sheet.resizing { animation: none; user-select: none; }
body.resizing-sheet, body.resizing-sheet * { cursor: ew-resize !important; user-select: none !important; }
.sheet.wide .kv { grid-template-columns: 160px 1fr; }
/* calmer jiggle: about half the rotation, a bit slower */
.widget.size-S { --j: .28deg; } .widget.size-M { --j: .14deg; } .widget.size-L { --j: .06deg; }
.widgets.editing .widget { --jd: .46s; }
.widgets.editing .widget:nth-child(2n) { --jd: .5s; }
.widgets.editing .widget:nth-child(3n) { --jd: .43s; }

/* ==========================================================================
   Shadow cleanup
   ========================================================================== */
:root { --ring: #1b1d22; --card-shadow: 0 8px 20px -12px rgba(0,0,0,0.55); --lift-shadow: 0 40px 80px -24px rgba(0,0,0,0.65), 0 12px 24px -8px rgba(0,0,0,0.35); }
@media (prefers-color-scheme: light) { :root { --ring: #f7f9fb; --card-shadow: 0 1px 2px rgba(20,30,50,0.05), 0 6px 16px -10px rgba(20,30,50,0.16); --lift-shadow: 0 28px 56px -20px rgba(20,30,50,0.28), 0 8px 18px -8px rgba(20,30,50,0.14); } }

/* sticky table header: one continuous surface + hairline, no per-cell drop shadows */
.panel.fill thead th { box-shadow: inset 0 -0.5px 0 var(--line-2); border-radius: 0 !important; }
.panel.fill thead th:first-child { border-top-left-radius: 12px !important; border-bottom-left-radius: 12px !important; }
.panel.fill thead th:last-child { border-top-right-radius: 12px !important; border-bottom-right-radius: 12px !important; }

/* stacked avatars ring with the panel color, not the page background */
.avatars .avatar, .hero-team .avatar { box-shadow: 0 0 0 2px var(--ring); }
.swatch.on { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--c); }

/* softer, mode-aware elevation */
.tcard { box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 0.5px var(--line-2), var(--card-shadow); }
.tcard:hover { box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 0.5px var(--line-3), var(--card-shadow), 0 10px 24px -14px rgba(20,30,50,0.25); }
.widget.lifted { box-shadow: inset 0 1px 0 var(--hi), var(--lift-shadow); }
.dir-hero .avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), var(--card-shadow); }
.btn.ask { box-shadow: inset 0 0 0 0.5px var(--line-2), inset 0 1px 0 var(--hi); }
@media (prefers-color-scheme: light) {
  .btn.primary { box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 10px -6px color-mix(in srgb, var(--blue) 55%, transparent); }
  .chip-nav.on { box-shadow: inset 0 0 0 0.5px var(--line-2), 0 2px 8px -4px rgba(20,30,50,0.14); }
  .w-del { box-shadow: 0 0 0 0.5px var(--line-3), 0 3px 8px rgba(20,30,50,0.15); }
}

/* Dialogs taller than the window scroll inside the overlay (gallery, long forms) */
.overlay { overflow-y: auto; overscroll-behavior: contain; padding: 7vh 16px 48px; align-items: start; }
.overlay > .modal, .overlay > .cmdk { margin-bottom: 24px; }
.modal-foot { position: sticky; bottom: -26px; margin: 0 -26px -26px; padding: 14px 26px 22px; border-radius: 0 0 20px 20px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface-solid) 85%, transparent) 30%); }
.modal-foot { position: static; margin: 0; padding: 0; background: none; border-radius: 0; }

/* ==========================================================================
   Mobile (phones & small tablets)
   ========================================================================== */
.tabbar { display: none; }
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .main { height: auto; min-height: 100dvh; }
  .content { overflow: visible; padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .content:has(> .view.fixed) { overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top)) 16px 8px; gap: 8px;
    background: linear-gradient(var(--bg) 60%, transparent); }
  .search { max-width: none; height: 40px; }
  .search kbd, .btn.ask kbd { display: none; }
  .btn.ask { padding: 0 14px; flex: none; }

  /* bottom tab bar */
  .tabbar { display: flex; position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 62px;
    padding: 6px; border-radius: 26px; justify-content: space-around; align-items: stretch; }
  .tabbar > * { position: relative; z-index: 2; }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--t3); transition: color .2s, background .2s; }
  .tab-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; transition: background .2s; }
  .tab.on { color: var(--t1); background: var(--fill-2); }
  .tab.on .tab-dot { background: var(--blue); }
  .agent-open .tabbar { opacity: 0; pointer-events: none; }

  /* page headers stack; segmented controls scroll sideways */
  h1 { font-size: 32px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; margin: 12px 0 18px; }
  .page-head > .row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
  .page-head > .row::-webkit-scrollbar, .chip-bar::-webkit-scrollbar { display: none; }
  .seg { flex: none; }
  .page-head .btn { flex: none; }
  .chip-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 2px 16px; }
  .chip-nav { flex: none; }

  /* figures: 2-up tiles */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat, .stat + .stat { padding: 14px 14px; border-radius: 18px; }
  .stat-v { font-size: 22px; }
  .w-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-tile-v { font-size: 22px; }

  /* tables keep their columns and scroll sideways inside the card */
  .view.fixed { height: auto; }
  .panel.fill > .table-wrap { overflow-x: auto; overflow-y: visible; mask-image: none; -webkit-mask-image: none; }
  .table-wrap.flush { -webkit-overflow-scrolling: touch; }
  .toolbar { padding: 14px 14px 6px; }
  .toolbar .filter-input { width: 100%; }

  /* projects */
  .hero { padding: 22px 20px; gap: 18px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero-title { font-size: 22px; flex-wrap: wrap; }
  .tl-row .proj-chip, .tl-row .tl-meta { display: none; }
  .tl-due { width: auto; }
  .board { grid-template-columns: repeat(4, 82vw); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 6px; }
  .col-k { scroll-snap-align: start; min-height: 0; }
  .timeline { overflow-x: auto; } .tlx-head, .tlx-row { grid-template-columns: 170px 600px; }
  .tlx-today { left: calc(170px + 600px * var(--tx, 0)) !important; display: none; }

  /* overview widgets */
  .widgets { gap: 12px; }
  .widget { padding: 16px; }
  .widget .seg.sm button { padding: 3px 9px; }

  /* directory: list, then the card */
  .dir { display: flex; flex-direction: column; }
  .dir-list { max-height: 55vh; }
  .dir-acts { gap: 8px; } .dir-act { min-width: 0; flex: 1; }
  .dir-body { padding: 0 14px 20px; }
  .dir-field { grid-template-columns: 110px 1fr; }

  /* panels & dialogs */
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100% !important; max-width: none; height: 92dvh; border-radius: 26px 26px 0 0; }
  .sheet-resize { display: none; }
  .agent { left: 0; right: 0; top: auto; bottom: 0; height: 92dvh; width: 100%; border-radius: 26px 26px 0 0; }
  .modal .form { grid-template-columns: 1fr; }
  .w-gal { grid-template-columns: 1fr; }
  .overlay { padding: 10vh 12px 40px; }
}
@media (max-width: 860px) {
  .view, .view.fixed > *, .panel, .panel.fill, .dir, .dir > *, .widgets, .widget { min-width: 0; max-width: 100%; }
  .table-wrap.flush { max-width: 100%; }
  .tabbar { background: color-mix(in srgb, var(--surface-solid) 82%, transparent); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); }
}
@media (max-width: 860px) { .table-wrap, .panel.fill > .table-wrap { overflow-x: auto !important; overflow-y: hidden !important; } .content { overflow-x: clip; } }
@media (max-width: 860px) { html, body { overflow-x: hidden; } .app, .main { overflow-x: clip; max-width: 100vw; } }
@media (max-width: 860px) {
  .tabbar.glass { background: color-mix(in srgb, var(--surface-solid) 95%, transparent); }
  body:has(.sheet) .tabbar, body:has(.overlay) .tabbar { opacity: 0; pointer-events: none; transform: translateY(20px); }
  .tabbar { transition: opacity .25s, transform .25s; }
  .sheet { height: 88dvh; }
}
