:root {
  --brand-primary: #111111;
  --brand-secondary: #123456;
  --brand-accent: #123456;
  --ink-950: #111111;
  --ink-900: #2a2a2a;
  --ink-700: #444444;
  --ink-500: #6d6d6d;
  --ink-300: #cfcfcf;
  --ink-200: #e6e6e6;
  --ink-100: #f0f0f0;
  --ink-50: #f7f7f7;
  --white: #ffffff;
  --success: #138a5b;
  --warning: #c87900;
  --danger: #c13c4a;
  --sidebar-width: 260px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 14px 40px rgba(17, 17, 17, 0.07);
  --shadow-modal: 0 28px 90px rgba(17, 17, 17, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: var(--ink-50);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--ink-50); color: var(--ink-950); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--brand-secondary); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 9999; transform: translateY(-150%);
  background: var(--ink-950); color: white; padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-accent) 78%, white); outline-offset: 3px; }

.loading-view {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px;
  background: radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--brand-secondary) 14%, white), var(--ink-50) 45%);
}
.loading-view img { animation: pulse 1.4s ease-in-out infinite; }
.loading-view p { color: var(--ink-700); font-weight: 650; }
@keyframes pulse { 50% { transform: scale(1.05); opacity: .78; } }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 48%) 1fr; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 7vw, 110px); background: white; }
.login-brand-block { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin-bottom: 38px; }
.login-brand-block h1 { margin: 5px 0 12px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.02; letter-spacing: -.045em; }
.login-brand-block p { max-width: 560px; }
.login-aside { position: relative; overflow: hidden; padding: clamp(36px, 6vw, 100px); background: linear-gradient(145deg, var(--brand-primary), color-mix(in srgb, var(--brand-secondary) 68%, #102a43)); color: white; display: flex; align-items: flex-end; }
.login-aside::before, .login-aside::after { content: ""; position: absolute; border-radius: 999px; filter: blur(2px); }
.login-aside::before { width: 430px; height: 430px; top: -150px; right: -120px; background: color-mix(in srgb, var(--brand-accent) 20%, transparent); }
.login-aside::after { width: 340px; height: 340px; bottom: -170px; left: -120px; border: 70px solid rgba(255,255,255,.06); }
.login-aside-content { position: relative; z-index: 1; max-width: 720px; }
.login-aside h2 { margin: 10px 0 46px; max-width: 700px; font-size: clamp(2rem, 4vw, 4.25rem); letter-spacing: -.05em; line-height: 1.02; }
.feature-row { padding: 20px 0; display: grid; grid-template-columns: 150px 1fr; gap: 16px; border-top: 1px solid rgba(255,255,255,.2); }
.feature-row strong { color: color-mix(in srgb, var(--brand-accent) 82%, white); }
.feature-row span { color: rgba(255,255,255,.82); }
.login-footer { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink-500); font-size: .9rem; }

.brand-mark { width: 64px; height: 64px; border-radius: 18px; padding: 14px; background: var(--brand-primary); display: flex; align-items: flex-end; gap: 5px; box-shadow: 0 14px 28px color-mix(in srgb, var(--brand-primary) 24%, transparent); }
.brand-mark span { display: block; width: 8px; border-radius: 4px 4px 2px 2px; background: white; }
.brand-mark span:nth-child(1) { height: 19px; }
.brand-mark span:nth-child(2) { height: 34px; }
.brand-mark span:nth-child(3) { height: 26px; background: var(--brand-accent); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; padding: 9px; gap: 3px; box-shadow: none; }
.brand-mark.small span { width: 5px; }
.brand-mark.small span:nth-child(1) { height: 13px; }
.brand-mark.small span:nth-child(2) { height: 23px; }
.brand-mark.small span:nth-child(3) { height: 18px; }

.eyebrow { margin: 0; color: var(--brand-secondary); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: color-mix(in srgb, var(--brand-accent) 75%, white); }
.control-brand-eyebrow { text-transform: none; }
.control-brand-eyebrow span { letter-spacing: .08em; }
.muted { color: var(--ink-700); }
.small-text { color: var(--ink-700); font-size: .88rem; }
.stack { display: grid; gap: 18px; }
.stack.tight { gap: 12px; }
.field { display: grid; gap: 7px; }
.field label, .compact-field label { color: var(--ink-700); font-size: .82rem; font-weight: 750; }
.field input, .field select, .field textarea, .compact-field select {
  width: 100%; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); background: white;
  color: var(--ink-950); padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-field select:focus { border-color: var(--brand-secondary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-secondary) 12%, transparent); outline: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field-help { color: var(--ink-500); font-size: .78rem; }
.form-error { margin: 0; padding: 11px 13px; border-radius: 9px; background: #fff0f1; color: var(--danger); font-weight: 650; }

.button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 760; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: white; background: var(--brand-primary); box-shadow: 0 10px 22px color-mix(in srgb, var(--brand-primary) 20%, transparent); }
.button-primary:hover { background: color-mix(in srgb, var(--brand-primary) 88%, black); }
.button-secondary { color: var(--brand-primary); background: color-mix(in srgb, var(--brand-secondary) 10%, white); border: 1px solid color-mix(in srgb, var(--brand-secondary) 22%, white); }
.button-ghost { color: var(--ink-700); background: transparent; border: 1px solid var(--ink-200); }
.button-danger { color: white; background: var(--danger); }
.button-inverse { color: var(--ink-950); background: white; }
.button-large { min-height: 48px; }
.button-compact { padding: 8px 12px; font-size: .84rem; }
.text-button { border: 0; background: transparent; color: var(--brand-secondary); font-weight: 720; padding: 4px; justify-self: start; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--ink-200); border-radius: 10px; background: white; color: var(--ink-700); font-size: 1.1rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 30; background: #102a43; color: white; display: flex; flex-direction: column; padding: 22px 16px; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 4px 4px 26px; }
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { display: block; margin-top: 2px; color: #9fb3c8; font-size: .72rem; }
.primary-navigation { display: grid; gap: 5px; overflow-y: auto; padding-right: 2px; }
.nav-button { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; border: 0; border-radius: 11px; padding: 11px 12px; color: #bcccdc; background: transparent; text-align: left; font-weight: 680; }
.nav-button:hover { background: rgba(255,255,255,.07); color: white; }
.nav-button.active { color: white; background: linear-gradient(100deg, color-mix(in srgb, var(--brand-secondary) 72%, #102a43), color-mix(in srgb, var(--brand-primary) 45%, #102a43)); box-shadow: inset 3px 0 var(--brand-accent); }
.nav-icon { font-size: 1.05rem; text-align: center; }
.nav-badge { min-width: 20px; padding: 2px 6px; border-radius: 999px; color: #102a43; background: var(--brand-accent); font-size: .7rem; text-align: center; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 2px 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-accent) 84%, white); color: #102a43; font-weight: 850; }
.sidebar-user { min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-user strong { font-size: .85rem; }
.sidebar-user small { color: #9fb3c8; font-size: .68rem; margin-top: 2px; }
.sidebar-footer .icon-button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: white; }

.app-column { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 88px; padding: 17px clamp(18px, 3vw, 42px); display: flex; align-items: center; gap: 20px; background: rgba(247,249,252,.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(188,204,220,.55); }
.topbar-title { min-width: 210px; }
.topbar-title h1 { margin: 2px 0 0; font-size: clamp(1.45rem, 2.4vw, 2.15rem); letter-spacing: -.035em; }
.topbar-controls { margin-left: auto; display: flex; gap: 12px; align-items: end; }
.compact-field { display: grid; gap: 4px; }
.compact-field select { min-width: 178px; padding: 9px 34px 9px 11px; font-size: .86rem; }

.impersonation-banner { position: fixed; top: 0; left: var(--sidebar-width); right: 0; z-index: 80; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 18px; color: white; background: #7a3e00; }
.impersonation-banner:not([hidden]) + .sidebar + .app-column .topbar { top: 48px; }

.main-content { padding: clamp(22px, 3vw, 44px); max-width: 1560px; margin: 0 auto; }
.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-intro h2 { margin: 0 0 7px; font-size: clamp(1.35rem, 2.3vw, 2rem); letter-spacing: -.03em; }
.page-intro p { margin: 0; color: var(--ink-700); max-width: 760px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid rgba(188,204,220,.65); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-card); }
.metric-label { color: var(--ink-700); font-size: .78rem; font-weight: 750; }
.metric-value { display: block; margin-top: 9px; font-size: clamp(1.55rem, 3vw, 2.45rem); line-height: 1; letter-spacing: -.045em; }
.metric-note { display: block; margin-top: 9px; color: var(--ink-500); font-size: .74rem; }
.metric-icon { float: right; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--brand-secondary) 10%, white); color: var(--brand-secondary); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; border: 1px solid rgba(188,204,220,.68); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-card); overflow: hidden; }
.panel-header { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--ink-100); }
.panel-header h3 { margin: 0; font-size: 1.02rem; }
.panel-header p { margin: 4px 0 0; color: var(--ink-500); font-size: .78rem; }
.panel-body { padding: 22px; }
.panel-body.flush { padding: 0; }

.company-grid, .report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.company-card, .report-card { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--ink-200); border-radius: var(--radius-md); background: white; transition: transform .15s, box-shadow .15s, border-color .15s; }
.company-card:hover, .report-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand-secondary) 42%, var(--ink-200)); box-shadow: var(--shadow-card); }
.company-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--company-primary, var(--brand-primary)); color: white; font-weight: 850; }
.company-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; padding: 5px; }
.company-logo-preview { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.company-logo-preview img { width: 92px; height: 64px; object-fit: contain; border: 1px solid var(--ink-200); border-radius: 10px; background: #fff; padding: 6px; }
.company-card h3, .report-card h3 { margin: 15px 0 6px; font-size: 1.05rem; }
.company-card p, .report-card p { margin: 0; color: var(--ink-700); font-size: .84rem; line-height: 1.45; }
.card-meta { margin-top: 18px; display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--ink-500); font-size: .75rem; }
.card-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.brand-swatches { display: flex; gap: 5px; margin-top: 15px; }
.brand-swatches span { width: 22px; height: 7px; border-radius: 999px; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 750; background: var(--ink-100); color: var(--ink-700); }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.success { background: #e7f7ef; color: var(--success); }
.status-pill.warning { background: #fff5df; color: var(--warning); }
.status-pill.danger { background: #fff0f1; color: var(--danger); }
.status-pill.info { background: #eaf4ff; color: #2368a2; }

.progress { height: 9px; overflow: hidden; border-radius: 999px; background: var(--ink-100); }
.progress > span { display: block; height: 100%; width: var(--progress, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--brand-secondary), var(--brand-accent)); }
.usage-summary { display: grid; gap: 14px; }
.usage-line { display: flex; justify-content: space-between; gap: 12px; font-size: .83rem; }
.usage-line span:first-child { color: var(--ink-700); }
.usage-line strong { text-align: right; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
th { color: var(--ink-700); background: var(--ink-50); font-size: .74rem; letter-spacing: .03em; text-transform: uppercase; }
td { color: var(--ink-900); font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 730; }
.table-secondary { display: block; color: var(--ink-500); font-size: .73rem; margin-top: 3px; }

.ask-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); gap: 18px; }
.conversation-panel { min-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.conversation-stream { flex: 1; padding: 24px; display: grid; align-content: start; gap: 18px; background: linear-gradient(180deg, #fbfcfe, white); }
.message { max-width: min(760px, 88%); padding: 15px 17px; border-radius: 17px; line-height: 1.55; font-size: .92rem; white-space: pre-wrap; }
.message.user { justify-self: end; color: white; background: var(--brand-primary); border-bottom-right-radius: 5px; }
.message.assistant { justify-self: start; background: white; border: 1px solid var(--ink-200); border-bottom-left-radius: 5px; box-shadow: 0 8px 22px rgba(16,42,67,.06); }
.message-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; color: var(--ink-500); font-size: .72rem; }
.sql-box { margin-top: 12px; padding: 12px; border-radius: 9px; color: #d9e2ec; background: #102a43; font: .76rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-x: auto; }
.ask-composer { padding: 17px; border-top: 1px solid var(--ink-100); background: white; }
.ask-composer-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.ask-composer textarea { min-height: 64px; max-height: 180px; }
.suggestion-list { display: grid; gap: 8px; }
.suggestion-button { text-align: left; border: 1px solid var(--ink-200); border-radius: 10px; padding: 11px 12px; background: white; color: var(--ink-700); font-size: .8rem; }
.suggestion-button:hover { border-color: var(--brand-secondary); color: var(--brand-primary); }

.empty-state { padding: 42px 24px; text-align: center; color: var(--ink-700); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink-950); font-size: 1.05rem; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px; background: var(--ink-100); font-size: 1.4rem; }
.callout { padding: 15px 16px; border-radius: 12px; border-left: 4px solid var(--brand-secondary); background: color-mix(in srgb, var(--brand-secondary) 7%, white); color: var(--ink-700); font-size: .83rem; line-height: 1.5; }
.callout.warning { border-left-color: var(--warning); background: #fff9ec; }
.callout strong { color: var(--ink-950); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(16,42,67,.56); backdrop-filter: blur(6px); }
.modal { width: min(760px, 100%); max-height: min(90vh, 880px); display: flex; flex-direction: column; border-radius: 22px; background: white; box-shadow: var(--shadow-modal); overflow: hidden; }
.modal.wide { width: min(1180px, 100%); }
.modal-header { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ink-100); }
.modal-header h2 { margin: 3px 0 0; font-size: 1.3rem; }
.modal-body { padding: 22px; overflow-y: auto; }
.report-viewer { width: 100%; height: min(72vh, 760px); border: 0; border-radius: 12px; background: var(--ink-100); }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; max-width: min(410px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; border-radius: 12px; color: white; background: var(--ink-950); box-shadow: 0 14px 38px rgba(16,42,67,.24); font-size: .85rem; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ink-100); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-copy strong, .toggle-copy span { display: block; }
.toggle-copy span { margin-top: 3px; color: var(--ink-500); font-size: .76rem; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--ink-300); transition: background .18s; }
.switch-track::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + .switch-track { background: var(--brand-secondary); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }

.mobile-only { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-grid, .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .ask-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .login-view { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-card { min-height: 100vh; padding: 32px max(22px, 7vw); }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(16,42,67,.22); }
  .sidebar.open { transform: translateX(0); }
  .app-column { width: 100%; }
  .mobile-only { display: grid; }
  .topbar { min-height: auto; flex-wrap: wrap; padding: 14px 16px; }
  .topbar-title { min-width: 0; flex: 1; }
  .topbar-controls { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .compact-field select { min-width: 0; }
  .main-content { padding: 22px 16px 40px; }
  .impersonation-banner { left: 0; align-items: flex-start; justify-content: space-between; }
}

@media (max-width: 620px) {
  .metric-grid, .company-grid, .report-grid, .content-grid.equal, .field-row { grid-template-columns: 1fr; }
  .page-intro { align-items: stretch; flex-direction: column; }
  .topbar-controls { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; gap: 4px; }
  .login-brand-block { grid-template-columns: 1fr; }
  .login-brand-block h1 { font-size: 2.2rem; }
  .ask-composer-row { grid-template-columns: 1fr; }
  .message { max-width: 96%; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 96vh; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* v0.1.2 central portfolio hierarchy */
.control-surface { --brand-primary:#111111; --brand-secondary:#123456; --brand-accent:#123456; }
.control-login .login-aside { background:#111111; }
.all-portals-button { margin: 4px 14px 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color:#d9e2ec; background:rgba(255,255,255,.055); text-align:left; font-weight:700; }
.all-portals-button:hover { background:rgba(255,255,255,.11); color:white; }
.selected-portal-chip { min-width:190px; padding:8px 12px; border:1px solid var(--ink-200); border-radius:12px; background:white; }
.selected-portal-chip span,.selected-portal-chip strong { display:block; }
.selected-portal-chip span { color:var(--ink-500); font-size:.68rem; text-transform:uppercase; letter-spacing:.07em; }
.selected-portal-chip strong { margin-top:2px; font-size:.88rem; }
.portal-chooser-intro { max-width:850px; margin-bottom:26px; }
.portal-chooser-intro h2 { margin:0 0 8px; font-size:clamp(1.6rem,3vw,2.5rem); letter-spacing:-.04em; }
.portal-chooser-intro p { margin:0; color:var(--ink-700); line-height:1.6; }
.portal-chooser-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.portal-choice { position:relative; overflow:hidden; min-height:310px; padding:0; border:1px solid var(--ink-200); border-radius:20px; background:white; box-shadow:var(--shadow-card); text-align:left; transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.portal-choice:hover { transform:translateY(-3px); box-shadow:0 22px 55px rgba(16,42,67,.14); border-color:#9fb3c8; }
.portal-choice-preview { height:118px; position:relative; overflow:hidden; display:grid; place-items:center; }
.portal-choice-preview.property-pulse { background:#f8f8f8 url('/assets/brands/property-pulse/login-bg.png') center/cover; }
.portal-choice-preview.tisdatapulse { background:#111 url('/assets/brands/tisdatapulse/login-bg-img.png') center 35%/cover; }
.portal-choice-preview.ticq { background:#173b75 url('/assets/brands/ticq/login-background-img.png') center/cover; }
.portal-choice-preview::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent,rgba(0,0,0,.09)); }
.portal-choice-preview img { position:relative; z-index:1; max-width:58%; max-height:68px; object-fit:contain; }
.portal-choice-preview.property-pulse img { max-width:42%; }
.portal-choice-preview.tisdatapulse img { filter:none; max-width:54%; }
.portal-choice-body { padding:20px; }
.portal-choice-body h3 { margin:0 0 6px; font-size:1.2rem; }
.portal-choice-domain { display:block; color:var(--ink-500); font-size:.74rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.portal-choice-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:20px; }
.portal-choice-stat { padding:10px 6px; border-radius:10px; background:var(--ink-50); text-align:center; }
.portal-choice-stat strong,.portal-choice-stat span { display:block; }
.portal-choice-stat strong { font-size:1.06rem; }
.portal-choice-stat span { margin-top:3px; color:var(--ink-500); font-size:.66rem; }
.portal-choice-action { margin-top:16px; display:flex; align-items:center; justify-content:space-between; color:var(--brand-secondary); font-size:.78rem; font-weight:800; }
.portal-context-note { margin-bottom:18px; padding:12px 14px; border-radius:12px; border:1px solid #d9e2ec; background:#fff; color:#52606d; font-size:.79rem; }
.output-brand-note { margin-top:10px; color:var(--ink-500); font-size:.72rem; line-height:1.45; }
@media(max-width:1000px){.portal-chooser-grid{grid-template-columns:1fr}.portal-choice{min-height:0}.portal-choice-preview{height:100px}}

/* v0.1.2 mobile navigation and selected-portal return contract */
.sidebar-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 78px;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: white;
  font-weight: 750;
  z-index: 2;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  border: 0;
  background: rgba(15,23,42,.48);
  backdrop-filter: blur(2px);
}
body.menu-open { overflow: hidden; }
.selected-portal-chip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  text-align: left;
  cursor: pointer;
}
.selected-portal-chip span,
.selected-portal-chip strong { grid-column: 1; }
.selected-portal-chip b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--brand-secondary);
  font-size: 1rem;
}
.selected-portal-chip:hover { border-color: var(--brand-secondary); background: var(--ink-50); }
.selected-portal-chip + .compact-field { margin-left: 0; }

@media (max-width: 860px) {
  .sidebar { padding-top: 58px; }
  .sidebar-close.mobile-only { display: flex; }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .topbar-controls { align-items: stretch; }
  .selected-portal-chip { width: 100%; min-width: 0; }
}


/* v0.1.3 techiserve Super Admin brand contract.
   Client portal CSS is intentionally not part of this theme. */
.control-surface {
  background:#f7f7f7;
  color:#111111;
}
.control-wordmark { display:block; height:auto; object-fit:contain; }
.loading-wordmark { width:min(290px,72vw); animation:none !important; }
.control-login .login-brand-block {
  grid-template-columns:1fr;
  gap:24px;
  margin-bottom:34px;
}
.login-wordmark { width:min(315px,82%); max-height:86px; object-position:left center; }
.control-brand-eyebrow { color:#123456; letter-spacing:.17em; text-transform:uppercase; }
.control-login .login-card { background:#ffffff; }
.control-login .login-aside {
  background-color:#111111;
  background-image:
    radial-gradient(circle at 86% 18%, rgba(18,52,86,.46), transparent 27%),
    linear-gradient(120deg, transparent 0 63%, rgba(255,255,255,.025) 63% 64%, transparent 64% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 42px);
}
.control-login .login-aside::before {
  inset:0;
  width:auto;
  height:auto;
  border-radius:0;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(18,52,86,.18) 28px, transparent 29px),
    radial-gradient(circle at 24% 72%, rgba(18,52,86,.28), transparent 24%);
  opacity:.8;
  filter:none;
}
.control-login .login-aside::after { display:none; }
.aside-wordmark { width:min(390px,72%); margin:0 0 46px; }
.control-login .login-aside h2 { max-width:760px; }
.control-login .feature-row strong { color:#ffffff; }
.control-login .feature-row span { color:#d9d9d9; }
.control-login .feature-row { border-color:rgba(255,255,255,.14); }
.control-login .eyebrow.light { color:#b7c8d8; }
.control-login .button-primary { background:#111111; box-shadow:0 10px 22px rgba(17,17,17,.14); }
.control-login .button-primary:hover { background:#2a2a2a; }
.control-login .text-button { color:#123456; }

.sidebar {
  background:#111111;
  border-right:1px solid #2a2a2a;
  padding-top:22px;
}
.sidebar-brand {
  display:grid;
  gap:8px;
  align-items:start;
  padding:4px 8px 24px;
}
.sidebar-wordmark { width:190px; max-width:100%; height:auto; object-fit:contain; object-position:left center; }
.sidebar-brand small { color:#a8a8a8; font-size:.68rem; letter-spacing:.045em; }
.primary-navigation { gap:4px; }
.nav-button { color:#c9c9c9; border-radius:9px; }
.nav-button:hover { background:#202020; color:#ffffff; }
.nav-button.active {
  color:#ffffff;
  background:#2a2a2a;
  box-shadow:inset 3px 0 #123456;
}
.nav-badge { color:#111111; background:#e6e6e6; }
.all-portals-button { color:#e6e6e6; border-color:#444444; background:#1d1d1d; }
.all-portals-button:hover { background:#2a2a2a; color:#ffffff; }
.sidebar-footer { border-color:#2a2a2a; }
.sidebar-user small { color:#9c9c9c; }
.sidebar-footer .icon-button { background:#1d1d1d; border-color:#444444; color:#ffffff; }
.user-avatar { background:#ffffff; color:#111111; border-radius:10px; }

.app-column { background:#f7f7f7; }
.topbar {
  background:rgba(255,255,255,.96);
  border-bottom:1px solid #e6e6e6;
  backdrop-filter:blur(16px);
}
.eyebrow { color:#123456; }
.selected-portal-chip { border-color:#e0e0e0; box-shadow:0 4px 16px rgba(17,17,17,.035); }
.selected-portal-chip:hover { border-color:#123456; background:#fafafa; }
.selected-portal-chip b { color:#123456; }
.metric-card,.panel,.company-card,.report-card,.portal-choice { border-color:#e0e0e0; box-shadow:var(--shadow-card); }
.portal-choice:hover,.company-card:hover,.report-card:hover { border-color:#bdbdbd; box-shadow:0 20px 46px rgba(17,17,17,.10); }
.portal-choice-action { color:#123456; }
.portal-choice-stat { background:#f4f4f4; }
.portal-context-note { border-color:#e6e6e6; color:#444444; }
.button-primary { background:#111111; color:#ffffff; box-shadow:0 10px 22px rgba(17,17,17,.14); }
.button-primary:hover { background:#2a2a2a; }
.button-secondary { color:#111111; background:#f2f2f2; border-color:#d9d9d9; }
.button-ghost { color:#444444; border-color:#d9d9d9; }
.text-button { color:#123456; }
.field input:focus,.field select:focus,.field textarea:focus,.compact-field select:focus {
  border-color:#123456;
  box-shadow:0 0 0 4px rgba(18,52,86,.10);
}
.switch input:checked + .switch-track { background:#123456; }
:focus-visible { outline-color:#123456; }

@media(max-width:860px){
  .sidebar { padding-top:58px; }
  .sidebar-wordmark { width:175px; }
  .sidebar-close { background:#2a2a2a; border-color:#444444; }
}

/* v0.2.0 Super User internal-login minimalism contract */
.control-login .login-brand-block { display:block; margin-bottom:30px; }
.control-login .login-brand-block > div { margin-top:32px; }
.control-login .login-brand-block h1 { max-width:620px; margin:6px 0 8px; }
.control-login .login-brand-block .muted { max-width:420px; }
.control-login .login-aside { align-items:center; justify-content:center; }
.control-login .login-aside-minimal { width:min(520px,72%); max-width:none; display:flex; align-items:center; justify-content:center; }
.control-login .login-aside-minimal .aside-wordmark { width:100%; max-width:470px; }
.control-login .login-footer { margin-top:22px; font-size:.82rem; letter-spacing:.01em; }

/* v0.2.3 Company -> Report -> Report Role -> User access editor */
.access-company { border: 1px solid var(--line); }
.access-report-list { display: grid; gap: 10px; padding-top: 4px; }
.access-report-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(220px,1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.access-report-row label { display: flex; align-items: center; gap: 8px; }
.access-report-row select { width: 100%; min-height: 38px; }
@media (max-width: 720px) { .access-report-row { grid-template-columns: 1fr; } }

/* v0.2.3 company workspace and user-management refinement */
.company-workspace-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:8px 0 22px;border-bottom:1px solid #e6e6e6}.company-workspace-title{min-width:0}.company-workspace-title h2{margin:5px 0 4px;font-size:2rem;letter-spacing:-.04em}.company-workspace-title p{margin:0;color:#6b7280}.workspace-eyebrow{display:block;color:#123456;font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.workspace-back{padding:0 0 12px;border:0;background:transparent;color:#5b6570;font:inherit;font-size:.78rem;cursor:pointer}.workspace-back:hover{color:#111}.company-workspace-actions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}.workspace-tabs{display:flex;gap:28px;margin:0 0 24px;border-bottom:1px solid #e6e6e6}.workspace-tab{position:relative;padding:16px 2px 14px;border:0;background:transparent;color:#727982;font:inherit;font-weight:700;cursor:pointer}.workspace-tab.active{color:#111}.workspace-tab.active::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#123456}.workspace-section{display:grid;gap:18px}.workspace-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.workspace-section-heading h3{margin:0 0 5px;font-size:1.18rem}.workspace-section-heading p{margin:0;color:#6b7280}.workspace-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.workspace-overview-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:18px}.workspace-mini-list{display:grid}.workspace-mini-list>div{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #ececec}.workspace-mini-list>div:last-child{border-bottom:0}.workspace-mini-list span:first-child{display:grid;gap:2px}.workspace-mini-list small{color:#777}.company-user-list{display:grid;gap:10px}.company-user-card{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:14px;padding:15px 16px;border:1px solid #e6e6e6;border-radius:13px;background:#fff}.company-user-avatar{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:#f1f3f5;color:#20262d;font-size:.75rem;font-weight:800}.company-user-main{min-width:0;display:grid;gap:2px}.company-user-main>span{color:#69717a;font-size:.8rem}.company-user-meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:5px;color:#737a82;font-size:.72rem}.company-user-meta>span:not(.company-user-reports){padding:4px 7px;border-radius:999px;background:#f5f6f7}.company-user-reports{max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.company-user-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.danger-text{color:#8b2f2f!important}.report-assignment-fieldset{display:grid;gap:9px;border:1px solid #e2e5e8;border-radius:12px;padding:14px}.report-assignment-fieldset legend{padding:0 6px;font-weight:800}.company-report-assignment{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1fr);align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #efefef}.company-report-assignment:last-child{border-bottom:0}.company-report-assignment label{display:flex;align-items:center;gap:7px}.company-report-assignment select{min-height:40px}.bulk-preview{display:grid;gap:4px;padding:13px 15px;border-radius:10px;background:#f4f7f9;border:1px solid #dbe2e7}.bulk-preview span{color:#66717c;font-size:.8rem}.bulk-credentials textarea{width:100%;min-height:130px;padding:11px;border:1px solid #d7dce1;border-radius:9px;font:12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:1000px){.workspace-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-overview-grid{grid-template-columns:1fr}.company-user-card{grid-template-columns:44px minmax(0,1fr)}.company-user-actions{grid-column:1/-1;justify-content:flex-start;padding-left:58px}}
@media(max-width:700px){.company-workspace-hero,.workspace-section-heading{align-items:stretch;flex-direction:column}.company-workspace-actions{justify-content:flex-start}.workspace-tabs{gap:18px;overflow-x:auto}.workspace-metrics{grid-template-columns:1fr 1fr}.company-user-card{grid-template-columns:38px minmax(0,1fr);padding:13px}.company-user-avatar{width:38px;height:38px}.company-user-actions{padding-left:52px}.company-report-assignment{grid-template-columns:1fr}.company-user-reports{max-width:70vw}}
@media(max-width:480px){.workspace-metrics{grid-template-columns:1fr}.company-user-actions{padding-left:0;grid-column:1/-1}.company-workspace-title h2{font-size:1.6rem}}
/* v0.2.3 Company Workspace refinement: avoid repeating the page title/actions already present in the app header. */
.company-workspace-context{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:4px;min-height:38px}.company-workspace-context-copy{display:flex;align-items:center;gap:14px;color:var(--text-muted);font-size:.82rem}.company-workspace-context .workspace-back{margin:0}.workspace-section-heading{margin-top:18px}
@media(max-width:700px){.company-workspace-context{align-items:flex-start}.company-workspace-context-copy{align-items:flex-start;flex-direction:column;gap:7px}}

/* v0.2.3 report catalogue and report-level carousel artwork */
.report-config-section{padding:16px 0;border-top:1px solid #e7eaee}.report-config-section h3{margin:0 0 4px}.section-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.report-carousel-logo-preview{width:150px;height:86px;padding:6px;border:1px solid #e2e6ea;border-radius:10px;background:#fff;object-fit:contain}.compact-file{max-width:320px}.page-sync-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0;color:#697480;font-size:.78rem}.report-page-catalogue{max-height:270px;overflow:auto;border:1px solid #e7eaee;border-radius:10px}.report-page-row{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #edf0f3}.report-page-row:last-child{border-bottom:0}.report-page-row>div{min-width:0}.report-page-row strong,.report-page-row span{display:block}.report-page-row div>span{margin-top:2px;color:#77828d;font-size:.7rem;overflow:hidden;text-overflow:ellipsis}.page-order{width:26px;height:26px;border-radius:50%;display:grid!important;place-items:center;background:#f1f3f5;color:#34404d;font-size:.72rem;font-weight:700}@media(max-width:650px){.section-row{align-items:flex-start;flex-direction:column}.report-carousel-logo-preview{width:130px}.report-page-row{grid-template-columns:30px 1fr}.report-page-row>.status-pill{grid-column:2}}

/* v0.2.9: one accessible password-visibility treatment on every secret field. */
.password-control{position:relative;display:block;width:100%}.password-control>input{width:100%;padding-right:52px}.password-toggle{position:absolute;right:7px;top:50%;transform:translateY(-50%);width:38px;height:38px;padding:9px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:var(--ink-700)}.password-toggle:hover{background:var(--ink-100);color:var(--ink-950)}.password-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.password-toggle .eye-slash{display:none}.password-toggle[aria-pressed="true"] .eye-slash{display:block}.password-toggle:focus-visible{outline:3px solid color-mix(in srgb,var(--brand-accent) 78%,white);outline-offset:1px}

/* v0.2.10: compact, touch-safe Super User navigation and actions on phones. */
@media(max-width:860px){.sidebar{left:8px;top:8px;bottom:8px;width:min(304px,calc(100vw - 34px));height:auto;padding:58px 12px max(12px,env(safe-area-inset-bottom));border-radius:18px}.sidebar-close{top:10px;right:10px;min-width:40px;width:40px;height:40px;padding:0;font-size:0}.sidebar-close::before{content:"×";font-size:1.2rem}.sidebar-brand{padding:0 4px 18px}.sidebar-wordmark{width:168px}.primary-navigation{overflow-y:auto}.nav-button,.all-portals-button{min-height:46px;padding:11px 12px}.sidebar-footer{padding-top:12px}.sidebar-backdrop{background:rgba(12,20,28,.52)}.icon-button{min-width:42px;width:42px;height:42px}.button{min-height:44px}.topbar{padding:10px 12px}.main-content{padding:18px 12px 36px}.action-row{flex-wrap:wrap}.action-row .button{flex:1 1 140px}}
@media(max-width:620px){.login-card{padding:28px 20px}.login-brand-block h1{font-size:clamp(1.85rem,10vw,2.2rem)}.topbar-controls{gap:8px}.panel,.metric-card,.company-card,.report-card{padding:16px}.modal{max-height:calc(100dvh - 20px)}.modal-header,.modal-body{padding:16px}.workspace-tabs{gap:16px;scrollbar-width:none}.workspace-tab{min-height:46px;white-space:nowrap}.company-user-actions .button{flex:1 1 120px}}
