:root {
  --bg: #090c13;
  --surface: #10131b;
  --surface-raised: #151820;
  --surface-hover: #191d26;
  --line: #242935;
  --line-strong: #343a48;
  --text: #f2f4f7;
  --muted: #7e8592;
  --muted-strong: #a8aebb;
  --ice: #8bb3ef;
  --ice-soft: rgba(139, 179, 239, 0.13);
  --green: #7be0b3;
  --green-soft: rgba(123, 224, 179, 0.12);
  --red: #f08d93;
  --red-soft: rgba(240, 141, 147, 0.12);
  --amber: #f5b766;
  --amber-soft: rgba(245, 183, 102, 0.12);
  --violet: #c29aef;
  --violet-soft: rgba(194, 154, 239, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.app-header {
  min-height: 66px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #0c0f16;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 1px solid #3b4352;
  background: #070a10;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ice);
  -webkit-mask: url("/lionmanlabslogo.png") center / contain no-repeat;
  mask: url("/lionmanlabslogo.png") center / contain no-repeat;
}

.brand h1 {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
}

.brand h1 span { color: var(--muted-strong); font-weight: 500; }
.brand p { margin-top: 4px; color: var(--muted); font-size: 10px; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.language-switch {
  height: 32px;
  display: inline-grid;
  grid-template-columns: repeat(2, 34px);
  align-items: stretch;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.language-option {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  font: 700 9px/1 "SFMono-Regular", Consolas, monospace;
}

.language-option:last-child { border-right: 0; }
.language-option:hover { color: var(--text); }
.language-option.active {
  color: #08120f;
  background: var(--ice);
}

.provider-state {
  min-height: 32px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font: 600 9px/1 "SFMono-Regular", Consolas, monospace;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.provider-state.connected { color: var(--green); }
.provider-state.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.button,
.tab,
.icon-button {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface-raised);
  color: var(--muted-strong);
}

.button {
  min-height: 34px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 650;
}

.button.primary {
  color: #08120f;
  background: var(--green);
  border-color: var(--green);
}

.button.primary:hover { filter: brightness(1.07); }
.button.secondary:hover { color: var(--text); border-color: #535b6b; }
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button-meta {
  margin-left: 7px;
  color: var(--ice);
  font: 600 8px/1 "SFMono-Regular", Consolas, monospace;
}
.button-icon { margin-right: 5px; color: var(--ice); }
#watchlist-open.warning { border-color: var(--amber); }
#watchlist-open.warning .button-meta { color: var(--amber); }
.button.scanning:disabled { cursor: wait; }
.scan-icon { display: inline-block; margin-right: 5px; font-size: 15px; line-height: 0; }
.scanning .scan-icon { animation: rotate 0.9s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

main {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 18px 24px 30px;
}

.app-footer {
  width: min(1680px, calc(100% - 48px));
  min-height: 46px;
  margin: 0 auto 18px;
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font: 600 10px/1.5 "SFMono-Regular", Consolas, monospace;
}

.footer-x-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  text-decoration: none;
}

.footer-x-link:hover { color: var(--ice); }

.footer-x-icon {
  color: var(--ice);
  font-size: 13px;
  line-height: 1;
}

.key-gate {
  min-height: 86px;
  margin-bottom: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(420px, 1.2fr);
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 2px 0 var(--ice);
}

.key-copy { min-width: 0; }
.key-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--ice);
  font: 600 8px/1 "SFMono-Regular", Consolas, monospace;
}
.key-copy strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}
.key-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.key-controls { min-width: 0; }
.key-input-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}
.key-input-row input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: #0b0e15;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}
.key-input-row input:focus { border-color: var(--ice); }
.key-input-row input:disabled {
  color: var(--green);
  opacity: 1;
}
.key-links {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}
.key-links a {
  color: var(--ice);
  text-decoration: none;
}
.key-links a:hover { text-decoration: underline; }
.key-links span { margin: 0 5px; color: var(--line-strong); }
.key-gate.connected {
  box-shadow: inset 2px 0 var(--green);
}
.key-gate.connected .key-eyebrow { color: var(--green); }

.summary-strip {
  min-height: 74px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(210px, 1.35fr);
  background: var(--surface);
  border: 1px solid var(--line);
}

.summary-cell {
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.summary-cell:last-child { border-right: 0; }
.summary-label {
  color: var(--muted);
  font: 600 9px/1.1 "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
}

.summary-cell strong {
  margin-top: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  line-height: 1;
  font-weight: 600;
}

.summary-cell:nth-child(2) strong { color: var(--red); }
.summary-cell:nth-child(3) strong { color: var(--violet); }
.summary-cell:nth-child(4) strong { color: var(--green); }
.summary-time strong { color: var(--muted-strong); font-size: 11px; line-height: 1.35; }

.toolbar {
  min-height: 48px;
  margin-top: 14px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.tabs { display: flex; gap: 25px; }
.tab {
  position: relative;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 9px/1 "SFMono-Regular", Consolas, monospace;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--text);
}

.search {
  width: 238px;
  height: 32px;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 10px;
}

.search input::placeholder { color: #636a76; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  min-height: 560px;
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.table-panel { min-width: 0; }
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace;
}

th {
  height: 36px;
  padding: 0 12px;
  text-align: left;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
}

td {
  height: 55px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 10px;
}

tbody tr { cursor: pointer; transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr.selected {
  background: var(--ice-soft);
  box-shadow: inset 2px 0 var(--ice);
}
tbody tr:last-child td { border-bottom: 0; }
th:nth-child(1) { width: 18%; }
th:nth-child(2) { width: 14%; }
th:nth-child(3) { width: 20%; }
th:nth-child(4) { width: 16%; }
th:nth-child(5) { width: 22%; }
th:nth-child(6) { width: 10%; }

.ticker {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ticker-dot {
  width: 3px;
  height: 29px;
  flex: 0 0 3px;
  background: var(--ice);
}

.ticker-name { min-width: 0; }
.ticker-name strong { display: block; color: var(--text); font-size: 12px; }
.ticker-name span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price strong { display: block; color: var(--text); font-size: 11px; }
.price span { display: block; margin-top: 4px; font-size: 9px; }
.positive { color: var(--green); }
.negative { color: var(--red); }

.score-cell { display: flex; align-items: center; gap: 8px; }
.score-number { min-width: 34px; color: var(--text); font-size: 14px; font-weight: 700; }
.score-track {
  width: 48px;
  height: 2px;
  background: var(--line-strong);
  overflow: hidden;
}
.score-track span { display: block; height: 100%; background: var(--ice); }

.level-badge,
.direction-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.level-extreme { color: var(--red); background: var(--red-soft); border-color: rgba(240, 141, 147, 0.25); }
.level-high { color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 183, 102, 0.25); }
.level-warm { color: var(--ice); background: var(--ice-soft); border-color: rgba(139, 179, 239, 0.25); }
.level-normal { color: var(--green); background: var(--green-soft); border-color: rgba(123, 224, 179, 0.2); }
.level-missing { color: var(--muted-strong); background: rgba(126, 133, 146, 0.12); border-color: var(--line-strong); }
.direction-badge { color: var(--violet); background: var(--violet-soft); border-color: rgba(194, 154, 239, 0.2); }
.pressure {
  color: var(--muted-strong);
  font-family: Inter, "PingFang SC", sans-serif;
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.coverage { color: var(--muted-strong); font-size: 10px; }

.detail-panel {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #0d1017;
}

.detail-placeholder {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.placeholder-mark { color: var(--ice); font-size: 30px; }
.detail-placeholder strong { margin-top: 12px; color: var(--text); font-size: 12px; }
.detail-placeholder p { margin-top: 6px; font-size: 9px; }

.detail-content { padding: 16px; }
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.detail-symbol strong {
  display: block;
  font: 700 18px/1 "SFMono-Regular", Consolas, monospace;
}
.detail-symbol span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.detail-score { text-align: right; }
.detail-score strong {
  display: block;
  color: var(--ice);
  font: 700 23px/1 "SFMono-Regular", Consolas, monospace;
}
.detail-score span { color: var(--muted); font-size: 8px; }
.short-cost-card {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(245, 183, 102, 0.28);
  background:
    linear-gradient(135deg, rgba(245, 183, 102, 0.10), rgba(245, 183, 102, 0.025)),
    #10131b;
}
.short-cost-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.short-cost-head span {
  display: block;
  color: var(--amber);
  font: 700 8px/1.2 "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
}
.short-cost-head strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 11px;
}
.short-cost-level {
  padding: 4px 7px;
  color: var(--amber) !important;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 183, 102, 0.28);
  white-space: nowrap;
}
.short-cost-basis {
  margin-top: 11px;
  color: var(--muted);
  font-size: 8px;
}
.short-cost-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 7px;
  border: 1px solid var(--line);
}
.short-cost-grid div {
  padding: 9px;
  border-right: 1px solid var(--line);
}
.short-cost-grid div:last-child { border-right: 0; }
.short-cost-grid span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}
.short-cost-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font: 700 12px/1 "SFMono-Regular", Consolas, monospace;
}
.short-cost-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
}
.short-cost-missing {
  border-color: var(--line-strong);
  background: #10131b;
}
.short-cost-missing .short-cost-head > span { color: var(--muted); }
.detail-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 {
  margin: 0 0 11px;
  color: var(--muted);
  font: 600 8px/1 "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
}
.metric { margin-bottom: 12px; }
.metric:last-child { margin-bottom: 0; }
.metric-line { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; }
.metric-line strong { color: var(--text); font-size: 9px; }
.metric-track { height: 2px; margin-top: 6px; background: var(--line-strong); overflow: hidden; }
.metric-track span { display: block; height: 100%; background: var(--green); }
.metric-meta { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.signal-list { margin: 0; padding: 0; list-style: none; }
.signal-list li {
  padding: 7px 0;
  color: var(--muted-strong);
  font-size: 9px;
  line-height: 1.45;
  border-bottom: 1px solid var(--line);
}
.signal-list li:last-child { border-bottom: 0; }

.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.empty-state strong { color: var(--text); font-size: 12px; }
.empty-state span { margin-top: 5px; font-size: 9px; }

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(2, 4, 8, 0.72); }
.dialog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  max-height: inherit;
}
.config-shell { grid-template-rows: auto 1fr auto; }
.onboarding-shell { grid-template-rows: auto 1fr auto; }
.watchlist-shell { grid-template-rows: auto minmax(0, 1fr) auto; }
.dialog-header,
.dialog-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialog-language-switch { height: 30px; }
.dialog-header h2 {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}
.dialog-header p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.icon-button { width: 30px; height: 30px; font-size: 19px; line-height: 1; }
.config-body { padding: 4px 16px; }
.config-field {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.75fr);
  align-items: center;
  gap: 18px;
  color: var(--muted-strong);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.config-field input,
.config-field select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  color: var(--text);
  background: #0d1017;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: 0;
}
.config-field input:focus,
.config-field select:focus { border-color: var(--ice); }
.config-field.disabled { opacity: 0.45; }
.config-preview {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font: 600 9px/1.3 "SFMono-Regular", Consolas, monospace;
}
.config-preview strong { color: var(--ice); text-align: right; }
.onboarding-body { padding: 4px 16px 10px; }
.onboarding-intro {
  margin: 0;
  padding: 13px 0;
  color: var(--muted-strong);
  font-size: 10px;
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}
.onboarding-step {
  min-height: 72px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.onboarding-step:last-child { border-bottom: 0; }
.onboarding-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--ice);
  background: var(--ice-soft);
  border: 1px solid rgba(87, 168, 255, 0.35);
  border-radius: 50%;
  font: 700 10px/1 "SFMono-Regular", Consolas, monospace;
}
.onboarding-step strong {
  display: block;
  font-size: 11px;
}
.onboarding-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}
.onboarding-step.done .onboarding-index {
  color: #07120e;
  background: var(--green);
  border-color: var(--green);
}
.onboarding-step.done p { color: var(--green); }
.onboarding-footnote {
  margin-right: auto;
  color: var(--muted);
  font-size: 8px;
}
.watchlist-body { min-height: 0; overflow: auto; }
.stock-presets {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.preset-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preset-heading strong {
  display: block;
  font-size: 10px;
}
.preset-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}
.stock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stock-chip {
  min-width: 48px;
  height: 28px;
  padding: 0 9px;
  color: var(--ice);
  background: var(--ice-soft);
  border: 1px solid rgba(139, 179, 239, 0.28);
  border-radius: 2px;
  font: 700 9px/1 "SFMono-Regular", Consolas, monospace;
}
.stock-chip:hover { border-color: var(--ice); }
.stock-chip.added {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}
.stock-template-list { display: grid; }
.stock-template {
  min-height: 43px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.stock-template:last-child { border-bottom: 0; }
.stock-template > div { min-width: 0; }
.stock-template strong { font-size: 10px; }
.stock-template span {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font: 600 8px/1.35 "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-template .button {
  width: 112px;
  min-height: 28px;
  padding: 0 9px;
  font-size: 9px;
}
.ticker-entry {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.ticker-entry input {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--text);
  background: #0d1017;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: 0;
  font-size: 10px;
}
.ticker-entry input:focus { border-color: var(--ice); }
.ticker-validation {
  min-height: 30px;
  margin: 0;
  padding: 7px 16px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  border-bottom: 1px solid var(--line);
}
.ticker-validation.success { color: var(--green); }
.ticker-validation.error { color: var(--red); }
.watchlist-items { padding: 6px 16px; }
.watch-item {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.watch-item:last-child { border-bottom: 0; }
.watch-item strong { font: 700 11px/1 "SFMono-Regular", Consolas, monospace; }
.watch-item span { margin-left: 8px; color: var(--muted); font-size: 9px; }
.remove-button { width: 28px; height: 28px; border: 0; background: transparent; color: var(--red); font-size: 17px; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 13px;
  color: #07120e;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s ease;
  font-size: 10px;
  font-weight: 650;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: #19080a; background: var(--red); }

@media (max-width: 1020px) {
  .summary-strip { grid-template-columns: repeat(4, 1fr); }
  .summary-time { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .workspace { grid-template-columns: minmax(0, 1fr) 310px; }
  th:nth-child(5), td:nth-child(5) { display: none; }
}

@media (max-width: 760px) {
  .app-header { align-items: flex-start; padding: 12px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .brand h1 { font-size: 13px; }
  .brand p { font-size: 8px; }
  .header-actions { flex-wrap: wrap; }
  .language-switch { height: 30px; grid-template-columns: repeat(2, 32px); }
  .provider-state { order: 3; min-height: 24px; padding: 0; border-left: 0; }
  .button { min-height: 32px; padding: 0 10px; font-size: 10px; }
  main { padding: 10px 8px 20px; }
  .key-gate {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-cell {
    min-height: 66px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
  }
  .summary-cell:nth-child(even) { border-right: 0; }
  .summary-cell strong { font-size: 17px; }
  .summary-time { grid-column: 1 / -1; border-bottom: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .tabs { min-height: 43px; gap: 21px; overflow-x: auto; }
  .tab { height: 43px; flex: 0 0 auto; }
  .search { width: 100%; margin-bottom: 10px; }
  .workspace { display: block; margin-top: 10px; }
  .detail-panel { border-left: 0; border-top: 1px solid var(--line); }
  table { min-width: 0; }
  th:nth-child(1) { width: 39%; }
  th:nth-child(2) { width: 24%; }
  th:nth-child(3) { width: 37%; }
  th:nth-child(n+4), td:nth-child(n+4) { display: none; }
  th, td { padding-left: 8px; padding-right: 8px; }
  td { height: 51px; }
  .score-cell { gap: 5px; }
  .score-track { display: none; }
  .detail-placeholder { min-height: 180px; }
  .ticker-entry { grid-template-columns: 1fr; }
  .ticker-entry .button { width: 100%; }
  .stock-template {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 0;
  }
  .stock-template .button { width: 96px; }
  .config-field {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 11px 0;
  }
  .config-preview { grid-template-columns: auto 1fr; }
  .onboarding-step {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 12px 0;
  }
  .onboarding-step .button {
    width: 100%;
    grid-column: 2;
  }
  .onboarding-footnote { display: none; }
  .app-footer {
    width: calc(100% - 16px);
    margin-bottom: 10px;
  }
}

@media (max-width: 450px) {
  .app-header { display: block; }
  .header-actions { margin-top: 11px; justify-content: flex-start; }
  .provider-state { width: calc(100% - 72px); }
  #config-open,
  #watchlist-open,
  #scan-button { flex: 1; }
  .level-badge { display: none; }
  .key-input-row { grid-template-columns: 1fr; }
  .key-input-row .button { width: 100%; }
}
