:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-soft: #101114;
  --panel: rgba(28, 28, 30, 0.9);
  --panel-2: rgba(36, 36, 38, 0.96);
  --panel-3: rgba(255, 255, 255, 0.055);
  --text: #f5f5f7;
  --muted: #98989d;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  --accent-2: #64d2ff;
  --good: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --radius-sm: 14px;
  --gap: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, rgba(10, 132, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #07080a 0%, #000 42%, #07080a 100%);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  padding-bottom: calc(104px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

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

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

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 18px 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
}

.topbar h1,
.panel-title,
.detail-title,
.section-title,
.modal-title,
.page-title {
  color: var(--text);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-btn,
.ghost-btn,
.secondary-btn,
.inline-btn {
  border-radius: 999px;
  padding: 0.8rem 1rem;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: var(--accent);
  box-shadow: none;
}

.ghost-btn,
.secondary-btn,
.inline-btn {
  color: var(--text);
  background: rgba(118, 118, 128, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inline-btn {
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}

.content-wrap {
  display: grid;
  gap: var(--gap);
}

.panel,
.hero-card,
.metric-card,
.list-card,
.status-card,
.modal-card,
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(135%);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(10, 132, 255, 0.2), rgba(28, 28, 30, 0.96) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -12% -40% auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(110, 243, 214, 0.18), transparent 66%);
  pointer-events: none;
}

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.hero-copy {
  margin: 0;
  max-width: 62ch;
  color: var(--text);
  line-height: 1.5;
}

.hero-status,
.signal-pill,
.kpi-pill,
.install-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.hero-status.ok,
.signal-pill.ok,
.kpi-pill.good,
.install-pill.good,
.score-pill.good {
  background: rgba(44, 211, 139, 0.14);
  color: #87f0bf;
}

.hero-status.warn,
.signal-pill.warn,
.kpi-pill.warn,
.install-pill.warn,
.score-pill.warn {
  background: rgba(255, 184, 77, 0.16);
  color: #ffd08b;
}

.hero-status.bad,
.signal-pill.bad,
.kpi-pill.bad,
.install-pill.bad,
.score-pill.bad {
  background: rgba(255, 107, 122, 0.15);
  color: #ff9daa;
}

.hero-grid,
.metrics-grid,
.card-grid,
.info-grid {
  display: grid;
  gap: 14px;
}

.hero-grid,
.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 18px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-card {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.metric-label,
.muted,
.section-subtitle,
.kpi-label,
.form-label,
.empty-copy,
.install-copy,
.detail-copy,
.list-meta,
.mini-copy,
.status-meta,
.score-caption {
  color: var(--muted);
}

.metric-value {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
}

.metric-footnote {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-metric {
  position: relative;
  overflow: hidden;
  min-height: 124px;
}

.dashboard-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.dashboard-metric.good::before { background: var(--good); }
.dashboard-metric.bad::before { background: var(--bad); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
}

.dashboard-panel {
  min-height: 230px;
}

.dashboard-panel .section-title {
  margin-bottom: 10px;
}

.dashboard-footnote {
  padding-top: 10px;
  padding-bottom: 10px;
}

.plain-list {
  margin: 12px 0 18px;
  padding-left: 1.2rem;
  color: var(--text);
  line-height: 1.55;
}

.plain-list li + li {
  margin-top: 7px;
}

.action-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.compact-status .status-row {
  padding: 9px 0;
}

.page-intro {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(71, 184, 255, 0.13), rgba(255, 255, 255, 0.025));
}

.page-intro.short-intro {
  background: linear-gradient(135deg, rgba(255, 107, 122, 0.12), rgba(255, 255, 255, 0.025));
}

.page-intro p:last-child {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.no-trade-state {
  display: grid;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.10), rgba(255, 255, 255, 0.025));
}

.no-trade-state .signal-pill {
  justify-self: start;
}

.no-trade-state p {
  margin: 0;
  line-height: 1.5;
}

.section {
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-title,
.modal-title,
.page-title {
  margin: 0;
  font-size: 1.3rem;
}

.section-subtitle,
.detail-copy,
.install-copy {
  margin: 6px 0 0;
  line-height: 1.5;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.list-card.long-card {
  border-left: 3px solid rgba(44, 211, 139, 0.72);
}

.list-card.short-card {
  border-left: 3px solid rgba(255, 107, 122, 0.78);
}

.list-card button.card-hit {
  all: unset;
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.card-symbol,
.card-kicker {
  margin: 2px 0 0;
  color: var(--accent-2);
  font-weight: 700;
}

.card-kicker {
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.card-summary {
  margin: 0;
  line-height: 1.45;
  color: var(--text);
}

.plain-facts,
.decision-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.plain-fact,
.decision-strip > div {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
}

.plain-fact span,
.decision-strip span {
  color: var(--muted);
  font-size: .75rem;
}

.plain-fact strong,
.decision-strip strong {
  color: var(--text);
  font-size: .92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: var(--accent-2);
  font-weight: 700;
}

.card-footer small {
  color: var(--muted);
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: right;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.score-row {
  display: grid;
  gap: 6px;
}

.score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.progress.good > span { background: linear-gradient(90deg, #1cbf6f, #6ef3d6); }
.progress.warn > span { background: linear-gradient(90deg, #ff9e45, #ffd266); }
.progress.bad > span { background: linear-gradient(90deg, #ff6275, #ff9ea6); }

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-pill {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}

.forecast-strip,
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.forecast-strip > div,
.scenario-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
}

.forecast-strip span,
.scenario-grid span,
.scenario-grid small {
  color: var(--muted);
  font-size: 0.76rem;
}

.forecast-strip strong,
.scenario-grid strong {
  color: var(--text);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 28px));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 7px 8px calc(7px + var(--safe-bottom));
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 27px;
  background: rgba(30, 30, 32, 0.78);
  box-shadow: 0 12px 36px rgba(0,0,0,0.38);
  backdrop-filter: blur(28px) saturate(180%);
  pointer-events: auto;
}

.tab-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  border: 0;
}

.tab-btn.active {
  color: var(--accent-2);
  background: rgba(10, 132, 255, 0.16);
}

.tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
}

.tab-icon svg {
  width: 20px;
  height: 20px;
}

.tab-label {
  font-size: 0.84rem;
  font-weight: 700;
}

.install-banner,
.notice,
.empty-state,
.status-card,
.form-card,
.modal-card {
  padding: 18px;
}

.install-banner,
.notice,
.empty-state {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.install-banner {
  background: linear-gradient(135deg, rgba(71, 184, 255, 0.14), rgba(110, 243, 214, 0.1));
}

.notice {
  background: rgba(255,255,255,0.04);
}

.notice.bad {
  background: rgba(255, 107, 122, 0.12);
}

.notice.good {
  background: rgba(44, 211, 139, 0.12);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(7, 13, 24, 0.72);
  color: var(--text);
  padding: 0.95rem 1rem;
}

.textarea {
  resize: vertical;
  min-height: 88px;
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 14px 0;
}

.wide-field {
  grid-column: 1 / -1;
}

.trade-entry-card {
  display: grid;
  gap: 14px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.form-actions,
.card-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  padding: 18px;
}

.modal-card {
  max-height: min(86vh, 920px);
  overflow: auto;
  border-radius: 28px;
  background: rgba(28, 28, 30, 0.98);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head .ghost-btn {
  padding: 0.6rem 0.85rem;
}

.detail-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.detail-block {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.detail-block h4 {
  margin: 0 0 10px;
  color: var(--text);
}

.detail-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-hero {
  background: linear-gradient(135deg, rgba(71, 184, 255, 0.11), rgba(110, 243, 214, 0.05));
}

.lead-copy {
  font-size: 1.02rem;
  line-height: 1.55;
}

.decision-strip {
  margin: 14px 0 0;
}

.gate-box {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 15px;
  background: rgba(255, 184, 77, 0.10);
  border: 1px solid rgba(255, 184, 77, 0.20);
}

.gate-box ul {
  margin-top: 8px;
}

.two-column-explain {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.advanced-details {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
}

.advanced-details summary {
  cursor: pointer;
  padding: 15px 16px;
  color: var(--muted);
  font-weight: 700;
}

.advanced-details .detail-block {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.technical-note {
  color: var(--muted) !important;
  font-size: .88rem;
}

.scenario-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.price-chart {
  display: block;
  width: 100%;
  min-height: 180px;
  color: var(--good);
  overflow: visible;
}

.price-chart.down {
  color: var(--bad);
}

.price-chart text {
  font-size: 12px;
  opacity: .76;
}

.forecast-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.forecast-table > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.forecast-table span {
  color: var(--muted);
  font-size: .8rem;
}

.positive { color: var(--good); }
.negative { color: var(--bad); }

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
}

.news-item a,
.news-item strong {
  color: var(--text);
  font-weight: 750;
  line-height: 1.4;
}

.news-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.detail-block p,
.detail-block li {
  color: var(--text);
  line-height: 1.5;
}

.detail-block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.status-list,
.quick-list {
  display: grid;
  gap: 10px;
}

.status-row,
.quick-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.status-row:last-child,
.quick-item:last-child {
  border-bottom: 0;
}

.empty-state {
  background: rgba(255,255,255,0.04);
}

.empty-state strong,
.notice strong,
.install-banner strong {
  color: var(--text);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.14);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript {
  margin: 18px;
  padding: 16px;
  color: #fff;
  background: #8b1d2c;
  border-radius: 14px;
}

.portfolio-page {
  gap: 16px;
}

.portfolio-page-head {
  align-items: center;
}

.circle-action {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.28);
}

.portfolio-summary-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 0%, rgba(100, 210, 255, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(10, 132, 255, 0.16), rgba(28, 28, 30, 0.96) 60%);
  box-shadow: var(--shadow);
}

.portfolio-balance {
  display: grid;
  gap: 4px;
}

.portfolio-balance span,
.portfolio-summary-grid span,
.position-hero-value span,
.position-facts span {
  color: var(--muted);
  font-size: .82rem;
}

.portfolio-balance > strong {
  font-size: clamp(1.9rem, 6vw, 3rem);
  letter-spacing: -.035em;
}

.portfolio-balance small {
  color: var(--muted);
}

.portfolio-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.portfolio-summary-grid > div {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-radius: 17px;
  background: rgba(255,255,255,.055);
}

.apple-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(28, 28, 30, .88);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.apple-group.in-sheet {
  margin-top: 18px;
  background: rgba(44,44,46,.8);
}

.apple-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 9px;
}

.apple-group-head h3 {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.apple-group-head span {
  color: var(--muted);
  font-size: .78rem;
}

.apple-list {
  display: grid;
}

.apple-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border-top: 1px solid rgba(255,255,255,.085);
}

.apple-row:first-child {
  border-top: 0;
}

.apple-row:active {
  background: rgba(255,255,255,.075);
}

.asset-avatar,
.activity-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #0a84ff, #5e5ce6);
  font-weight: 750;
  letter-spacing: -.03em;
}

.asset-avatar.large {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 1.05rem;
}

.activity-icon {
  border-radius: 50%;
  font-size: 1.35rem;
}

.activity-icon.buy {
  background: rgba(48, 209, 88, .18);
  color: #63e685;
}

.activity-icon.sell {
  background: rgba(255, 69, 58, .18);
  color: #ff6961;
}

.apple-row-copy,
.apple-row-value {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.apple-row-copy strong,
.apple-row-value strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apple-row-copy small,
.apple-row-value small {
  color: var(--muted);
  font-size: .78rem;
}

.apple-row-value {
  justify-items: end;
  text-align: right;
}

.row-chevron {
  color: #636366;
  font-size: 1.7rem;
  font-weight: 300;
}

.clean-empty {
  margin: 8px 12px 14px;
  text-align: center;
  background: rgba(255,255,255,.035);
}

.clean-empty p {
  margin: 7px 0 14px;
  color: var(--muted);
}

.compact-notice {
  padding: 13px 15px;
  border-radius: 17px;
  font-size: .88rem;
}

.sheet-grabber {
  width: 38px;
  height: 5px;
  margin: -5px auto 12px;
  border-radius: 999px;
  background: #636366;
}

.trade-sheet {
  width: min(640px, 100%);
  margin: 0 auto;
}

.sheet-head {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.sheet-head .modal-title {
  font-size: 1.02rem;
  text-align: center;
}

.sheet-head-spacer {
  display: block;
}

.text-action {
  justify-self: start;
  padding: 8px 0;
  color: var(--accent-2);
  background: transparent;
  font-weight: 650;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin: 18px 0;
  border-radius: 11px;
  background: rgba(118,118,128,.24);
}

.segmented-control button {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segmented-control button.active {
  color: var(--text);
  background: #3a3a3c;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.segmented-control button.active.buy {
  color: #63e685;
}

.segmented-control button.active.sell {
  color: #ff6961;
}

.apple-form-group {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 17px;
  background: rgba(44,44,46,.86);
}

.apple-field {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid rgba(255,255,255,.09);
  color: var(--text);
}

.apple-field:first-child {
  border-top: 0;
}

.apple-field > span {
  font-weight: 600;
}

.apple-field input,
.apple-field textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px 0;
  color: var(--text);
  background: transparent;
  text-align: right;
}

.apple-field input::placeholder,
.apple-field textarea::placeholder {
  color: #636366;
}

.apple-field.vertical {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
  padding-top: 13px;
}

.apple-field.vertical textarea {
  min-height: 76px;
  text-align: left;
  resize: vertical;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 12px 0;
}

.split-fields .apple-field {
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  padding-top: 10px;
  border-top: 0;
  border-left: 1px solid rgba(255,255,255,.09);
}

.split-fields .apple-field:first-child {
  border-left: 0;
}

.split-fields .apple-field input {
  text-align: left;
}

.field-help {
  margin: 8px 12px 14px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.field-help strong {
  color: var(--text);
}

.field-help.centered {
  text-align: center;
}

.optional-fields {
  margin: 14px 0;
}

.optional-fields summary {
  padding: 9px 2px;
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 650;
}

.full-action {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.destructive-btn {
  border-radius: 999px;
  padding: .8rem 1rem;
  color: #ff6961;
  background: rgba(255,69,58,.12);
  font-weight: 700;
}

.confirm-shell {
  align-items: center;
}

.confirm-card {
  width: min(390px, 100%);
  margin: auto;
  text-align: center;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: #ff6961;
  background: rgba(255,69,58,.14);
  font-size: 1.45rem;
  font-weight: 800;
}

.confirm-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.position-sheet {
  width: min(680px, 100%);
  margin: 0 auto;
}

.position-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.position-hero-value {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 26px 10px 22px;
  text-align: center;
}

.position-hero-value > strong {
  font-size: clamp(1.75rem, 6vw, 2.7rem);
  letter-spacing: -.035em;
}

.position-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.position-facts > div {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  border-left: 1px solid rgba(255,255,255,.08);
}

.position-facts > div:nth-child(-n+2) {
  border-top: 0;
}

.position-facts > div:nth-child(odd) {
  border-left: 0;
}

.position-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.positive {
  color: #63e685 !important;
}

.negative {
  color: #ff6961 !important;
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(92px + var(--safe-bottom));
  }

  .app-shell {
    padding: calc(10px + var(--safe-top)) 10px 18px;
  }

  .topbar {
    align-items: center;
    margin-bottom: 10px;
  }

  .topbar-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .topbar-actions > * {
    flex: 0 0 auto;
    padding: .68rem .78rem;
    font-size: .8rem;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .hero-card {
    padding: 15px;
    border-radius: 20px;
  }

  .hero-head h2 {
    font-size: 1.3rem;
    line-height: 1.18;
  }

  .hero-copy {
    font-size: .88rem;
    line-height: 1.4;
  }

  .hero-status {
    padding: .38rem .58rem;
    font-size: .72rem;
  }

  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-metric {
    min-height: 108px;
  }

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

  .dashboard-panel {
    min-height: 0;
  }

  .page-intro {
    padding: 16px;
    border-radius: 19px;
  }

  .metric-card {
    padding: 11px;
    border-radius: 15px;
  }

  .metric-label,
  .metric-footnote {
    font-size: .72rem;
  }

  .metric-value {
    font-size: 1.12rem;
  }

  .list-card,
  .status-card,
  .install-banner,
  .notice,
  .empty-state {
    border-radius: 18px;
    padding: 14px;
  }

  .forecast-strip {
    grid-template-columns: 1fr 1fr;
  }

  .plain-facts,
  .decision-strip {
    grid-template-columns: 1fr 1fr;
  }

  .plain-fact:last-child,
  .decision-strip > div:first-child {
    grid-column: 1 / -1;
  }

  .two-column-explain {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .forecast-strip > div:first-child {
    grid-column: 1 / -1;
  }

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

  .modal-shell {
    padding: 0;
    align-items: end;
  }

  .modal-card {
    width: 100%;
    max-height: 94dvh;
    border-radius: 26px 26px 0 0;
    padding: 16px 12px calc(20px + var(--safe-bottom));
  }

  .confirm-shell {
    align-items: center;
    padding: 18px;
  }

  .confirm-card {
    width: 100%;
    border-radius: 26px;
    padding: 22px 18px;
  }

  .portfolio-summary-card {
    padding: 18px;
    border-radius: 22px;
  }

  .portfolio-summary-grid {
    gap: 8px;
  }

  .apple-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(82px, auto) auto;
    gap: 9px;
    padding: 10px 12px;
  }

  .asset-avatar,
  .activity-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: .88rem;
  }

  .activity-icon {
    border-radius: 50%;
    font-size: 1.25rem;
  }

  .apple-row-copy strong,
  .apple-row-value strong {
    font-size: .9rem;
  }

  .apple-row-copy small,
  .apple-row-value small {
    font-size: .7rem;
  }

  .row-chevron {
    font-size: 1.35rem;
  }

  .trade-sheet,
  .position-sheet {
    max-height: 96dvh;
  }

  .apple-field {
    grid-template-columns: minmax(105px, .8fr) minmax(0, 1.2fr);
    padding: 0 12px;
    font-size: .9rem;
  }

  .split-fields .apple-field {
    grid-template-columns: 1fr;
  }

  .position-actions {
    grid-template-columns: 1fr;
  }

  .tabbar {
    width: calc(100% - 12px);
    gap: 4px;
    padding: 7px 6px calc(7px + var(--safe-bottom));
  }

  .tab-btn {
    gap: 3px;
    padding: 8px 3px;
    border-radius: 15px;
  }

  .tab-icon {
    width: 24px;
    height: 24px;
  }

  .tab-icon svg {
    width: 18px;
    height: 18px;
  }

  .tab-label {
    font-size: .68rem;
  }
}
