:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #15221f;
  --muted: #66756f;
  --line: #e3e9e6;
  --sidebar: #10241f;
  --sidebar-2: #17342c;
  --brand: #1f8a6b;
  --brand-dark: #166b53;
  --brand-soft: #e9f6f1;
  --purple: #7254d8;
  --purple-soft: #f0edff;
  --danger: #c84e4e;
  --danger-soft: #fff0ef;
  --warning: #b97717;
  --warning-soft: #fff7e7;
  --shadow: 0 1px 2px rgba(16, 36, 31, .04), 0 8px 28px rgba(16, 36, 31, .05);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[x-cloak], .hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--sidebar), #0b1b17); color: #d6e3df; padding: 22px 14px 14px; z-index: 50; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 24px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #4fd1a3, #16805f); box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 7px 18px rgba(17,139,101,.23); color: white; font-weight: 800; font-size: 18px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand b { color: #fff; font-size: 16px; letter-spacing: .01em; }
.brand small { color: #829c94; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav-group { margin: 8px 0 19px; }
.nav-group h2 { color: #6f8c83; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; margin: 0 12px 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 41px; margin: 3px 0; padding: 0 12px; border-radius: 10px; color: #a9bdb7; font-weight: 550; transition: .16s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(54, 190, 145, .15); box-shadow: inset 2px 0 #47c99e; }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; color: #7ea399; font-size: 16px; }
.nav-item.active .nav-icon { color: #54d3a8; }
.sidebar-status { margin: 7px 4px 10px; padding: 11px 12px; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 11px; }
.sidebar-status > span:last-child { display: flex; flex-direction: column; }
.sidebar-status b { color: #dceae6; font-size: 11px; }
.sidebar-status small { color: #6f8c83; margin-top: 2px; font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #49d29f; box-shadow: 0 0 0 4px rgba(73,210,159,.12); flex: 0 0 auto; }
.user-card { display: flex; align-items: center; gap: 9px; padding: 11px 9px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #dcefe8; color: #226b56; font-size: 11px; font-weight: 800; }
.avatar.small { width: 30px; height: 30px; }
.user-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.user-copy b { color: #eef7f4; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: #789188; font-size: 10px; margin-top: 2px; }
.icon-button { border: 0; background: transparent; color: var(--muted); min-width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.icon-button:hover { background: rgba(127,150,143,.1); color: var(--ink); }
.sidebar .icon-button { color: #708b83; }

.main-area { min-height: 100vh; margin-left: 248px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.page-heading span { color: var(--brand); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .13em; }
.page-heading h1 { margin: 3px 0 0; font-size: 20px; line-height: 1.1; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-button { min-width: 245px; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f8; color: #84918d; text-align: left; }
.search-button kbd { margin-left: auto; background: white; border: 1px solid #dde4e1; border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; font-size: 10px; }
.live-pill { display: flex; align-items: center; gap: 7px; border: 1px solid #dcebe5; color: #397a65; background: #f1faf6; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 650; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #36b987; }
.mobile-menu { display: none; }
.page-content { padding: 24px 30px 42px; max-width: 1650px; margin: 0 auto; }

.notice { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.notice.success { background: var(--brand-soft); border: 1px solid #cde9df; color: #226f57; }
.notice.error { background: var(--danger-soft); border: 1px solid #f2d1ce; color: #a94242; }
.button { min-height: 38px; padding: 0 14px; border-radius: 9px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; cursor: pointer; font-weight: 650; font-size: 12px; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--brand); box-shadow: 0 5px 12px rgba(31,138,107,.16); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { background: white; border-color: var(--line); color: #31423d; }
.button.secondary:hover { border-color: #bdcbc6; }
.button.ghost { background: transparent; color: var(--brand-dark); }
.button.light { background: rgba(255,255,255,.96); color: #174d3e; }
.button.wide { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.danger-text { color: var(--danger) !important; }
.chip, .tag { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 8px; background: #f0f3f2; color: #5a6964; font-size: 10px; font-weight: 700; }
.chip.purple { color: #6546be; background: var(--purple-soft); }
.source-badge { display: inline-flex; width: max-content; align-items: center; border-radius: 6px; background: #eef3f1; color: #56665f; padding: 4px 7px; font-size: 9px; font-weight: 750; letter-spacing: .025em; }
.rating-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.rating-good { background: #e7f6ef; color: #247556; }
.rating-mid { background: #fff3dc; color: #9b6a1d; }
.rating-bad { background: #ffebe9; color: #b74747; }
.sentiment-positive { background: #e7f6ef; color: #247556; }
.sentiment-neutral { background: #eef1f5; color: #59677b; }
.sentiment-negative { background: #ffebe9; color: #b74747; }

.hero-strip, .harness-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 148px; padding: 25px 29px; border-radius: 18px; color: white; background: radial-gradient(circle at 80% 0, rgba(77,207,164,.27), transparent 30%), linear-gradient(120deg, #173b31, #176a51); box-shadow: 0 13px 34px rgba(16,78,60,.14); }
.hero-kicker { display: inline-flex; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 800; color: #8be0c1; margin-bottom: 8px; }
.hero-strip h2, .harness-hero h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.hero-strip p, .harness-hero p { max-width: 760px; color: #b8d6cc; margin: 9px 0 0; line-height: 1.55; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.metric-card { padding: 18px 19px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 116px; }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card strong { margin: 9px 0 5px; font-size: 29px; letter-spacing: -.045em; }
.metric-card small { color: #8a9793; font-size: 10px; }
.trend.up { color: #2d8d6c; }
.trend.danger { color: var(--danger); }
.trend.warning { color: var(--warning); }

.dashboard-grid, .analysis-grid, .agent-grid { display: grid; grid-template-columns: 1fr 1fr .82fr; gap: 15px; margin-top: 16px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.span-2 { grid-column: span 2; }
.panel-header { min-height: 68px; padding: 16px 18px; border-bottom: 1px solid #edf1ef; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-header h3 { margin: 3px 0 0; font-size: 14px; letter-spacing: -.015em; }
.panel-header a { color: var(--brand); font-size: 11px; font-weight: 700; }
.panel-kicker { color: #8a9893; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 750; }
.chart { height: 285px; padding: 10px; }
.chart.small { height: 255px; }
.chart.large { height: 330px; }
.source-health { padding-bottom: 14px; }
.health-ring { width: 120px; height: 120px; display: grid; place-items: center; margin: 22px auto 15px; border-radius: 50%; background: conic-gradient(var(--brand) 0 28%, #edf2f0 28% 100%); position: relative; }
.health-ring::after { content: ""; position: absolute; inset: 10px; background: white; border-radius: 50%; }
.health-ring span { position: relative; z-index: 1; display: flex; flex-direction: column; text-align: center; }
.health-ring b { font-size: 22px; }
.health-ring small { color: var(--muted); font-size: 9px; }
.compact-list { list-style: none; padding: 0 18px; margin: 0; }
.compact-list li { display: flex; align-items: center; gap: 8px; min-height: 31px; border-top: 1px solid #f0f3f2; font-size: 10px; }
.compact-list li span { flex: 1; color: #4c5b56; }
.compact-list li b { font-weight: 600; color: #8a9793; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot.ok { background: #38b884; }
.dot.wait { background: #e1a644; }
.review-list { padding: 0 17px 5px; }
.review-row { display: grid; grid-template-columns: 90px minmax(0,1fr) 55px 68px; align-items: center; gap: 12px; min-height: 66px; border-bottom: 1px solid #eef2f0; }
.review-row:last-child { border-bottom: 0; }
.review-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.review-main b { font-size: 11px; }
.review-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.row-time { color: #929d99; font-size: 9px; text-align: right; }

.toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.toolbar-copy h2 { margin: 0; font-size: 16px; }
.toolbar-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.toolbar-right { display: flex; gap: 8px; }
.segmented { display: flex; align-items: center; gap: 2px; background: #e9eeec; padding: 3px; border-radius: 10px; }
.segmented button { border: 0; padding: 7px 11px; background: transparent; color: #687670; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 650; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(14,42,34,.08); }

.inbox-layout { display: grid; grid-template-columns: minmax(330px, .78fr) minmax(540px, 1.45fr); min-height: calc(100vh - 172px); border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; box-shadow: var(--shadow); }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 173px); background: #fafcfb; }
.inbox-summary { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.inbox-summary b { color: var(--ink); }
.inbox-summary small { font-size: 9px; }
.inbox-item { padding: 14px 15px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; }
.inbox-item:hover { background: white; }
.inbox-item.selected { background: white; border-left-color: var(--brand); }
.inbox-item-top { display: flex; justify-content: space-between; }
.inbox-author { display: flex; align-items: center; gap: 9px; margin: 10px 0; }
.inbox-author > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.inbox-author b { font-size: 11px; }
.inbox-author small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.inbox-item p { margin: 0 0 10px; color: #52615c; font-size: 11px; line-height: 1.48; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-line { display: flex; gap: 5px; }
.review-detail { padding: 24px 27px; overflow-y: auto; max-height: calc(100vh - 173px); }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 9px 0 3px; font-size: 20px; }
.detail-header p { color: var(--muted); margin: 0; font-size: 10px; }
.big-rating { color: #9d6b1d; background: #fff4df; border-radius: 10px; padding: 9px 11px; font-weight: 800; }
.review-quote { margin: 22px 0 17px; padding-left: 17px; border-left: 3px solid #61c5a4; }
.review-quote p { margin: 0; font-size: 15px; line-height: 1.7; color: #34443f; }
.ai-insight { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 15px; border: 1px solid #ddd7fb; background: linear-gradient(135deg, #f7f5ff, #fbfaff); border-radius: 13px; }
.ai-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--purple); color: white; font-size: 9px; font-weight: 800; box-shadow: 0 5px 12px rgba(114,84,216,.23); }
.ai-insight > div:nth-child(2) > span { color: #7459ca; font-size: 9px; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.ai-insight h3 { margin: 4px 0 5px; font-size: 12px; }
.ai-insight p { margin: 0; color: #716c82; font-size: 10px; line-height: 1.45; }
.confidence { color: #7157c8; font-size: 10px; font-weight: 800; }
.detail-section { margin-top: 22px; }
.detail-section > h3, .section-heading h3 { margin: 0 0 10px; font-size: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.evidence-grid > div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.evidence-grid span { color: var(--muted); font-size: 9px; }
.evidence-grid b { font-size: 11px; margin: 4px 0; }
.evidence-grid small { color: #a0aaa6; font-size: 8px; }
.reply-box { width: 100%; border: 1px solid var(--line); background: #fbfcfc; border-radius: 10px; padding: 12px; line-height: 1.55; resize: vertical; color: #35443f; }
.reply-box:focus { outline: 2px solid rgba(31,138,107,.16); border-color: var(--brand); }
.helper { margin: 7px 0 0; color: #8b9793; font-size: 9px; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }

.table-shell { overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; gap: 16px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.view-tabs, .table-actions { display: flex; align-items: center; gap: 5px; }
.view-tabs button { border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 650; }
.view-tabs button.active { background: var(--brand-soft); color: var(--brand-dark); }
.view-tabs .add-view { font-size: 15px; }
.filter-strip { display: flex; align-items: center; gap: 7px; padding: 10px 15px; background: #fafcfb; border-bottom: 1px solid var(--line); }
.table-search { min-width: 290px; flex: 1; max-width: 430px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 0 9px; }
.table-search input { width: 100%; min-height: 34px; border: 0; outline: 0; font-size: 10px; }
.filter-chip { min-height: 34px; border: 1px solid var(--line); background: white; border-radius: 8px; color: var(--muted); padding: 0 9px; font-size: 9px; }
.filter-chip b { color: var(--ink); margin-left: 5px; }
.data-grid { min-height: 560px; }
.tabulator { border: 0 !important; background: white !important; font-size: 11px !important; }
.tabulator .tabulator-header { border-bottom: 1px solid var(--line) !important; background: #f7f9f8 !important; color: #5c6b66 !important; font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }
.tabulator .tabulator-header .tabulator-col { background: #f7f9f8 !important; border-right-color: #e8edeb !important; }
.tabulator-row { border-bottom: 1px solid #edf1ef !important; background: white !important; }
.tabulator-row:hover { background: #f8fbfa !important; }
.tabulator .tabulator-cell { border-right-color: #edf1ef !important; padding: 10px 9px !important; white-space: normal !important; }

.analysis-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 4px; }
.analysis-intro h2 { margin: 0; font-size: 19px; }
.analysis-intro p { color: var(--muted); margin: 5px 0 0; font-size: 11px; }
.signal-list, .rank-list, .profile-list { padding: 8px 16px 15px; }
.signal { min-height: 61px; display: grid; grid-template-columns: 30px 1fr 20px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.signal > span { font-size: 10px; color: #9ba6a2; }
.signal > div { display: flex; flex-direction: column; gap: 3px; }
.signal b { font-size: 11px; }
.signal small { color: var(--muted); font-size: 9px; }
.signal strong { font-size: 16px; }
.signal.danger strong { color: var(--danger); }
.signal.warning strong { color: var(--warning); }
.signal.good strong { color: var(--brand); }
.rank-list > div { min-height: 51px; display: grid; grid-template-columns: 1fr 35px 80px; align-items: center; border-bottom: 1px solid var(--line); }
.rank-list span { font-size: 10px; font-weight: 650; }
.rank-list b { color: var(--brand-dark); }
.rank-list small { color: var(--muted); font-size: 8px; text-align: right; }
.narrative { display: flex; align-items: flex-start; gap: 13px; padding: 18px; }
.narrative p { margin: 1px 0 0; line-height: 1.65; color: #4f5f59; }

.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.source-card { min-height: 226px; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.source-card > header { display: flex; align-items: flex-start; gap: 10px; }
.platform-logo { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(145deg, #e4f2ed, #cde9df); color: #216d57; font-size: 11px; font-weight: 800; }
.source-card header > div { flex: 1; min-width: 0; }
.source-card h3 { margin: 1px 0 4px; font-size: 13px; }
.source-card header a { color: #80908a; font-size: 9px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin: 18px 0 14px; }
.source-meta span { display: flex; flex-direction: column; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.source-meta small { color: var(--muted); font-size: 8px; }
.source-meta b { margin-top: 3px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.source-health-line { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); }
.test-status { display: flex; align-items: center; gap: 6px; color: #7d8985; font-size: 9px; }
.test-status i { width: 6px; height: 6px; border-radius: 50%; background: #d29b39; }
.status-ok i { background: var(--brand); }
.source-card footer { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; }
.add-source { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--muted); box-shadow: none; }
.add-source > span { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.add-source b { color: #41514b; margin: 11px 0 4px; }
.add-source small { font-size: 9px; }

.studio-steps { display: flex; align-items: center; justify-content: center; margin: 0 0 17px; }
.studio-steps span { display: flex; align-items: center; gap: 7px; color: #87938f; font-size: 10px; font-weight: 700; }
.studio-steps span b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #e7ecea; color: #72817b; }
.studio-steps span.active { color: var(--brand-dark); }
.studio-steps span.active b { background: var(--brand); color: white; }
.studio-steps > i { width: 55px; height: 1px; background: #dfe6e3; margin: 0 10px; }
.studio-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); gap: 15px; align-items: start; }
.studio-main { display: flex; flex-direction: column; gap: 14px; }
.form-panel { overflow: hidden; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.form-panel > .form-grid, .compact-form { padding: 17px 18px 19px; }
label { display: flex; flex-direction: column; gap: 6px; }
label > span { color: #4f5e59; font-size: 10px; font-weight: 700; }
input, select, textarea { border: 1px solid #dce4e1; background: white; color: var(--ink); border-radius: 9px; min-height: 39px; padding: 0 10px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,138,107,.1); }
label small { color: #8c9894; font-size: 8px; }
.selector-lead { display: flex; align-items: center; gap: 9px; padding: 12px 18px 0; }
.selector-lead > span { background: #eef2f1; border-radius: 6px; padding: 4px 7px; font-size: 9px; font-weight: 800; }
.selector-lead p { margin: 0; color: var(--muted); font-size: 9px; }
.selectors .important input { background: #f7fbf9; border-color: #bcded2; }
.contract-preview { margin: 0 18px 18px; padding: 10px 11px; border-radius: 9px; background: #f7f9f8; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.contract-preview span { font-size: 9px; color: var(--muted); }
.contract-preview code { font-size: 9px; color: #3e6558; white-space: normal; }
.studio-actions { display: flex; justify-content: flex-end; gap: 8px; }
.test-bench { position: sticky; top: 95px; overflow: hidden; min-height: 585px; }
.test-idle { color: #899590; font-size: 9px; }
.test-idle i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #bdc5c2; margin-right: 5px; }
.test-empty, .test-loading { min-height: 480px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.test-empty h3, .test-loading h3 { margin: 14px 0 5px; font-size: 13px; }
.test-empty p, .test-loading p { max-width: 300px; margin: 0; color: var(--muted); line-height: 1.55; font-size: 10px; }
.radar-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #e9f8f2 25%, #dff2eb 26% 48%, #f2faf7 49%); color: var(--brand); font-size: 22px; }
.spinner { width: 34px; height: 34px; border: 3px solid #dceee7; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.test-result { padding: 16px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.diagnostic-grid span { padding: 9px; border-radius: 8px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.diagnostic-grid small, .test-title small { color: var(--muted); font-size: 8px; }
.diagnostic-grid b { margin-top: 3px; font-size: 11px; }
.test-title { margin: 11px 0; padding: 10px; background: #f8faf9; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.test-title b { font-size: 10px; }
.test-title span { color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; margin: 13px 0 8px; }
.preview-heading span { font-size: 10px; font-weight: 750; }
.preview-heading small { color: var(--muted); font-size: 8px; }
.test-records { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; }
.test-record { border: 1px solid var(--line); border-radius: 9px; padding: 9px; }
.test-record header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 9px; }
.test-record p { margin: 0; color: #56645f; font-size: 9px; line-height: 1.45; }
.test-record small { color: var(--muted); }

.scheduler-layout { display: grid; grid-template-columns: minmax(0,1.25fr) 390px; gap: 15px; align-items: start; }
.schedule-list { display: flex; flex-direction: column; gap: 9px; }
.schedule-card { min-height: 94px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); background: white; border-radius: 13px; box-shadow: var(--shadow); }
.schedule-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 18px; }
.schedule-copy > div { display: flex; align-items: center; gap: 8px; }
.schedule-copy h3 { margin: 0; font-size: 12px; }
.schedule-copy p { margin: 5px 0 3px; color: #576660; font-size: 10px; }
.schedule-copy small { color: #8a9692; font-size: 8px; }
.next-run { display: grid; grid-template-columns: auto 28px; column-gap: 9px; align-items: center; min-width: 160px; }
.next-run small, .next-run b { grid-column: 1; }
.next-run small { color: var(--muted); font-size: 8px; }
.next-run b { margin-top: 3px; font-size: 10px; }
.next-run button { grid-column: 2; grid-row: 1 / span 2; }
.calendar-preview { margin-top: 14px; }
.timeline-preview { display: flex; padding: 20px; }
.timeline-preview > span { flex: 1; position: relative; display: flex; flex-direction: column; border-top: 2px solid #dce7e3; padding-top: 12px; }
.timeline-preview i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); top: -5px; left: 0; box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-preview b { font-size: 11px; }
.timeline-preview small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.rule-builder { position: sticky; top: 95px; overflow: hidden; }
.compact-form { gap: 12px; }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row input { width: 36px; min-height: 20px; accent-color: var(--brand); }
.load-estimate { padding: 11px; background: var(--brand-soft); border-radius: 9px; display: flex; flex-direction: column; }
.load-estimate span, .load-estimate small { font-size: 8px; color: #568273; }
.load-estimate b { margin: 4px 0; font-size: 10px; color: #246d57; }

.harness-hero { min-height: 132px; background: radial-gradient(circle at 85% 10%, rgba(150,119,255,.24), transparent 33%), linear-gradient(120deg, #24223c, #3e315e); }
.harness-hero .hero-kicker { color: #c7b9ff; }
.harness-hero p { color: #cdc6df; }
.harness-state { min-width: 180px; padding: 13px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.06); border-radius: 12px; display: grid; grid-template-columns: 18px 1fr; }
.harness-state b, .harness-state small { grid-column: 2; }
.harness-state b { font-size: 11px; }
.harness-state small { color: #aea7c2; margin-top: 3px; font-size: 9px; }
.harness-state .status-dot { grid-row: 1 / span 2; align-self: center; }
.agent-flow { display: flex; align-items: center; padding: 25px 18px; overflow-x: auto; }
.flow-step { min-width: 115px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.flow-step > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #eff2f1; color: #8d9994; font-size: 9px; font-weight: 800; }
.flow-step.done > span { background: var(--brand-soft); color: var(--brand); }
.flow-step.active > span { background: var(--purple); color: white; box-shadow: 0 0 0 5px var(--purple-soft); }
.flow-step div { margin-top: 9px; display: flex; flex-direction: column; }
.flow-step b { font-size: 10px; }
.flow-step small { color: var(--muted); font-size: 7px; margin-top: 2px; }
.flow-step i { margin-top: 5px; font-style: normal; color: var(--brand); font-size: 9px; }
.flow-line { min-width: 30px; height: 1px; background: #dfe5e3; margin: 0 -4px 35px; }
.tool-policy { margin: 0 18px 18px; padding: 12px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; }
.tool-policy header { display: flex; justify-content: space-between; margin-bottom: 9px; }
.tool-policy header span { font-size: 10px; font-weight: 750; }
.tool-policy header small { color: var(--muted); font-size: 8px; }
.tool-policy > div { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-policy code { padding: 5px 7px; border-radius: 6px; background: white; border: 1px solid #dfe5e3; color: #40544c; font-size: 8px; }
.profile-list > div { min-height: 57px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.profile-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: white; font-size: 10px; font-weight: 800; }
.profile-icon.blue { background: #4281c7; }.profile-icon.purple { background: var(--purple); }.profile-icon.green { background: var(--brand); }
.profile-list > div > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.profile-list b { font-size: 10px; }.profile-list small { color: var(--muted); font-size: 8px; margin-top: 2px; }.profile-list i { color: #7e8c87; font-size: 8px; font-style: normal; }
.budget-list { padding: 11px 17px; }
.budget-list > div { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-bottom: 13px; }
.budget-list span, .budget-list b { font-size: 9px; }.budget-list b { color: #68756f; }.budget-list progress { grid-column: span 2; width: 100%; height: 5px; accent-color: var(--purple); }
.empty-inline { display: flex; align-items: center; gap: 12px; padding: 20px; }
.empty-inline > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.empty-inline > div { display: flex; flex-direction: column; gap: 4px; }.empty-inline b { font-size: 11px; }.empty-inline small { color: var(--muted); font-size: 9px; }

.runs-panel, .users-panel { overflow: hidden; }
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th { padding: 11px 13px; text-align: left; background: #f7f9f8; border-bottom: 1px solid var(--line); color: #75827d; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.simple-table td { padding: 12px 13px; border-bottom: 1px solid #edf1ef; font-size: 10px; vertical-align: middle; }
.simple-table tr:last-child td { border-bottom: 0; }
.mono-cell { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #455750; font-size: 9px; }
.muted-cell { color: var(--muted); max-width: 270px; }
.simple-table td > small { display: block; margin-top: 4px; }
.empty-table { padding: 35px; text-align: center; color: var(--muted); }
.access-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 15px; align-items: start; }
.person-cell { display: flex; align-items: center; gap: 8px; }
.role-pill { display: inline-flex; border-radius: 7px; padding: 5px 8px; font-size: 8px; font-weight: 800; }
.role-admin { color: #6745b9; background: var(--purple-soft); }.role-operator { color: #236e9c; background: #e8f4fb; }.role-marketer { color: #247556; background: var(--brand-soft); }.role-analyst { color: #93681e; background: var(--warning-soft); }
.permission-list { padding: 8px 17px 16px; }
.permission-list > div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.permission-list p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.user-create { margin: 16px 0; padding: 0 17px 17px; overflow: hidden; }
.user-create summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; list-style: none; }
.user-create summary::-webkit-details-marker { display: none; }
.user-create summary > span:first-child { display: flex; flex-direction: column; gap: 4px; }.user-create summary b { font-size: 12px; }.user-create summary small { color: var(--muted); font-size: 9px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }.form-actions { display: flex; align-items: end; min-height: 64px; }
.table-scroll { overflow-x: auto; }.inline-edit { display: flex; align-items: center; gap: 6px; min-width: 250px; }.inline-edit input, .inline-edit select { min-height: 32px; padding: 0 7px; font-size: 10px; }.inline-edit input { min-width: 105px; }.inline-edit button { white-space: nowrap; }
.user-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }.user-actions form { display: flex; align-items: center; gap: 6px; }.user-actions .inline-edit { min-width: 210px; }.user-actions .inline-edit input { min-width: 130px; }
.roles-panel { overflow: hidden; }.role-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }.info-panel { margin-top: 15px; }
.role-studio-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); gap: 15px; align-items: start; }.role-studio-layout > .studio-actions { grid-column: 1 / -1; }
.role-meta-form { padding: 18px; }.permissions-editor { overflow: hidden; }.permission-group { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 16px 18px 19px; }.permission-group legend { padding: 0 5px 0 0; color: var(--brand-dark); font-size: 11px; font-weight: 800; }.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }.permission-option { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; cursor: pointer; }.permission-option:has(input:checked) { border-color: #a8d8c6; background: var(--brand-soft); }.permission-option input { margin-top: 2px; accent-color: var(--brand); }.permission-option span { display: flex; flex-direction: column; gap: 3px; }.permission-option b { font-size: 10px; }.permission-option small { color: var(--muted); font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; }

.forbidden { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.forbidden > span { color: #cbd6d2; font-size: 70px; font-weight: 800; letter-spacing: -.08em; }
.forbidden h2 { margin: -7px 0 7px; }.forbidden p { color: var(--muted); margin: 0 0 18px; }

.login-body { background: #0f231e; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-story { position: relative; overflow: hidden; padding: 35px 52px 38px; display: flex; flex-direction: column; color: white; background: radial-gradient(circle at 20% 80%, rgba(75,204,160,.24), transparent 28%), radial-gradient(circle at 90% 10%, rgba(66,156,126,.20), transparent 33%), linear-gradient(145deg, #112a23, #0b1b17); }
.login-story::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(111,220,182,.08); border-radius: 50%; right: -230px; bottom: -230px; box-shadow: 0 0 0 80px rgba(111,220,182,.025), 0 0 0 160px rgba(111,220,182,.018); }
.brand-light { padding-left: 0; position: relative; z-index: 1; }
.story-copy { margin: auto 0; position: relative; z-index: 1; max-width: 640px; }
.eyebrow-light { color: #70d7b3; text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.story-copy h1 { margin: 17px 0; font-size: clamp(38px, 4vw, 65px); letter-spacing: -.055em; line-height: 1.02; }
.story-copy p { max-width: 520px; color: #a9c8bd; line-height: 1.65; font-size: 14px; }
.story-metrics { display: flex; gap: 50px; position: relative; z-index: 1; }
.story-metrics span { display: flex; flex-direction: column; }.story-metrics b { font-size: 21px; }.story-metrics small { color: #78998e; margin-top: 3px; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.login-panel { display: grid; place-items: center; padding: 35px; background: #f5f7f6; }
.login-form-wrap { width: min(390px, 100%); }
.login-kicker { color: var(--brand); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.login-form-wrap h2 { margin: 8px 0 6px; font-size: 28px; letter-spacing: -.04em; }.login-form-wrap > p { color: var(--muted); margin: 0 0 24px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.login-form-wrap input { min-height: 45px; background: white; }
.login-form-wrap .button { min-height: 45px; margin-top: 3px; justify-content: space-between; padding: 0 16px; }
.demo-access { margin-top: 20px; padding: 12px; border-radius: 10px; background: #edf1ef; display: flex; flex-direction: column; gap: 5px; }
.demo-access b { color: #66746f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }.demo-access code { color: #52635d; font-size: 9px; }

.mobile-overlay { display: none; }
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .analysis-grid, .agent-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid .span-2, .analysis-grid .span-2, .agent-grid .span-2 { grid-column: span 2; }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-layout { grid-template-columns: 1fr; }
  .role-studio-layout { grid-template-columns: 1fr; }.role-studio-layout > .studio-actions { grid-column: auto; }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test-bench, .rule-builder { position: static; }
  .scheduler-layout { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }.sidebar.sidebar-open { transform: translateX(0); }
  .mobile-overlay { display: block; position: fixed; inset: 0; background: rgba(4,18,14,.45); z-index: 40; }
  .main-area { margin-left: 0; }.mobile-menu { display: block; border: 0; background: transparent; font-size: 19px; }.topbar { padding: 0 18px; }.page-content { padding: 18px; }
  .search-button { display: none; }.inbox-layout { grid-template-columns: 1fr; }.inbox-list { max-height: none; border-right: 0; }.review-detail { display: none; }
  .login-shell { grid-template-columns: 1fr; }.login-story { display: none; }.access-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .metric-grid, .dashboard-grid, .analysis-grid, .agent-grid, .source-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2, .analysis-grid .span-2, .agent-grid .span-2 { grid-column: span 1; }
  .hero-strip, .harness-hero { align-items: flex-start; flex-direction: column; }.topbar-actions .live-pill { display: none; }
  .form-grid.two { grid-template-columns: 1fr; }.form-grid .span-2 { grid-column: span 1; }.studio-steps { overflow-x: auto; justify-content: flex-start; }.table-toolbar, .toolbar { align-items: flex-start; flex-direction: column; }.filter-strip { overflow-x: auto; }.table-search { min-width: 240px; }
  .form-grid.four { grid-template-columns: 1fr; }.permission-options { grid-template-columns: 1fr; }.user-create summary { align-items: flex-start; flex-direction: column; padding: 14px 0; }.user-actions .inline-edit { min-width: 0; }
}
