:root {
  color-scheme: dark;
  --ink: #eef6f8;
  --muted: #8fa7ad;
  --quiet: #557079;
  --night: #061014;
  --panel: #0b181d;
  --panel-2: #102229;
  --line: #1d3942;
  --signal: #47e6c1;
  --signal-dark: #0f7f6d;
  --warning: #ffc86b;
  --danger: #ff8d8d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--night); color: var(--ink); }
body { min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 296px minmax(0, 1fr); }
.page-with-sidebar { min-height: 100vh; display: grid; grid-template-columns: 296px minmax(0, 1fr); }
.page-with-sidebar > .sidebar { position: sticky; top: 0; }
.page-content { min-width: 0; }
.project-item { text-decoration: none; }
.conversation-item > a { min-width: 0; height: 36px; padding: 0 9px; display: flex; align-items: center; overflow: hidden; color: inherit; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.sidebar-actions .active { border-color: var(--signal-dark); color: var(--signal); background: #0c2924; }
.shared-sidebar-error { padding: 12px; color: var(--danger); font-size: .82rem; }
.sidebar { height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: #081419; padding: 28px 22px; display: flex; flex-direction: column; gap: 24px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border: 1px solid var(--signal-dark); border-radius: 10px; display: grid; place-items: center; color: var(--signal); font-weight: 800; }
.brand-mark img { width: 31px; height: 31px; object-fit: contain; }
.brand-row strong, .brand-row span { display: block; }
.brand-row strong { letter-spacing: .09em; }
.brand-row span { color: var(--muted); font-size: .82rem; margin-top: 2px; }

.agent-card { padding: 18px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-avatar { position: relative; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; color: var(--signal); font-size: 1.6rem; font-weight: 700; border: 1px solid var(--signal-dark); background: #0d2625; margin-bottom: 18px; }
.agent-avatar img { width: 55px; height: 55px; object-fit: contain; }
.pulse { position: absolute; right: 4px; bottom: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); border: 3px solid #0d2625; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.agent-card h2 { margin: 0; font-size: 1.2rem; }
.agent-meta { color: var(--muted); line-height: 1.5; margin: 12px 0 0; font-size: .86rem; }
.project-navigation { display: grid; gap: 8px; }
.nav-section-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-section-heading button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--signal); background: var(--panel); font-size: 1.1rem; line-height: 1; }
.history-heading { margin-top: 12px; }
.project-list, .conversation-list { display: grid; gap: 4px; }
.project-item, .conversation-item { min-width: 0; border-radius: 8px; }
.project-item { min-height: 36px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; color: var(--muted); background: transparent; text-align: left; }
.project-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item small { color: var(--quiet); }
.project-item:hover, .project-item.active, .conversation-item:hover, .conversation-item.active { color: var(--ink); background: var(--panel-2); }
.project-item.active { box-shadow: inset 2px 0 var(--signal); }
.conversation-item { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; }
.conversation-item > button { min-width: 0; height: 36px; padding: 0 9px; overflow: hidden; border: 0; color: inherit; background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.conversation-item .rename-conversation { padding: 0; text-align: center; color: var(--quiet); font-size: 1rem; }
.conversation-item .rename-conversation:hover { color: var(--signal); }
.empty-history { margin: 4px 9px; color: var(--quiet); font-size: .78rem; }
.guardrails ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; color: var(--muted); font-size: .88rem; }
.guardrails li { display: flex; align-items: center; gap: 9px; }
.guardrails li span { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--signal); }
.specialist-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.specialist-row { display: flex; align-items: center; gap: 10px; }
.specialist-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--warning); color: var(--warning); font-weight: 800; }
.forge-mark { border-color: #8fa7ff; color: #aebcff; }
.specialist-row strong, .specialist-row span { display: block; }
.specialist-row span, .specialist-card > p:last-child { color: var(--muted); font-size: .78rem; }
.specialist-card > p:last-child { margin: 12px 0 0; }
.sidebar-actions { margin-top: auto; display: grid; gap: 10px; }
.secondary-button, .text-button { min-height: 42px; border-radius: 9px; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); }
.link-button { display: grid; place-items: center; text-decoration: none; font-size: .88rem; }
.text-button { border: 0; color: var(--muted); background: transparent; }
.signed-in-user { margin: 2px 0 0; color: var(--quiet); text-align: center; font-size: .76rem; text-transform: capitalize; }

.workspace { min-width: 0; height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.topbar { min-height: 104px; display: flex; justify-content: space-between; align-items: center; padding: 22px 34px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.dashboard-link { min-height: 38px; padding: 0 14px; display: grid; place-items: center; border: 1px solid var(--signal-dark); border-radius: 8px; color: var(--signal); background: #0c2924; text-decoration: none; font-size: .8rem; font-weight: 750; }
.dashboard-link:hover { background: #113b33; }
.conversation-project { min-width: 150px; height: 30px; margin-top: 8px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel); font-size: .76rem; outline: none; }
.conversation-project:focus { border-color: var(--signal-dark); }
.task-panel { padding: 14px 34px 16px; border-bottom: 1px solid var(--line); background: #081419; }
.task-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.task-panel-heading h2 { margin: 0; font-size: .98rem; }
.active-task-count { color: var(--muted); font-size: .75rem; }
.task-heading-actions { display: flex; align-items: center; gap: 12px; }
.task-heading-actions a { color: var(--signal); font-size: .75rem; text-decoration: none; }
.task-carousel { width: min(100%, 1114px); display: grid; grid-template-columns: 34px minmax(0, 1030px) 34px; align-items: stretch; gap: 8px; }
.task-list { min-height: 78px; display: flex; gap: 10px; overflow-x: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.task-nav { width: 34px; min-height: 78px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--signal); background: var(--panel); font-size: 1.35rem; }
.task-nav:hover:not(:disabled) { border-color: var(--signal-dark); background: var(--panel-2); }
.task-nav:disabled { opacity: .28; cursor: default; }
.task-card { flex: 0 0 250px; min-width: 0; padding: 11px 12px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--panel); text-align: left; }
.task-card { scroll-snap-align: start; }
.task-card:hover { border-color: var(--signal-dark); }
.task-card.completed { opacity: .7; }
.task-card.failed { border-color: #713b3b; }
.task-card-top { display: flex; justify-content: space-between; gap: 8px; }
.task-card-top strong { color: var(--signal); font-size: .72rem; letter-spacing: .08em; }
.task-card-top small, .task-meta { color: var(--muted); font-size: .7rem; text-transform: capitalize; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 650; }
.task-card progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 999px; background: var(--line); accent-color: var(--signal); }
.task-card progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.task-card progress::-webkit-progress-value { background: var(--signal); border-radius: 999px; }
.task-card.failed progress::-webkit-progress-value { background: var(--danger); }
.empty-tasks { margin: 2px 0; color: var(--quiet); font-size: .78rem; }
.connection-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.connection-state > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.connection-state[data-state="reconnecting"] > span:first-child { background: var(--warning); }
.connection-state[data-state="server-only"] > span:first-child { background: var(--muted); }
.conversation { overflow-y: auto; padding: 44px max(24px, calc((100% - 860px) / 2)); }
.welcome-state { max-width: 780px; margin: 7vh auto 0; }
.welcome-state h2 { margin: 0; max-width: 650px; font-size: clamp(2rem, 5vw, 3.8rem); letter-spacing: -.055em; line-height: .98; }
.welcome-state > p:not(.eyebrow) { max-width: 590px; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.prompt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 34px; }
.prompt-grid button { min-height: 112px; padding: 16px; text-align: left; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; line-height: 1.45; }
.prompt-grid button:hover, .prompt-grid button:focus-visible { border-color: var(--signal-dark); background: var(--panel-2); }
.messages { display: grid; gap: 24px; max-width: 860px; margin: 0 auto; }
.message { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; }
.message-label { color: var(--muted); font-size: .8rem; font-weight: 700; padding-top: 12px; }
.message-body { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; line-height: 1.65; background: var(--panel); overflow-wrap: anywhere; }
.message.user .message-body { background: #10242a; }
.message.pending .message-body { color: var(--muted); }
.composer-wrap { padding: 18px max(24px, calc((100% - 860px) / 2)) 24px; border-top: 1px solid var(--line); background: #081419; }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.composer:focus-within { border-color: var(--signal-dark); }
.composer textarea { width: 100%; min-height: 44px; max-height: 160px; padding: 10px 0; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; line-height: 1.5; }
.composer button, .login-panel button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 9px; background: var(--signal); color: #03110f; font-weight: 800; }
.composer button:disabled, .login-panel button:disabled { opacity: .55; cursor: wait; }
.composer-wrap > p { margin: 9px 2px 0; text-align: center; color: var(--quiet); font-size: .78rem; }

.login-body { display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(960px, 100%); min-height: 590px; display: grid; grid-template-columns: 1.1fr .9fr; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.login-shell-simple { width: min(460px, 100%); min-height: 0; display: block; }
.login-mark, .login-panel { padding: clamp(32px, 6vw, 68px); display: flex; flex-direction: column; justify-content: center; }
.login-mark { background: #07181b; border-right: 1px solid var(--line); }
.orb { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 48px; color: var(--signal); font-size: 2.3rem; font-weight: 800; border: 1px solid var(--signal-dark); background: #0d2625; }
.login-mark h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 5.6rem); letter-spacing: -.07em; line-height: .9; }
.login-mark > p:last-child { color: var(--muted); max-width: 480px; line-height: 1.65; }
.login-panel { background: var(--panel); }
.login-panel h2 { margin: 0 0 30px; font-size: 2rem; }
.login-identity { text-align: center; margin-bottom: 28px; }
.login-logo { display: block; width: 104px; height: 104px; object-fit: contain; margin: 0 auto 12px; }
.login-name { margin: 0 0 8px; color: var(--signal); font-size: .82rem; font-weight: 800; letter-spacing: .22em; }
.login-identity h2 { margin-bottom: 0; }
.login-panel form { display: grid; gap: 10px; }
.login-panel label { color: var(--muted); font-size: .84rem; font-weight: 650; margin-top: 9px; }
.login-panel input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #081419; outline: none; }
.login-panel input:focus { border-color: var(--signal-dark); }
.login-panel button { margin-top: 14px; }
.form-error { margin: 6px 0 0; color: var(--danger); font-size: .86rem; }
.security-note { color: var(--quiet); font-size: .78rem; line-height: 1.5; margin-top: 24px; }
.team-body { min-height: 100vh; background: var(--night); }
.team-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 60px; }
.account-shell { width: min(680px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 60px; }
.account-panel { margin-top: 30px; }
.team-header { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.team-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; }
.back-link { color: var(--signal); text-decoration: none; font-weight: 700; }
.team-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 28px; margin-top: 30px; align-items: start; }
.team-panel { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.team-panel h2 { margin: 0 0 8px; }
.team-panel > p { color: var(--muted); line-height: 1.55; }
.team-form { display: grid; gap: 10px; margin-top: 20px; }
.team-form label { color: var(--muted); font-size: .84rem; font-weight: 650; margin-top: 6px; }
.team-form input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #081419; outline: none; }
.team-form input:focus { border-color: var(--signal-dark); }
.team-form button { min-height: 44px; margin-top: 12px; border: 0; border-radius: 9px; background: var(--signal); color: #03110f; font-weight: 800; }
.manager-list { display: grid; gap: 10px; margin-top: 20px; }
.manager-row { display: grid; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.manager-row:last-child { border-bottom: 0; }
.manager-row strong, .manager-row span { display: block; }
.manager-row span { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.manager-controls { display: grid; gap: 12px; }
.permission-options { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.permission-options legend { padding: 0 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.permission-choice { display: flex !important; align-items: center; gap: 7px; color: var(--ink) !important; margin: 0 !important; }
.permission-choice input { width: 17px; height: 17px; accent-color: var(--signal); }
.create-permissions { margin-top: 7px; }
.manager-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.password-reset-form label, .fixed-access { color: var(--muted); font-size: .78rem; }
.password-reset-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.password-reset-form input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #081419; outline: none; }
.password-reset-form button { padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel-2); }
.fixed-access { margin: 0; }
.status-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel-2); }
.status-button.enable { border-color: var(--signal-dark); color: var(--signal); }
.team-message { min-height: 22px; color: var(--signal); font-size: .86rem; }
.team-message.error { color: var(--danger); }
.dashboard-body { min-height: 100vh; background: var(--night); }
.dashboard-shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 60px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.dashboard-identity { display: flex; align-items: center; gap: 14px; }
.dashboard-identity img { width: 52px; height: 52px; object-fit: contain; }
.dashboard-header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
.dashboard-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.dashboard-actions button, .dashboard-actions a { min-height: 38px; padding: 0 13px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); text-decoration: none; }
.dashboard-actions .primary-action { border-color: var(--signal); color: #03110f; background: var(--signal); font-weight: 800; }
.data-state { padding: 7px 10px; border-radius: 999px; color: var(--warning); background: #2a2417; font-size: .76rem; }
.data-state[data-state="live"] { color: var(--signal); background: #0c2924; }
.data-state[data-state="error"] { color: var(--danger); background: #2b1717; }
.dashboard-notice { display: flex; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--panel); font-size: .82rem; }
.dashboard-notice strong { color: var(--signal); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.metric-card, .dashboard-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.metric-card { padding: 18px; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: .8rem; }
.metric-card strong { display: block; margin: 12px 0 8px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.04em; }
.metric-card small { font-size: .72rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 18px; margin-top: 18px; }
.dashboard-panel { min-width: 0; padding: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.panel-heading > span { color: var(--muted); font-size: .74rem; }
.monthly-list { display: grid; gap: 16px; }
.month-row { display: grid; gap: 7px; }
.month-row > strong { font-size: .78rem; }
.month-row > div { display: grid; grid-template-columns: 62px minmax(60px, 1fr) 100px; align-items: center; gap: 8px; }
.month-row span, .month-row small { color: var(--muted); font-size: .68rem; }
.month-row small { text-align: right; }
.month-row progress { width: 100%; height: 7px; accent-color: var(--signal); }
.month-row progress.expense { accent-color: var(--warning); }
.table-wrap { overflow-x: auto; }
.dashboard-panel table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.dashboard-panel th, .dashboard-panel td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dashboard-panel th { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.record-status { color: var(--signal); text-transform: capitalize; }
.empty-records { padding: 28px 8px !important; color: var(--muted); text-align: center !important; }
.sales-entry-panel { margin-top: 18px; }
.sales-entry-panel td small { display: block; margin-top: 4px; color: var(--muted); }
.record-status.draft { color: var(--warning); }
.sale-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); box-shadow: 0 24px 90px #000a; }
.sale-dialog::backdrop { background: #02080bcc; backdrop-filter: blur(3px); }
.sale-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sale-dialog-header h2 { margin: 0; font-size: 1.4rem; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--panel-2); font-size: 1.4rem; }
.sale-step { padding: 22px; }
.sale-step[hidden] { display: none; }
.modal-intro { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.sale-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.sale-form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.sale-form-grid label small { color: var(--quiet); font-weight: 500; }
.sale-form-grid .wide-field { grid-column: 1 / -1; }
.sale-form-grid input, .sale-form-grid select, .sale-form-grid textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: #081419; }
.sale-form-grid textarea { resize: vertical; }
.sale-form-grid input:focus, .sale-form-grid select:focus, .sale-form-grid textarea:focus { border-color: var(--signal-dark); }
.draft-hint, .review-status { margin: 16px 0 0; padding: 11px 12px; border: 1px solid #5b4a25; border-radius: 8px; color: var(--warning); background: #211d14; font-size: .8rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions button { min-height: 42px; padding: 0 16px; border-radius: 8px; font-weight: 750; }
.secondary-modal-button { border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); }
.primary-modal-button { border: 1px solid var(--signal); color: #03110f; background: var(--signal); }
.primary-modal-button:disabled { opacity: .55; cursor: wait; }
.sale-review-list { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sale-review-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.sale-review-list > div:last-child { border-bottom: 0; }
.sale-review-list dt { color: var(--muted); font-size: .78rem; }
.sale-review-list dd { margin: 0; overflow-wrap: anywhere; }
.sale-success { text-align: center; padding: 38px 24px; }
.success-mark { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; color: #03110f; background: var(--signal); font-size: 1.5rem; font-weight: 900; }
.sale-success h3 { margin: 0 0 10px; }
.sale-success p { color: var(--muted); line-height: 1.55; }
.sale-success code { display: block; padding: 10px; overflow-wrap: anywhere; border-radius: 8px; color: var(--signal); background: #071318; }
.history-body { min-height: 100vh; background: var(--night); }
.history-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 60px; }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.history-header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.history-toolbar strong, .history-toolbar span { display: block; }
.history-toolbar strong { color: var(--signal); font-size: .84rem; }
.history-toolbar span { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.history-toolbar input { width: min(360px, 40vw); height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #081419; outline: none; }
.history-toolbar input:focus { border-color: var(--signal-dark); }
.history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
.history-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.history-panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.history-panel-heading h2 { margin: 0; font-size: 1.05rem; }
.history-panel-heading > span { color: var(--muted); font-size: .72rem; }
.history-list { display: grid; gap: 6px; max-height: 68vh; overflow-y: auto; }
.history-row { min-width: 0; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: #0a151a; text-decoration: none; }
.history-row:hover { border-color: var(--signal-dark); background: var(--panel-2); }
.history-row span, .history-row strong, .history-row small { min-width: 0; display: block; }
.history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.history-row strong b { margin-right: 5px; color: var(--signal); font-size: .68rem; letter-spacing: .07em; }
.history-row small, .history-row time { color: var(--muted); font-size: .7rem; }
.history-row small { margin-top: 5px; text-transform: capitalize; }
.history-row time { flex: 0 0 auto; }
.empty-history-records { color: var(--muted); font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .page-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { min-height: 84px; padding: 18px 20px; }
  .task-panel { padding: 12px 18px; }
  .task-carousel { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 6px; }
  .task-card { flex-basis: min(250px, 100%); }
  .connection-state { display: none; }
  .conversation { padding: 28px 18px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-grid button { min-height: 72px; }
  .message { grid-template-columns: 1fr; gap: 6px; }
  .message-label { padding: 0; }
  .composer-wrap { padding: 14px 14px 18px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-mark { display: none; }
  .team-grid { grid-template-columns: 1fr; }
  .team-header { align-items: start; flex-direction: column; }
  .dashboard-header, .dashboard-notice { align-items: start; flex-direction: column; }
  .metric-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .sale-form-grid { grid-template-columns: 1fr; }
  .sale-form-grid .wide-field { grid-column: auto; }
  .history-header, .history-toolbar { align-items: stretch; flex-direction: column; }
  .history-toolbar input { width: 100%; }
  .history-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
