:root {
  color-scheme: light;
  --ink: #181816;
  --muted: #77736b;
  --line: #e6e1d8;
  --paper: #ffffff;
  --summary: #12343b;
  --accent: #1f6f62;
  --locked: #f5f5f5;
  --phone-width: 430px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f3f0ea;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 50%;
  z-index: -1;
  width: min(var(--phone-width), 100vw);
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(24, 24, 22, 0.06);
  transform: translateX(-50%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: default;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  width: min(var(--phone-width), 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  scrollbar-width: none;
  white-space: nowrap;
}

nav::-webkit-scrollbar {
  display: none;
}

.app-main {
  width: min(var(--phone-width), 100%);
  margin: 0 auto;
  padding: 12px 16px 28px;
  background: var(--paper);
}

.summary-band {
  padding: 16px;
  border-radius: 8px;
  background: var(--summary);
  color: #ffffff;
}

.summary-band p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.summary-band h1 {
  margin: 0;
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
}

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

.summary-metrics span,
.summary-metrics strong {
  display: block;
}

.summary-metrics span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.summary-metrics strong {
  margin-top: 2px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.plan-panel,
.account-card,
.income-panel,
.panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.plan-panel {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.section-row h2,
.account-head h3,
.doc-head h1 {
  margin: 0;
  color: var(--ink);
}

.section-row h2 {
  font-size: 18px;
  font-weight: 900;
}

.text-action {
  padding: 0;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-head h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 900;
}

.account-card > p,
.income-panel > p,
.panel p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.icon-actions {
  display: inline-flex;
  flex: none;
  gap: 2px;
}

.icon-actions button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink);
  font-size: 18px;
}

.holding-row,
.income-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.holding-row > div:first-child,
.income-row > div:first-child {
  min-width: 0;
}

.holding-row strong,
.holding-row span,
.income-row strong,
.income-row span {
  display: block;
}

.holding-row strong,
.income-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.holding-row span,
.income-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.income-title {
  margin-top: 18px;
}

.income-row b {
  flex: none;
  font-size: 14px;
}

.doc-head {
  padding: 2px 0 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.doc-head h1 {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

.doc-stack {
  display: grid;
  gap: 10px;
}

.panel {
  margin-top: 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 900;
}

footer {
  width: min(var(--phone-width), 100%);
  margin: 0 auto;
  padding: 0 16px 28px;
  background: var(--paper);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.web-login-panel {
  margin-top: 40px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.web-login-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.web-login-panel p {
  margin: 0 0 14px;
  color: var(--muted);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
}

.primary-action:disabled {
  background: var(--muted);
}

.form-error {
  color: #c62828 !important;
  font-weight: 800;
}

.month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.month-chips span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0 calc((100vw - min(var(--phone-width), 100vw)) / 2);
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(24, 24, 22, 0.35);
}

.modal-panel {
  width: 100%;
  max-height: min(760px, 92vh);
  overflow-y: auto;
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
}

.modal-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.modal-panel label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-panel input,
.modal-panel select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}

.suggestion-list {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.suggestion-list:empty {
  display: none;
}

.suggestion-list button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

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

.suggestion-list strong,
.suggestion-list span {
  display: block;
}

.suggestion-list strong {
  font-size: 14px;
}

.suggestion-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 430px) {
  .summary-band h1 {
    font-size: 26px;
  }
}
