:root {
  --bg: #f2f5f3;
  --surface: #fff;
  --ink: #142126;
  --muted: #5b6b72;
  --line: #d5e0db;
  --brand: #0f3d3e;
  --brand-2: #1f6f64;
  --ok: #1f7a4d;
  --danger: #a33b2d;
  --shadow: 0 12px 32px rgba(15, 61, 62, 0.08);
  --radius: 18px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 15% -10%, #d7ebe5 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--brand-2); text-decoration: none; }
button, input, textarea { font: inherit; }

.wrap {
  width: min(720px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero {
  text-align: center;
  margin: 1.5rem 0 1.25rem;
}
.hero .mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}
.hero p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.drop {
  border: 2px dashed #9bb8b0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 2.4rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.drop:hover, .drop.drag {
  border-color: var(--brand-2);
  background: #f4faf8;
  transform: translateY(-1px);
}
.drop strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}
.drop span { color: var(--muted); }
.drop input { display: none; }

.field {
  margin: 1rem 0;
}
.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.04); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; width: 100%; font-size: 1.05rem; }
.btn-secondary { background: #e8f1ee; color: var(--brand); }
.btn-danger { background: #f6e8e5; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-lg { padding: 1.05rem 1.2rem; font-size: 1.1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.share {
  display: grid;
  gap: 0.7rem;
}
.share input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  background: #f7faf8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 1rem 0;
}
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.2rem;
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.route span { color: var(--muted); }

.status {
  margin-top: 0.9rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.4em;
}
.status.ok { color: var(--ok); font-weight: 600; }
.status.err { color: var(--danger); }

.top-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.top-simple h1 {
  margin: 0;
  font-size: 1.25rem;
}
.mark-mini {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

.year-grid, .month-grid {
  display: grid;
  gap: 0.65rem;
}
.year-grid { grid-template-columns: 1fr 1fr; }
.month-grid { grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) {
  .month-grid { grid-template-columns: repeat(3, 1fr); }
}
.year-card, .month-card {
  display: block;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 0.9rem;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.year-card:hover, .month-card:hover {
  border-color: var(--brand-2);
  background: #eef7f3;
  text-decoration: none;
  transform: translateY(-1px);
}
.year-card.current, .month-card.current {
  border-color: var(--brand-2);
  background: #e7f3ef;
}
.year-card strong, .month-card strong {
  display: block;
  font-size: 1.1rem;
}
.year-card span, .month-card span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.actions .btn { width: auto; }

.trip {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}
.trip:last-child { border-bottom: none; }
.trip .main { font-weight: 650; }
.trip .meta { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }
.trip .row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.trip .amount { font-weight: 750; white-space: nowrap; }

.footer-note {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 1.25rem;
  line-height: 1.45;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}
