:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #e5e7eb;
  --ink: #0f172a;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #f97316;
  --accent-3: #0ea5e9;
  --danger: #e11d48;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 80% at 20% 20%, #c7f2f6 0, transparent 60%),
    radial-gradient(50% 70% at 85% 0%, #ffe0b2 0, transparent 55%),
    radial-gradient(30% 40% at 50% 20%, #dbeafe 0, transparent 70%);
  filter: blur(60px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

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

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.lede {
  margin: 10px 0 14px;
  color: #1f2937;
  max-width: 720px;
  line-height: 1.6;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f5132;
  font-weight: 600;
  font-size: 14px;
}

.pill--muted {
  background: rgba(15, 23, 42, 0.3);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.5);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}

.hero {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(14, 165, 233, 0.94));
  color: #f8fafc;
  padding: 28px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.hero h1 {
  font-size: 30px;
}

.hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.hero .pill {
  background: rgba(248, 250, 252, 0.18);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.35);
  font-weight: 700;
}

#newEntryBtn {
  font-size: 15px;
  padding: 14px 22px;
  border: 2px solid rgba(248, 250, 252, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.45);
}

#newEntryBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.55);
}

.btn {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: translateY(1px);
}

.btn--solid {
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #f8fafc;
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.35);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn--quiet {
  background: #e5e7eb;
  color: #111827;
}

.btn--danger {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.board {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card__label {
  font-weight: 700;
  color: #0f172a;
}

.card__value {
  font-size: 30px;
  font-weight: 800;
  margin: 8px 0;
}

.card__note {
  color: var(--muted);
  font-size: 14px;
}

.summary-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -20px;
  top: -30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent);
}

.summary-card--income::after {
  background: radial-gradient(circle at 30% 30%, rgba(15, 118, 110, 0.18), transparent 60%);
}

.summary-card--expense::after {
  background: radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.2), transparent 60%);
}

.summary-card--balance::after {
  background: radial-gradient(circle at 30% 30%, rgba(14, 165, 233, 0.22), transparent 60%);
}

.panel {
  margin-top: 22px;
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

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

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
}

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

.stack__title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stack__title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  background: #fff;
}

.entry:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.entry__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.entry__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.entry__badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.entry__badge--income {
  background: rgba(15, 118, 110, 0.12);
  color: #0f5132;
}

.entry__badge--expense {
  background: rgba(249, 115, 22, 0.12);
  color: #9a3412;
}

.entry__amount {
  font-weight: 800;
  font-size: 18px;
}

.entry__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 16px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.category-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.category {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }

.category:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.category__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category__bar {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.category__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(15, 118, 110, 0.8));
  width: calc(var(--percent, 0) * 1%);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 10;
}

.overlay.is-open {
  display: flex;
}

.sheet {
  background: #fff;
  border-radius: 20px;
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow);
  padding: 20px;
  animation: rise 0.2s ease;
}

.sheet--compact {
  width: min(520px, 100%);
}

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

.sheet__footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sheet__actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  border: none;
  background: #e5e7eb;
  color: #0f172a;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
}

.icon-button--help {
  background: rgba(248, 250, 252, 0.18);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.45);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-weight: 800;
}

.icon-button--help:hover {
  background: rgba(248, 250, 252, 0.26);
}

.help-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-section p {
  margin-top: 6px;
  line-height: 1.6;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background: #fff;
}

textarea {
  resize: vertical;
}

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

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.segmented__item {
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  color: #0f172a;
}

.segmented__item--active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(15, 118, 110, 0.14));
  color: #0f172a;
}

.toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.toggle input {
  width: 48px;
  height: 26px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 18px;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(10px);
  z-index: 20;
  max-width: 320px;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.is-hidden {
  display: none !important;
}

.ad-slot {
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }

  .hero__actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero__actions .btn {
    flex: 1 1 150px;
  }

  .sheet {
    max-height: calc(100vh - 20px);
  }
}
