:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #191f28;
  --muted: #8b95a1;
  --subtle: #6b7684;
  --line: #edf0f3;
  --brand: #3182f6;
  --brand-soft: #eef6ff;
  --amber: #f59f00;
  --red: #f04452;
  --green: #00a661;
  --shadow: none;
  --app-max: 480px;
  --control-bg: #f2f4f6;
  --control-radius: 12px;
  --control-height: 42px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  letter-spacing: 0;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  background: var(--surface);
  border-bottom: 0;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  margin: 0 auto;
  max-width: var(--app-max);
  padding: 18px 18px 14px;
}

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

.header-side {
  align-items: end;
  display: grid;
  gap: 7px;
  justify-items: end;
  min-width: 150px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 0;
}

h2 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 0;
}

.top-meta {
  color: var(--muted);
  display: grid;
  gap: 4px;
  justify-items: end;
  margin-top: 2px;
  min-width: 0;
  text-align: right;
}

.top-meta span {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.top-meta b {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}

.meta-pill {
  display: contents;
}

.meta-pill strong {
  font-size: inherit;
}

.meta-pill span,
.muted,
small {
  color: var(--muted);
}

.user-control {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 0;
  min-width: 0;
  width: 100%;
}

.user-select-wrap {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 3px;
  min-width: 0;
  text-align: right;
}

.user-select-wrap select {
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  min-height: 34px;
  padding: 0 9px;
}

.user-switch::-webkit-scrollbar,
.account-tabs::-webkit-scrollbar {
  display: none;
}

.add-user,
.rename-user {
  align-items: center;
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--brand);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0 9px;
  white-space: nowrap;
}

.rename-user {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-height: 42px;
  padding: 0 4px;
}

.delete-user {
  background: transparent;
  border: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 0;
}

.user-tab,
.account-tab,
.nav-tab {
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--muted);
  min-height: var(--control-height);
  padding: 0 12px;
}

.user-tab.active,
.account-tab.active,
.nav-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.app-shell {
  margin: 0 auto;
  max-width: var(--app-max);
  padding: 12px 10px 118px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.account-card,
.holdings-section,
.dividend-summary,
.settings-holdings,
.universe-summary,
.capture-panel,
.holding-add-panel,
.user-create-form,
.report-item,
.market-row {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-card {
  align-items: flex-end;
  background: transparent;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 10px 8px 14px;
}

.sticky-summary {
  position: sticky;
  top: 118px;
  z-index: 6;
}

.account-card strong {
  display: block;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 6px 0 5px;
}

.mini-stats {
  display: grid;
  gap: 6px;
  text-align: right;
}

.mini-stats span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mini-stats b {
  color: var(--ink);
  font-size: 17px;
  margin-right: 2px;
}

.account-tabs {
  display: grid;
  grid-auto-columns: max-content;
  grid-auto-flow: column;
  background: transparent;
  border-bottom: 1px solid var(--line);
  gap: 18px;
  margin: 2px 0 12px;
  overflow-x: auto;
  padding: 0 8px;
}

.account-tab {
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  min-height: 42px;
  padding: 0;
  position: relative;
  white-space: nowrap;
}

.account-tab.active {
  background: transparent;
  color: var(--ink);
}

.account-tab.active::after {
  background: var(--ink);
  border-radius: 999px;
  bottom: -1px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

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

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

.holding-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.holdings-section,
.settings-holdings,
.capture-panel,
.holding-add-panel,
.user-create-form {
  margin-bottom: 10px;
  padding: 18px;
}

.capture-panel,
.holding-add-panel,
.user-create-form {
  background: #ffffff;
  border-radius: 8px;
}

.file-input {
  height: 1px;
  min-height: 1px;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 1px;
}

.capture-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-picker {
  align-items: center;
  background: var(--control-bg);
  border-radius: var(--control-radius);
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 800;
  min-height: var(--control-height);
  padding: 0 14px;
}

.capture-file-name {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.holding-form,
.filter-bar {
  display: grid;
  gap: 10px;
}

.holding-form {
  grid-template-columns: repeat(6, minmax(0, 1fr)) 72px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 5px;
}

input,
select {
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  min-height: var(--control-height);
  padding: 0 14px;
  width: 100%;
}

input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #d7e8ff;
  outline-offset: 2px;
}

.holding-form button,
.user-create-form button,
.text-button {
  background: var(--brand);
  border: 0;
  border-radius: var(--control-radius);
  color: #ffffff;
  font-weight: 800;
  min-height: var(--control-height);
  padding: 0 13px;
}

.text-button {
  background: var(--brand-soft);
  color: var(--brand);
}

.text-button.ghost {
  background: var(--control-bg);
  color: var(--subtle);
}

.text-button.mini {
  font-size: 12px;
  min-height: 34px;
  padding: 0 10px;
}

.screen-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.screen-note:empty {
  display: none;
}

.list-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.segmented {
  background: var(--control-bg);
  border-radius: var(--control-radius);
  display: inline-grid;
  grid-auto-flow: column;
  padding: 3px;
}

.segmented button {
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-height: 36px;
  min-width: 46px;
  padding: 0 10px;
}

.segmented button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(25, 31, 40, 0.08);
}

.holding-list,
.market-list,
.report-list {
  display: grid;
  gap: 0;
}

.holding-row {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0;
  position: relative;
}

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

.holding-row.is-hidden {
  opacity: 0.72;
}

.holding-row.is-hidden .symbol-mark {
  background: #f2f4f6;
  color: var(--muted);
}

.row-main {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.symbol-mark {
  align-items: center;
  background: var(--brand-soft);
  border-radius: 13px;
  color: var(--brand);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.symbol-mark.small {
  border-radius: 50%;
  font-size: 10px;
  height: 34px;
  width: 34px;
}

.stock-name {
  min-width: 0;
}

.stock-name strong,
.row-amount strong,
.market-row strong,
.report-item strong {
  display: block;
  font-family: inherit;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stock-name span,
.row-sub,
.market-row span,
.report-item p {
  color: var(--subtle);
}

.stock-name span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.row-amount {
  min-width: 116px;
  text-align: right;
}

.row-amount strong {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
}

.row-amount span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
}

.row-sub {
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 4px 10px;
  line-height: 1.55;
  margin-top: 12px;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.row-tags span {
  background: #f2f4f6;
  border-radius: 999px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.row-tags .good {
  background: #e9f8ee;
  color: var(--green);
}

.row-tags .warn {
  background: #fff7ed;
  color: var(--amber);
}

.row-tags .risk {
  background: #fef2f2;
  color: var(--red);
}

.issue-strip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 12px;
  padding-right: 44px;
}

.holding-strategy {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px 0 0;
}

.strategy-mini-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.strategy-mini-head b {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.strategy-mini-head span {
  background: #eef6ff;
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.strategy-mini-head span.good {
  background: #e9f8ee;
  color: var(--green);
}

.strategy-mini-head span.warn {
  background: #fff7ed;
  color: var(--amber);
}

.strategy-mini-head span.risk {
  background: #fef2f2;
  color: var(--red);
}

.strategy-mini-head span.neutral {
  background: #f2f4f6;
  color: #6b7684;
}

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

.strategy-metrics.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.strategy-metrics div {
  background: #f8fafc;
  border: 0;
  border-radius: 8px;
  min-width: 0;
  padding: 11px 12px;
}

.strategy-metrics span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 5px;
}

.strategy-metrics strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.holding-strategy p {
  color: #4e5968;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.strategy-brief,
.strategy-checkline {
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.6;
}

.strategy-checkline {
  color: var(--muted);
}

.schedule-checks {
  background: #f8fafc;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 12px;
}

.schedule-checks > b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.schedule-checks div {
  display: grid;
  gap: 2px;
}

.schedule-checks strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.schedule-checks span {
  color: #4e5968;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-checks {
  display: grid;
  gap: 6px;
}

.strategy-checks span {
  color: #4e5968;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-checks span::before {
  color: var(--brand);
  content: "확인 ";
  font-weight: 800;
}

.strategy-news {
  display: grid;
  gap: 6px;
}

.strategy-news a {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}

.strategy-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-detail {
  background: #f9fafb;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 12px;
}

.analysis-detail > b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.evidence-card {
  border-left: 2px solid #d7e8ff;
  display: grid;
  gap: 5px;
  padding-left: 10px;
}

.evidence-card div {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

.evidence-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.evidence-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.evidence-card p {
  color: #4e5968;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.row-tools {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}

.hide-toggle,
.remove {
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.hide-toggle {
  color: var(--brand);
}

.remove {
  color: var(--red);
}

.filter-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.filter-bar input {
  grid-column: 1 / -1;
}

.universe-summary,
.dividend-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
}

.dividend-summary {
  background: #ffffff;
  color: var(--ink);
  overflow: hidden;
  padding: 18px 16px 16px;
  position: relative;
}

.dividend-summary::after {
  background: linear-gradient(135deg, rgba(49, 130, 246, 0.12), rgba(0, 166, 97, 0.08));
  content: "";
  height: 120px;
  position: absolute;
  right: -40px;
  top: -48px;
  transform: rotate(12deg);
  width: 160px;
}

.universe-summary strong,
.dividend-summary strong {
  color: inherit;
  display: block;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.2;
  margin: 5px 0;
}

.dividend-summary small {
  color: var(--subtle);
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.dividend-top-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.dividend-top-row select {
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  min-height: var(--control-height);
  padding: 0 12px;
  width: 112px;
}

.dividend-view-options {
  align-items: center;
  background: var(--control-bg);
  border-radius: var(--control-radius);
  color: var(--muted);
  display: flex;
  gap: 0;
  font-size: 13px;
  font-weight: 800;
  padding: 3px;
  white-space: nowrap;
}

.dividend-view-options span {
  border-radius: 10px;
  min-height: 36px;
  padding: 9px 10px 0;
}

.dividend-view-options span.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(25, 31, 40, 0.08);
}

.dividend-chart {
  align-items: end;
  background: transparent;
  border-radius: 0;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin: 8px 0 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.dividend-bar {
  align-items: end;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 112px;
  padding: 0;
}

.dividend-bar em {
  color: var(--subtle);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  min-height: 14px;
  white-space: nowrap;
}

.dividend-bar span {
  align-self: end;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  border-radius: 6px 6px 3px 3px;
  display: block;
  min-height: 8px;
  width: 100%;
}

.dividend-bar b {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.dividend-bar.active {
  color: var(--brand);
}

.dividend-bar.active span {
  background: linear-gradient(180deg, #4f9bff, #3182f6);
}

.month-picker-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin: 22px 6px 14px;
}

.month-picker-row h2 {
  font-size: 24px;
}

.month-picker-row strong {
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}

.month-picker-row select {
  background: var(--control-bg);
  border: 0;
  border-radius: var(--control-radius);
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  min-height: var(--control-height);
  padding: 0 12px;
  width: 112px;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.market-explain {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
}

.market-metrics {
  align-items: flex-end;
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.market-metrics strong {
  color: var(--brand);
  font-size: 20px;
}

.market-row .row-tags {
  grid-column: 1 / -1;
  margin-top: 0;
}

.dividend-calendar {
  display: grid;
  gap: 10px;
}

.dividend-month,
.security-panel {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
}

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

.month-head strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.month-head span,
.empty-month {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.month-head b {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.dividend-event {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 44px 38px minmax(0, 1fr) auto;
  padding: 16px 0;
}

.dividend-event span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.dividend-event small {
  color: var(--muted);
  font-size: 11px;
  grid-column: 1 / -1;
  line-height: 1.45;
}

.dividend-event strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.dividend-event b {
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.event-name {
  min-width: 0;
}

.empty-month {
  margin: 0;
}

.security-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.security-actions .text-button {
  white-space: nowrap;
}

.security-actions .text-button:first-child {
  grid-column: 1 / -1;
}

.settings-subtitle {
  margin-top: 8px;
}

.settings-user-actions {
  align-items: end;
  display: grid;
  gap: 3px;
  justify-items: end;
}

.profile-actions {
  margin-top: 10px;
}

.danger-box {
  background: #fff1f2;
  border-radius: var(--control-radius);
  min-height: var(--control-height);
  padding: 0 14px;
  width: 100%;
}

.settings-holding-list {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.settings-stock-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 15px 0;
}

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

.settings-stock-row.is-hidden {
  opacity: 0.62;
}

.settings-stock-row strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.settings-stock-row span {
  color: var(--subtle);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.hide-check {
  align-items: center;
  color: var(--subtle);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 36px;
  white-space: nowrap;
}

.hide-check input {
  accent-color: var(--brand);
  height: 18px;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

.report-item {
  box-shadow: none;
  padding: 15px;
}

.report-item p {
  line-height: 1.55;
  margin-bottom: 0;
}

.empty-state {
  background: #f9fafb;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.bottom-nav {
  background: #ffffff;
  border-top: 1px solid #edf0f3;
  box-shadow: 0 -8px 20px rgba(2, 32, 71, 0.04);
  bottom: 0;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(5, 1fr);
  left: 50%;
  max-width: var(--app-max);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  position: fixed;
  right: auto;
  transform: translateX(-50%);
  width: 100%;
  z-index: 20;
}

.nav-tab {
  background: transparent;
  font-size: 13px;
  min-height: 42px;
  padding: 0 6px;
}

.nav-tab.active {
  background: #eef6ff;
  color: var(--brand);
}

@media (max-width: 820px) {
  .holding-form,
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .holding-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  :root {
    --app-max: 100vw;
  }

  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .header-inner {
    padding: 17px 18px 12px;
  }

  .brand-row {
    gap: 8px;
  }

  .header-side {
    min-width: 142px;
  }

  .user-control {
    grid-template-columns: minmax(82px, 1fr) 52px;
  }

  .sticky-summary {
    top: 172px;
  }

  .account-card {
    padding: 8px 8px 14px;
  }

  .account-card strong {
    font-size: 28px;
  }

  .holding-form,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .dividend-summary {
    padding: 18px 14px 16px;
  }

  .dividend-chart {
    gap: 5px;
  }

  .dividend-bar b {
    font-size: 9px;
  }

  .dividend-bar em {
    font-size: 9px;
  }

  .month-picker-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .month-picker-row select {
    grid-column: 2;
  }

  .dividend-event {
    grid-template-columns: 40px 34px minmax(0, 1fr) auto;
  }

  .market-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-stock-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-stock-row .remove {
    grid-column: 2;
    justify-self: end;
  }

  .row-main {
    gap: 9px;
    grid-template-columns: 36px minmax(0, 1fr) minmax(112px, auto);
  }

  .row-amount {
    min-width: 112px;
    text-align: right;
  }

  .section-title {
    align-items: flex-start;
  }

  .holding-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .strategy-metrics,
  .strategy-metrics.compact {
    grid-template-columns: 1fr;
  }
}
