@charset "UTF-8";

:root {
  color-scheme: light;
  --canvas: #f5f6f2;
  --surface: #ffffff;
  --ink: #233431;
  --muted: #64716b;
  --line: #dfe5dc;
  --subtle: #edf1e9;
  --accent: #27674f;
  --accent-hover: #1d533f;
  --mint: #dcebdd;
  --night: #152828;
  --night-muted: #a6b8b2;
  --amber: #8d5915;
  --amber-bg: #fbf0d7;
  --danger: #a03c3a;
  --danger-bg: #faece8;
  --radius: 12px;
  --font: Tahoma, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.85; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #699584; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; line-height: 1.6; letter-spacing: -.9px; }
h2 { font-size: 17px; line-height: 1.75; letter-spacing: -.3px; }
h3 { font-size: 15px; line-height: 1.75; }
small, .small { font-size: 12px; }
svg { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ltr, .numeric { direction: ltr; unicode-bidi: isolate; }
.numeric { font-variant-numeric: tabular-nums; }
.break-word { overflow-wrap: anywhere; }
.space-top { margin-top: 16px; }
.space-top-md { margin-top: 20px; }
.space-top-lg { margin-top: 24px; }
.skip-link { position: fixed; top: -80px; right: 20px; z-index: 100; padding: 12px 20px; background: white; border: 2px solid var(--accent); }
.skip-link:focus { top: 12px; }
.initial-loading { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; }
.brand-mark { width: 44px; height: 44px; color: #cbe4cb; }
.brand-word { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.brand-word > span { display: block; font-family: "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 5px; margin-top: 7px; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .5px; margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none !important; transition: background-color .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--subtle); border-color: #b6c4b8; }
.btn-primary { color: white; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); background: white; border-color: #e8c6be; }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: #d99887; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-small { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.btn-icon { width: 40px; min-width: 40px; padding: 8px; }
.btn-wide { width: 100%; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.text-button { color: var(--accent); border: 0; background: transparent; font-size: 12px; font-weight: 600; padding: 6px 0; }
.text-button:hover { text-decoration: underline; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 2px 9px; border-radius: 5px; font-size: 11px; line-height: 1.7; font-weight: 600; white-space: nowrap; background: var(--subtle); color: var(--muted); }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-green { color: #326346; background: #e8f1e5; }
.tag-amber { color: var(--amber); background: var(--amber-bg); }
.tag-red { color: var(--danger); background: var(--danger-bg); }
.tag-blue { color: #46657b; background: #e8eff4; }

/* The access screen deliberately uses the same workspace language as the app. */
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-story { background: var(--night); color: #f0f4eb; padding: 52px clamp(32px, 5vw, 88px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-story .eyebrow { color: var(--night-muted); margin-bottom: 20px; }
.auth-story h1 { font-size: clamp(32px, 3.4vw, 50px); line-height: 1.7; letter-spacing: -1.5px; max-width: 540px; }
.auth-story h1 span { color: #bcd8b8; }
.auth-story-copy { padding: 48px 0; position: relative; z-index: 1; }
.auth-story-copy > p { color: #b8c7bf; max-width: 420px; margin-top: 24px; line-height: 2.15; }
.auth-points { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-point { display: flex; gap: 14px; align-items: flex-start; }
.auth-point > svg { color: #bcd8b8; margin-top: 5px; }
.auth-point strong { font-size: 13px; display: block; }
.auth-point p { color: #aebfb5; font-size: 12px; }
.auth-foot { font-size: 11px; color: #a6b8ad; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-main { padding: 48px 32px; display: flex; align-items: center; justify-content: center; }
.auth-form-box { width: 100%; max-width: 400px; }
.auth-form-box h2 { font-size: 25px; margin-bottom: 8px; }
.auth-form-box > p { margin-bottom: 28px; }
.auth-form-box .brand { display: none; margin-bottom: 40px; }
.auth-form-box .brand-mark { color: var(--accent); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #e8ede5; padding: 4px; border-radius: 9px; margin-bottom: 28px; }
.auth-tabs button { border: 0; border-radius: 6px; background: transparent; padding: 8px; color: var(--muted); font-weight: 600; }
.auth-tabs button[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 1px 3px #15282812; }
.auth-note { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; margin-top: 24px; }
.auth-note svg { width: 16px; margin-top: 3px; }
.auth-form-box .btn-primary { margin-top: 8px; min-height: 47px; }

/* Workspace shell */
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 238px; z-index: 40; padding: 32px 20px 20px; background: var(--night); color: #dae5da; display: flex; flex-direction: column; }
.sidebar .brand { padding-inline: 12px; margin-bottom: 48px; }
.sidebar { overflow-y: auto; overscroll-behavior: contain; }
.sidebar-caption { color: #839b91; font-size: 10px; padding: 0 14px; margin-bottom: 10px; }
.navigation { display: flex; flex-direction: column; gap: 5px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: #b6c7bd; font-size: 12px; font-weight: 500; border-radius: 7px; text-decoration: none !important; }
.nav-link:hover { color: white; background: #ffffff09; }
.nav-link[aria-current="page"] { color: #eaf2e5; background: #2b4240; }
.nav-link[aria-current="page"]::after { content: ""; position: absolute; inset-inline-start: 0; top: 15px; bottom: 15px; width: 3px; background: #b7d3a9; border-radius: 4px; }
.nav-link svg { width: 18px; height: 18px; }
.sidebar-bottom { margin-top: auto; padding-top: 28px; }
.sidebar-trial { background: #233938; border: 1px solid #36504a; border-radius: 9px; padding: 14px; margin-bottom: 16px; }
.sidebar-trial > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sidebar-trial strong { font-size: 11px; }
.sidebar-trial small { color: #adbfaf; font-size: 10px; }
.sidebar-trial .progress-track { display: block; width: 100%; height: 3px; margin: 12px 0; border: 0; appearance: none; background: #3b534b; color: #c3d9b6; }
.sidebar-trial .progress-track::-webkit-progress-bar { background: #3b534b; }
.sidebar-trial .progress-track::-webkit-progress-value { background: #c3d9b6; }
.sidebar-trial .progress-track::-moz-progress-bar { background: #c3d9b6; }
.sidebar-trial a { color: #cfdfc9; font-size: 11px; display: flex; align-items: center; justify-content: space-between; }
.user-block { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; border-top: 1px solid #344641; }
.avatar { width: 34px; height: 34px; background: #d8e3cc; color: #263c32; font-size: 14px; font-weight: 600; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-block .user-details { min-width: 0; flex: 1; }
.user-block strong { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-block small { color: #9bb0a2; font-size: 10px; }
.user-block .btn { color: #b6c7bd; }
.user-block .btn:hover { background: #2b4240; }
.workspace { margin-inline-start: 238px; min-height: 100dvh; }
.topbar { min-height: 79px; padding: 20px 40px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fafbf7; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.breadcrumb > span:first-child { color: var(--muted); }
.breadcrumb svg { width: 12px; color: #89978d; }
.topbar-meta { display: flex; align-items: center; gap: 16px; font-size: 10px; color: var(--muted); }
.topbar-meta .dot { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin-inline-end: 6px; }
.mobile-menu { display: none; }
.main-content { max-width: 1510px; margin: 0 auto; padding: 32px 40px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-header p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.page-heading { min-width: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; color: #788478; font-size: 10px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.workspace-footer > span { display: inline-flex; gap: 6px; align-items: center; }
.workspace-footer svg { width: 13px; height: 13px; }
.sidebar-scrim { display: none; }

/* Real data and setup states */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.panel-header p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 24px; }
.grid-half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.welcome-banner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; background: #e7eddf; border: 1px solid #d6e0ce; padding: 26px 28px; border-radius: var(--radius); margin-bottom: 24px; }
.welcome-banner h2 { font-size: 19px; margin-bottom: 6px; }
.welcome-banner p { color: #5b6c55; font-size: 12px; max-width: 620px; }
.welcome-banner .banner-icon { height: 64px; width: 64px; color: #446b48; }
.welcome-banner .button-row { margin-top: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.stat-label svg { color: #7d8e7e; width: 17px; height: 17px; }
.stat-value { display: flex; align-items: baseline; gap: 7px; margin-top: 14px; line-height: 1.4; }
.stat-value strong { font-size: 30px; font-family: "Segoe UI", Tahoma, sans-serif; font-weight: 600; letter-spacing: -.7px; }
.stat-value span { color: var(--muted); font-size: 11px; }
.stat-foot { color: var(--muted); font-size: 10px; margin-top: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 235px; padding: 32px 24px; }
.empty-symbol { width: 48px; height: 48px; background: #f0f3ed; color: #769078; border: 1px solid #e3e9df; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.empty-symbol svg { width: 23px; height: 23px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 12px; max-width: 380px; line-height: 1.9; }
.empty-state .btn { margin-top: 18px; }
.empty-state.compact { min-height: 170px; padding: 24px; }
.notice { padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.notice > svg { margin-top: 3px; width: 17px; height: 17px; }
.notice p + p { margin-top: 4px; }
.notice-warning { background: var(--amber-bg); border-color: #ecdab0; color: #77501f; }
.notice-error { color: var(--danger); background: var(--danger-bg); border-color: #ebc8c1; }
.notice-info { background: #eaf0f0; border-color: #d5e2e1; color: #456363; }
.notice + .panel, .notice + .grid-half { margin-top: 24px; }
.setup-list { list-style: none; padding: 0; margin: 0; }
.setup-step { display: flex; gap: 14px; padding: 18px 24px; border-bottom: 1px solid #edf0e9; }
.setup-step:last-child { border: 0; }
.step-index { width: 27px; height: 27px; background: #f0f3ec; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 3px; }
.setup-step.complete .step-index { color: var(--accent); background: #e3efdf; border-color: #d0e1c9; }
.step-index svg { width: 14px; height: 14px; }
.setup-step p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.setup-step strong { font-size: 12px; }
.setup-step .step-content { flex: 1; }
.service-list { padding: 0 24px; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid #edf0e9; font-size: 12px; }
.service-row:last-child { border: 0; }
.service-label { display: flex; align-items: center; gap: 10px; }
.service-label svg { width: 17px; height: 17px; color: #788d7b; }
.service-detail { padding: 0 24px 18px; color: var(--muted); font-size: 10px; }
.activity-list { list-style: none; padding: 0 24px; margin: 0; }
.activity-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid #edf0e9; }
.activity-item:last-child { border: 0; }
.activity-dot { width: 7px; height: 7px; background: #7f9a7b; border-radius: 50%; margin-top: 8px; flex-shrink: 0; }
.activity-item p { font-size: 12px; overflow-wrap: anywhere; }
.activity-item time { color: var(--muted); font-size: 10px; }
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.record-card { padding: 24px; }
.record-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.record-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.record-name h2 { overflow-wrap: anywhere; }
.record-icon { width: 42px; height: 42px; background: var(--subtle); color: #547651; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.record-subtitle { color: var(--muted); font-size: 11px; }
.record-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.record-stats small { color: var(--muted); font-size: 10px; display: block; margin-bottom: 5px; }
.record-stats strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.record-card .notice { margin-block: 14px; }
.wallet-address { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: var(--muted); background: #f4f6f1; padding: 10px 12px; border-radius: 5px; display: block; overflow-wrap: anywhere; text-align: left; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: start; white-space: nowrap; font-size: 12px; }
th { font-weight: 500; color: var(--muted); background: #fafbf8; font-size: 10px; padding: 12px 20px; text-align: start; border-bottom: 1px solid var(--line); }
td { padding: 16px 20px; border-bottom: 1px solid #edf0e9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf8; }
td .subline { font-size: 10px; color: var(--muted); display: block; }
.order-id { display: block; font-size: 11px; user-select: all; }
.order-message { max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.table-note { font-size: 10px; color: var(--muted); padding: 12px 20px; border-top: 1px solid var(--line); }
.money-positive { color: var(--accent); }
.money-negative { color: var(--danger); }
.section-tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.section-tabs button { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 2px 14px; font-size: 12px; }
.section-tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.form-panel { padding: 24px; }
.form-panel h2 { margin-bottom: 6px; }
.form-panel > p { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.market-search-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 18px 20px; }
.dex-section > summary { display: flex; align-items: center; gap: 10px; padding: 20px 24px; font-weight: 600; cursor: pointer; }
.dex-section > summary::before { content: "+"; width: 14px; color: var(--accent); font-size: 20px; font-weight: 400; }
.dex-section[open] > summary::before { content: "−"; }
.dex-section[open] > summary { border-bottom: 1px solid var(--line); }
.dex-section > summary .tag { margin-inline-start: auto; }
.data-definition.space-top-md { margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { background: white; border: 1px solid #cfd8ca; border-radius: 7px; padding: 10px 12px; min-height: 43px; width: 100%; color: var(--ink); font-size: 12px; }
.field input:hover, .field select:hover { border-color: #a6b5a1; }
.field input::placeholder { color: #929c90; font-size: 11px; }
.field .hint { color: var(--muted); font-size: 10px; line-height: 1.9; }
.field input[readonly] { background: var(--subtle); }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.form-error { color: var(--danger); background: var(--danger-bg); border: 1px solid #ebc8c1; padding: 12px 14px; border-radius: 7px; font-size: 12px; margin-top: 16px; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.check-field { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; }
.check-field input { accent-color: var(--accent); width: 16px; height: 16px; margin-top: 4px; flex-shrink: 0; }
.form-section { border: none; border-top: 1px solid var(--line); padding: 20px 0 0; margin: 24px 0 0; }
.form-section legend { padding-inline-end: 12px; font-size: 12px; font-weight: 600; }
.inline-search { display: flex; gap: 8px; align-items: flex-end; }
.inline-search .field { flex: 1; }
.inline-search .btn { min-height: 43px; }
.price { font-size: 38px; font-weight: 600; line-height: 1.4; letter-spacing: -1px; }
.price span { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.billing-plan { padding: 30px; background: #edf2e7; border-color: #cfdec6; }
.billing-plan > .eyebrow { margin-bottom: 16px; }
.billing-plan h2 { font-size: 24px; margin-bottom: 14px; }
.billing-plan .price { margin: 22px 0; }
.billing-features { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 12px; font-size: 12px; }
.billing-features li { display: flex; align-items: center; gap: 10px; }
.billing-features svg { color: #52774d; width: 16px; height: 16px; }
.subscription-info { padding: 24px; }
.subscription-info .service-row { padding-block: 18px; }
.subscription-info h2 { margin-bottom: 10px; }
.data-definition { margin: 0; display: grid; gap: 12px; }
.data-definition > div { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.data-definition dt { color: var(--muted); }
.data-definition dd { margin: 0; text-align: end; max-width: 65%; overflow-wrap: anywhere; }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.result-summary > div { background: var(--subtle); padding: 16px; border-radius: 7px; }
.result-summary small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.result-summary strong { font-size: 22px; font-weight: 600; }
.equity-chart { width: 100%; height: 190px; display: block; margin-block: 16px; }
.equity-chart line { stroke: #dde4d8; stroke-width: 1; }
.equity-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-caption { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.detail-list { margin: 10px 0 0; padding-inline-start: 20px; color: var(--muted); font-size: 11px; }
.capability-row { display: flex; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); font-size: 12px; }
.capability-row:last-child { border: 0; }
.capability-row p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.loading-content { display: grid; gap: 20px; }
.skeleton { border: 1px solid var(--line); border-radius: var(--radius); background: #e9eee4; min-height: 110px; animation: breathe 1.5s ease-in-out infinite alternate; }
.skeleton.tall { height: 290px; }
@keyframes breathe { from { opacity: .5; } to { opacity: 1; } }

/* Native dialogs keep keyboard focus and escape behavior. */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); color: var(--ink); background: var(--surface); box-shadow: 0 24px 90px #0f231c33; }
dialog::backdrop { background: #0b1f1d91; backdrop-filter: blur(3px); }
.secret-block { display: block; max-width: 100%; padding: 16px; margin-block: 12px; background: var(--bg, #f2f4ef); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: 12px/1.8 Consolas, monospace; user-select: text; }
.recovery-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.recovery-page > section { width: min(620px, 100%); min-width: 0; }
.recovery-page h1 { margin-top: 28px; font-size: 24px; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 24px; }
.recovery-codes code { padding: 12px; border: 1px solid var(--line); border-radius: 6px; font: 13px/1.6 Consolas, monospace; overflow-wrap: anywhere; }
.factor-fields { border-top: 1px solid var(--line); padding-top: 16px; margin-block: 8px; }
details > summary { cursor: pointer; line-height: 1.8; font-size: 12px; }
details > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.token-limit-row { padding: 16px; margin-block: 16px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.token-limit-row legend { font-size: 12px; padding-inline: 8px; }
.field textarea { width: 100%; min-height: 110px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; font: 12px/1.6 Consolas, monospace; }
.field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
fieldset[hidden] { display: none; }
.navigation { min-height: 0; overflow-y: auto; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 24px; }
.dialog-body > p { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.dialog-body > .notice { margin-bottom: 24px; }
.dialog-body h3 { margin-block: 20px 12px; }
.toast-region { position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--night); color: #eef3e9; border: 1px solid #3e5b50; padding: 14px 16px; border-radius: 9px; font-size: 12px; box-shadow: 0 8px 24px #10221a1c; display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; }
.toast-error { background: #823c36; border-color: #a66259; }
.toast > span { flex: 1; overflow-wrap: anywhere; }
.toast button { background: transparent; color: inherit; border: 0; padding: 0; display: flex; margin-top: 3px; }
.toast button svg { width: 15px; height: 15px; }

@media (min-width: 1600px) {
  .main-content { padding-top: 40px; }
  .sidebar { width: 254px; padding-inline: 24px; }
  .workspace { margin-inline-start: 254px; }
}
@media (max-width: 1180px) {
  .sidebar { width: 218px; padding-inline: 14px; }
  .workspace { margin-inline-start: 218px; }
  .main-content { padding: 28px 24px; }
  .topbar { padding-inline: 24px; }
  .grid-main { grid-template-columns: minmax(0, 1.25fr) minmax(270px, 1fr); gap: 20px; }
  .stat { padding: 16px; }
  .stat-value strong { font-size: 25px; }
  .record-grid { grid-template-columns: 1fr; }
  .panel-header, .panel-body, .form-panel { padding: 20px; }
}
@media (max-width: 940px) {
  .grid-main, .grid-half { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header { align-items: flex-start; }
  .page-actions { max-width: 200px; justify-content: flex-end; }
  .page-actions .btn { font-size: 11px; padding-inline: 10px; }
  .auth-story { padding: 36px; }
  .auth-story h1 { font-size: 34px; }
  .auth-main { padding: 40px 28px; }
  .topbar-meta .today { display: none; }
}
@media (max-width: 720px) {
  .recovery-codes { grid-template-columns: 1fr; }
  .recovery-page { padding: 16px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-main { padding: 40px 24px; min-height: 100dvh; }
  .auth-form-box .brand { display: flex; }
  .sidebar { transform: translateX(100%); transition: transform .2s ease; width: 250px; padding: 28px 20px 20px; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim.is-open { display: block; position: fixed; inset: 0; border: 0; background: #10221ba6; z-index: 35; }
  body.menu-open { overflow: hidden; }
  .workspace { margin-inline-start: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { min-height: 65px; padding: 12px 20px; }
  .topbar-start { display: flex; align-items: center; gap: 12px; }
  .breadcrumb > span:first-child, .breadcrumb > svg { display: none; }
  .topbar-meta { gap: 8px; }
  .topbar-meta .sync-label { display: none; }
  .main-content { padding: 24px 20px 28px; }
  .page-header { flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .page-actions .btn { font-size: 12px; }
  .welcome-banner { padding: 22px; grid-template-columns: 1fr; gap: 0; }
  .welcome-banner .banner-icon { display: none; }
  .welcome-banner h2 { font-size: 17px; }
  .welcome-banner p { font-size: 11px; }
  .stats-grid { gap: 12px; }
  .stat { padding: 16px; }
  .stat-label { font-size: 10px; }
  .stat-label svg { width: 15px; height: 15px; }
  .stat-value strong { font-size: 26px; }
  .stat-foot { font-size: 9px; }
  .panel-header { padding: 18px 20px; }
  .panel-header h2 { font-size: 15px; }
  .panel-header .btn { font-size: 10px; padding-inline: 8px; }
  .setup-step { padding: 17px 20px; }
  .panel-body { padding: 20px; }
  .stack { gap: 20px; }
  .workspace-footer { flex-direction: column; gap: 6px; margin-top: 28px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .market-search-grid { grid-template-columns: 1fr; gap: 16px; }
  .dex-section > summary { flex-wrap: wrap; padding: 16px 20px; font-size: 12px; }
  .dex-section > summary .tag { margin-inline-start: 24px; }
  .record-card { padding: 20px; }
  .record-stats { gap: 8px; }
  .record-stats strong { font-size: 11px; }
  .record-top { gap: 8px; }
  .record-name h2 { font-size: 15px; }
  .record-icon { width: 36px; height: 36px; }
  .record-top .tag { font-size: 9px; }
  .form-panel { padding: 20px; }
  .result-summary { gap: 8px; }
  .result-summary > div { padding: 12px; }
  .result-summary strong { font-size: 18px; }
  .result-summary small { font-size: 9px; }
  .dialog-header { padding: 16px 20px; }
  .dialog-body { padding: 20px; }
  dialog { max-height: calc(100dvh - 32px); }
  .toast-region { inset-inline-end: 16px; bottom: 16px; }
  .inline-search { flex-wrap: wrap; }
  .inline-search .field { flex-basis: 100%; }
}
.evaluation-candidate { border-top: 1px solid var(--line); padding-top: 24px; min-width: 0; }
.evaluation-candidate h3 { margin: 0; }
.evaluation-candidate h4 { margin: 20px 0 8px; font-size: 13px; }
.evaluation-candidate details { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
