/* taqat portal. Brand tokens from branding/README.md: two purples used with discipline, neutrals for
   the rest, Hanken Grotesk, generous radius, hairlines instead of shadows. Light theme only, like the site. */

:root {
  --purple: #6a26d1;
  --purple-deep: #3b016f;
  --purple-ink: #4a1a9a;
  --tint: #f0eafb;
  --tint-2: #f7f4fd;
  --ink: #14101f;
  --ink-2: #3d3a47;
  --body: #5d6370;
  --muted: #8a8f9b;
  --bg: #f6f5f9;
  --surface: #ffffff;
  --line: #e9e6f0;
  --line-2: #f1eef6;
  --good: #1a7f4b;
  --good-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff3dc;
  --bad: #c0362f;
  --bad-bg: #fdecea;
  --blue: #2b48b8;
  --blue-bg: #e9edfb;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  --r-lg: 18px;
  --side: 248px;
  --shadow-pop: 0 12px 40px rgba(20, 16, 31, 0.14), 0 2px 8px rgba(20, 16, 31, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--body); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--purple); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
kbd { font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: #fff; }

/* ---------- buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.btn.primary, .btn-primary { background: var(--purple); color: #fff; }
.btn.primary:hover, .btn-primary:hover { background: var(--purple-deep); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #cfc4e6; color: var(--purple); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn .muted { font-weight: 500; font-size: 12px; }
.on-primary-muted { color: #d9c9f7; font-weight: 500; font-size: 12.5px; }
.btn.fake { pointer-events: none; align-self: flex-start; margin-top: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: transparent; color: var(--body); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--tint-2); color: var(--purple); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.text-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--body); font-size: 13px; display: inline-flex; gap: 5px; align-items: center; }
.text-btn:hover { color: var(--purple); }
.text-btn.danger:hover { color: var(--bad); }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }

input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--purple); padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--tint); }
input::placeholder, textarea::placeholder { color: #a7a9b3; }
select { padding-right: 30px; appearance: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f9b' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.form-error { color: var(--bad); font-size: 13.5px; min-height: 1.2em; }
.error { color: var(--bad); font-size: 13.5px; min-height: 1.4em; margin-top: 8px; }

.search-box { position: relative; display: flex; align-items: center; min-width: 220px; }
.search-box .ico { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 36px; border-radius: 999px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg-ctl { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.seg-ctl button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: none; font-weight: 600; font-size: 13px; color: var(--body); cursor: pointer; }
.seg-ctl button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,16,31,.08); }

/* chips and pills */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; border: 0; }
.chip.kind { background: var(--tint); color: var(--purple-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn); cursor: pointer; }
.chip.ok { background: var(--good-bg); color: var(--good); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pill, .pill-select { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 0; }
.pill-select { width: auto; padding-right: 26px; background-position: right 8px center; background-size: 10px; }
.st-lead, .ts-to_contact { background-color: var(--line-2); color: var(--ink-2); }
.st-contacted, .ts-contacted { background-color: var(--blue-bg); color: var(--blue); }
.st-talks, .ts-replied { background-color: var(--tint); color: var(--purple-ink); }
.st-demo { background-color: #e7dcfb; color: var(--purple-deep); }
.st-pilot, .ts-engaged, .st-won { background-color: var(--good-bg); color: var(--good); }
.st-waiting, .ts-not_now { background-color: var(--warn-bg); color: var(--warn); }
.st-closed, .st-lost, .ts-not_a_fit { background-color: var(--bad-bg); color: var(--bad); }
.chip.seg-agency { background: #efe6fd; color: var(--purple-deep); }
.chip.seg-a_finance { background: var(--blue-bg); color: var(--blue); }
.chip.seg-b_employer { background: #e6f4f1; color: #13665a; }
.chip.seg-c_champion { background: #fff1e8; color: #9a4a15; }
.chip.seg-government { background: var(--line-2); color: var(--ink-2); }
.hot-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 1px 7px 1px 5px; vertical-align: middle; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--body); }
.due.overdue { color: var(--bad); }
.due.now { color: var(--purple); }
.due.soon { color: var(--ink-2); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--body); font-size: 11.5px; font-weight: 700; }

.avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--purple-ink); font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 52px; height: 52px; font-size: 17px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--surface) 0 calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px) var(--side), transparent var(--side)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
.side-logo img { height: 28px; width: auto; }
.side-logo span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding-top: 4px; }
.side-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--bg); color: var(--muted); cursor: pointer; text-align: left;
}
.side-search span { flex: 1; font-size: 13.5px; }
.side-search:hover { border-color: #cfc4e6; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 11px;
  color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative;
}
.nav-item:hover { background: var(--tint-2); color: var(--ink); }
.nav-item.active { background: var(--tint); color: var(--purple-ink); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--purple); }
.nav-item span:first-of-type { flex: 1; }
.nav-count { font-size: 11.5px; font-weight: 700; color: var(--purple-ink); background: #fff; border: 1px solid #e3d8f6; border-radius: 999px; padding: 0 7px; line-height: 19px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 4px; border-top: 1px solid var(--line); }
.side-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-user strong { color: var(--ink); font-size: 13.5px; }
.side-user .who span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-col { min-width: 0; }
.mobile-bar, .bottom-nav { display: none; }
main { outline: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 30px 32px 64px; }
.page.wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 27px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; min-width: 140px; }
.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, #eeecf3 0%, #f7f6fa 50%, #eeecf3 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 14px; }
.skeleton.short { height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.pad, .pad { padding: 20px 22px; }
.pad-x { padding: 0 22px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 20px; color: var(--muted); }
.empty-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--tint-2); color: var(--purple); margin-bottom: 4px; }
.empty strong { color: var(--ink); font-size: 15px; }
.notice { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); padding: 11px 14px; border-radius: 12px; font-size: 13.5px; margin: 14px 0; }
.callout { background: var(--tint-2); border: 1px solid #ece4fa; border-radius: 14px; padding: 13px 15px; margin-top: 14px; }
.callout-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--purple-ink); margin-bottom: 5px; }
.callout p { color: var(--ink-2); font-size: 13.5px; }

/* ---------- home ---------- */
.stage-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stage-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 13px 14px 12px; border-radius: 14px; background: var(--bg);
  border: 1px solid var(--line); border-top: 3px solid var(--muted); color: var(--ink); min-height: 104px; transition: border-color .15s, background .15s;
}
.stage-tile:hover { background: #fff; border-color: #d9cdf0; }
.stage-tile.zero { opacity: .62; }
.stage-tile.st-lead { border-top-color: #b9b5c4; }
.stage-tile.st-contacted { border-top-color: #4c6ad6; }
.stage-tile.st-talks { border-top-color: #9b6be3; }
.stage-tile.st-demo { border-top-color: var(--purple); }
.stage-tile.st-pilot { border-top-color: #2f9a62; }
.stage-tile.st-waiting { border-top-color: #e3a23a; }
.stage-count { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stage-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.stage-names { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 3px; }
.att-list { display: flex; flex-direction: column; }
.att-group { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 0 6px; }
.att-group:first-child { padding-top: 0; }
.att-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 0 -10px; border-radius: 11px; color: var(--ink); }
.att-row:hover { background: var(--tint-2); }
.att-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.att-dot.contacted { background: #4c6ad6; } .att-dot.talks { background: #9b6be3; } .att-dot.demo { background: var(--purple); }
.att-dot.pilot { background: #2f9a62; } .att-dot.waiting { background: #e3a23a; }
.att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-main strong { font-size: 14px; }
.att-main .muted { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.all-clear { display: flex; align-items: center; gap: 10px; padding: 18px; background: var(--good-bg); color: var(--good); border-radius: 12px; font-weight: 600; }
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; padding: 12px 14px; background: var(--bg); border-radius: 12px; }
.kpi-num { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.seg-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.seg-row { display: grid; grid-template-columns: 112px 1fr 70px; gap: 12px; align-items: center; padding: 7px 8px; margin: 0 -8px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.seg-row:hover { background: var(--tint-2); }
.seg-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 99px; background: var(--purple); }
.seg-num { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 12px; padding: 10px; margin: 0 -10px; border-radius: 12px; color: var(--ink); }
.feed-row:hover { background: var(--tint-2); }
.feed-row.big { margin: 0; padding: 14px 18px; border-radius: 0; border-bottom: 1px solid var(--line-2); }
.feed-row.big:last-child { border-bottom: 0; }
.feed-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--line-2); color: var(--ink-2); }
.k-call .feed-ico, .feed-ico.k-call, .tl-item.k-call .tl-ico { background: #e9edfb; color: #2b48b8; }
.feed-ico.k-meeting, .tl-item.k-meeting .tl-ico { background: #e6f4ec; color: #1a7f4b; }
.feed-ico.k-email, .tl-item.k-email .tl-ico { background: #fff1e8; color: #9a4a15; }
.feed-ico.k-message, .tl-item.k-message .tl-ico { background: #e6f4f1; color: #13665a; }
.feed-ico.k-demo, .tl-item.k-demo .tl-ico { background: var(--tint); color: var(--purple-ink); }
.feed-ico.k-note, .tl-item.k-note .tl-ico { background: var(--line-2); color: var(--ink-2); }
.feed-ico.k-status, .tl-item.k-status .tl-ico { background: #fff3dc; color: #8a5a00; }
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed-top strong { font-size: 14px; }
.feed-top .muted { font-size: 12.5px; }
.feed-body { font-size: 13.5px; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-body.full { -webkit-line-clamp: unset; display: block; color: var(--ink-2); }
.feed-day { margin-bottom: 18px; }
.feed-day h2 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px 4px; }
.quick-dl, .dl-grid { display: grid; gap: 8px; }
.dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl-tile { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); }
.dl-tile:hover { border-color: #cfc4e6; background: var(--tint-2); }
.dl-tile > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dl-tile strong { font-size: 13.5px; }
.dl-tile .muted { font-size: 12px; }
.dl-tile.big { padding: 14px 16px; }
.dl-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tint); color: var(--purple); flex: none; }

/* ---------- engagements ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.col { background: #efedf4; border-radius: 16px; padding: 10px; min-height: 180px; scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
.col.drop { background: var(--tint); box-shadow: inset 0 0 0 2px #cdb7f2; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.col-head span:nth-child(2) { flex: 1; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9b5c4; }
.col.st-contacted .col-dot { background: #4c6ad6; } .col.st-talks .col-dot { background: #9b6be3; } .col.st-demo .col-dot { background: var(--purple); }
.col.st-pilot .col-dot { background: #2f9a62; } .col.st-waiting .col-dot { background: #e3a23a; } .col.st-closed .col-dot { background: var(--bad); }
.col-count { font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 999px; padding: 0 8px; line-height: 20px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; }
.col-empty { border: 1.5px dashed #d6d1e1; border-radius: 12px; padding: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.eng-card {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; background: #fff; border: 1px solid var(--line);
  border-radius: 13px; color: var(--ink); cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.eng-card:hover { border-color: #cfc4e6; box-shadow: 0 4px 14px rgba(59, 1, 111, .07); }
.eng-card.dragging { opacity: .45; transform: rotate(1.5deg); }
.eng-card.archived { opacity: .6; }
.ec-top { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 2px; }
.ec-name { font-size: 14.5px; line-height: 1.3; }
.ec-org { font-size: 12.5px; color: var(--muted); }
.ec-next { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.ec-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 12px; }
.ec-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.ec-meta .ico:nth-of-type(2) { margin-left: 6px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fbfafd; white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #fbf9ff; }
table.data tr.sel td { background: #f6f1ff; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); background: #fbfafd; }
table.data.compact td, table.data.compact th { padding: 8px 12px; }
.card > .table-wrap table.data th:first-child { border-top-left-radius: var(--r-lg); }
.card > .table-wrap table.data th:last-child { border-top-right-radius: var(--r-lg); }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort.on { color: var(--purple-ink); }
.td-next { max-width: 320px; }
.td-next .due { margin-top: 3px; }
.eng-body > .table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }

/* side panel */
#drawer-root { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 16, 31, .28); opacity: 0; transition: opacity .2s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); overflow-y: auto; outline: none;
  transform: translateX(24px); opacity: 0; transition: transform .22s ease, opacity .22s ease; box-shadow: var(--shadow-pop);
}
.drawer.wide { width: min(820px, 100vw); }
#drawer-root.open .drawer-backdrop { opacity: 1; }
#drawer-root.open .drawer { transform: none; opacity: 1; }
body.drawer-open { overflow: hidden; }
.panel { padding: 22px 26px 40px; }
.panel-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.panel-title h2 { font-size: 22px; font-weight: 800; margin: 7px 0 2px; }
.panel-tools { display: flex; gap: 2px; }
.panel-person { display: flex; gap: 14px; align-items: flex-start; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.panel-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; padding: 12px 14px; background: var(--bg); border-radius: 14px; }
.meta-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta-item.wide { grid-column: span 1; }
.meta-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
input.inline, textarea.inline, select.inline { border-color: transparent; background-color: transparent; padding-left: 8px; margin-left: -8px; height: 32px; }
textarea.inline { height: auto; padding: 8px; margin: 0 -8px; width: calc(100% + 16px); }
input.inline:hover, textarea.inline:hover, select.inline:hover { border-color: var(--line); background-color: #fff; }
input.inline:focus, textarea.inline:focus, select.inline:focus { background-color: #fff; border-color: var(--purple); }
input.inline.strong { font-weight: 700; font-size: 15px; color: var(--ink); }
.saving { border-color: #d9cdf0 !important; }
.saved { border-color: #8ad1a9 !important; box-shadow: 0 0 0 3px #e6f4ec !important; }
.next-box { border: 1px solid #e3d8f6; background: var(--tint-2); border-radius: 14px; padding: 12px 14px 8px; }
.next-box.d-overdue { border-color: #f3c2bd; background: #fff8f7; }
.next-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--purple-ink); }
.next-label .due { margin-left: auto; text-transform: none; letter-spacing: 0; }
.next-box input.inline { margin-left: -8px; }
.next-date { display: flex; align-items: center; gap: 6px; color: var(--muted); max-width: 210px; }
.summary-box { margin: 12px 0 4px; }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line button {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; background: none;
  font-weight: 600; font-size: 14px; color: var(--body); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs-line button:hover { color: var(--ink); }
.tabs-line button.on { color: var(--purple-ink); border-bottom-color: var(--purple); }
.tabs-line button.on .count { background: var(--tint); color: var(--purple-ink); }
.tabs-line.big { margin-top: 6px; }
.tab-body { display: flex; flex-direction: column; gap: 14px; }

.composer { border: 1px solid var(--line); border-radius: 15px; padding: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #cdb7f2; box-shadow: 0 0 0 3px var(--tint); }
.composer textarea { border: 0; box-shadow: none !important; padding: 8px 6px; min-height: 52px; }
.kind-pick { display: flex; gap: 5px; flex-wrap: wrap; padding: 2px 2px 4px; }
.kind-btn { display: inline-flex; align-items: center; gap: 5px; height: 29px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--body); cursor: pointer; }
.kind-btn:hover { border-color: #cfc4e6; }
.kind-btn.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.composer-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 9px; flex-wrap: wrap; }
.composer-fields { display: flex; gap: 6px; flex: 1; min-width: 240px; }
.composer-fields input[type="date"] { width: 150px; flex: none; }
.composer .hint { font-size: 11.5px; color: var(--muted); }
.timeline { display: flex; flex-direction: column; }
.tl-month { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 6px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 14px; top: 32px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--line-2); color: var(--ink-2); position: relative; }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.tl-head strong { color: var(--ink); }
.tl-with { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); background: var(--bg); border-radius: 999px; padding: 1px 8px 1px 6px; }
.tl-body { color: var(--ink-2); white-space: pre-wrap; margin: 4px 0; }
.tl-foot { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.tl-foot .text-btn { font-size: 12px; opacity: 0; transition: opacity .15s; }
.tl-item:hover .tl-foot .text-btn { opacity: 1; }
.pick { position: relative; }
.pick-results { display: flex; flex-direction: column; margin-top: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.pick-row:hover { background: var(--tint-2); }
.pick-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.people { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.person { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-bottom: 1px solid var(--line-2); }
.person:last-child { border-bottom: 0; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.strong-link { font-weight: 700; color: var(--ink); }
.strong-link:hover { color: var(--purple); }
.doc-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.doc { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.doc:last-child { border-bottom: 0; }
.doc-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tint-2); color: var(--purple); flex: none; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.doc-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main:hover strong { color: var(--purple); }
.doc-add { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; }
.panel-foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* modal and palette */
dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(20, 16, 31, .38); }
dialog.modal { width: min(560px, calc(100vw - 24px)); }
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal-form { background: #fff; border-radius: 20px; padding: 20px 22px 18px; box-shadow: var(--shadow-pop); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font-size: 19px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
dialog.palette { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; }
dialog.palette > * { background: #fff; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 18px 18px 0 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-input input { border: 0; height: 56px; padding: 0; font-size: 16px; box-shadow: none !important; }
.pal-list { max-height: 56vh; overflow-y: auto; padding: 6px; border-radius: 0 0 18px 18px; box-shadow: var(--shadow-pop); }
.pal-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; color: var(--ink-2); }
.pal-item.active { background: var(--tint); color: var(--purple-ink); }
.pal-title { font-weight: 600; color: var(--ink); }
.pal-sub { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-empty { padding: 18px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; padding: 10px 16px 10px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop);
  animation: pop .18s ease;
}
.toast .ico { color: #9ee0b8; }
.toast.error .ico { color: #ffb4ad; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- targets ---------- */
.seg-hint { font-size: 13px; color: var(--muted); margin: -8px 0 12px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chip-toggle.on { background: var(--bad-bg); border-color: #f3c2bd; color: var(--bad); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip-filter span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.chip-filter:hover { border-color: #cfc4e6; }
.chip-filter.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-filter.on span { color: #c9c4d6; }
.bulk-bar { position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px 9px 16px; margin-bottom: 10px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); }
.bulk-bar strong { color: #fff; margin-right: 6px; }
.bulk-bar select { width: auto; height: 32px; background-color: #2a2535; border-color: #3b3549; color: #fff; }
.bulk-bar .text-btn { color: #c9c4d6; }
.t-body { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.targets td { padding: 9px 14px; }
th.cb, td.cb { width: 40px; padding-right: 0 !important; }
.person-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; max-width: 330px; }
.person-cell > div { min-width: 0; display: flex; flex-direction: column; }
.person-cell strong { color: var(--ink); font-size: 13.5px; }
.li-link { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #0a66c2; margin-left: auto; flex: none; }
.li-link:hover { background: #e8f1fb; }
.eng-link { font-weight: 600; font-size: 13px; display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.targets td:nth-child(3) .clamp1 { max-width: 210px; }
table.targets .person-cell .clamp1 { max-width: 230px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 4px; font-size: 13px; }

/* ---------- forecast ---------- */
.fc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scenario-tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.scenario-tabs button { height: 32px; padding: 0 15px; border: 0; border-radius: 999px; background: none; font-weight: 700; font-size: 13.5px; color: var(--body); cursor: pointer; display: inline-flex; align-items: center; }
.scenario-tabs button.on { background: var(--purple); color: #fff; }
.scenario-tabs button.add { width: 32px; padding: 0; justify-content: center; color: var(--purple); }
.scenario-tools { display: flex; gap: 2px; }
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--good); }
.save-state.busy { color: var(--muted); }
.fc-body { display: flex; flex-direction: column; gap: 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi-tile { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.kpi-tile .kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 25px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-tile.neg .kpi-value { color: var(--bad); }
.kpi-tile.pos .kpi-value { color: var(--ink); }
.kpi-note { font-size: 12px; color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 10px; position: relative; min-width: 0; }
.card .chart { border: 0; padding: 0; }
.chart figcaption { display: flex; flex-direction: column; margin-bottom: 8px; }
.chart figcaption strong { color: var(--ink); font-size: 15px; }
.chart figcaption .muted { font-size: 12.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.plot { width: 100%; position: relative; }
.plot svg { display: block; overflow: visible; }
.plot .grid { stroke: #eeecf3; stroke-width: 1; }
.plot .zero { stroke: #b9b5c4; stroke-width: 1; }
.plot .tick { font: 500 11px var(--font); fill: #8a8f9b; }
.plot .end-label { font: 700 12px var(--font); fill: var(--ink); }
.plot .hover-band { fill: #6a26d1; fill-opacity: .06; }
.chart-tip {
  position: absolute; top: 64px; z-index: 4; pointer-events: none; min-width: 160px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 11px; box-shadow: var(--shadow-pop); font-size: 12.5px;
}
.tip-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; color: var(--ink-2); padding: 1px 0; }
.tip-row .v { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tip-row.strong { border-top: 1px solid var(--line-2); margin-top: 3px; padding-top: 4px; font-weight: 700; }
.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.hb-row { display: grid; grid-template-columns: 180px 1fr 72px; gap: 10px; align-items: center; font-size: 13px; }
.hb-label { color: var(--ink-2); }
.hb-track { height: 10px; background: var(--line-2); border-radius: 0 99px 99px 0; }
.hb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-val { text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
dl.ue { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; }
dl.ue dt { padding: 10px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; }
dl.ue dt small { font-weight: 400; color: var(--muted); font-size: 12px; }
dl.ue dd { margin: 0; padding: 10px 0 10px 16px; border-bottom: 1px solid var(--line-2); text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-wrap { overflow-x: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; }
table.pnl { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
table.pnl th, table.pnl td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
table.pnl thead th { background: #fbfafd; color: var(--ink); font-weight: 700; font-size: 12.5px; position: sticky; top: 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
table.pnl thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
table.pnl .sticky { position: sticky; left: 0; text-align: left; background: #fff; z-index: 1; min-width: 250px; color: var(--ink-2); box-shadow: 1px 0 0 var(--line); }
table.pnl thead .sticky { background: #fbfafd; z-index: 2; }
table.pnl .sticky small { display: block; color: var(--muted); font-size: 11px; }
table.pnl tr.sec td { background: #f8f6fc; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--purple-ink); padding-top: 11px; }
table.pnl tr.sec .sticky { background: #f8f6fc; }
table.pnl tr.total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); }
table.pnl tr.margin td { color: var(--muted); font-size: 12px; font-style: italic; padding-top: 3px; }
table.pnl td.neg { color: var(--bad); }
table.pnl .tot { background: #fbfafd; font-weight: 700; color: var(--ink); }
table.pnl tr.sec .tot { background: #f8f6fc; }

.as-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.as-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.as-group .card-head { margin-bottom: 4px; }
.as-group .fine { margin: 0 0 10px; }
.as-fields { display: flex; flex-direction: column; }
.as-field { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.as-field:last-child { border-bottom: 0; }
.as-label { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.as-label small { font-weight: 400; color: var(--muted); font-size: 12px; }
.as-input { display: flex; align-items: center; gap: 6px; }
.as-input input, .as-input select { height: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.as-input select { text-align: left; }
.unit { font-size: 11.5px; color: var(--muted); white-space: nowrap; min-width: 50px; }
.as-years { display: flex; gap: 6px; align-items: flex-end; }
.as-years .yr { display: flex; flex-direction: column; gap: 2px; }
.as-years .yr small { font-size: 10.5px; color: var(--muted); }
.as-years input { height: 34px; width: 58px; text-align: right; padding: 0 8px; }
.as-field:has(.as-years) { grid-template-columns: minmax(0, 1fr) auto; }
.as-sub { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 2px; }
.as-sub > strong { color: var(--ink); font-size: 13.5px; }
.as-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr) auto; gap: 6px; align-items: end; background: var(--bg); border-radius: 12px; padding: 8px; }
.as-row .as-field { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0; border: 0; }
.as-row .as-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.as-row .as-label small { display: none; }
.as-row .unit { display: none; }
.as-row > input { height: 34px; }
.as-row .check { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; height: 34px; }
.as-row:has(> :nth-child(3):last-child) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr); }
.as-side .sticky-side { position: sticky; top: 20px; }
.as-side h2 { font-size: 16px; }
.as-preview { display: flex; flex-direction: column; margin-top: 10px; }
.pv-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.pv-row:last-child { border-bottom: 0; }
.pv-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-row.neg strong { color: var(--bad); }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.exp-add { display: grid; grid-template-columns: 150px minmax(0, 2fr) 150px 120px 120px auto; gap: 8px; }
table.exp td { vertical-align: top; }
.row-tools { display: flex; gap: 2px; justify-content: flex-end; }
table.compare th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink-2); background: #fff; font-weight: 600; }
table.compare th.on, table.compare td.on { background: var(--tint-2); color: var(--ink); font-weight: 700; }
table.compare td { font-variant-numeric: tabular-nums; }

/* ---------- brand ---------- */
.brand-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; align-items: start; }
.brand-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.brand-nav button { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px; border: 0; background: none; border-radius: 10px; color: var(--body); font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left; }
.brand-nav button:hover { background: var(--tint-2); color: var(--ink); }
.brand-nav button.on { background: var(--tint); color: var(--purple-ink); }
.brand-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.brand-sec { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; scroll-margin-top: 20px; }
.brand-sec-head { margin-bottom: 16px; }
.brand-sec-head h2 { font-size: 20px; font-weight: 800; }
.brand-sec-head p { margin-top: 4px; max-width: 760px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.logo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.logo-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.logo-card figcaption { display: flex; flex-direction: column; gap: 6px; }
.logo-card figcaption strong { color: var(--ink); }
.logo-card .dl-row { margin: 0; }
.logo-preview { height: 136px; border-radius: 16px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; }
.logo-preview.dark { background: linear-gradient(135deg, #6a26d1 0%, #54129c 55%, #3b016f 100%); border-color: transparent; }
.logo-preview img { max-width: 68%; max-height: 64px; }
.rules { display: grid; gap: 10px; margin-top: 16px; }
.rules.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rules.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rule { display: flex; gap: 11px; padding: 13px 14px; border-radius: 14px; background: var(--bg); }
.rule > span:last-child { display: flex; flex-direction: column; font-size: 13px; }
.rule strong { color: var(--ink); font-size: 13.5px; }
.rule-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--tint); color: var(--purple); }
.rule-ico.check { background: var(--good-bg); color: var(--good); }
.rule-ico.x { background: var(--bad-bg); color: var(--bad); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; color: var(--muted); }
.swatch:hover { border-color: var(--purple); color: var(--purple); }
.swatch-chip { width: 52px; height: 52px; border-radius: 11px; flex: none; box-shadow: inset 0 0 0 1px rgba(20,16,31,.08); }
.sw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; }
.sw-text strong { color: var(--ink); font-size: 13.5px; }
.sw-text code { color: var(--purple-deep); font-size: 12px; }
.gradient-card { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 26px 20px 16px; border-radius: 16px; color: #fff; font-weight: 700; background: linear-gradient(135deg, #6a26d1 0%, #54129c 55%, #3b016f 100%); }
.gradient-card code { color: #e6dcf7; font-size: 12px; font-weight: 500; }
.type-card { border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 12px; }
.type-hero { font-size: clamp(30px, 4vw, 52px); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.05; }
.type-body { max-width: 640px; margin: 12px 0 18px; font-size: 16px; line-height: 1.6; color: #6b7280; }
.type-weights { display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.type-weights span { display: flex; flex-direction: column; align-items: flex-start; }
.type-weights b { font-size: 30px; color: var(--ink); line-height: 1.1; }
.frame-demo { background: var(--purple); border-radius: 24px; padding: 22px; }
.frame-demo > div { background: #fff; border-radius: 20px; padding: 30px; display: flex; flex-direction: column; gap: 6px; }
.frame-demo strong { font-size: 28px; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); display: inline-block; }
.bg-group + .bg-group { margin-top: 20px; }
.bg-group h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.media-grid.screens .thumb { aspect-ratio: 16 / 10; }
.media { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.thumb { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); cursor: zoom-in; transition: border-color .15s, transform .15s; }
.thumb:hover { border-color: #cdb7f2; transform: translateY(-1px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.media figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.media figcaption > span { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; }
.media figcaption strong { color: var(--ink); font-size: 13.5px; }
.film-card { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
video.film, img.film { width: 100%; border-radius: 16px; display: block; background: #000; aspect-ratio: 16 / 9; }
.film-side { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.film-side .callout { margin-top: 6px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.icon-cell { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 12.5px; text-transform: capitalize; }
.icon-cell:hover { border-color: var(--purple); background: var(--tint-2); }
.tpl-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tpl { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.tpl:last-child { border-bottom: 0; }
.tpl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tpl-main strong { color: var(--ink); }
dialog.viewer { width: 100vw; height: 100vh; background: rgba(12, 9, 20, .92); display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 1fr auto; padding: 24px 12px 18px; }
dialog.viewer::backdrop { background: transparent; }
.viewer-stage { grid-column: 2; display: grid; place-items: center; min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: calc(100vh - 130px); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.4); background: repeating-conic-gradient(#2a2535 0 25%, #221e2c 0 50%) 0 0 / 20px 20px; }
.viewer-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; align-self: center; justify-self: center; }
.viewer-btn:hover { background: rgba(255,255,255,.2); }
.viewer-btn.close { position: absolute; top: 16px; right: 16px; }
.viewer-btn.prev { grid-column: 1; grid-row: 1; }
.viewer-btn.next { grid-column: 3; grid-row: 1; }
.viewer-cap { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 14px; color: #c9c4d6; font-size: 13.5px; padding-top: 14px; }
.viewer-cap strong { color: #fff; }
.viewer-n { color: #8f8a9c; }

/* ---------- sign in ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--purple); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 26px; padding: 36px 32px 28px; }
.login-card .logo { height: 34px; width: auto; display: block; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .lead { margin: 0 0 22px; }
.login-card .btn { width: 100%; margin-top: 6px; height: 44px; }
.login-card .back { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--body); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stage-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-layout { grid-template-columns: 1fr; }
  .as-side { order: -1; }
  .as-side .sticky-side { position: static; }
  .as-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 18px; }
  .exp-add { grid-template-columns: 1fr 1fr; }
  .exp-add input[name="item"] { grid-column: 1 / -1; }
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .film-card { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    padding: 10px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mobile-bar img { height: 26px; width: auto; display: block; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .tab-item.active { color: var(--purple); }
  .tab-item.active .ico { background: var(--tint); border-radius: 999px; padding: 2px 10px; width: 41px; height: 25px; }
  .page { padding: 20px 16px 96px; }
  .page-head h1 { font-size: 23px; }
  .grid-2, .grid-2.wide-left, .chart-grid, .as-main { grid-template-columns: 1fr; }
  .brand-layout { grid-template-columns: 1fr; }
  .brand-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .brand-nav::-webkit-scrollbar { display: none; }
  .brand-nav button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; }
  .rules.two, .rules.three { grid-template-columns: 1fr; }
  .toast { bottom: 86px; }
}
@media (max-width: 640px) {
  .stage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-row .kpi:last-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 21px; }
  .panel { padding: 18px 16px 40px; }
  .panel-meta { grid-template-columns: 1fr 1fr; }
  .composer-fields { flex-wrap: wrap; }
  .composer-fields input[type="date"] { width: 100%; }
  .doc-add { grid-template-columns: 1fr; }
  .search-box { min-width: 0; flex: 1; }
  .filters .seg-ctl { width: 100%; justify-content: center; }
  .filters .seg-ctl button { flex: 1; justify-content: center; }
  .dl-grid, .logo-grid { grid-template-columns: 1fr; }
  .brand-sec { padding: 18px 16px; }
  .as-field { grid-template-columns: 1fr; gap: 6px; }
  .as-row { grid-template-columns: 1fr 1fr; }
  .hb-row { grid-template-columns: 120px 1fr 64px; }
  .exp-add { grid-template-columns: 1fr; }
  /* Target table becomes cards on phones. */
  table.targets thead { display: none; }
  table.targets, table.targets tbody { display: block; }
  table.targets tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 8px; padding: 12px; border-bottom: 1px solid var(--line-2); }
  table.targets td { display: block; padding: 0 !important; border: 0; }
  table.targets td:nth-child(2) { grid-column: 2 / 4; }
  table.targets td:nth-child(3) { grid-column: 2 / 4; font-size: 12.5px; }
  table.targets td:nth-child(4) { grid-column: 2; }
  table.targets td:nth-child(5) { grid-column: 3; grid-row: 3; }
  table.targets td:nth-child(6), table.targets td:nth-child(7) { grid-column: 2 / 4; font-size: 12px; }
  table.targets td:empty { display: none; }
  .person-cell { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Grid children may shrink below their content, so long one-line text truncates instead of widening the page. */
.grid-2 > *, .chart-grid > *, .as-main > *, .kpi-grid > *, .brand-main > *, .as-layout > * { min-width: 0; }
@media (max-width: 640px) {
  .filters .search-box { flex: 1 1 100%; }
  .filters select { flex: 1; }
}

/* ---------- taqat Search ---------- */
.search-status { margin-bottom: 14px; }
.status-line { display: flex; align-items: center; gap: 14px; }
.status-line > div { flex: 1; display: flex; flex-direction: column; }
.status-line strong { color: var(--ink); font-size: 15.5px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); }
.status-dot.up { background: #1fa463; box-shadow: 0 0 0 5px #e6f4ec; }
.status-dot.down { background: var(--bad); box-shadow: 0 0 0 5px var(--bad-bg); }
.status-dot.wait { background: #c9c4d6; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .4; } }
.addr-list { display: flex; flex-direction: column; }
.addr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.addr:last-child { border-bottom: 0; }
.addr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.addr-url { font-weight: 700; color: var(--ink); word-break: break-all; }
.addr-url:hover { color: var(--purple); }
dl.ue dd.plain { font-weight: 600; font-size: 13.5px; white-space: normal; max-width: 330px; }
.fine.top0 { margin: -6px 0 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.step.done { background: #f6fbf8; border-color: #cfe9da; }
.step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--tint); color: var(--purple-ink); font-weight: 800; font-size: 13px; }
.step.done .step-n { background: var(--good); color: #fff; }
.step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-head strong { color: var(--ink); margin-right: 4px; }
code.code { font: 500 12px ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px 6px; color: var(--ink-2); word-break: break-all; }
.dns { display: flex; flex-direction: column; gap: 8px; }
.dns-row { display: grid; grid-template-columns: 52px 90px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; }
@media (max-width: 980px) { .bottom-nav { grid-template-columns: repeat(8, 1fr); } .tab-item { font-size: 9.5px; } }
@media (max-width: 640px) { .dns-row { grid-template-columns: 52px 1fr; } }
.card-head { flex-wrap: wrap; }

/* ---------- Emirati Jobs Finder ---------- */
.jobs-kpis { margin-top: 14px; }
.job-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 420px; }
td:has(> .job-cell) { display: flex; align-items: center; gap: 8px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); }
.hot-badge.in-targets { color: var(--purple-ink); background: var(--tint); }
.employer-badge { display: block; margin-top: 2px; font-size: 11px; }
.run-history { display: flex; gap: 3px; align-items: center; }
.run-tick { width: 6px; height: 18px; border-radius: 3px; background: #1fa463; }
.run-tick.cut { background: var(--bad); }
@media (max-width: 980px) { .jobs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .run-history { display: none; } }
.fit-col { text-align: center; }
.fit-pill { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 8px; font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; background: var(--line-2); color: var(--muted); }
.fit-pill.high { background: var(--good-bg); color: var(--good); }
.fit-pill.mid { background: var(--tint); color: var(--purple-ink); }
.fit-pill.low { background: var(--line-2); color: var(--ink-2); }
.chip-toggle.good.on { background: var(--tint); border-color: #d9c8f7; color: var(--purple-ink); }
.fit-box { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.fit-row { display: grid; grid-template-columns: 70px 44px 1fr; gap: 10px; align-items: center; }
.job-desc { max-height: 340px; overflow-y: auto; white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; padding: 10px 12px; background: var(--bg); border-radius: 12px; margin-top: 6px; }
.search-status.alarm { border-color: #f3c2bd; background: #fffafa; }
.status-dot.wait { animation: none; background: #e0a100; box-shadow: 0 0 0 5px #fdf3d8; }
details.cov { margin-top: 12px; }
details.cov summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cov-grid { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; overflow-x: auto; }
.cov-row { display: grid; grid-template-columns: 64px repeat(24, minmax(10px, 1fr)); gap: 2px; align-items: center; }
.cov-day { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cov-cell { height: 14px; border-radius: 3px; background: var(--line-2); }
.cov-cell.full { background: #1fa463; }
.cov-cell.part { background: #e0a100; }
.cov-cell.none { background: var(--bad); }
.cov-cell.future { background: transparent; border: 1px dashed var(--line); }
.cov-axis { grid-template-columns: 64px repeat(4, 1fr); }
.cov-tick { font-size: 10.5px; color: var(--muted); }
