:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #f0f3ed;
  --ink: #17201a;
  --muted: #667067;
  --line: #dfe5dc;
  --green: #2f7d52;
  --green-2: #e5f2e9;
  --gold: #a56a1f;
  --gold-2: #f8eedf;
  --red: #bd4b45;
  --red-2: #fae9e7;
  --blue: #306f95;
  --blue-2: #e4f0f5;
  --tone-operable: #f4ead8;
  --tone-operable-edge: #b88418;
  --tone-operable-text: #6f5419;
  --tone-watch: #ece8f4;
  --tone-watch-edge: #8a73ba;
  --tone-watch-text: #5e4b83;
  --tone-downgrade: #e3eff4;
  --tone-downgrade-edge: #2f7f9d;
  --tone-downgrade-text: #2f6f88;
  --shadow: 0 14px 40px rgba(25, 36, 28, .10);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f8;
  letter-spacing: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 14px 12px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -14px -12px 10px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(247, 248, 245, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(223, 229, 220, .82);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

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

.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17201a;
  color: #f7f8f5;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(23, 32, 26, .16);
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
  font-weight: 760;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 54vw;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(25, 36, 28, .07);
}

.primary:active, .tab:active {
  transform: translateY(1px);
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.quick-target {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.quick-target span {
  flex: 0 0 auto;
}

.quick-target select {
  min-height: 55px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 14px;
  outline: none;
  color: var(--ink);
  font-weight: 720;
  font-size: 15px;
}

.search-wrap {
  position: relative;
  min-width: 0;
}

.search {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  outline: none;
  box-shadow: 0 6px 18px rgba(25, 36, 28, .05);
}

.search:focus {
  border-color: rgba(47, 125, 82, .52);
  box-shadow: 0 0 0 3px rgba(47, 125, 82, .12);
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: none;
  max-height: 310px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.suggestions.open { display: block; }

.suggestion {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border-bottom: 1px solid rgba(223, 229, 220, .72);
}

.suggestion:last-child { border-bottom: 0; }

.suggestion strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.suggestion span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.suggestion em {
  font-style: normal;
  color: var(--green);
  font-size: 12px;
  font-weight: 720;
}

.primary {
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 720;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 10px 22px rgba(47, 125, 82, .24);
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 6px;
}

.tab {
  min-height: 50px;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  text-align: left;
  display: flex;
  align-items: center;
}

.tab strong {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 15px;
  line-height: 1.15;
}

.tab strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.tab.active {
  background: #17201a;
  color: #fff;
  border-color: #17201a;
  box-shadow: var(--shadow);
}

.tab.active strong small { color: rgba(255, 255, 255, .72); }

.info-zone {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.info-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
}

.info-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  padding: 0 4px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.info-tab strong {
  font-size: 11.5px;
  line-height: 1.1;
}

.info-tab span {
  display: none;
}

.info-tab.active {
  background: #17201a;
  border-color: #17201a;
  color: #fff;
  box-shadow: 0 10px 22px rgba(25, 36, 28, .12);
}

.info-tab.active span {
  color: rgba(255, 255, 255, .72);
}

.info-sheet {
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px 10px;
  box-shadow: 0 8px 24px rgba(25, 36, 28, .05);
}

.review-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.review-list {
  display: grid;
  gap: 6px;
}

.review-item {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border-left: 3px solid var(--muted);
}

.review-item.add,
.review-item.operable { background: var(--tone-operable); border-left-color: var(--tone-operable-edge); }
.review-item.keep,
.review-item.watch { background: var(--tone-watch); border-left-color: var(--tone-watch-edge); }
.review-item.downgrade { background: var(--tone-downgrade); border-left-color: var(--tone-downgrade-edge); }
.review-item.remove { background: #eef0ee; border-left-color: #8c948e; }

.review-group {
  display: grid;
  gap: 7px;
}

.review-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.review-group-head strong {
  font-size: 13px;
  line-height: 1.2;
}

.review-group-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
}

.review-group-list {
  display: grid;
  gap: 6px;
}

.review-item strong {
  font-size: 12px;
  line-height: 1.2;
}

.review-item .review-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
}

.review-item .review-name {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 760;
}

.review-item .review-status {
  color: #27342d;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 520;
}

.review-item .review-change {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.pool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 8px;
}

.pool-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
}

.pool-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .76);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
}

.chip.active {
  background: var(--green-2);
  color: var(--green);
  border-color: rgba(47, 125, 82, .25);
  font-weight: 720;
}

.list {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(223, 229, 220, .78);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(25, 36, 28, .06);
}

.list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 68px 78px;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid rgba(223, 229, 220, .78);
}

.list-head span:nth-child(n+2) {
  text-align: right;
}

.card {
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid rgba(223, 229, 220, .78);
  border-radius: 0;
  padding: 12px;
  box-shadow: none;
}

.card:last-child {
  border-bottom: 0;
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px 62px 88px;
  gap: 6px;
  align-items: center;
}

.name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 5px;
}

.name-line h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.quote-title {
  display: inline;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  color: inherit;
  text-decoration: none;
}

.quote-title.multiline {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.quote-title .name-part {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.quote-title:active {
  color: var(--green);
}

.grade {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 760;
}

.market-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.manual-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 8px;
  background: #f4ede0;
  color: #8b5b16;
  font-size: 9px;
  font-weight: 760;
  line-height: 16px;
  white-space: nowrap;
}

.spark {
  width: 50px;
  height: 34px;
  color: var(--muted);
  opacity: .95;
}

.spark svg {
  width: 50px;
  height: 34px;
  stroke-width: 2;
}

.spark path.area {
  stroke: none;
  opacity: .12;
}

.price-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.price-cell b {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 760;
}

.price-cell span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.cost {
  min-width: 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  color: #fff;
  background: var(--muted);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 760;
}

.quote-up { color: var(--red); }
.quote-down { color: var(--green); }
.quote-flat { color: var(--muted); }
.quote-up-bg { background: var(--red) !important; }
.quote-down-bg { background: #24a876 !important; }
.quote-flat-bg { background: #8b948c !important; }

.note {
  margin: 8px 0 0;
  color: #344139;
  font-size: 12px;
  line-height: 1.6;
}

.entry-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(240, 243, 237, .92);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.entry-card.entry-up { color: var(--red); background: var(--red-2); }
.entry-card.entry-down { color: var(--green); background: var(--green-2); }
.entry-date { font-weight: 720; color: var(--ink); }
.entry-card.entry-up .entry-date { color: var(--red); }
.entry-card.entry-down .entry-date { color: var(--green); }
.entry-price {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-weight: 720;
}
.entry-pct {
  font-size: 16px;
  font-weight: 800;
  color: inherit;
}

.intraday-hint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border-left: 4px solid transparent;
  background: rgba(240, 243, 237, .92);
}

.hint-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1;
  font-weight: 760;
  white-space: nowrap;
}

.hint-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.hint-action {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.hint-detail {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.hint-buy,
.hint-trigger {
  border-left-color: #a56a1f;
  background: #f3ead9;
}

.hint-buy .hint-label,
.hint-trigger .hint-label {
  background: #eadbbf;
  color: #7a531b;
}

.hint-wait {
  border-left-color: #8a6bb8;
  background: #ece5f5;
}

.hint-wait .hint-label {
  background: #ded3ed;
  color: #604887;
}

.hint-chase,
.hint-profit {
  border-left-color: #306f95;
  background: #e4f0f5;
}

.hint-chase .hint-label,
.hint-profit .hint-label {
  background: #d4e6ee;
  color: #306f95;
}

.hint-stop {
  border-left-color: #a3a9a4;
  background: #eef0ee;
}

.hint-stop .hint-label {
  background: #dfe2df;
  color: #666f67;
}

.metric-stack {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(223, 229, 220, .9);
  background: rgba(223, 229, 220, .9);
}

.metric-cell {
  min-height: 50px;
  background: rgba(240, 243, 237, .92);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.metric-cell.wide {
  grid-column: span 2;
}

.metric-cell span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.metric-cell b {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 760;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.metric-cell.trade-main {
  padding: 10px 12px 12px;
}

.trade-main-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.status-operable {
  background: var(--tone-operable);
  color: var(--tone-operable-text);
}

.status-watch {
  background: var(--tone-watch);
  color: var(--tone-watch-text);
}

.status-downgrade {
  background: var(--tone-downgrade);
  color: var(--tone-downgrade-text);
}

.status-remove {
  background: #eef0ee;
  color: #666f67;
}

.trade-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, .92fr) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 8px;
  align-items: start;
}

.trade-main-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trade-main-block span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.trade-main-block b {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 760;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.pool-advice {
  display: none;
  gap: 4px;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  padding: 9px 10px;
  margin-bottom: 10px;
}

.pool-advice.show {
  display: grid;
}

.pool-advice strong {
  font-size: 12px;
  line-height: 1.2;
}

.pool-advice span {
  font-size: 11px;
  line-height: 1.45;
}

.quote-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  text-decoration: none;
  font-size: 12px;
  font-weight: 720;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.quote-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.text-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 680;
  font-size: 12px;
}

.text-btn.delete {
  color: var(--red);
  background: var(--red-2);
}

.empty {
  border: 1px dashed #c8d1c6;
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, .62);
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.rule-grid {
  display: grid;
  gap: 8px;
}

.rule-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 0;
  border-top: 1px solid rgba(223, 229, 220, .72);
}

.rule-row:first-child { border-top: 0; padding-top: 0; }
.rule-row b { color: var(--ink); }
.rule-row span { color: var(--muted); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer.open { display: block; }

.shade {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 26, .38);
}

.panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow: auto;
  padding: 16px 12px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -24px 70px rgba(23, 32, 26, .24);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  outline: none;
  padding: 10px;
  min-height: 42px;
}

.field textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.45;
}

.form-hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  position: sticky;
  bottom: calc(-18px - env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0 0;
  background: linear-gradient(180deg, rgba(247, 248, 245, 0), var(--bg) 24%);
}

.secondary {
  height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 720;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(24px);
  z-index: 80;
  min-width: min(92vw, 320px);
  padding: 11px 14px;
  border-radius: 8px;
  background: #17201a;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  text-align: center;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.desktop-grid {
  display: grid;
  gap: 12px;
}

svg {
  width: 19px;
  height: 19px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.mark svg {
  width: 22px;
  height: 22px;
}

@media (min-width: 720px) {
  .app {
    padding: 20px 20px 96px;
  }

  .topbar {
    margin: -20px -20px 12px;
    padding: 18px 20px 12px;
  }

  .desktop-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .side {
    display: grid;
    gap: 8px;
    margin-bottom: 6px;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .list {
    grid-template-columns: 1fr;
  }

  .info-zone {
    margin-top: 0;
  }

  .panel {
    width: min(560px, calc(100% - 32px));
    left: auto;
    right: 16px;
    bottom: 16px;
    border-radius: 8px;
  }
}

@media (max-width: 380px) {
  .brand h1 { font-size: 18px; }
  .brand p { max-width: 46vw; }
  .primary { padding: 0 10px; }
  .tabs { gap: 6px; }
  .tab {
    min-height: 46px;
    padding: 6px 7px;
  }
  .tab strong { font-size: 12px; }
  .list-head,
  .card-top {
    grid-template-columns: minmax(0, 1fr) 46px 62px 70px;
    gap: 6px;
  }
  .spark,
  .spark svg {
    width: 46px;
  }
  .price-cell b { font-size: 16px; }
  .cost b {
    min-width: 66px;
    padding: 0 6px;
    font-size: 13px;
  }
  .entry-card {
    grid-template-columns: 1fr 1fr;
  }
  .entry-price,
  .entry-pct {
    text-align: left;
  }
  .intraday-hint {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .metric-band {
    grid-template-columns: 1fr;
  }
  .metric-cell.wide {
    grid-column: auto;
  }
  .trade-main-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}
