﻿:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #172221;
  --muted: #66716f;
  --line: #d9ded8;
  --accent: #25635f;
  --accent-2: #b5573f;
  --good: #2f7652;
  --warning: #a85f2c;
  --shadow: 0 12px 28px rgba(28, 38, 35, 0.1);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfaf7;
  position: relative;
  padding-bottom: 86px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 19px;
}

h3 {
  margin: 0;
  font-size: 16px;
}

h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.icon-button,
.install-button {
  border: 0;
  background: var(--accent);
  color: white;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.install-button {
  min-height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

main {
  padding: 18px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

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

.status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e1eee9;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.attention {
  background: #f4e4da;
  color: var(--warning);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

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

.home-add-button {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.secondary-action {
  background: #e8ebe8;
  color: var(--ink);
}

.capture-status {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.saved-status {
  margin-top: -6px;
  background: #f6f1eb;
}

.metric,
.property-card,
.review-card,
.drop-zone,
.document-item,
.cf-table,
.detail-panel,
.sync-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 14px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
}

.metric.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.metric.primary span,
.metric.primary small {
  color: rgba(255, 255, 255, 0.78);
}

.property-list,
.document-list {
  display: grid;
  gap: 10px;
}

.property-card {
  padding: 14px;
}

.property-card header,
.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.property-card h3 {
  margin: 0;
  font-size: 16px;
}

.property-card strong {
  font-size: 18px;
}

.bar {
  height: 8px;
  margin-top: 12px;
  background: #e8ebe8;
  border-radius: 99px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--good);
}

.file-button,
.restore-button,
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
}

.mini-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.file-button input,
.restore-button input {
  display: none;
}

.drop-zone {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 138px;
  margin-bottom: 14px;
  padding: 18px;
  border-style: dashed;
  color: var(--muted);
  text-align: center;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 18px;
}

.document-item {
  padding: 12px;
}

.doc-meta {
  min-width: 0;
}

.doc-meta strong,
.doc-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta span {
  color: var(--muted);
  font-size: 13px;
}

.review-card {
  padding: 14px;
}

.receipt-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #eef2ef;
  color: var(--muted);
}

.receipt-preview span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: white;
  color: var(--accent-2);
  font-weight: 800;
}

.receipt-preview strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-box {
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
}

.file-preview-image,
.file-preview-pdf {
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.file-preview-image {
  object-fit: contain;
}

.file-preview-pdf {
  height: 340px;
}

.preview-empty {
  color: var(--muted);
  font-size: 13px;
}

.preview-policy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-label {
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

.flow-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}

.flow-step {
  min-width: 0;
  padding: 8px 6px;
  border-radius: 8px;
  background: #e8ebe8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.flow-step.active {
  background: #e1eee9;
  color: var(--accent);
}

.flow-arrow {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px;
}

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

button.secondary {
  background: #e8ebe8;
  color: var(--ink);
}

.cf-table {
  margin-bottom: 12px;
  overflow: hidden;
}

.cf-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.cf-row:last-child {
  border-bottom: 0;
}

.cf-row.header {
  background: #eef2ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cf-row strong {
  font-size: 14px;
}

.negative {
  color: var(--accent-2);
}

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

.detail-panel {
  padding: 14px;
}

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

.section-heading.subheading {
  margin-top: 14px;
}

.section-heading.compact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.home-summary {
  margin-bottom: 12px;
}

.detail-item {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f4;
}

.detail-item span,
.history-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f4;
}

.history-row strong {
  font-size: 13px;
}

.detail-blocks {
  display: grid;
  gap: 10px;
}

.breakdown-group {
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f4;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.breakdown-row span {
  color: var(--muted);
  font-size: 13px;
}

.breakdown-row strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
}

.annual-chart {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7f4;
}

.annual-chart.cumulative {
  background: #f6f1eb;
}

.annual-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.annual-chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.annual-chart-head strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.annual-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  gap: 5px;
  align-items: end;
  min-height: 150px;
}

.annual-bar {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 5px;
  min-height: 146px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.annual-bar span {
  width: 100%;
  display: block;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: var(--accent);
}

.annual-bar strong {
  font-size: 11px;
}

.annual-bar.gain span {
  background: var(--good);
}

.annual-bar.loss span {
  background: var(--accent-2);
}

.annual-bar.empty span {
  background: #cfd6d0;
}

.annual-bar.selected span {
  outline: 3px solid rgba(37, 99, 95, 0.22);
}

.compact-table {
  margin-bottom: 0;
}

.sync-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
}

.sync-panel h3 {
  margin-bottom: 4px;
}

.sync-panel p {
  color: var(--muted);
  font-size: 13px;
}

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

.restore-button {
  display: grid;
  place-items: center;
  background: #e8ebe8;
  color: var(--ink);
}

.sync-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sync-status span {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-note {
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 520px);
  padding: 8px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 4;
}

.nav-item {
  min-height: 48px;
  padding: 8px 4px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.nav-item.active {
  background: #e1eee9;
  color: var(--accent);
}

@media (min-width: 720px) {
  body {
    padding: 28px 0;
  }

  .app-shell {
    min-height: calc(100vh - 56px);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
  }

  .bottom-nav {
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

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

.version-status {
  color: #6b7280;
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.sync-state {
  margin-top: -6px;
  background: #eef2ef;
  color: var(--accent);
  font-weight: 700;
}

.settings-card {
  display: grid;
  gap: 12px;
}

.settings-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-result {
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

