:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --muted: #86868b;
  --line: #e5e5e7;
  --line-strong: #d2d2d7;
  --blue: #0071e3;
  --blue-dark: #0060c0;
  --blue-soft: #eaf4ff;
  --green: #16834b;
  --green-soft: #eaf8f0;
  --orange: #ad6800;
  --orange-soft: #fff5df;
  --red: #c9342b;
  --red-soft: #fff0ef;
  --navy: #161b25;
  --shadow: 0 12px 32px rgba(0, 0, 0, .05), 0 2px 6px rgba(0, 0, 0, .03);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, .09), 0 3px 8px rgba(0, 0, 0, .04);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: 0; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 17px; height: 17px; display: inline-block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; vertical-align: -4px; flex: 0 0 auto; }

/* App frame */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 246px; flex: 0 0 246px; display: flex; flex-direction: column; padding: 24px 15px 18px; background: rgba(255,255,255,.78); border-right: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 2px 10px 32px; }
.brand-lockup b { display: block; font-size: 14px; font-weight: 700; }
.brand-lockup span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--navy); font-size: 19px; font-weight: 700; box-shadow: 0 5px 14px rgba(22,27,37,.22); }
.brand-mark-large { width: 48px; height: 48px; margin: 0 auto 22px; border-radius: 15px; font-size: 25px; }
.sidebar-label { padding: 0 12px 9px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; color: var(--ink-2); border-radius: 10px; font-size: 13px; font-weight: 600; transition: background .18s ease, color .18s ease; }
.nav-link .icon { width: 17px; height: 17px; color: #8a8a8f; }
.nav-link:hover { background: #f0f0f2; color: var(--ink); }
.nav-link.active { color: var(--blue); background: var(--blue-soft); }
.nav-link.active .icon { color: var(--blue); }
.sidebar-bottom { margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line); }
.secure-chip { display: flex; align-items: center; gap: 8px; padding: 10px 8px 13px; color: var(--muted); font-size: 11px; }
.secure-chip .icon { width: 14px; height: 14px; color: var(--green); }
.logout-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px; color: var(--ink-2); background: transparent; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.logout-link:hover { color: var(--red); background: var(--red-soft); }
.app-body { min-width: 0; flex: 1; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid rgba(229,229,231,.8); background: rgba(245,245,247,.86); }
.topbar-context { color: var(--ink-2); font-size: 12px; }
.topbar-dot { display: inline-block; width: 3px; height: 3px; margin: 0 8px 3px; border-radius: 50%; background: var(--line-strong); }
.topbar-actions { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.live-dot, .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22,131,75,.12); }
.status-dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(22,131,75,.12); }
.status-dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(201,52,43,.11); }
.mobile-menu { display: none; color: var(--ink); background: transparent; cursor: pointer; font-size: 21px; }
.main-content { width: min(1220px, 100%); margin: 0 auto; padding: 48px 42px 70px; }
.site-footer { width: min(1220px, 100%); margin: -38px auto 0; padding: 0 42px 30px; color: var(--muted); font-size: 11px; }

/* Type and page headers */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 36px; line-height: 1.1; letter-spacing: 0; font-weight: 700; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.25; font-weight: 700; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.page-head-actions, .form-actions, .output-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.schedule-pill, .safe-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 35px; padding: 0 12px; color: var(--ink-2); background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.safe-pill { color: var(--green); background: var(--green-soft); border-color: transparent; }
.safe-pill .icon { width: 14px; height: 14px; }
.status-dot { margin-right: 1px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 650; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 5px 12px rgba(0,0,0,.08); }
.button .icon { width: 15px; height: 15px; }
.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--ink-2); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { color: var(--ink); background: var(--surface-soft); }
.button-danger { color: #fff; background: var(--red); }
.button-danger:hover { background: #ad2922; }
.button-block { width: 100%; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 9px; }
.icon-button:hover { background: #dceeff; }
.icon-button .icon { width: 15px; height: 15px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; }
.text-button:hover { color: var(--blue-dark); }
.text-button .icon { width: 13px; height: 13px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* Notices */
.notice { display: flex; align-items: center; gap: 12px; min-height: 58px; margin: -7px 0 22px; padding: 11px 15px; border: 1px solid transparent; border-radius: 12px; }
.notice-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-weight: 800; }
.notice > div:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.notice b { font-size: 13px; }
.notice span { color: inherit; font-size: 12px; opacity: .82; }
.notice a, .notice form { margin-left: auto; flex: 0 0 auto; }
.notice-danger { color: #8e241e; background: var(--red-soft); border-color: #ffd8d5; }
.notice-danger .notice-icon { color: #fff; background: var(--red); }
.notice-warning { color: #835100; background: var(--orange-soft); border-color: #ffe8b8; }
.notice-warning .notice-icon { color: #fff; background: var(--orange); }
.notice-success { color: #14673c; background: var(--green-soft); border-color: #ccefdc; }
.notice-success .notice-icon { color: #fff; background: var(--green); }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card { min-height: 132px; padding: 19px 20px; transition: box-shadow .2s ease, transform .2s ease; }
.metric-card:hover, .panel:hover { box-shadow: var(--shadow-hover); }
.metric-card-accent { background: #f2f8ff; border-color: #d9ebff; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-value { display: flex; align-items: center; gap: 10px; min-height: 46px; color: var(--ink); font-size: 28px; font-weight: 700; line-height: 1.1; }
.metric-value small { margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value-small { font-size: 22px; }
.metric-note { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 18px; margin-bottom: 18px; }
.lower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; padding: 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-head .muted { padding-top: 3px; font-size: 11px; }
.strategy-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 15px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.strategy-summary-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.strategy-summary-main > div { min-width: 0; display: grid; gap: 1px; }
.strategy-summary-main b { font-size: 13px; }
.strategy-summary-main span:not(.ticker-badge) { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ticker-badge { display: inline-grid; place-items: center; min-width: 47px; height: 31px; padding: 0 8px; color: var(--blue); background: var(--blue-soft); border-radius: 8px; font-size: 12px; font-weight: 800; }
.strategy-amount { display: grid; gap: 2px; text-align: right; white-space: nowrap; }
.strategy-amount span { color: var(--muted); font-size: 10px; }
.strategy-amount b { font-size: 15px; }
.ladder-list { display: grid; gap: 5px; margin: 22px 0 16px; }
.ladder-row { display: grid; grid-template-columns: 88px minmax(80px, 1fr) 70px; align-items: center; gap: 12px; min-height: 30px; padding: 3px 7px; border-radius: 8px; }
.ladder-row-current { background: #f4f8fc; }
.ladder-tier { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 11px; }
.tier-number { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-2); background: #ededf0; border-radius: 7px; font-size: 11px; font-weight: 750; }
.ladder-row-current .tier-number { color: var(--blue); background: var(--blue-soft); }
.ladder-line { height: 5px; overflow: hidden; background: #eeeeef; border-radius: 999px; }
.ladder-line .progress-bar { display: block; height: 100%; min-width: 7px; background: #aecff5; border-radius: inherit; }
.progress-0 { width: 0; }
.progress-5 { width: 5%; }.progress-10 { width: 10%; }.progress-15 { width: 15%; }.progress-20 { width: 20%; }
.progress-25 { width: 25%; }.progress-30 { width: 30%; }.progress-35 { width: 35%; }.progress-40 { width: 40%; }
.progress-45 { width: 45%; }.progress-50 { width: 50%; }.progress-55 { width: 55%; }.progress-60 { width: 60%; }
.progress-65 { width: 65%; }.progress-70 { width: 70%; }.progress-75 { width: 75%; }.progress-80 { width: 80%; }
.progress-85 { width: 85%; }.progress-90 { width: 90%; }.progress-95 { width: 95%; }.progress-100 { width: 100%; }
.ladder-amount { color: var(--ink); font-size: 12px; text-align: right; }
.panel-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11px; }
.state-badge, .table-type { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.state-success, .state-ok, .table-type-green { color: var(--green); background: var(--green-soft); }
.state-danger, .state-error, .state-expired, .state-invalid, .state-token_error { color: var(--red); background: var(--red-soft); }
.state-info, .state-preview, .table-type-blue { color: var(--blue); background: var(--blue-soft); }
.state-warning, .state-expiring { color: var(--orange); background: var(--orange-soft); }
.state-skipped, .state-missing { color: var(--muted); background: #f0f0f2; }
.run-result { display: flex; align-items: center; gap: 11px; min-height: 62px; margin-bottom: 17px; padding: 11px 12px; border-radius: 10px; }
.run-result-ok { color: var(--green); background: var(--green-soft); }
.run-result-bad { color: var(--red); background: var(--red-soft); }
.run-result-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 14px; font-weight: 800; }
.run-result-bad .run-result-icon { background: var(--red); }
.run-result > div:last-child { min-width: 0; display: grid; gap: 2px; }
.run-result b { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.run-result span { color: var(--muted); font-size: 10px; }
.compact-list { display: grid; gap: 0; margin-bottom: 17px; }
.compact-list > div, .detail-grid > div, .compare-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.compact-list b, .detail-grid b, .compare-row b { color: var(--ink-2); font-size: 12px; }
.empty-state { display: grid; place-items: center; min-height: 160px; padding: 15px; color: var(--muted); text-align: center; }
.empty-state b { color: var(--ink-2); font-size: 13px; }
.empty-state span { max-width: 250px; font-size: 11px; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 22px; }
.action-form { display: grid; gap: 16px; }
.action-row, .execute-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.action-label, .action-note { display: block; }
.action-label { font-size: 15px; font-weight: 700; }
.action-note { color: var(--muted); font-size: 11px; }
.execute-row { padding-top: 15px; border-top: 1px solid var(--line); }
.execute-row input { min-width: 0; flex: 1; }
.security-list { display: grid; gap: 13px; }
.security-list > div { display: flex; align-items: center; gap: 10px; min-height: 45px; }
.security-list > div > div { min-width: 0; flex: 1; display: grid; gap: 1px; }
.security-list b, .security-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-list b { font-size: 12px; }
.security-list div div span { color: var(--muted); font-size: 10px; }
.list-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; }
.list-icon .icon { width: 15px; height: 15px; }
.table-panel { padding-bottom: 15px; }
.activity-list { display: grid; }
.activity-row { display: flex; align-items: center; gap: 11px; min-height: 57px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-mark { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.activity-mark-blue { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.activity-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.activity-main b { font-size: 12px; }
.activity-main span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-row > strong { color: var(--ink-2); font-size: 12px; }

/* Forms and settings */
.settings-layout, .security-layout, .confirm-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); align-items: start; gap: 18px; }
.settings-form-panel { padding: 28px; }
.settings-form { display: grid; gap: 0; }
.form-section-title { padding: 19px 0 12px; color: var(--ink-2); border-top: 1px solid var(--line); font-size: 11px; font-weight: 750; }
.form-section-title:first-of-type { padding-top: 0; border-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--ink-2); font-size: 11px; font-weight: 650; }
.field-span-2 { grid-column: span 2; }
.field small { color: var(--muted); font-size: 10px; font-weight: 400; }
input[type=text], input[type=password], input[type=number], textarea, select { width: 100%; min-height: 39px; padding: 0 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
textarea { min-height: 144px; padding: 11px; resize: vertical; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
select { appearance: auto; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input-prefix, .input-suffix { position: relative; }
.input-prefix input { padding-left: 27px; }
.input-suffix input { padding-right: 30px; }
.input-prefix i, .input-suffix i { position: absolute; top: 10px; color: var(--muted); font-size: 13px; font-style: normal; pointer-events: none; }
.input-prefix i { left: 11px; }
.input-suffix i { right: 11px; }
.switch-row { display: flex; align-items: center; gap: 11px; padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 36px; height: 21px; position: relative; flex: 0 0 auto; background: #d2d2d7; border-radius: 999px; transition: background .2s ease; }
.switch-ui::after { content: ""; position: absolute; width: 17px; height: 17px; top: 2px; left: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.switch-row input:checked + .switch-ui { background: var(--green); }
.switch-row input:checked + .switch-ui::after { transform: translateX(15px); }
.switch-row > span:last-child { display: grid; gap: 1px; }
.switch-row b { font-size: 12px; }
.switch-row small { color: var(--muted); font-size: 10px; font-weight: 400; }
.settings-form .form-actions { margin-top: 23px; }
.strategy-preview-column { display: grid; gap: 18px; }
.preview-panel { padding: 25px; }
.preview-hero { display: flex; align-items: baseline; gap: 10px; padding: 16px; background: #f2f8ff; border: 1px solid #d9ebff; border-radius: 10px; }
.preview-hero span, .preview-hero small { color: var(--muted); font-size: 10px; }
.preview-hero strong { color: var(--blue); font-size: 24px; }
.preview-hero small { margin-left: auto; }
.ladder-preview { margin: 19px 0 12px; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.preview-foot b { color: var(--ink-2); }
.info-panel p { margin: 0 0 17px; color: var(--ink-2); font-size: 12px; }
.info-panel > .panel-head > .icon { color: var(--green); }
.backup-list { display: grid; gap: 5px; overflow: hidden; color: var(--muted); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.backup-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Credentials */
.credential-card { min-height: 244px; }
.credential-status { display: flex; align-items: center; gap: 16px; min-height: 93px; }
.credential-status > div:last-child { min-width: 0; display: grid; gap: 4px; }
.credential-status b { font-size: 13px; }
.credential-status span { color: var(--muted); font-size: 11px; }
.credential-status code, code { overflow-wrap: anywhere; padding: 2px 5px; color: var(--ink-2); background: #f0f0f2; border-radius: 4px; font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.credential-ring { width: 80px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border: 5px solid #cde6ff; border-radius: 50%; }
.credential-ring span { font-size: 23px; font-weight: 750; line-height: 1; }
.credential-ring small { margin-top: 2px; font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; margin-top: 14px; }
.detail-grid-large { margin-top: 20px; }
.detail-grid-large > div { min-height: 42px; }
.detail-span-2 { grid-column: span 2; }
.key-status { display: flex; align-items: flex-start; gap: 12px; min-height: 93px; padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.key-status-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green); background: var(--green-soft); border-radius: 9px; }
.key-status > div { display: grid; gap: 4px; }
.key-status b { font-size: 12px; }
.key-status span { color: var(--muted); font-size: 11px; }
.token-form-panel { margin-top: 18px; }
.token-form { display: grid; gap: 17px; }
.token-form .form-actions { justify-content: space-between; }
.confirm-card { min-height: 300px; }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 18px; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.confirm-icon .icon { width: 21px; height: 21px; }
.confirm-card h2 { margin: 6px 0 0; }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.inline-warning { margin-top: 17px; padding: 10px 12px; color: #835100; background: var(--orange-soft); border-radius: 8px; font-size: 11px; }
.confirm-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
.confirm-actions > div:first-child { display: grid; gap: 3px; }
.confirm-actions > div:first-child b { font-size: 13px; }
.confirm-actions > div:first-child span { color: var(--muted); font-size: 11px; }

/* Tables, output, audit */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { min-height: 43px; padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.data-table th { color: var(--muted); font-size: 10px; font-weight: 700; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.muted { max-width: 270px; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.output-panel { padding-bottom: 15px; }
.output-meta { justify-content: flex-start; min-height: 30px; }
.console { max-height: 620px; overflow: auto; margin: 12px 0 0; padding: 17px; color: #edf2f7; background: #171a21; border-radius: 10px; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 185px 140px minmax(0, 1fr); align-items: center; gap: 16px; min-height: 50px; border-bottom: 1px solid var(--line); font-size: 11px; }
.audit-row:last-child { border-bottom: 0; }
.audit-time { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.audit-action { color: var(--blue); font-weight: 700; }
.audit-detail { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }

/* Login */
.auth-layout { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; background: var(--bg); }
.login-shell { position: relative; width: min(430px, 100%); }
.login-card { position: relative; z-index: 1; padding: 42px 38px 30px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 26px 70px rgba(0,0,0,.1); text-align: center; }
.login-card h1 { margin-bottom: 8px; font-size: 27px; }
.login-card > p { margin-bottom: 27px; color: var(--muted); font-size: 13px; }
.login-card .eyebrow { font-size: 9px; }
.login-form { display: grid; gap: 15px; text-align: left; }
.login-form .button { margin-top: 2px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; color: var(--muted); font-size: 10px; }
.login-security .icon { width: 13px; height: 13px; color: var(--green); }
.login-error { margin: 0 0 15px; padding: 10px; color: var(--red); background: var(--red-soft); border-radius: 8px; font-size: 12px; }
.flash { margin-bottom: 17px; padding: 11px 14px; border-radius: 9px; font-size: 12px; }
.flash-ok { color: #14673c; background: var(--green-soft); }
.flash-error { color: #8e241e; background: var(--red-soft); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 1050px) {
  .sidebar { width: 215px; flex-basis: 215px; }
  .main-content { padding-right: 25px; padding-left: 25px; }
  .topbar { padding: 0 25px; }
  .site-footer { padding-right: 25px; padding-left: 25px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 246px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 15px 0 35px rgba(0,0,0,.12); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { height: 57px; padding: 0 18px; }
  .topbar-context { margin-right: auto; margin-left: 13px; }
  .topbar-actions { display: none; }
  .main-content { padding: 32px 17px 60px; }
  .site-footer { margin-top: -29px; padding: 0 17px 25px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 24px; }
  .page-head-actions { width: 100%; justify-content: space-between; }
  h1 { font-size: 31px; }
  .dashboard-grid, .settings-layout, .security-layout, .confirm-layout { grid-template-columns: 1fr; }
  .lower-grid { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; flex-wrap: wrap; }
  .notice a, .notice form { margin-left: 39px; }
  .audit-row { grid-template-columns: 1fr 1fr; gap: 3px 10px; padding: 9px 0; }
  .audit-detail { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 118px; padding: 15px 13px; }
  .metric-value { min-height: 39px; font-size: 22px; }
  .metric-value-small { font-size: 18px; }
  .metric-note { font-size: 10px; }
  .panel { padding: 19px 16px; border-radius: 8px; }
  .strategy-summary, .action-row, .execute-row, .confirm-actions { align-items: stretch; flex-direction: column; }
  .strategy-amount { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2, .detail-span-2 { grid-column: span 1; }
  .ladder-row { grid-template-columns: 76px minmax(55px, 1fr) 57px; gap: 7px; }
  .ladder-tier { gap: 5px; font-size: 10px; }
  .tier-number { width: 20px; height: 20px; }
  .form-actions, .token-form .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .page-head-actions .schedule-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .credential-status { align-items: flex-start; }
  .credential-ring { width: 66px; height: 66px; }
  .credential-ring span { font-size: 19px; }
  .login-card { padding: 34px 23px 26px; }
}
