/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; transition: all .15s ease; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(18,160,166,.3); }
.btn.primary:hover { background: var(--brand-600); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sidebar-hover); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
a.card { display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover, .card.hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }
:root[data-theme="dark"] .badge.brand { color: var(--brand); }
.badge.s-Bad { background: var(--s-bad); color: #fff; }
.badge.s-Bad::before { background: #fff; }
.badge.s-Negative { background: var(--s-neg-bg); color: var(--s-bad); border-color: color-mix(in srgb, var(--s-neg) 45%, transparent); }
.badge.s-Neutral { background: var(--s-neu-bg); color: var(--s-neu-ink); border-color: color-mix(in srgb, var(--s-neu) 55%, transparent); }
.badge.s-Positive { background: var(--s-pos-bg); color: var(--success); border-color: color-mix(in srgb, var(--s-pos) 45%, transparent); }
.badge.s-Owned { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.badge.demo { background: #FFF1C9; color: #7A5600; border-color: #F2D27A; }
.badge.demo::before { display: none; }
:root[data-theme="dark"] .badge.demo { background: rgba(247,201,74,.14); color: #F7C94A; border-color: rgba(247,201,74,.3); }

.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.input, .select { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border .15s, box-shadow .15s; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }

.seg { display: inline-flex; padding: 3px; background: var(--sidebar-hover); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.toggle { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background .2s; flex-shrink: 0; border: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(16px); }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--ink); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .hl { font-weight: 600; line-height: 1.4; }
.tbl tr.s-row-Bad td:first-child { box-shadow: inset 3px 0 0 var(--s-bad); }
.tbl tr.s-row-Negative td:first-child { box-shadow: inset 3px 0 0 var(--s-neg); }
.tbl tr.s-row-Neutral td:first-child { box-shadow: inset 3px 0 0 var(--s-neu); }
.tbl tr.s-row-Positive td:first-child { box-shadow: inset 3px 0 0 var(--s-pos); }

.bar { height: 7px; border-radius: 999px; background: var(--sidebar-hover); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

/* sentiment stack bar */
.sbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--sidebar-hover); gap: 2px; }
.sbar.lg { height: 16px; border-radius: 6px; }
.sbar.xl { height: 44px; border-radius: 10px; gap: 3px; }
.sbar > span { display: block; height: 100%; min-width: 2px; transition: flex .4s ease; }
.sbar.xl > span { display: flex; align-items: center; padding: 0 12px; font-weight: 800; font-size: 14px; color: #fff; overflow: hidden; white-space: nowrap; }
.sbar.xl > span.neu { color: #3D2E00; }
.sbar .bad { background: var(--s-bad); } .sbar .neg { background: var(--s-neg); } .sbar .neu { background: var(--s-neu); } .sbar .pos { background: var(--s-pos); } .sbar .own { background: var(--s-own); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.avatar.teal { background: var(--brand); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--border); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; }
.brandbar { height: 68px; display: flex; align-items: center; gap: 11px; padding: 0 20px; background: var(--navy); color: #fff; flex-shrink: 0; border-bottom: 3px solid var(--brand); }
.brandmark { display: grid; grid-template-columns: 11px 11px; gap: 3px; flex-shrink: 0; }
.brandmark i { width: 11px; height: 11px; border-radius: 2.5px; background: #fff; display: block; }
.brandmark i:nth-child(1) { background: var(--brand); } .brandmark i:nth-child(4) { background: var(--brand); }
.brandname { font-weight: 700; font-size: 17px; letter-spacing: -.01em; line-height: 1.1; }
.brandname small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.client-card { margin: 14px 14px 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.client-card b { display: block; font-size: 13px; line-height: 1.3; }
.client-card .small { margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav-sec { padding: 8px 0 6px; }
.nav-sec .eyebrow { padding: 0 12px 6px; display: block; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: all .15s; margin-bottom: 1px; }
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav a:hover { background: var(--sidebar-hover); color: var(--ink); }
.nav a.active { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
:root[data-theme="dark"] .nav a.active { background: var(--brand); color: #04262A; }
.nav a.active svg { opacity: 1; }
.nav a .tag { margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.nav a.active .tag { color: rgba(255,255,255,.6); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--s-bad); color: #fff; border-radius: 999px; padding: 1px 7px; }
.userbox { margin: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.userbox .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.userbox .two button { height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: 11px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.userbox .two button:hover { background: var(--sidebar-hover); color: var(--ink); }
.userbox .two svg { width: 13px; height: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.search { position: relative; width: min(380px, 100%); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-2); }
.search input { padding-left: 36px; background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .pip { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--s-bad); border: 2px solid var(--surface); }
.entity-seg button .dot { width: 8px; height: 8px; border-radius: 50%; }

.page { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); font-size: 31px; font-weight: 600; margin: 4px 0 0; letter-spacing: -.015em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.crumb svg { width: 13px; height: 13px; }
.source-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); border: 1px dashed var(--border-strong); padding: 5px 11px; border-radius: 999px; background: var(--surface); font-weight: 600; }
.source-chip svg { width: 13px; height: 13px; }

.demo-banner { display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin-bottom: 18px; border-radius: 12px; background: #FFF6DA; border: 1px solid #F2D27A; color: #6B4B00; font-size: 13px; }
.demo-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.demo-banner b { font-weight: 800; }
:root[data-theme="dark"] .demo-banner { background: rgba(247,201,74,.1); border-color: rgba(247,201,74,.28); color: #F7D57A; }

.grid { display: grid; gap: 16px; }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.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-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 16px; }
.mt-l { margin-top: 26px; }

/* KPI tile */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .k-label svg { width: 15px; height: 15px; color: var(--brand); }
.kpi .k-value { font-family: var(--serif); font-size: 34px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 15px; color: var(--muted); font-family: var(--font); font-weight: 700; margin-left: 3px; }
.kpi .k-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kpi.tone-bad { border-top: 3px solid var(--s-bad); }
.kpi.tone-neg { border-top: 3px solid var(--s-neg); }
.kpi.tone-neu { border-top: 3px solid var(--s-neu); }
.kpi.tone-pos { border-top: 3px solid var(--s-pos); }
.kpi.tone-brand { border-top: 3px solid var(--brand); }
.kpi canvas.spark { position: absolute; right: 14px; bottom: 14px; width: 96px !important; height: 34px !important; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 12px; }
.delta svg { width: 13px; height: 13px; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }

.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 210px; }
.chart-box.lg { height: 330px; }
.chart-box.xl { height: 420px; }

/* hero */
.hero { background: radial-gradient(1200px 300px at 100% 0%, rgba(18,160,166,.35), transparent 60%), linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border: 0; position: relative; overflow: hidden; padding: 28px 30px; }
.hero::after { content: ''; position: absolute; right: -120px; bottom: -180px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 61px rgba(255,255,255,.08); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #7FD6D9; }
.hero h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.15; margin: 10px 0 8px; letter-spacing: -.01em; }
.hero p { color: #BAC5D9; margin: 0; max-width: 680px; font-size: 14.5px; }
.hero b.hl-bad { color: #FF9A8A; } .hero b.hl-pos { color: #8FE3A5; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; }
.hero-stats div b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.hero-stats div span { font-size: 12px; color: #9DAAC2; font-weight: 600; }
.hero .chip-dark { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); font-size: 12px; font-weight: 700; color: #E5ECF7; }
.hero .chip-dark svg { width: 14px; height: 14px; }

/* gauge ring */
.ring { --v: 50; --c: var(--brand); width: 148px; height: 148px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--sidebar-hover) 0); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--serif); font-size: 30px; font-weight: 600; display: block; line-height: 1; }
.ring span { font-size: 11px; color: var(--muted); font-weight: 700; }
.ring .tick { position: absolute; inset: 0; border-radius: 50%; }
.ring .tick::before { content: ''; position: absolute; left: 50%; top: -3px; width: 3px; height: 20px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }

/* entity cards */
.ent-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.ent-card .ent-top { display: flex; align-items: center; gap: 12px; }
.ent-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex-shrink: 0; font-weight: 800; font-size: 13px; }
.ent-icon svg { width: 19px; height: 19px; }
.ent-aisha { background: var(--navy); } .ent-felak { background: var(--brand); } .ent-oceangate { background: var(--blue); }
.ent-num { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini-stats div { text-align: center; padding: 6px 0; border-radius: 8px; background: var(--surface-2); }
.mini-stats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* list rows */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover .lr-title { color: var(--brand-600); }
.lr-title { font-weight: 600; font-size: 13px; line-height: 1.38; }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sdot.Bad { background: var(--s-bad); } .sdot.Negative { background: var(--s-neg); } .sdot.Neutral { background: var(--s-neu); } .sdot.Positive { background: var(--s-pos); } .sdot.Owned { background: var(--s-own); }

/* filters + toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input, .toolbar .select { height: 34px; width: auto; font-size: 13px; }
.toolbar .search { width: 300px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); transition: all .12s; }
.fchip:hover { border-color: var(--border-strong); }
.fchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .fchip.on { background: var(--brand); border-color: var(--brand); color: #04262A; }
.fchip .n { font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---------- findings (deck styling) ---------- */
.slide { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.slide-head { padding: 26px 28px 6px; }
.slide-head h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 40px; line-height: 1; margin: 0; letter-spacing: .003em; }
.slide-head p { margin: 8px 0 0; color: var(--muted); }
.slide-body { padding: 18px 28px 28px; }
.tile { padding: 18px 20px; border-radius: 10px; color: #fff; display: flex; flex-direction: column; min-height: 150px; }
.tile .eyebrow { color: inherit; opacity: .9; }
.tile .big { font-family: var(--display); font-size: 64px; line-height: 1; margin: 12px 0 6px; }
.tile.bad { background: var(--s-bad); } .tile.neg { background: var(--s-neg); } .tile.neu { background: var(--s-neu); color: #241A00; } .tile.pos { background: var(--s-pos); color: #072B12; }
.tile.blue { background: var(--blue); } .tile.navy { background: var(--navy); } .tile.light { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.tile.outline { background: var(--surface); color: var(--ink); border: 3px solid var(--ink); }
.cover { display: grid; grid-template-columns: 1.25fr 1fr; min-height: 340px; }
.cover-left { background: var(--blue); color: #fff; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; }
.cover-left h1 { font-family: var(--display); font-weight: 400; font-size: 76px; line-height: .95; margin: 0; text-transform: uppercase; }
.cover-right { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr auto; gap: 10px; padding: 10px; background: var(--surface-2); }
.cover-right .keys { grid-column: 1 / -1; }
.implication { padding: 22px; border-radius: 10px; min-height: 280px; display: flex; flex-direction: column; color: #fff; }
.implication .big { font-family: var(--display); font-size: 84px; line-height: .9; }
.implication h4 { font-size: 22px; font-weight: 600; margin: 12px 0 0; }
.implication p { margin-top: auto; font-size: 14.5px; line-height: 1.5; }
.implication.bad { background: var(--s-bad); } .implication.blue { background: var(--blue); } .implication.neutral { background: var(--s-neu); color: #1E1600; } .implication.pos { background: var(--s-pos); color: #052310; }

/* cluster cards */
.cl-card { padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.cl-code { font-family: var(--display); font-size: 26px; line-height: 1; }
.cl-tone-bad .cl-code { color: var(--s-bad); } .cl-tone-pos .cl-code { color: var(--success); } .cl-tone-mixed .cl-code { color: var(--s-neu-ink); }

/* SERP strip */
.serp { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.serp i { height: 18px; border-radius: 4px; display: block; }
.serp.lg i { height: 30px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; }
.serp i.Bad { background: var(--s-bad); } .serp i.Negative { background: var(--s-neg); } .serp i.Neutral { background: var(--s-neu); color: #3D2E00; } .serp i.Positive { background: var(--s-pos); } .serp i.Owned { background: var(--s-own); }
.serp-result { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.serp-result:last-child { border-bottom: 0; }
.serp-pos { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); }
.serp-url { font-size: 11.5px; color: var(--success); }
.term-row { cursor: pointer; }
.term-row.on td { background: var(--brand-50); }

/* gantt / timeline */
.gantt { position: relative; }
.gantt-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-track { position: relative; height: 30px; background: var(--surface-2); border-radius: 8px; }
.gantt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.gantt-bar.p1 { background: var(--brand); } .gantt-bar.p2 { background: var(--blue); } .gantt-bar.p3 { background: var(--navy); } .gantt-bar.p4 { background: #5B6E95; } .gantt-bar.p5 { background: #8A99B8; }
.gantt-axis { display: grid; grid-template-columns: 170px 1fr; gap: 14px; font-size: 10.5px; font-weight: 800; color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; }
.gantt-axis .ticks { position: relative; height: 18px; }
.gantt-axis .ticks span { position: absolute; transform: translateX(-50%); }
.gantt-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--s-bad); border-radius: 2px; }
.gantt-now::after { content: 'Today'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: var(--s-bad); }
.ms { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ms:last-child { border-bottom: 0; }
.ms-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; background: var(--surface); }
.ms-dot svg { width: 14px; height: 14px; }
.ms.done .ms-dot { background: var(--success); border-color: var(--success); color: #fff; }
.ms.next .ms-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }

/* bubble timeline legend */
.heat { display: grid; gap: 3px; font-size: 11px; }
.heat .hcell { height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.heat .hhead { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: center; align-self: end; padding-bottom: 4px; }
.heat .hrow { font-weight: 700; display: flex; align-items: center; color: var(--ink-2); font-size: 12px; }

/* drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(10, 18, 36, .42); backdrop-filter: blur(2px); z-index: 60; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .25s ease; border-left: 1px solid var(--border); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 22px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 500; }
.callout { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; font-size: 13px; z-index: 90; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: toast .25s ease; }
.toast svg { width: 16px; height: 16px; color: #5FE0B0; }
@keyframes toast { from { transform: translate(-50%, 10px); opacity: 0; } }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { background: radial-gradient(900px 400px at 0% 100%, rgba(18,160,166,.35), transparent 60%), var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); right: -220px; top: -180px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 81px rgba(255,255,255,.09); }
.login-art > * { position: relative; z-index: 1; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.role-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; margin-bottom: 8px; transition: all .12s; }
.role-opt:hover { border-color: var(--border-strong); }
.role-opt.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.role-opt input { accent-color: var(--brand); }

.empty { text-align: center; padding: 40px; color: var(--muted); }
.foot-note { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 1280px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover { grid-template-columns: 1fr; }
  .entity-seg .lbl { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -270px; z-index: 70; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .g-5, .g-3, .g-2, .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 16px; }
  .topbar .search { display: none; }
  .menu-btn { display: grid !important; }
  .page { padding: 18px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .gantt-row, .gantt-axis { grid-template-columns: 110px 1fr; }
}

@media print {
  .sidebar, .topbar, .btn, .seg, .toolbar { display: none !important; }
  .page { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
}

svg.inline { width: 13px; height: 13px; vertical-align: -2px; }
.callout > svg, .foot-note svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* per-page subject filter */
.ent-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin: -6px 0 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.ent-filter > .eyebrow { margin: 0 6px 0 4px; }
.ent-opt { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.ent-opt svg { width: 16px; height: 16px; }
.ent-opt .n { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--sidebar-hover); color: var(--muted); font-variant-numeric: tabular-nums; }
.ent-opt:hover { border-color: var(--border-strong); color: var(--ink); }
.ent-opt.on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--shadow); }
.ent-opt.on .n { background: rgba(255,255,255,.18); color: #fff; }
.ent-opt.ent-o-felak.on { background: var(--brand); border-color: var(--brand); }
.ent-opt.ent-o-oceangate.on { background: var(--blue); border-color: var(--blue); }
:root[data-theme="dark"] .ent-opt.on { background: var(--brand); border-color: var(--brand); color: #04262A; }
:root[data-theme="dark"] .ent-opt.ent-o-oceangate.on { background: var(--blue); color: #fff; }
@media (max-width: 1100px) { .ent-opt span:not(.n) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* findings appendix */
.app-tab { min-height: 116px; border: 0; cursor: pointer; text-align: left; font: inherit; transition: transform .12s, box-shadow .12s; }
.app-tab:hover { transform: translateY(-2px); }
.app-tab.on { box-shadow: inset 0 0 0 4px var(--ink); }
.app-tbl .app-group td { background: var(--surface-2); border-top: 2px solid var(--ink); font-size: 13px; position: sticky; top: 0; }
.app-tbl td.hl { color: var(--blue, #2337C6); }

/* ---------- sign-in ---------- */
.login-points { display: grid; gap: 12px; margin-top: 28px; color: #D5DDEA; font-size: 14px; }
.login-points div { display: flex; align-items: center; gap: 10px; }
.login-points svg { width: 18px; height: 18px; color: #7FD6D9; }
.login-steps { display: flex; gap: 6px; margin-bottom: 26px; flex-wrap: wrap; }
.login-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.login-steps span.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.login-steps span.done { color: var(--brand-600); border-color: var(--brand-100); background: var(--brand-50); }
.login-steps svg { width: 12px; height: 12px; }
.form-error { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--s-neg-bg); color: var(--s-bad); font-size: 13px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--s-neg) 40%, transparent); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; display: grid; }
.pw-eye svg { width: 17px; height: 17px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-boxes .otp { height: 56px; text-align: center; font-size: 24px; font-weight: 800; padding: 0; }
.spin { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell additions ---------- */
.user-btn { width: 100%; border: 0; background: transparent; padding: 6px; margin: -6px -6px 6px; border-radius: 10px; cursor: pointer; color: inherit; font: inherit; gap: 10px; }
.user-btn:hover { background: var(--sidebar-hover); }
.user-btn > svg { width: 16px; height: 16px; color: var(--muted); }
.nav .tag.live, .nav a.active .tag.live { display: inline-flex; align-items: center; gap: 5px; color: var(--success); background: var(--s-pos-bg); padding: 2px 7px; border-radius: 999px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--s-pos); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,181,90,.55); } 70% { box-shadow: 0 0 0 7px rgba(61,181,90,0); } 100% { box-shadow: 0 0 0 0 rgba(61,181,90,0); } }
.toast.err { background: #8E1F12; }
.toast.err svg { color: #FFB4A8; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: calc(100vh - 40px); background: var(--surface); z-index: 61; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border: 1px solid var(--border); animation: fadein .18s; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.select.sm { height: 30px; font-size: 12px; padding: 0 8px; width: auto; }
.toggle.sm { width: 30px; height: 17px; }
.toggle.sm::after { width: 13px; height: 13px; }
.toggle.sm.on::after { transform: translateX(13px); }
.chk { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.chk input { accent-color: var(--brand); }
.code-pill { background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 6px; font-weight: 800; letter-spacing: .08em; }
.pdf-card { margin-left: auto; opacity: .55; }
.card-head .pdf-card, .slide-head .pdf-card { flex-shrink: 0; }
.card:hover .pdf-card, .slide:hover .pdf-card { opacity: 1; }
.slide-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.slide-head > h2 { flex: 1; }

/* ---------- live feed ---------- */
.live-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 14px 18px; border-left: 4px solid var(--s-pos); }
.live-pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--s-pos); flex-shrink: 0; animation: pulse 1.8s infinite; }
.feed-tools { padding: 14px 20px; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.search.sm svg { top: 8px; }
.feed-day { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.feed-card { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 12px 20px; margin-bottom: 12px; background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.feed-card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--rail); }
.feed-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.feed-card.is-hidden { opacity: .55; }
.fc-top { display: flex; align-items: flex-start; gap: 12px; }
.fc-pub-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; color: var(--ink-2); }
.fc-pub-ico svg { width: 17px; height: 17px; }
.fc-pub { font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-title { font-size: 16.5px; line-height: 1.35; margin: 10px 0 4px; font-weight: 700; }
.fc-title a { color: var(--ink); text-decoration: none; }
.fc-title a:hover { color: var(--blue); text-decoration: underline; }
.fc-snippet { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.badge.suggested { background: transparent !important; border: 1.5px dashed currentColor; }
.badge.suggested::before { display: none; }
.badge.suggested.s-Bad { color: var(--s-bad); }
.seg.sm button { padding: 4px 9px; font-size: 11px; }
.seg.review button.on.s-Bad { background: var(--s-bad); color: #fff; }
.seg.review button.on.s-Negative { background: var(--s-neg); color: #fff; }
.seg.review button.on.s-Neutral { background: var(--s-neu); color: #3A2A00; }
.seg.review button.on.s-Positive { background: var(--s-pos); color: #fff; }
.recip-list { margin-top: 14px; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.recip { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; }
.recip.off { opacity: .55; }
.recip-mail { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hour-pick { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- PDF export ---------- */
#printRoot { display: none; }
@page { size: A4; margin: 14mm 12mm; }
@media print {
  body.printing #root, body.printing .scrim, body.printing .drawer, body.printing .modal, body.printing .toast { display: none !important; }
  body.printing #printRoot { display: block; }
  body.printing { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printRoot .print-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 3px solid #0F2142; color: #18233A; }
  #printRoot .page { padding: 0; max-width: none; }
  #printRoot .card, #printRoot .slide, #printRoot .tile, #printRoot .feed-card, #printRoot tr, #printRoot .kpi { break-inside: avoid; box-shadow: none; }
  #printRoot .slide { margin-top: 18px; }
  #printRoot .print-chart { max-width: 100%; height: auto; display: block; }
  #printRoot .chart-box { height: auto !important; }
  #printRoot .table-wrap { overflow: visible; max-height: none !important; }
  #printRoot a { color: inherit; text-decoration: none; }
  #printRoot .fc-actions, #printRoot .page-actions { display: none; }
  #printRoot .grid.g-21 { grid-template-columns: 1fr; }
}
