:root {
  color-scheme: dark;
  --bg: #020608;
  --frame: #060b10;
  --panel: #091017;
  --panel-2: #0c151e;
  --panel-3: #101b26;
  --line: #1a2a39;
  --line-strong: #263b50;
  --ink: #f4f8fd;
  --muted: #8795a5;
  --subtle: #5d6a78;
  --blue: #0d6bff;
  --blue-soft: rgba(13, 107, 255, .18);
  --green: #61dc5a;
  --green-soft: rgba(97, 220, 90, .16);
  --amber: #f5b849;
  --amber-soft: rgba(245, 184, 73, .16);
  --violet: #8b6cff;
  --violet-soft: rgba(139, 108, 255, .16);
  --danger: #ff716b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

body.light {
  color-scheme: light;
  --bg: #e9eef5;
  --frame: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --panel-3: #eef3f8;
  --line: #d8e1ea;
  --line-strong: #bdcad8;
  --ink: #101722;
  --muted: #627184;
  --subtle: #7c8998;
  --shadow: 0 24px 70px rgba(26, 39, 56, .14);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 20% 0%, rgba(13, 107, 255, .14), transparent 30rem), var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: #55a0ff; text-decoration: none; font-size: 12px; }

.desktop-frame { width: min(1580px, calc(100vw - 24px)); min-height: calc(100vh - 36px); margin: 18px auto; display: grid; grid-template-columns: 210px minmax(0, 1fr) 255px; overflow: hidden; border: 1px solid #121a21; border-radius: 18px; background: var(--frame); box-shadow: var(--shadow); }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 20px 14px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(13,107,255,.13), transparent 220px), #050c13; }
body.light .sidebar { background: #ffffff; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 22px; font-size: 19px; line-height: 1.05; }
.brand-icon { position: relative; width: 30px; height: 42px; }
.brand-icon span { position: absolute; bottom: 0; width: 4px; border-radius: 6px 6px 0 0; background: var(--blue); box-shadow: 0 0 14px rgba(13, 107, 255, .6); }
.brand-icon span:nth-child(1) { left: 0; height: 25px; }
.brand-icon span:nth-child(2) { left: 7px; height: 38px; }
.brand-icon span:nth-child(3) { left: 14px; height: 31px; }
.brand-icon span:nth-child(4) { left: 21px; height: 19px; }
.primary-nav, .saved-views { display: grid; gap: 5px; }
.nav-item, .saved-views button, .settings-button { position: relative; min-height: 34px; border: 0; border-radius: 7px; padding: 0 10px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; transition: background .16s ease, color .16s ease; }
.nav-item { display: flex; align-items: center; gap: 10px; }
.nav-item span { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; color: #bcd0e6; font-size: 10px; }
.nav-item.active, .nav-item:hover { background: linear-gradient(90deg, #0c3b86, #0d6bff); color: #fff; box-shadow: inset 3px 0 0 #66a6ff, 0 0 0 1px rgba(85, 160, 255, .18); }
.nav-item.active::after { content: ""; position: absolute; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: #66a6ff; box-shadow: 0 0 10px #66a6ff; }
.nav-item.active span { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; }
.saved-views { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.small-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.saved-views #resetData { margin-top: 8px; color: var(--danger); }
.workspace-tools { display: grid; gap: 7px; margin: 0 8px 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.workspace-tools select { width: 100%; min-height: 32px; font-size: 12px; }
.workspace-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.workspace-actions button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--ink); font-size: 11px; font-weight: 850; }
.launch-button { min-height: 30px; border: 1px solid rgba(85,160,255,.42); border-radius: 7px; background: var(--blue-soft); color: #8fbfff; font-size: 11px; font-weight: 900; }
.student-mini { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; margin: auto 8px 10px; }
.avatar, .person { display: grid; place-items: center; border-radius: 50%; color: #07111c; font-weight: 900; }
.avatar { width: 38px; height: 38px; background: linear-gradient(145deg, #e8f2ff, #7bb8ff); font-size: 12px; }
.student-mini strong { font-size: 13px; }
.student-mini p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.settings-button { margin: 0 8px; border: 1px solid var(--line); background: var(--panel-2); text-align: center; color: var(--ink); }

.app-surface { min-width: 0; padding: 16px; border-right: 1px solid var(--line); }
.topbar, .network-bar, .top-actions, .section-head, .student-profile, .table-footer { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.network-bar, .top-actions { gap: 8px; min-width: 0; }
.network-bar { overflow-x: auto; scrollbar-width: thin; }
.network-select, .network-tab, .chip, .circle-action, .bell, .theme-cluster, .add-button, .ghost-button, .link-row { border: 1px solid var(--line); border-radius: 7px; min-height: 34px; background: var(--panel-2); color: var(--ink); }
.network-select { padding: 0 14px; white-space: nowrap; }
.network-tab { border-color: transparent; color: var(--muted); white-space: nowrap; }
.chip { min-height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.chip.blue { color: #8fbfff; background: var(--blue-soft); }
.chip.green { color: #91ef8b; background: var(--green-soft); }
.chip.violet { color: #b6a6ff; background: var(--violet-soft); }
.chip.amber { color: #ffd27a; background: var(--amber-soft); }
.circle-action { display: grid; place-items: center; width: 30px; min-height: 30px; padding: 0; }
.add-button { padding: 0 16px; border-color: #166fff; background: #0d6bff; color: #fff; font-weight: 800; }
.search-wrap { display: grid; grid-template-columns: 18px minmax(120px, 170px); align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: var(--panel-2); }
.search-wrap span { width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; position: relative; }
.search-wrap span::after { content: ""; position: absolute; width: 7px; height: 2px; right: -6px; bottom: -3px; rotate: 45deg; background: var(--muted); }
.search-wrap input { width: 100%; min-height: 28px; border: 0; padding: 0; background: transparent; color: var(--ink); outline: none; }
.theme-cluster { display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.theme-cluster span { width: 18px; height: 18px; border-radius: 50%; background: #1b2430; box-shadow: inset -5px 0 0 #fff; }
.theme-cluster strong { width: 24px; height: 24px; border-radius: 50%; background: #0d6bff; }
.bell { width: 34px; position: relative; }
.bell::before { content: ""; position: absolute; left: 11px; top: 8px; width: 10px; height: 13px; border: 2px solid var(--muted); border-radius: 7px 7px 4px 4px; }
.bell::after { content: ""; position: absolute; right: 8px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.student-profile { justify-content: space-between; gap: 18px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(9,16,23,.76); }
body.light .student-profile { background: #fff; }
.student-profile strong { display: block; margin-top: 3px; font-size: 13px; }
.student-profile p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.student-profile label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
select, input, textarea { border: 1px solid var(--line); border-radius: 7px; min-height: 34px; padding: 0 10px; background: var(--panel-2); color: var(--ink); }
textarea { padding: 10px; line-height: 1.4; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(315px, 355px); gap: 14px; }
.main-column, .right-column { display: grid; gap: 14px; align-content: start; min-width: 0; }
.section-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(9,16,23,.88); box-shadow: inset 0 1px 0 rgba(255,255,255,.03); scroll-margin-top: 14px; }
body.light .section-card { background: #fff; }
.section-head { justify-content: space-between; gap: 12px; padding: 14px 14px 8px; }
h1, h2, p { margin: 0; }
h1, h2 { font-size: 16px; letter-spacing: 0; }
.text-button { border: 0; background: transparent; color: #55a0ff; font-size: 12px; cursor: pointer; }
#resultCount, #pipelineHint, .timeline-section .section-head span { color: var(--muted); font-size: 12px; }

.goals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 14px 14px; }
.goal-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 14px; background: var(--panel-2); }
.goal-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.goal-icon { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; color: #8ab9ff; font-size: 10px; }
.goal-main { display: flex; align-items: baseline; gap: 6px; margin: 13px 0 8px; }
.goal-main strong { font-size: 30px; line-height: 1; }
.goal-main span, .goal-card small { color: var(--muted); }
.goal-card small { display: block; margin-top: 8px; font-size: 11px; }
.goal-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #162333; }
.goal-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0d6bff, #58a0ff); }
.goal-card.green .goal-bar span { background: var(--green); }
.goal-card.green small { color: var(--green); }

.toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; }
.toolbar-row select { min-height: 30px; font-size: 12px; }
.opportunity-table { padding: 0 0 4px; overflow-x: auto; }
.opp-row { display: grid; grid-template-columns: 64px minmax(220px, 1.25fr) minmax(220px, .95fr) 92px 128px 138px 112px; align-items: center; gap: 14px; min-width: 1030px; min-height: 104px; padding: 12px 14px; border-top: 1px solid var(--line); }
.opp-row.selected { background: rgba(13, 107, 255, .08); box-shadow: inset 3px 0 0 var(--blue); }
.logo, .opp-title, .fit-cell { border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.logo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 7px; background: #fff; color: #05090d; font-size: 13px; font-weight: 950; text-align: center; }
.logo.dark { background: #020202; color: #fff; border: 1px solid #1d1d1d; }
.opp-title { min-width: 0; padding: 0; }
.opp-title strong { display: block; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.opp-title p, .opp-col span, .fit-explain { color: var(--muted); font-size: 11px; line-height: 1.35; }
.opp-title p { margin-top: 3px; }
.opp-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.opp-tags span, .network-badge { border-radius: 4px; padding: 2px 5px; background: var(--panel-3); color: var(--muted); font-size: 10px; }
.fit-cell { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; padding: 0; }
.fit-circle { display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--green); border-radius: 50%; color: var(--green); font-size: 13px; font-weight: 900; }
.fit-explain { display: -webkit-box; max-width: 100%; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; word-break: normal; overflow-wrap: anywhere; }
.opp-col { min-width: 0; }
.opp-col strong { display: block; color: var(--amber); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.opp-col .plain { color: var(--ink); }
.opp-col select { width: 100%; min-height: 30px; padding: 0 6px; font-size: 11px; }
.danger { color: var(--danger) !important; }
.opp-actions { display: flex; justify-content: flex-end; gap: 7px; min-width: 104px; }
.opp-actions button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.table-footer { justify-content: space-between; padding: 8px 14px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.table-footer button { border: 0; background: transparent; color: #55a0ff; }

.pipeline-board { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 8px; padding: 0 14px 14px; overflow-x: auto; }
.stage { min-height: 188px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: var(--panel-2); }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.stage-head span:first-child { display: flex; align-items: center; gap: 6px; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.stage-card { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel); color: var(--ink); text-align: left; font-size: 11px; cursor: pointer; }
.stage-card:hover { border-color: var(--line-strong); background: var(--panel-3); }
.stage-card strong { display: block; margin-bottom: 4px; font-size: 11px; }
.stage-add { width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; }

.selected-card { min-height: 230px; }
.selected-summary { display: grid; gap: 6px; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.selected-summary strong { font-size: 15px; }
.selected-summary p { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-label { display: grid; gap: 6px; padding: 10px 14px 0; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.field-label textarea { min-height: 78px; resize: vertical; text-transform: none; font-weight: 500; }
.checklist { display: grid; gap: 8px; padding: 12px 14px 0; }
.checklist label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-transform: none; font-weight: 600; }
.checklist input { min-height: auto; }

.contacts-card, .news-card, .notes-card { overflow: hidden; }
.connections-card { overflow: hidden; }
.launch-card { overflow: hidden; }
.launch-steps { display: grid; gap: 8px; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.launch-steps label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.launch-steps label.done { color: var(--ink); }
.launch-steps input { width: 14px; min-height: 14px; accent-color: var(--green); }
.launch-actions { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; }
.launch-actions button { min-height: 32px; }
.cloud-status { margin: 0; padding: 0 12px 12px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.feedback-card { overflow: hidden; }
.feedback-form { display: grid; gap: 8px; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.feedback-form textarea { min-height: 66px; resize: vertical; }
.feedback-list { display: grid; gap: 8px; padding: 10px 12px 12px; }
.feedback-list article:not(.empty-state) { border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: var(--panel-2); }
.feedback-list span { color: #8fbfff; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.feedback-list p { margin-top: 4px; color: var(--ink); font-size: 12px; line-height: 1.35; }
.feedback-list small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.launch-guide { display: grid; gap: 10px; }
.launch-guide article { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: var(--panel-2); }
.launch-guide strong { display: block; font-size: 13px; }
.launch-guide p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.connections-form { display: grid; gap: 9px; padding: 0 12px 12px; }
.connections-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.connections-form textarea { min-height: 64px; resize: vertical; text-transform: none; }
.connections-form button { width: 100%; }
.contact-row, .news-row, .note-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); }
.person { width: 34px; height: 34px; background: linear-gradient(145deg, #ffe1ba, #8bc9ff); font-size: 11px; }
.contact-main strong, .news-main strong, .note-row strong { display: block; font-size: 12px; }
.contact-main p, .news-main p, .note-row p { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.follow-up { border: 0; background: transparent; color: var(--amber); font-size: 11px; font-weight: 850; text-align: right; cursor: pointer; }
.news-thumb { width: 48px; height: 34px; border-radius: 5px; background: linear-gradient(135deg, #345b79, #d9aa56); }
.note-row { grid-template-columns: 38px minmax(0, 1fr) 24px; }
.note-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; color: #d5e6f8; }
.note-row button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.link-row { width: calc(100% - 24px); margin: 8px 12px 12px; border: 0; background: transparent; color: #55a0ff; font-size: 12px; }
.timeline-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 14px 14px; }
.timeline-item { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: var(--panel-2); }
.timeline-item span { color: var(--amber); font-size: 12px; font-weight: 900; }
.timeline-item strong { display: block; margin-top: 5px; font-size: 13px; }
.timeline-item p { margin-top: 4px; color: var(--muted); font-size: 11px; }

.phone-preview { display: grid; place-items: center; padding: 0 18px; background: radial-gradient(circle at center, rgba(13,107,255,.18), transparent 14rem); }
.phone { width: 238px; height: 520px; border: 9px solid #07090b; border-radius: 36px; background: #050a0f; box-shadow: 0 0 0 1px #29313a, 0 20px 60px rgba(0,0,0,.55); overflow: hidden; color: #fff; }
.phone-status, .phone-header, .phone-network, .phone-section-head, .phone-nav { display: flex; align-items: center; justify-content: space-between; }
.phone-status { padding: 12px 15px 5px; font-size: 10px; }
.phone-status span:last-child { width: 42px; height: 9px; border-radius: 99px; background: linear-gradient(90deg, #fff 60%, transparent 60%); opacity: .8; }
.phone-header { padding: 4px 12px 10px; font-size: 11px; }
.phone-header button { width: 22px; height: 22px; border: 0; background: transparent; position: relative; }
.phone-header button:first-child::before { content: ""; position: absolute; left: 3px; top: 6px; width: 15px; height: 2px; background: #fff; box-shadow: 0 5px 0 #fff, 0 10px 0 #fff; }
.phone-header button:last-child::before { content: ""; position: absolute; inset: 5px; border: 1px solid #fff; border-radius: 8px 8px 4px 4px; }
.phone-network { margin: 0 10px 12px; border: 1px solid #203143; border-radius: 7px; padding: 8px; font-size: 10px; }
.phone-network button { border: 0; border-radius: 50%; background: #0d6bff; color: #fff; }
.phone-section { padding: 0 10px 12px; }
.phone-section-head { margin-bottom: 8px; font-size: 11px; }
.phone-section-head a { font-size: 10px; }
.phone-goals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.phone-goal { text-align: center; font-size: 9px; color: var(--muted); }
.ring { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto 4px; border: 2px solid var(--green); border-radius: 50%; color: #fff; font-size: 9px; }
.phone-opp, .phone-follow { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; min-height: 49px; border-top: 1px solid #172638; font-size: 10px; }
.phone-opp-logo { display: grid; place-items: center; width: 36px; height: 30px; border-radius: 5px; background: #fff; color: #000; font-weight: 900; font-size: 9px; }
.phone-opp strong, .phone-follow strong { display: block; }
.phone-opp p, .phone-follow p { color: var(--muted); font-size: 9px; }
.phone-score { color: var(--green); text-align: right; }
.phone-add { width: 100%; min-height: 34px; border: 0; border-radius: 6px; background: #0d6bff; color: #fff; font-weight: 850; }
.phone-nav { height: 42px; margin: 0 10px; border-top: 1px solid #172638; font-size: 9px; color: var(--muted); }
.phone-nav .active { color: #55a0ff; }

.modal { width: min(780px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.68); }
.modal-body { padding: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.form-grid textarea { min-height: 82px; resize: vertical; }
.onboarding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.onboarding-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.onboarding-grid textarea { min-height: 74px; resize: vertical; }
.wide { grid-column: 1 / -1; }
menu { display: flex; justify-content: flex-end; gap: 10px; margin: 14px 0 0; padding: 0; }
.ghost-button { padding: 0 14px; }

@media (max-width: 1360px) {
  .desktop-frame { grid-template-columns: 210px minmax(0, 1fr); }
  .phone-preview { display: none; }
}
@media (max-width: 1120px) {
  .content-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-card { grid-column: 1 / -1; }
}
@media (max-width: 840px) {
  body { background: #050a0f; }
  .desktop-frame { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; grid-template-columns: 1fr; }
  .sidebar, .student-profile, .right-column .news-card { display: none; }
  .app-surface { border: 0; padding: 12px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .network-bar { padding-bottom: 4px; }
  .top-actions { display: grid; grid-template-columns: 1fr; }
  .search-wrap { grid-template-columns: 18px minmax(0, 1fr); }
  .theme-cluster, .bell { width: 100%; justify-content: center; }
  .goals-grid { grid-template-columns: repeat(4, minmax(145px, 1fr)); overflow-x: auto; }
  .goal-card { padding: 10px; }
  .goal-main strong { font-size: 21px; }
  .toolbar-row { flex-direction: column; }
  .opportunity-table { display: grid; gap: 8px; padding: 0 10px 10px; overflow: visible; }
  .opp-row { grid-template-columns: 48px minmax(0, 1fr) 46px; min-width: 0; min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
  .logo { width: 42px; height: 42px; font-size: 10px; }
  .fit-cell { display: flex; justify-content: flex-end; }
  .fit-cell .fit-explain, .opp-col, .opp-actions { display: none; }
  .pipeline-board { grid-template-columns: repeat(7, 150px); }
  .right-column { grid-template-columns: 1fr; }
  .timeline-list, .form-grid, .onboarding-grid { grid-template-columns: 1fr; }
}
.empty-state { margin: 0; border-top: 1px solid var(--line); padding: 18px 14px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty-state p { margin-bottom: 10px; font-size: 12px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.opportunity-table .empty-state { min-width: 0; }
.research-card .section-head p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.research-capture { display: grid; grid-template-columns: 145px minmax(180px, 1fr) auto; gap: 8px; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.research-capture textarea { grid-column: 1 / -1; min-height: 72px; resize: vertical; }
.parser-preview { grid-column: 1 / -1; min-height: 0; }
.parser-preview div { border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: rgba(13,107,255,.08); }
.parser-preview span { color: #8fbfff; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.parser-preview strong { display: block; margin-top: 4px; font-size: 13px; }
.parser-preview p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.research-list { display: grid; gap: 8px; padding: 10px 14px 14px; }
.research-lead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: var(--panel-2); }
.research-lead strong { display: block; font-size: 13px; }
.research-lead p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.research-actions { display: grid; gap: 7px; }
.research-actions button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: #55a0ff; font-size: 11px; font-weight: 850; }
.phone-empty { padding: 12px 0; color: var(--muted); font-size: 10px; text-align: center; }
/* App-table compact pass: fit reason lives with the role, score gets its own stable cell. */
.opp-row {
  grid-template-columns: 56px minmax(230px, 1fr) 46px 82px 108px 128px 98px;
  min-width: 820px;
  min-height: 112px;
  gap: 10px;
}
.fit-inline {
  display: -webkit-box;
  margin-top: 5px !important;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.fit-cell {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}
.fit-cell .fit-explain { display: none; }
.active-filter {
  outline: 1px solid rgba(85, 160, 255, .75);
  box-shadow: 0 0 0 3px rgba(13, 107, 255, .16);
}
@media (max-width: 1280px) {
  .content-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-card { grid-column: 1 / -1; }
}
@media (max-width: 1480px) {
  .desktop-frame { grid-template-columns: 210px minmax(0, 1fr); }
  .phone-preview { display: none; }
}
@media (max-width: 840px) {
  .opp-row { min-width: 0; }
  .fit-inline { display: none; }
}

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; gap: 8px; width: min(320px, calc(100vw - 32px)); pointer-events: none; }
.toast { transform: translateY(8px); opacity: 0; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px; background: var(--panel-3); color: var(--ink); box-shadow: var(--shadow); font-size: 12px; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.mini-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mini-actions button { border: 0; padding: 0; background: transparent; color: #55a0ff; font-size: 10px; font-weight: 800; }
.checklist label { align-items: center; }
.checklist label span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.checklist label button { border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.checklist-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 10px 14px 14px; }
.checklist-add input { min-width: 0; }
.checklist-add button { border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; background: var(--panel-2); color: #55a0ff; font-size: 12px; font-weight: 850; }
@media (max-width: 840px) {
  .toast-region { right: 12px; bottom: 12px; }
  .contact-row { grid-template-columns: 38px minmax(0, 1fr); }
  .contact-row .follow-up { grid-column: 2; justify-self: start; }
}

.mobile-tabbar { display: none; }
@media (max-width: 840px) {
  .app-surface { padding-bottom: 74px; }
  .mobile-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; border-top: 1px solid var(--line); background: var(--frame); box-shadow: 0 -14px 34px rgba(0,0,0,.32); }
  .mobile-tabbar button { min-width: 0; min-height: 56px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; }
  .mobile-tabbar button.active { color: #fff; background: rgba(13, 107, 255, .24); box-shadow: inset 0 3px 0 var(--blue); }
}
/* Final phone layout guard: keep right-rail sections usable after tablet overrides. */
@media (max-width: 840px) {
  .content-grid, .right-column { grid-template-columns: 1fr; }
  .right-column { gap: 12px; }
  .selected-card, .contacts-card, .notes-card { grid-column: auto; }
  .contact-row, .note-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .contact-main strong { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
  .contact-row .follow-up { grid-column: auto; justify-self: end; }
}
@media (max-width: 840px) {
  .desktop-frame { width: 100%; grid-template-columns: 1fr; }
  .app-surface { grid-column: 1; width: 100%; }
}

/* Keep opportunity logos from spilling into titles on narrow rows. */
.logo, .phone-opp-logo {
  overflow: hidden;
  padding: 4px;
  line-height: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 840px) {
  .opp-row { grid-template-columns: 48px minmax(0, 1fr) 42px; gap: 12px; align-items: start; }
  .logo { width: 42px; height: 42px; font-size: 11px; }
  .opp-title { padding-top: 1px; }
  .opp-title strong { font-size: 15px; line-height: 1.18; }
  .opp-title p { font-size: 12px; }
}
/* View switching and navigation pass. */
.view-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: rgba(12,21,30,.84); }
body.light .view-context { background: #fff; }
.view-context h1 { margin-top: 2px; font-size: 20px; }
.view-context p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
body:not([data-view="dashboard"]) .content-grid { grid-template-columns: 1fr; }
body:not([data-view="dashboard"]) .main-column,
body:not([data-view="dashboard"]) .right-column { display: contents; }
body[data-view="opportunities"] .view-card:not(.view-opportunities),
body[data-view="research"] .view-card:not(.view-research),
body[data-view="pipeline"] .view-card:not(.view-pipeline),
body[data-view="contacts"] .view-card:not(.view-contacts),
body[data-view="notes"] .view-card:not(.view-notes),
body[data-view="calendar"] .view-card:not(.view-calendar),
body[data-view="analytics"] .view-card:not(.view-analytics) { display: none; }
.stage-tabs { display: flex; gap: 7px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: thin; }
.stage-tab { display: flex; align-items: center; gap: 7px; min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: var(--panel-2); color: var(--muted); white-space: nowrap; font-size: 11px; }
.stage-tab strong { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--panel-3); color: var(--ink); font-size: 10px; }
.stage-tab.active { border-color: rgba(85,160,255,.85); background: var(--blue-soft); color: var(--ink); }
.opportunities-section .toolbar-row { position: sticky; top: 0; z-index: 4; border-bottom: 1px solid var(--line); padding-top: 8px; background: rgba(9,16,23,.96); backdrop-filter: blur(10px); }
body.light .opportunities-section .toolbar-row { background: rgba(255,255,255,.96); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.detail-meta span { border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 800; }
.detail-drawer { position: fixed; inset: 0; z-index: 30; visibility: hidden; pointer-events: none; }
.detail-drawer.open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.46); opacity: 0; transition: opacity .18s ease; }
.detail-drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(430px, 100vw); height: 100%; overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); transform: translateX(100%); transition: transform .22s ease; }
.detail-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-actions { display: flex; gap: 8px; padding: 0 14px 16px; }
.drawer-actions .add-button, .drawer-actions .ghost-button { min-height: 34px; }
.opp-actions button:first-child { width: auto; padding: 0 8px; color: #55a0ff; }
@media (max-width: 840px) {
  .student-profile { display: none; }
  .view-context { align-items: flex-start; margin-bottom: 12px; padding: 12px; }
  .view-context h1 { font-size: 18px; }
  .view-context p { display: none; }
  .view-context .text-button { flex: 0 0 auto; }
  .stage-tabs { padding: 0 10px 10px; }
  .toolbar-row { gap: 7px; }
  .research-capture { grid-template-columns: 1fr; }
  .research-lead { grid-template-columns: 1fr; }
  .research-actions { grid-template-columns: 1fr 1fr; }
  .opportunity-table { gap: 10px; }
  .opp-row { grid-template-columns: 44px minmax(0, 1fr) 44px; min-height: 116px; padding: 10px; align-items: start; }
  .logo { width: 40px; height: 40px; }
  .opp-title strong { font-size: 14px; }
  .opp-title p { margin-top: 4px; }
  .opp-tags { margin-top: 8px; }
  .fit-circle { width: 38px; height: 38px; font-size: 12px; }
  .opp-actions { display: flex; grid-column: 1 / -1; justify-content: stretch; gap: 6px; min-width: 0; }
  .opp-actions button { flex: 1; width: auto; height: 30px; background: var(--panel-2); }
  .drawer-panel { width: 100vw; }
}
/* Mobile topbar polish: keep utility controls compact. */
@media (max-width: 840px) {
  .top-actions { grid-template-columns: minmax(0, 1fr) 42px 42px; align-items: center; }
  .search-wrap { grid-column: 1 / -1; }
  .top-actions .add-button { grid-column: 1; width: 100%; }
  .theme-cluster, .bell { width: 42px; min-width: 42px; height: 34px; justify-content: center; }
  .theme-cluster { gap: 0; padding: 0; }
  .theme-cluster span { width: 16px; height: 16px; }
  .theme-cluster strong { display: none; }
  .network-bar { border-bottom: 1px solid var(--line); }
}
/* Workflow upgrade polish. */
.action-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: auto; }
.action-toast button { border: 0; background: transparent; color: #55a0ff; font-weight: 900; }
.sidebar #importData { margin-top: 8px; }
.drawer-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 14px 14px; border-bottom: 1px solid var(--line); }
.drawer-edit label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.drawer-edit .wide { grid-column: 1 / -1; }
.drawer-edit textarea { min-height: 70px; resize: vertical; text-transform: none; }
.drawer-edit button { grid-column: 1 / -1; }
.linked-contacts { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.linked-contacts .section-head { padding-bottom: 8px; }
.linked-contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin: 0 14px 8px; border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: var(--panel-2); }
.linked-contact strong { font-size: 12px; }
.linked-contact span, .drawer-muted { color: var(--muted); font-size: 11px; }
.linked-contact button { grid-row: 1 / span 2; grid-column: 2; border: 0; background: transparent; color: var(--amber); font-size: 11px; font-weight: 900; }
.drawer-muted { margin: 0 14px 8px; }
.analytics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 14px 14px; }
.analytics-grid article { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: var(--panel-2); }
.analytics-grid span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.analytics-grid strong { display: block; margin-top: 7px; font-size: 24px; }
.analytics-grid p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.stage.drag-over { outline: 2px solid rgba(85,160,255,.8); outline-offset: 2px; background: rgba(13,107,255,.12); }
.stage-card[draggable="true"] { cursor: grab; }
.stage-card[draggable="true"]:active { cursor: grabbing; }
@media (max-width: 1120px) {
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  .drawer-edit, .analytics-grid { grid-template-columns: 1fr; }
  .linked-contact { grid-template-columns: 1fr; }
  .linked-contact button { grid-row: auto; grid-column: auto; justify-self: start; }
}
