:root {
  color-scheme: dark;
  --bg: #080d12;
  --surface: #101820;
  --surface-2: #151f28;
  --surface-3: #1b2731;
  --line: #2b3b47;
  --text: #edf3f6;
  --muted: #8fa4b1;
  --label: #c5d1d7;
  --teal: #56d6c4;
  --green: #7ce39d;
  --red: #ff7187;
  --amber: #f2c66d;
  --blue: #79b9ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 14px; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.8rem, 6vw, 5.4rem); letter-spacing: -.04em; line-height: .96; }
h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.03em; }
h3 { font-size: 1rem; }
.app-shell { min-height: 100vh; }
.muted, small { color: var(--muted); }
.eyebrow { color: var(--teal); font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; border: 1px solid rgba(86,214,196,.6); border-radius: 12px; color: var(--teal); font-size: 1.1rem; font-weight: 900; letter-spacing: .08em; background: #10262a; }
.brand-image { display: block; width: 58px; height: 58px; flex: 0 0 auto; border: 1px solid rgba(86,214,196,.6); border-radius: 12px; background: #10262a; }
.brand-image.small { width: 36px; height: 36px; border-radius: 8px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 8px; font-size: .72rem; }

.auth-view { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 480px); align-items: center; gap: clamp(40px, 8vw, 120px); width: min(1120px, calc(100% - 48px)); min-height: 100vh; margin: auto; padding: 56px 0; }
.auth-brand { display: grid; gap: 22px; max-width: 570px; }
.auth-brand > div:not(.brand-mark) { display: grid; gap: 14px; }
.auth-panel { padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin: -4px -4px 24px; }
.tab-button { position: relative; border: 0; background: transparent; color: var(--muted); padding: 12px; font-weight: 700; }
.tab-button.active { color: var(--text); }
.tab-button.active::after { content: ""; position: absolute; bottom: -1px; left: 16px; right: 16px; height: 2px; background: var(--teal); }
.form-stack { display: grid; gap: 15px; }
.form-stack label, .field-label { display: grid; gap: 7px; color: var(--label); font-size: .82rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--text); background: #0c1319; padding: 11px 12px; }
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(86,214,196,.12); }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.primary-button, .danger-button, .secondary-button, .quiet-button, .icon-button { border: 1px solid transparent; border-radius: 6px; padding: 11px 14px; color: var(--text); font-weight: 800; transition: .18s ease; }
.primary-button { background: #167d72; border-color: #32ad9d; }
.primary-button:hover { background: #209b8d; }
.secondary-button { background: #19303a; border-color: #35606a; }
.secondary-button:hover { border-color: var(--teal); }
.danger-button { background: #49232c; border-color: #a04455; color: #ffdce1; }
.danger-button:hover { background: #67303c; }
.quiet-button { background: transparent; border-color: transparent; color: var(--muted); }
.quiet-button:hover { color: var(--text); background: var(--surface-2); }
.quiet-button.full { width: 100%; text-align: left; }
.icon-button { min-width: 40px; background: var(--surface-2); border-color: var(--line); font-size: 1.1rem; }
.icon-button:hover { border-color: var(--teal); color: var(--teal); }
.verify-note { padding: 12px; background: #12262b; border: 1px solid #27565a; border-radius: 6px; color: #bfe5df; line-height: 1.5; }
.connection-line { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--muted); font-size: .78rem; }
.connection-line.compact { margin: 0 0 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(242,198,109,.13); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(124,227,157,.14); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 3px rgba(255,113,135,.14); }
.auth-footer { grid-column: 1 / -1; align-self: end; color: var(--muted); font-size: .75rem; }
.auth-downloads { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); align-items: center; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.auth-downloads h2 { margin-top: 6px; font-size: 1.35rem; }
.auth-downloads .muted { margin-top: 6px; font-size: .82rem; }
.auth-download-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-download-list .download-button { min-width: 0; width: 100%; }

.dashboard-view { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.dashboard-downloads { grid-column: 1 / -1; grid-row: 1; justify-content: center; border-bottom: 1px solid var(--line); background: #0b1117; padding: 13px 22px; }
.dashboard-downloads .download-button { flex: 0 1 260px; }
.sidebar { display: flex; flex-direction: column; gap: 36px; border-right: 1px solid var(--line); background: #0b1117; padding: 22px 14px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 3px; font-size: .68rem; }
.main-nav { display: grid; gap: 4px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); padding: 11px 12px; text-align: left; font-weight: 700; }
.nav-button:hover, .nav-button.active { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.nav-icon { display: grid; place-items: center; width: 22px; color: var(--teal); font-size: 1rem; }
.sidebar-bottom { margin-top: auto; padding: 0 8px; }
.main-content { min-width: 0; padding: 22px clamp(18px, 4vw, 54px) 48px; }
.admin-lock-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(6, 11, 15, .9); }
.admin-lock-panel { width: min(390px, 100%); padding: 26px; text-align: center; }
.admin-lock-panel p { margin: 10px 0 18px; color: var(--muted); line-height: 1.5; }
.admin-lock-panel button { width: 100%; }
.admin-pin-panel { width: min(430px, 100%); padding: 26px; }
.admin-pin-panel > p { margin: 10px 0 18px; color: var(--muted); line-height: 1.5; }
.admin-pin-panel .actions-row { justify-content: stretch; }
.admin-pin-panel .actions-row button { flex: 1 1 0; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.topbar h2 { margin-top: 5px; }
.topbar-actions, .profile-chip, .client-downloads { display: flex; align-items: center; gap: 10px; }
.client-downloads { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: end; }
.download-button { display: inline-flex; align-items: center; gap: 11px; min-width: 224px; min-height: 66px; border: 1px solid #35606a; border-radius: 8px; background: #12262b; color: var(--text); padding: 10px 13px; text-decoration: none; transition: .18s ease; }
.download-button:hover { border-color: var(--teal); background: #19363b; }
.download-button.disabled { border-color: var(--line); background: var(--surface-2); color: var(--muted); cursor: not-allowed; opacity: .72; }
.download-button img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 8px; }
.download-button span { display: grid; gap: 2px; text-align: left; }
.download-button small { color: var(--teal); font-size: .62rem; font-weight: 800; letter-spacing: .08em; line-height: 1.1; }
.download-button strong { font-size: .9rem; line-height: 1.15; }
.download-button .download-version { color: var(--muted); font-size: .68rem; font-style: normal; line-height: 1.15; }
.profile-chip { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 6px 6px; color: var(--muted); }
.profile-chip > span:first-child { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; background: #1a3c43; color: var(--teal); font-size: .72rem; font-weight: 900; }
.message { margin: 0 0 18px; border: 1px solid #35606a; border-radius: 6px; background: #12262b; color: #ccebe6; padding: 11px 13px; line-height: 1.45; }
.message.error { border-color: #9c3d50; background: #321b22; color: #ffd9df; }
.message.success { border-color: #3a895f; background: #142a21; color: #d6f5df; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 28px 0 13px; }
.section-header p { color: var(--muted); margin-top: 4px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 9px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 116px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric-card .metric-label { color: var(--muted); font-size: .75rem; font-weight: 700; }
.metric-card strong { display: block; margin-top: 15px; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.03em; }
.metric-card.positive strong { color: var(--green); }
.metric-card.negative strong { color: var(--red); }
.metric-card.info strong { color: var(--blue); }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 14px; align-items: start; }
.data-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.data-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.data-panel-header p { color: var(--muted); font-size: .78rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 12px 14px; border-bottom: 1px solid rgba(43,59,71,.72); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
td { color: #dce6ea; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.account-list, .trade-list, .user-list { display: grid; gap: 10px; padding: 12px; }
.account-card, .trade-card, .user-card { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); padding: 15px; }
.account-card { display: grid; grid-template-columns: minmax(170px, 1.25fr) repeat(3, minmax(90px, .7fr)) auto; gap: 13px; align-items: center; }
.account-main strong, .account-main small { display: block; }
.account-main small { margin-top: 5px; }
.account-value span, .account-value small { display: block; }
.account-value small { color: var(--muted); font-size: .7rem; }
.account-value span { margin-top: 5px; font-weight: 800; }
.account-value.positive span { color: var(--green); }
.account-value.negative span { color: var(--red); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.status-pill.online { background: #15352d; color: var(--green); }
.status-pill.offline { background: #3a2027; color: var(--red); }
.status-pill.pending { background: #3b321d; color: var(--amber); }
.account-actions { grid-column: 1 / -1; border-top: 1px solid rgba(43,59,71,.7); padding-top: 10px; }
.account-actions summary { display: inline-block; font-size: .76rem; }
.account-actions .actions-row { margin-top: 9px; }
.empty-state { padding: 34px 18px; text-align: center; color: var(--muted); }
.notice-banner { margin-bottom: 14px; padding: 15px 18px; border: 1px solid #a94a5c; border-left: 4px solid var(--red); border-radius: 7px; background: #351b22; color: #ffdde2; }
.notice-banner strong { display: block; margin-bottom: 5px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 14px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar input { width: 150px; }
.trade-card { display: grid; gap: 13px; }
.trade-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.trade-head strong { font-size: 1rem; }
.trade-head small { display: block; margin-top: 5px; }
.trade-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.trade-controls { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) auto auto; gap: 8px; align-items: center; }
.trade-controls input { min-width: 0; }
.trade-positions { border-top: 1px solid var(--line); padding-top: 10px; }
.trade-positions .table-wrap { margin-top: 9px; }
.trade-stat { color: var(--muted); font-size: .72rem; }
.trade-stat strong { display: block; margin-top: 4px; color: var(--text); font-size: .9rem; }
.trade-stat.positive strong { color: var(--green); }
.trade-stat.negative strong { color: var(--red); }
.user-card { display: grid; grid-template-columns: minmax(170px, 1fr) auto auto; gap: 14px; align-items: center; }
.user-main strong, .user-main small { display: block; }
.user-main small { margin-top: 4px; }
.user-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.split-panel { display: grid; gap: 12px; padding: 16px; }
.split-panel h3 { margin-bottom: 2px; }
.broker-status-wrap { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.broker-status { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: #0d151c; padding: 12px; }
.broker-status strong { font-size: 1rem; }
.broker-status span:not(.status-pill), .broker-status small { color: var(--muted); }
.compact-empty { padding: 18px 8px; }
.small-note { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.toggle-row { display: flex; align-items: center; gap: 9px; color: #c5d1d7; font-size: .82rem; font-weight: 700; }
.toggle-row input { width: auto; accent-color: var(--teal); }
.notification-list, .payment-request-list, .approval-list, .issue-list { display: grid; gap: 10px; padding: 12px; }
.issue-list { max-height: 560px; overflow-y: auto; }
.issue-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 2px; color: var(--muted); font-size: .78rem; }
.notification-card, .payment-request, .approval-card, .issue-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); padding: 14px; }
.notification-card.unread { border-left: 3px solid var(--teal); }
.notification-card.read { opacity: .72; }
.notification-card strong, .notification-card p, .notification-card small, .payment-request strong, .payment-request small, .approval-card strong, .approval-card small, .issue-card strong, .issue-card small { display: block; }
.notification-card p { margin-top: 5px; color: #d9e5e9; line-height: 1.45; }
.notification-card small, .payment-request small, .approval-card small, .issue-card small { margin-top: 5px; color: var(--muted); }
.approval-card, .issue-card { align-items: flex-start; }
.approval-card .actions-row, .issue-card .actions-row, .payment-request .actions-row { justify-content: end; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; color: var(--teal); font-weight: 700; }
.settings-json { max-height: 360px; overflow: auto; margin: 12px 0 0; border: 1px solid var(--line); border-radius: 6px; background: #0b1117; color: #ccebe6; padding: 12px; font: .72rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 560px; }
.chat-threads { border-right: 1px solid var(--line); }
.chat-thread { display: block; width: 100%; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.chat-thread:hover, .chat-thread.active { background: var(--surface-2); }
.chat-thread strong, .chat-thread small { display: block; }
.chat-thread small { margin-top: 5px; }
.chat-window { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.chat-header { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.chat-messages { display: grid; align-content: start; gap: 9px; overflow: auto; padding: 18px; }
.chat-message { max-width: 76%; border-radius: 8px; padding: 10px 12px; background: var(--surface-2); color: #d9e5e9; line-height: 1.45; }
.chat-message.admin { justify-self: end; background: #17433e; color: #dff9f1; }
.chat-message small { display: block; margin-top: 5px; font-size: .65rem; }
.chat-compose { display: flex; gap: 8px; border-top: 1px solid var(--line); padding: 13px; }
.chat-compose input { min-width: 0; }
.guest-chat-actions { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 10px 13px; }
.guest-chat-actions .small-note { margin: 0; }
.guest-chat-actions .button-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.guest-chat-actions select { min-width: 150px; max-width: 220px; }
.guest-chat-actions textarea { width: 100%; min-height: 42px; resize: vertical; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.kv-list { display: grid; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(43,59,71,.65); padding-bottom: 9px; }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; font-weight: 700; }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .account-card { grid-template-columns: repeat(3, 1fr); }
  .account-main { grid-column: 1 / -1; }
  .account-card > .status-pill { justify-self: start; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .trade-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .auth-view { grid-template-columns: 1fr; width: min(560px, calc(100% - 32px)); padding: 30px 0; }
  .auth-brand { gap: 16px; }
  .auth-brand h1 { font-size: 3.5rem; }
  .auth-footer { grid-column: auto; }
  .auth-downloads { grid-column: auto; grid-template-columns: 1fr; gap: 14px; }
  .auth-download-list { grid-template-columns: 1fr; }
  .dashboard-view { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .dashboard-downloads { grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 13px; }
  .dashboard-downloads .download-button { flex: 0 0 auto; width: 100%; }
  .dashboard-view > .sidebar { grid-column: 1; grid-row: 2; }
  .dashboard-view > .main-content { grid-column: 1; grid-row: 3; }
  .sidebar { position: sticky; top: 0; z-index: 5; display: block; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .sidebar-brand { display: inline-flex; }
  .main-nav { display: flex; overflow-x: auto; gap: 4px; margin-top: 10px; }
  .nav-button { width: auto; flex: 0 0 auto; padding: 8px 10px; }
  .nav-button span:last-child { display: none; }
  .sidebar-bottom { position: absolute; top: 13px; right: 12px; display: flex; align-items: center; gap: 6px; padding: 0; }
  .sidebar-bottom .connection-line { display: none; }
  .quiet-button.full { width: auto; font-size: 0; padding: 8px; }
  .quiet-button.full span { font-size: 1rem; }
  .main-content { padding: 18px 13px 35px; }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { align-items: flex-start; }
  .client-downloads { display: flex; justify-content: flex-start; }
  .download-button { flex: 0 1 224px; min-width: 0; }
  .grid-two, .admin-layout, .settings-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-threads { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-thread { min-width: 180px; border-bottom: 0; border-right: 1px solid var(--line); }
  .user-card { grid-template-columns: 1fr; }
  .user-actions { justify-content: start; }
}
@media (max-width: 540px) {
  .form-grid.two, .form-grid.three, .metrics-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .profile-chip { display: none; }
  .account-card { grid-template-columns: 1fr 1fr; }
  .account-main { grid-column: 1 / -1; }
  .trade-stats { grid-template-columns: 1fr 1fr; }
  .notification-card, .payment-request, .approval-card, .issue-card { align-items: stretch; flex-direction: column; }
}

/* V1.7 control-room visual system: existing API-backed views keep their contracts. */
:root {
  --bg: #02070d;
  --surface: #071018;
  --surface-2: #0b151e;
  --surface-3: #111e29;
  --line: #263542;
  --text: #f4f7f8;
  --muted: #8796a3;
  --teal: #16e0cf;
  --green: #7aff1a;
  --red: #ff5360;
  --amber: #f6c85f;
  --blue: #3ddcff;
  --shadow: 0 22px 70px rgba(0, 0, 0, .36);
}
html, body { background: var(--bg); }
body { letter-spacing: 0; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { font-size: clamp(3.2rem, 7vw, 6.4rem); line-height: .94; font-weight: 760; }
h2 { font-weight: 730; }
.eyebrow { color: var(--green); letter-spacing: .17em; }
.muted, small { color: #91a0aa; }

/* Auth header and hero */
.auth-view { display: block; width: 100%; min-height: 100vh; margin: 0; padding: 0; }
.auth-downloads { display: flex; align-items: center; justify-content: space-between; gap: 30px; width: 100%; min-height: 112px; border: 0; border-bottom: 1px solid rgba(55, 74, 87, .72); border-radius: 0; padding: 18px clamp(22px, 4vw, 58px); background: #02070d; }
.site-wordmark { display: flex; align-items: center; gap: 12px; min-width: 250px; color: var(--text); text-decoration: none; }
.site-wordmark img { width: 60px; height: 60px; border: 1px solid #2d3c48; border-radius: 11px; }
.site-wordmark span { display: grid; gap: 4px; }.site-wordmark strong, .sidebar-brand strong { font-size: 1.5rem; letter-spacing: -.04em; }.site-wordmark strong b, .sidebar-brand strong b { color: var(--green); font-weight: 780; }.site-wordmark small { font-size: .72rem; }
.auth-download-list { display: grid; grid-template-columns: repeat(3, minmax(205px, 1fr)); gap: 12px; width: min(930px, 100%); }
.auth-download-list .download-button { width: 100%; }
.download-button { position: relative; min-width: 0; min-height: 78px; border: 1px solid #2b3b49; border-radius: 10px; background: #071018; padding: 12px 42px 12px 14px; box-shadow: none; }
.download-button:hover { border-color: var(--green); background: #0b171c; }.download-button img { width: 40px; height: 40px; border-radius: 7px; }.download-button span { gap: 4px; }.download-button small { color: var(--green); font-size: .67rem; letter-spacing: .08em; }.download-button strong { font-size: .91rem; font-weight: 730; }.download-button .download-version { color: #b7c0c5; font-size: .72rem; }.download-button i { position: absolute; top: 50%; right: 14px; transform: translateY(-53%); color: #e9eff0; font-size: 2rem; font-style: normal; font-weight: 300; }.download-button:nth-child(3) small { color: var(--blue); }.download-button.disabled { opacity: .78; }.download-button.disabled:hover { border-color: #2b3b49; background: #071018; }
.auth-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, 560px); align-items: center; gap: clamp(44px, 7vw, 130px); width: min(1480px, calc(100% - 48px)); min-height: calc(100vh - 230px); margin: 0 auto; padding: 58px 0 42px; }
.auth-brand { position: relative; display: grid; align-content: center; min-height: 590px; max-width: 760px; overflow: hidden; }.hero-copy { position: relative; z-index: 2; display: grid; gap: 17px; max-width: 575px; }.hero-copy .muted { max-width: 500px; font-size: 1rem; line-height: 1.65; }.hero-copy h1 { margin-top: 3px; }.hero-copy h1 span { color: var(--green); }
.market-scene { position: absolute; inset: 19% -4% 14% -7%; z-index: 0; opacity: .78; pointer-events: none; transform: perspective(800px) rotateX(8deg) rotateY(-5deg); }.market-grid { position: absolute; inset: 13% 0 0; border-top: 1px solid rgba(37, 111, 129, .24); border-bottom: 1px solid rgba(37, 111, 129, .18); opacity: .72; }.market-grid::before, .market-grid::after { position: absolute; inset: 20% 0 0; border-top: 1px solid rgba(42, 95, 108, .16); border-bottom: 1px solid rgba(42, 95, 108, .13); content: ""; }.market-grid::after { inset: 40% 0 0; }.candles { position: absolute; inset: 18% 6% 24% 4%; display: flex; align-items: end; justify-content: space-around; gap: 18px; opacity: .82; }.candles i { position: relative; display: block; width: 13px; height: 24%; background: #34d94a; box-shadow: 0 -17px 0 -5px #34d94a, 0 19px 0 -5px #34d94a; }.candles i::before, .candles i::after { position: absolute; left: 50%; width: 2px; background: currentColor; content: ""; transform: translateX(-50%); }.candles i::before { top: -18px; height: 20px; }.candles i::after { bottom: -21px; height: 22px; }.candles i:nth-child(2n) { height: 38%; color: #ff4b50; background: #ff4b50; box-shadow: 0 -16px 0 -5px #ff4b50, 0 18px 0 -5px #ff4b50; }.candles i:nth-child(3n) { height: 52%; }.candles i:nth-child(4n) { height: 29%; color: #ff4b50; background: #ff4b50; box-shadow: 0 -18px 0 -5px #ff4b50, 0 20px 0 -5px #ff4b50; }.candles i:nth-child(5n) { height: 66%; }.candles i:nth-child(6n) { height: 44%; color: #ff4b50; background: #ff4b50; box-shadow: 0 -18px 0 -5px #ff4b50, 0 18px 0 -5px #ff4b50; }.trend-line { position: absolute; inset: 32% 2% 22% 0; border-bottom: 2px solid var(--teal); transform: skewY(-12deg) rotate(-1deg); box-shadow: 0 0 16px rgba(22, 224, 207, .35); }.trend-line::before { position: absolute; inset: 0; border-bottom: 1px solid rgba(22,224,207,.35); content: ""; transform: translateY(34px) skewY(12deg); }.trend-line b { position: absolute; bottom: -6px; width: 9px; height: 9px; border: 2px solid var(--teal); border-radius: 50%; background: var(--bg); box-shadow: 0 0 11px var(--teal); }.trend-line b:nth-child(1) { left: 11%; bottom: 9%; }.trend-line b:nth-child(2) { left: 28%; bottom: 27%; }.trend-line b:nth-child(3) { left: 44%; bottom: 19%; }.trend-line b:nth-child(4) { left: 58%; bottom: 44%; }.trend-line b:nth-child(5) { left: 70%; bottom: 47%; }.trend-line b:nth-child(6) { left: 83%; bottom: 76%; }.trend-line b:nth-child(7) { left: 96%; bottom: 93%; }
.feature-row { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 260px; border-top: 1px solid rgba(55,74,87,.7); padding-top: 22px; }.feature-row > div { display: flex; align-items: start; gap: 11px; min-height: 52px; padding: 0 18px; border-right: 1px solid rgba(55,74,87,.7); }.feature-row > div:first-child { padding-left: 0; }.feature-row > div:last-child { border-right: 0; }.feature-row strong, .feature-row small { display: block; }.feature-row strong { font-size: .8rem; }.feature-row small { margin-top: 6px; font-size: .68rem; line-height: 1.4; }.feature-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--green); border-radius: 7px; color: var(--green); font-size: 1rem; flex: 0 0 32px; }
.auth-panel { align-self: center; width: 100%; padding: 34px; border: 1px solid #2b3b49; border-radius: 13px; background: #071018; box-shadow: 0 24px 70px rgba(0,0,0,.3); }.auth-tabs { margin: -2px -5px 28px; border-bottom-color: #2b3b49; }.tab-button { padding: 13px 10px; font-size: .95rem; }.tab-button.active::after { left: 12px; right: 12px; background: var(--green); box-shadow: 0 0 10px rgba(122,255,26,.5); }.form-stack { gap: 17px; }.form-stack label, .field-label { gap: 8px; color: #e3eaed; font-size: .79rem; }.form-stack input, .form-stack select, .form-stack textarea { min-height: 46px; border-color: #2b3b49; border-radius: 8px; background: #0b151e; padding: 12px 13px; }.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(122,255,26,.1); }.primary-button { min-height: 46px; border-color: var(--green); border-radius: 8px; background: var(--green); color: #071006; box-shadow: 0 7px 22px rgba(122,255,26,.14); }.primary-button:hover { background: #95ff4c; }.secondary-button { border-color: #236f51; border-radius: 8px; background: #0b1818; }.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 23px; }.connection-line { margin-top: 0; }.secure-note { color: var(--green); font-size: .75rem; }
.auth-footer { display: flex; align-items: center; gap: 0; width: min(1480px, calc(100% - 48px)); margin: 0 auto; border: 1px solid #263542; border-radius: 11px 11px 0 0; padding: 18px 24px; color: #e3eaed; }.auth-footer > span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; flex: 1; min-height: 38px; padding: 0 22px; border-right: 1px solid #263542; color: var(--green); font-size: 1.2rem; }.auth-footer > span:first-child { padding-left: 0; }.auth-footer > span:last-child { border-right: 0; }.auth-footer strong, .auth-footer small { display: block; grid-column: 2; }.auth-footer strong { color: #eef4f5; font-size: .76rem; }.auth-footer small { margin-top: 3px; color: var(--muted); font-size: .68rem; }.auth-footer .auth-version { display: none; }

/* Logged-in control room */
.dashboard-view { display: grid; grid-template-columns: 254px minmax(0, 1fr); min-height: 100vh; background: #02070d; }.sidebar { position: sticky; top: 0; height: 100vh; gap: 34px; border-right-color: #263542; background: #03080f; padding: 27px 15px 20px; }.sidebar-brand { color: var(--text); text-decoration: none; padding: 0 10px; }.sidebar-brand strong { font-size: 1.15rem; }.sidebar-brand small { color: #8d9aa3; }.main-nav { gap: 7px; }.nav-button { min-height: 49px; border-radius: 9px; padding: 11px 13px; color: #d1dade; }.nav-button:hover, .nav-button.active { border-color: var(--green); background: #102013; color: var(--green); box-shadow: inset 3px 0 0 var(--green); }.nav-icon { color: currentColor; }.sidebar-bottom { padding: 0 10px; }.main-content { position: relative; overflow: hidden; padding: 28px clamp(20px, 4vw, 58px) 52px; }.main-content::before { position: absolute; top: 30px; right: 5%; width: 480px; height: 230px; border-top: 1px solid rgba(22,224,207,.08); border-radius: 50%; content: ""; transform: rotate(-12deg); pointer-events: none; }.topbar { position: relative; z-index: 1; align-items: start; gap: 26px; margin-bottom: 30px; }.topbar h2 { margin-top: 7px; font-size: clamp(2rem, 3vw, 3rem); }.topbar-right { display: grid; justify-items: end; gap: 12px; min-width: 0; }.dashboard-downloads { display: flex; gap: 10px; flex-wrap: nowrap; align-items: stretch; justify-content: end; border: 0; background: transparent; padding: 0; }.dashboard-downloads .download-button { width: 215px; min-width: 0; min-height: 70px; }.topbar-actions { gap: 10px; }.icon-button { width: 42px; min-width: 42px; height: 42px; border-color: #2b3b49; border-radius: 9px; background: #071018; }.profile-chip { min-height: 42px; border-color: #2b3b49; border-radius: 9px; background: #071018; color: #e9eff0; }.profile-chip > span:first-child { background: #073b40; color: var(--teal); }.profile-chip b { margin-left: 8px; color: #b9c4c9; }.metrics-grid { position: relative; z-index: 1; gap: 15px; }.metric-card { position: relative; min-height: 130px; border-color: #2b3b49; border-radius: 10px; background: #071018; padding: 22px 20px; overflow: hidden; }.metric-card::after { position: absolute; right: 14px; bottom: -22px; width: 100px; height: 70px; border-top: 1px solid rgba(22,224,207,.26); border-radius: 50%; content: ""; transform: rotate(-10deg); }.metric-card .metric-label { color: #d1dade; font-size: .88rem; font-weight: 500; }.metric-card strong { margin-top: 18px; font-size: clamp(1.75rem, 3vw, 2.3rem); }.metric-card.info strong { color: var(--text); }.metric-card.positive strong { color: var(--green); }.metric-card.negative strong { color: var(--red); }.section-header { position: relative; z-index: 1; margin-top: 29px; }.section-header h3 { font-size: 1.25rem; }.section-header p { margin-top: 6px; }.grid-two { position: relative; z-index: 1; gap: 16px; }.data-panel { border-color: #2b3b49; border-radius: 10px; background: #071018; }.data-panel-header { padding: 18px 20px; border-bottom-color: #23333f; }.data-panel-header h3 { font-size: 1.1rem; }.split-panel { padding: 19px 20px; }.account-list { padding: 12px 14px 14px; }.account-card { border-color: #2b3b49; border-radius: 9px; background: #0a141d; padding: 15px 17px; }.account-main strong { font-size: 1rem; }.account-main small { color: #a1adb4; }.account-value small { color: #a1adb4; }.account-value span { font-size: .94rem; }.status-pill.online { border-color: #1b6e3b; background: #071b13; color: var(--green); }.status-pill.offline { border-color: #72323c; background: #241116; }.kv-list { display: grid; gap: 0; }.kv { min-height: 52px; border-bottom-color: #263542; }.kv:last-child { border-bottom: 0; }.kv span:last-child { font-weight: 650; }.alarm-panel { margin-top: 16px; }.alarm-panel h3 { font-size: 1.1rem; }

@media (max-width: 1250px) { .auth-download-list { grid-template-columns: repeat(3, minmax(170px, 1fr)); }.download-button { padding-right: 34px; }.download-button strong { font-size: .8rem; }.dashboard-downloads .download-button { width: 180px; }.dashboard-downloads .download-button strong { font-size: .75rem; }.dashboard-downloads .download-button img { width: 32px; height: 32px; } }
@media (max-width: 980px) { .auth-downloads { align-items: start; flex-direction: column; }.site-wordmark { min-width: 0; }.auth-download-list { width: 100%; }.auth-main { grid-template-columns: minmax(0, 1fr) minmax(340px, 480px); gap: 28px; }.feature-row { margin-top: 190px; }.dashboard-view { grid-template-columns: 210px minmax(0, 1fr); }.dashboard-downloads .download-button { width: 150px; }.dashboard-downloads .download-button span { display: none; }.dashboard-downloads .download-button { justify-content: center; padding: 8px; }.dashboard-downloads .download-button i { display: none; }.topbar { gap: 16px; }.topbar-right { max-width: 58%; }.trade-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .auth-downloads { padding: 16px; }.auth-download-list { grid-template-columns: 1fr; gap: 8px; }.auth-download-list .download-button { min-height: 68px; }.auth-main { display: block; width: min(100% - 28px, 560px); min-height: auto; padding: 36px 0 28px; }.auth-brand { min-height: 420px; }.hero-copy { padding: 0 4px; }.hero-copy h1 { font-size: clamp(3.2rem, 15vw, 5rem); }.market-scene { inset: 22% -15% 20% -18%; opacity: .46; }.feature-row { margin-top: 135px; grid-template-columns: 1fr; gap: 12px; border-top: 0; padding-top: 20px; }.feature-row > div, .feature-row > div:first-child { min-height: 42px; padding: 0; border-right: 0; }.feature-row > div:nth-child(2), .feature-row > div:nth-child(3) { display: none; }.auth-panel { padding: 25px 20px; }.auth-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100% - 28px, 560px); border-radius: 10px 10px 0 0; padding: 15px; }.auth-footer > span, .auth-footer > span:first-child { padding: 0 8px; border-right: 0; }.auth-footer > span:nth-child(3) { display: none; }.dashboard-view { display: block; }.sidebar { position: static; height: auto; gap: 15px; padding: 16px 14px 11px; border-right: 0; border-bottom: 1px solid #263542; }.sidebar-brand { padding: 0 9px; }.main-nav { display: flex; overflow-x: auto; gap: 7px; padding: 0 5px 3px; }.nav-button { flex: 0 0 auto; min-width: 47px; width: 47px; padding: 10px; justify-content: center; }.nav-button .nav-icon { font-size: 1.1rem; }.nav-button > span:last-child { display: none; }.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 9px; }.sidebar-bottom .connection-line { margin: 0; }.quiet-button.full { width: auto; }.main-content { padding: 21px 14px 34px; }.main-content::before { display: none; }.topbar { display: block; margin-bottom: 22px; }.topbar-right { display: flex; flex-direction: column-reverse; align-items: stretch; max-width: none; margin-top: 18px; }.topbar-actions { justify-content: flex-end; }.dashboard-downloads { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }.dashboard-downloads .download-button { width: auto; min-height: 61px; justify-content: center; }.dashboard-downloads .download-button img { width: 27px; height: 27px; }.dashboard-downloads .download-button span { display: none; }.metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.metric-card { min-height: 102px; padding: 15px; }.metric-card strong { margin-top: 13px; font-size: 1.45rem; }.grid-two, .admin-layout, .settings-grid { grid-template-columns: 1fr; }.account-card { grid-template-columns: 1fr 1fr; }.account-main { grid-column: 1 / -1; }.account-card .status-pill { justify-self: start; }.account-value span { font-size: .86rem; }.form-grid.three, .form-grid.two { grid-template-columns: 1fr; }.trade-controls { grid-template-columns: 1fr 1fr; }.trade-controls button { grid-column: span 2; }.user-card { grid-template-columns: 1fr; }.user-actions { justify-content: start; }.table-wrap { margin-inline: -3px; } }
@media (max-width: 420px) { .site-wordmark strong { font-size: 1.25rem; }.site-wordmark img { width: 48px; height: 48px; }.auth-download-list .download-button:nth-child(2) { display: none; }.dashboard-downloads { grid-template-columns: 1fr 1fr; }.dashboard-downloads .download-button:nth-child(2) { display: none; }.metrics-grid { grid-template-columns: 1fr; }.auth-footer { grid-template-columns: 1fr; }.auth-footer > span:nth-child(2) { display: none; } }
@media (min-width: 721px) and (max-width: 800px) { .dashboard-view { grid-template-rows: auto; }.dashboard-view > .sidebar, .dashboard-view > .main-content { grid-column: auto; grid-row: auto; }.dashboard-downloads { flex-direction: row; align-items: stretch; padding: 0; }.dashboard-downloads .download-button { width: 150px; } }

/* V1.8 polish: clearer hierarchy, responsive navigation and readable chat */
body { font-family: "Segoe UI Variable", "Inter", "Segoe UI", Arial, sans-serif; font-weight: 450; }
.site-wordmark, .sidebar-brand { letter-spacing: 0; }
.site-wordmark strong, .sidebar-brand strong { letter-spacing: 0; }
.site-wordmark { margin-left: clamp(0px, 1.5vw, 24px); }
.site-wordmark small { color: #aab6bd; }
.auth-brand { padding-left: clamp(10px, 4vw, 64px); }
.hero-copy { gap: 9px; }
.hero-copy .eyebrow { margin: 0; }
.hero-copy h1 { max-width: 680px; margin-top: 0; font-size: clamp(2.75rem, 5vw, 5.15rem); line-height: 1; }
.hero-copy h1 span { white-space: nowrap; }
.hero-copy .muted { display: none; }
.market-scene { opacity: .82; }
.trend-line { inset: 30% 1% 19% 0; border: 0; background: #11d8c5; clip-path: polygon(0 86%, 8% 77%, 16% 81%, 25% 66%, 34% 73%, 43% 52%, 51% 59%, 60% 40%, 69% 47%, 78% 27%, 87% 34%, 100% 5%, 100% 10%, 87% 40%, 78% 33%, 69% 53%, 60% 46%, 51% 65%, 43% 58%, 34% 79%, 25% 72%, 16% 87%, 8% 83%, 0 92%); transform: none; box-shadow: 0 0 16px rgba(22,224,207,.35); }
.trend-line::before { display: none; }
.trend-line b { z-index: 1; }
.feature-row { margin-top: 218px; }
.dashboard-downloads { gap: 10px; }
.dashboard-downloads .download-button { width: 220px; min-height: 64px; padding-block: 9px; }
.dashboard-downloads .download-button:nth-child(3) { width: 270px; }
.dashboard-downloads .download-button strong { white-space: nowrap; font-size: .84rem; }
.dashboard-downloads .download-button .download-version { font-size: .65rem; }
.topbar-actions { align-items: center; }
.topbar-actions .icon-button { width: 50px; min-width: 50px; height: 50px; border-radius: 10px; font-size: 1.35rem; }
.profile-chip { min-width: 50px; min-height: 50px; justify-content: center; padding: 5px; }
.profile-chip > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
.mobile-menu-button { display: none; }
.policy-layout { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.policy-layout .data-panel { min-height: 100%; }
.policy-list { display: grid; gap: 8px; margin-top: 18px; }
.policy-list details { border: 1px solid #263542; border-radius: 8px; background: #0a141d; padding: 13px 14px; }
.policy-list summary { cursor: pointer; color: #e7edef; font-weight: 650; }
.policy-list p { margin: 10px 0 0; color: #9eabb3; font-size: .86rem; line-height: 1.55; }
.chat-message { min-width: min(42%, 520px); }
.chat-message-body { white-space: pre-wrap; color: #e9f0f1; line-height: 1.5; }
.chat-message small { display: block; margin-top: 7px; }

@media (max-width: 1250px) {
  .dashboard-downloads .download-button { width: 190px; }
  .dashboard-downloads .download-button:nth-child(3) { width: 235px; }
}

@media (max-width: 720px) {
  .site-wordmark { margin-left: 0; }
  .auth-brand { padding-left: 0; }
  .hero-copy h1 { font-size: clamp(2.55rem, 11vw, 4.3rem); }
  .hero-copy h1 span { white-space: normal; }
  .feature-row { margin-top: 135px; }
  .mobile-menu-button { display: inline-flex; align-items: center; gap: 9px; width: fit-content; border: 1px solid #2b3b49; border-radius: 8px; background: #071018; color: #e9eff0; padding: 9px 12px; font: inherit; }
  .mobile-menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--green); }
  .mobile-menu-button b { font-size: .8rem; font-weight: 650; }
  .main-nav { display: none; overflow: visible; }
  .main-nav.menu-open { display: grid; }
  .nav-button { width: 100%; min-width: 0; justify-content: flex-start; text-align: left; }
  .nav-button > span:last-child { display: inline; }
  .dashboard-downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-downloads .download-button, .dashboard-downloads .download-button:nth-child(3) { width: auto; min-height: 66px; padding: 7px 5px; gap: 4px; justify-content: center; }
  .dashboard-downloads .download-button img { width: 25px; height: 25px; }
  .dashboard-downloads .download-button span { display: grid; gap: 1px; min-width: 0; }
  .dashboard-downloads .download-button small { font-size: .5rem; letter-spacing: .04em; white-space: nowrap; }
  .dashboard-downloads .download-button strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; }
  .dashboard-downloads .download-button .download-version { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .48rem; }
  .dashboard-downloads .download-button i { display: none; }
  .policy-layout { grid-template-columns: 1fr; }
  .chat-message { min-width: 0; max-width: 88%; }
}

/* V1.20 analytics, responsive theme selector and compact chart */
.theme-selector { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: .72rem; }
.theme-selector span { white-space: nowrap; }
.theme-selector select { width: auto; min-width: 88px; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.theme-selector select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.analytics-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.analytics-chart-panel { min-width: 0; }
.analytics-chart-wrap { width: 100%; min-width: 0; overflow: hidden; }
 .analytics-chart { display: block; width: 100%; height: auto; min-height: 220px; overflow: visible; }
 .analytics-grid-line { stroke: var(--line); stroke-width: 1; opacity: .55; }
 .analytics-zero { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
 .analytics-segment { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
 .analytics-segment.positive { stroke: var(--green); }
 .analytics-segment.negative { stroke: var(--red); }
 .analytics-point { stroke: var(--surface); stroke-width: 2; }
 .analytics-point.positive { fill: var(--green); }
 .analytics-point.negative { fill: var(--red); }
 .analytics-y-label, .analytics-x-label { fill: var(--muted); font-size: 12px; }
.analytics-chart-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .7rem; }
.analytics-chart-caption strong { color: var(--text); }
.analytics-range-tabs { flex-wrap: wrap; }
.analytics-range-button.active { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.guest-chat-entry { width: 100%; margin-top: 13px; }
.guest-chat-panel { width: min(560px, 100%); max-height: min(720px, calc(100vh - 48px)); overflow: hidden; padding: 18px; }
.guest-chat-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.guest-chat-header h3 { margin-top: 4px; }
.guest-chat-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: .75rem; }
.guest-chat-panel .chat-messages { max-height: 420px; }
.guest-chat-panel .chat-message-body { display: grid; gap: 4px; }
.guest-chat-panel .chat-message-body strong { color: var(--teal); font-size: .72rem; }
.guest-chat-admin-group { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.support-contact-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.support-contact-panel h3, .support-contact-panel p { margin: 0; }
.support-contact-panel .secondary-button { flex: 0 0 auto; }
.guest-chat-admin-group h4 { color: var(--teal); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
body.theme-black { color-scheme: dark; --bg: #020405; --surface: #080b0e; --surface-2: #0d1216; --surface-3: #12191e; --line: #25323a; --text: #eef4f5; --muted: #91a2a8; --label: #b8c5c9; --teal: #2dc6c0; --green: #78ed16; --red: #ff5571; --amber: #f2bc50; --blue: #56b6ff; background: var(--bg); color: var(--text); }
body.theme-black .dashboard-view, body.theme-black .main-content { background: var(--bg); }
body.theme-black .sidebar, body.theme-black .dashboard-downloads, body.theme-black .auth-downloads { background: #050709; }
body.theme-black input, body.theme-black textarea, body.theme-black select { background: var(--surface-2); color: var(--text); }
body.theme-black .download-button, body.theme-black .data-panel, body.theme-black .metric-card, body.theme-black .panel { background: var(--surface); }
body.theme-white { color-scheme: light; --bg: #f4f8fa; --surface: #ffffff; --surface-2: #edf3f5; --surface-3: #e6eef1; --line: #c9d6dc; --text: #16242b; --muted: #58717c; --label: #263640; --teal: #087f79; --green: #238a3d; --red: #c9384d; --amber: #a56b00; --blue: #1263a0; background: var(--bg); color: var(--text); }
body.theme-white .dashboard-view, body.theme-white .main-content { background: var(--bg); }
body.theme-white .sidebar, body.theme-white .dashboard-downloads, body.theme-white .auth-downloads { background: #eaf1f3; }
body.theme-white input, body.theme-white textarea, body.theme-white select { background: #f8fbfc; color: var(--text); }
body.theme-white .download-button, body.theme-white .data-panel, body.theme-white .metric-card, body.theme-white .panel { background: var(--surface); }
body.theme-white .sidebar-brand small, body.theme-white .site-wordmark small { color: var(--muted); }

@media (max-width: 1020px) {
  .analytics-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .support-contact-panel { align-items: flex-start; flex-direction: column; }
  .theme-selector { grid-column: 3; grid-row: 1; justify-self: end; }
  .theme-selector span { display: none; }
  .theme-selector select { min-width: 82px; min-height: 40px; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-chart-caption { font-size: .62rem; }
}

/* V1.11 mobile compact header and live support contact */
.theme-toggle { display: inline-grid; place-items: center; width: 46px; height: 44px; border: 1px solid #2b3b49; border-radius: 8px; background: #071018; color: var(--green); font-size: 1.1rem; }
.theme-toggle:hover { border-color: var(--teal); color: var(--teal); }
.live-chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--teal); border-radius: 50%; background: var(--panel-strong); color: var(--teal); box-shadow: 0 10px 28px rgba(0,0,0,.4), 0 0 0 5px rgba(48,214,180,.12); font-size: 1.2rem; cursor: pointer; }
.live-chat-fab:hover { background: var(--teal); color: var(--ink); transform: translateY(-2px); }

body.theme-day { --bg: #f4f8fa; --surface: #ffffff; --surface-2: #edf3f5; --surface-3: #e6eef1; --line: #c9d6dc; --text: #16242b; --muted: #58717c; --label: #263640; --teal: #087f79; --green: #238a3d; --red: #c9384d; --amber: #a56b00; --blue: #1263a0; background: var(--bg); color: var(--text); }
body.theme-day .dashboard-view, body.theme-day .main-content { background: var(--bg); }
body.theme-day .sidebar, body.theme-day .dashboard-downloads, body.theme-day .auth-downloads { background: #eaf1f3; }
body.theme-day input, body.theme-day textarea, body.theme-day select { background: #f8fbfc; color: var(--text); }
body.theme-day .download-button, body.theme-day .data-panel, body.theme-day .metric-card, body.theme-day .panel { background: var(--surface); }
body.theme-day .sidebar-brand small, body.theme-day .site-wordmark small { color: var(--muted); }

@media (max-width: 720px) {
  .sidebar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 12px 11px; }
  .sidebar-brand { grid-column: 1; padding: 0 4px; gap: 8px; }
  .sidebar-brand .brand-image.small { width: 31px; height: 31px; border-radius: 7px; }
  .sidebar-brand strong { font-size: 1rem; line-height: 1; }
  .sidebar-brand small { max-width: 190px; margin-top: 2px; font-size: .58rem; line-height: 1.1; }
  .mobile-menu-button { grid-column: 2; grid-row: 1; width: 40px; height: 40px; padding: 8px; }
  .mobile-menu-button span { width: 20px; }
  .theme-toggle { grid-column: 3; grid-row: 1; width: 40px; height: 40px; font-size: 1rem; }
  .live-chat-fab { right: 16px; bottom: 18px; width: 52px; height: 52px; }
}

@media (max-width: 420px) {
  .auth-download-list .download-button:nth-child(2), .dashboard-downloads .download-button:nth-child(2) { display: flex; }
  .dashboard-downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-downloads .download-button img { width: 22px; height: 22px; }
  .dashboard-downloads .download-button strong { font-size: .56rem; }
}

/* V1.9 auth controls, header alignment and compact navigation */
.auth-downloads { padding-left: clamp(44px, 8.4vw, 135px); }
.site-wordmark strong { font-size: 1.82rem; }
.site-wordmark small { font-size: .8rem; }
.auth-panel { min-height: 492px; padding-top: 42px; padding-bottom: 42px; }
.auth-panel .form-stack { gap: 20px; }
.auth-panel .form-stack input { min-height: 51px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -4px; }
.checkbox-row { display: inline-flex !important; flex-direction: row; align-items: center; gap: 8px !important; color: #aebbc1 !important; font-size: .78rem !important; }
.checkbox-row input { width: 17px !important; min-height: 17px !important; accent-color: var(--green); }
.link-button { border: 0; background: transparent; color: var(--green); padding: 3px 0; font: inherit; font-size: .78rem; cursor: pointer; }
.link-button:hover { color: #c5ff9e; text-decoration: underline; }
.password-field { position: relative; display: flex; align-items: stretch; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--green); padding: 5px; cursor: pointer; font-size: .75rem; font-weight: 700; }
.password-toggle:hover { color: #c5ff9e; }
#password-reset-form h3 { margin-top: 5px; font-size: 1.35rem; }
#password-reset-form .form-stack { gap: 15px; }
#password-reset-form .actions-row { align-items: center; }
#password-reset-form .actions-row .primary-button { flex: 1; }
.sidebar-bottom { display: grid; gap: 10px; padding: 0 10px; }
.sidebar-refresh { justify-self: start; }
.topbar-right { width: min(820px, 100%); }
.dashboard-downloads { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.24fr); }
.dashboard-downloads .download-button, .dashboard-downloads .download-button:nth-child(3) { width: auto; min-width: 0; }
.dashboard-downloads .download-button strong { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .auth-downloads { padding-left: 16px; }
  .auth-panel { min-height: 0; padding-top: 30px; padding-bottom: 30px; }
  .sidebar-bottom { display: flex; align-items: center; gap: 10px; }
  .sidebar-bottom .sidebar-refresh { order: 0; }
  .sidebar-bottom .connection-line { order: 1; }
  .sidebar-bottom #logout-button { order: 2; }
  .mobile-menu-button { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 46px; height: 44px; padding: 9px; }
  .mobile-menu-button span { width: 22px; height: 2px; }
  .mobile-menu-button b { display: none; }
  .topbar-right { width: 100%; }
  .dashboard-downloads { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; }
  .dashboard-downloads .download-button, .dashboard-downloads .download-button:nth-child(3) { width: 100%; min-height: 68px; justify-content: flex-start; padding: 10px 42px 10px 14px; }
  .dashboard-downloads .download-button img { width: 32px; height: 32px; }
  .dashboard-downloads .download-button span { display: grid; gap: 3px; }
  .dashboard-downloads .download-button strong { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; font-size: .86rem; }
  .dashboard-downloads .download-button small { font-size: .6rem; }
  .dashboard-downloads .download-button .download-version { font-size: .62rem; }
}

/* V1.10 mobile information order and final header alignment */
.auth-downloads { padding-left: clamp(54px, 9vw, 160px); }
.nav-logout-button { display: none; }
@media (max-width: 720px) {
  .auth-downloads { padding-left: 16px; }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 14px; padding: 16px 14px 14px; }
  .sidebar-brand { grid-column: 1; grid-row: 1; min-width: 0; padding: 0 8px; }
  .sidebar-brand small { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-menu-button { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; padding: 0; }
  .main-nav.menu-open { display: grid; }
  .main-nav .nav-logout-button { display: flex; }
  .sidebar-bottom { display: none; }
  .main-content { display: flex; flex-direction: column; padding-top: 22px; }
  .topbar { display: contents; }
  .topbar-right { order: 2; display: block; width: 100%; margin: 0 0 20px; }
  .topbar > div:first-child { order: 3; margin: 0 0 22px; }
  #dashboard-message { order: 4; }
  #dashboard-content { order: 5; }
  .dashboard-view:not(.home-page) .topbar-right { display: none; }
  .dashboard-view:not(.home-page) .topbar > div:first-child { margin-bottom: 22px; }
  .dashboard-view.home-page .dashboard-downloads { margin-top: 0; }
}

/* V1.11 final mobile header override */
.theme-toggle { display: none; }

@media (max-width: 720px) {
  .auth-downloads .site-wordmark img { width: 48px; height: 48px; border-radius: 9px; }
  .auth-downloads .site-wordmark strong { font-size: 1.28rem; }
  .auth-downloads .site-wordmark small { font-size: .64rem; }
  .sidebar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 12px 11px; }
  .sidebar-brand { grid-column: 1; grid-row: 1; min-width: 0; padding: 0 4px; gap: 8px; }
  .sidebar-brand .brand-image.small { width: 36px; height: 36px; border-radius: 8px; }
  .sidebar-brand strong { font-size: 1.08rem; line-height: 1; }
  .sidebar-brand small { max-width: 210px; margin-top: 2px; font-size: .63rem; line-height: 1.1; }
  .mobile-menu-button { grid-column: 2; grid-row: 1; width: 40px; height: 40px; padding: 8px; }
  .mobile-menu-button span { width: 20px; }
  .theme-toggle { grid-column: 3; grid-row: 1; display: inline-grid; width: 40px; height: 40px; font-size: 1rem; }
  .live-chat-fab { right: 16px; bottom: 18px; width: 52px; height: 52px; }
}
