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

:root {
  --primary: #D4A854;
  --primary-light: #FDF6E8;
  --primary-dark: #B8892E;
  --text-main: #3D3225;
  --text-sub: #9CA3AF;
  --bg: #FDFAF3;
  --bg-card: #FFFFFF;
  --accent-pink: #E8A0BF;
  --accent-red: #FCA5A5;
  --accent-yellow: #FDE68A;
  --accent-green: #86EFAC;
  --border: #EDE4D0;
  --pia-bubble: #FDF2F8;

  --income-color: #4CAF50;
  --expense-color: #EF5350;
  --danger-color: #F44336;

  --radius-card: 16px;
  --radius-btn: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --max-w: 520px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }

/* ===== Animations ===== */
.section { animation: fade-up 0.3s ease-out; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
button:active { transform: scale(0.97); }

/* ===== Layout ===== */
.app-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}
@media (min-width: 768px) {
  .app-wrapper { max-width: 640px; }
}

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-bar-inner {
  display: flex;
  max-width: var(--max-w);
  width: 100%;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  font-size: 10px;
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.15s;
  border: none;
  background: none;
  cursor: pointer;
}
.tab-item.active { color: var(--primary-dark); }
.tab-item svg { width: 22px; height: 22px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-danger {
  background: var(--accent-red);
  color: #fff;
}
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-block {
  display: flex;
  width: 100%;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 84px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-pink);
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: transform 0.15s;
}
.fab:hover { transform: scale(1.05); }
.fab img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
@media (min-width: 768px) {
  .fab { right: calc(50% - 260px + 20px); }
}

/* ===== Inputs ===== */
input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="password"],
textarea,
select {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  background: var(--primary-light);
  color: var(--text-main);
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-main);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 24px;
  width: 100%;
  max-width: var(--max-w);
  max-height: 90dvh;
  overflow-y: auto;
  animation: slide-up 0.3s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 18px; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

/* ===== Section ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 8px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
}
.section-count {
  font-size: 13px;
  color: var(--text-sub);
}

/* ===== Loading ===== */
.loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Pia-chan ===== */
.pia-comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pia-icon-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.pia-icon-lg {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.pia-bubble {
  background: var(--pia-bubble);
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
  position: relative;
}
.pia-bubble::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 14px;
  width: 12px;
  height: 12px;
  background: var(--pia-bubble);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* ===== Dashboard ===== */
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
}
.stat-value.income { color: var(--income-color); }
.stat-value.expense { color: var(--expense-color); }
.stat-value.danger { color: var(--danger-color); }

.net-worth-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 4px 12px rgba(212, 168, 84, 0.3);
  text-align: center;
}
.net-worth-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
}
.net-worth-value {
  font-size: 28px;
  font-weight: 800;
}

/* ===== Forecast Chart ===== */
.forecast-chart-container {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.forecast-chart-container canvas {
  width: 100%;
  height: 200px;
}

/* ===== Asset List ===== */
.asset-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.asset-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.asset-item:active { background: var(--primary-light); }
.asset-name {
  font-weight: 600;
  font-size: 14px;
}
.asset-institution {
  font-size: 12px;
  color: var(--text-sub);
}
.asset-balance {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
}
.asset-updated {
  font-size: 11px;
  color: var(--text-sub);
  text-align: right;
}

/* ===== Recurring List ===== */
.recurring-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.recurring-name {
  font-weight: 600;
  font-size: 14px;
}
.recurring-meta {
  font-size: 12px;
  color: var(--text-sub);
}
.recurring-amount {
  font-size: 16px;
  font-weight: 700;
}
.recurring-amount.income { color: var(--income-color); }
.recurring-amount.expense { color: var(--expense-color); }
.recurring-inactive {
  opacity: 0.5;
}

/* ===== Tab Switcher ===== */
.tab-switcher {
  display: flex;
  background: var(--primary-light);
  border-radius: var(--radius-btn);
  padding: 3px;
  margin-bottom: 16px;
}
.tab-switch {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-sub);
  transition: all 0.15s;
}
.tab-switch.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== Events Timeline ===== */
.event-month-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--primary-light);
}
.event-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.event-item.paid {
  opacity: 0.6;
}
.event-name {
  font-weight: 600;
  font-size: 14px;
}
.event-date {
  font-size: 12px;
  color: var(--text-sub);
}
.event-amount {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
}
.event-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.badge-estimate {
  background: var(--accent-yellow);
  color: #92400E;
}
.badge-paid {
  background: var(--accent-green);
  color: #065F46;
}
.badge-overdue {
  background: var(--accent-red);
  color: #fff;
}

/* ===== Checklist ===== */
.checklist-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.checklist-item.checked {
  opacity: 0.6;
}
.checklist-checkbox {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.checklist-info {
  flex: 1;
}
.checklist-name {
  font-weight: 600;
  font-size: 14px;
}
.checklist-desc {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}
.checklist-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ===== Chat ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-bottom: 56px;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.chat-header-name {
  font-weight: 700;
  font-size: 16px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-quick-btns {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  scrollbar-width: none;
}
.chat-quick-btns::-webkit-scrollbar { display: none; }
.chat-quick-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-main);
}
.chat-quick-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.message {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.message.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message.assistant {
  background: var(--pia-bubble);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: var(--primary-light);
}
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Settings ===== */
.settings-section {
  margin-bottom: 24px;
}
.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.settings-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.settings-item label {
  font-weight: 600;
  font-size: 14px;
}

/* ===== Summary Row ===== */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
}
.summary-label {
  font-size: 13px;
  color: var(--text-sub);
}
.summary-value {
  font-size: 16px;
  font-weight: 700;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-sub);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.empty-state-text {
  font-size: 14px;
}

/* ===== Badge/Tag ===== */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ===== Net Income Calculator ===== */
.calc-result {
  background: var(--primary-light);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-top: 16px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.calc-row.total {
  border-top: 2px solid var(--primary);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}

/* ===== Phase 2: Kakeibo ===== */

/* 3-tab switcher */
.tab-switcher-3 { display: flex; background: var(--primary-light); border-radius: var(--radius-btn); padding: 3px; margin-bottom: 16px; }
.tab-switcher-3 .tab-switch { flex: 1; }

/* Month selector */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 12px;
}
.month-label { font-size: 16px; font-weight: 700; min-width: 100px; text-align: center; }

/* Balance bar */
.balance-bar {
  text-align: center;
  padding: 8px;
  margin-top: 8px;
  background: var(--primary-light);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
}

/* Filter chips */
.filter-chips { display: flex; gap: 8px; margin-bottom: 12px; }
.chip {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-sub);
  transition: all 0.15s;
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Transaction list */
.tx-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tx-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.tx-item:active { background: var(--primary-light); }
.tx-name { font-weight: 600; font-size: 14px; }
.tx-meta { font-size: 12px; color: var(--text-sub); }
.tx-amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tx-amount.income { color: var(--income-color); }
.tx-amount.expense { color: var(--expense-color); }

/* Budget comparison */
.comparison-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.comparison-row {}
.comparison-label { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bar-label { font-size: 11px; color: var(--text-sub); width: 28px; flex-shrink: 0; }
.bar-track { flex: 1; height: 16px; background: var(--primary-light); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; transition: width 0.5s ease; }
.bar-fill.income { background: var(--income-color); opacity: 0.4; }
.bar-fill.income-actual { background: var(--income-color); }
.bar-fill.expense { background: var(--expense-color); opacity: 0.4; }
.bar-fill.expense-actual { background: var(--expense-color); }
.bar-value { font-size: 12px; font-weight: 600; width: 80px; text-align: right; flex-shrink: 0; }
.comparison-diff { font-size: 12px; font-weight: 600; text-align: right; margin-top: 2px; }
.comparison-diff.positive { color: var(--income-color); }
.comparison-diff.negative { color: var(--expense-color); }

/* Category donut chart */
.category-chart {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.donut-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}
.donut-container canvas { width: 160px; height: 160px; }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-total { font-size: 14px; font-weight: 700; }
.category-legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; }
.legend-value { font-weight: 600; white-space: nowrap; }

/* Color helpers */
.income { color: var(--income-color); }
.expense { color: var(--expense-color); }

/* ==============================
   Forecast toggle (12/36ヶ月)
   ============================== */
.forecast-toggle {
  display: flex;
  gap: 4px;
}
.forecast-toggle-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-sub);
  cursor: pointer;
}
.forecast-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==============================
   子ども成長タイムライン
   ============================== */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.timeline-content {}
.timeline-name { font-size: 14px; font-weight: 600; }
.timeline-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ==============================
   負債ページ
   ============================== */
.liab-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-left: 3px solid var(--expense-color);
}
.liab-item:active { background: var(--primary-light); }
.liab-inactive { opacity: 0.5; border-left-color: var(--border); }
.liab-name { font-size: 14px; font-weight: 600; }
.liab-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.liab-payment { font-size: 12px; color: var(--expense-color); margin-top: 2px; }
.liab-balance { font-size: 16px; font-weight: 700; color: var(--expense-color); white-space: nowrap; }

/* Assets page liabilities summary link */
.liab-summary-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-card);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--expense-color);
  text-decoration: none;
}

/* ==============================
   定期カレンダービュー
   ============================== */
.recurring-calendar {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.cal-day-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.cal-day-row:last-child { border-bottom: none; }
.cal-day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  width: 30px;
  flex-shrink: 0;
}
.cal-day-items { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-item {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--text-main);
}
.cal-item.income { background: #DCFCE7; }
.cal-item.expense { background: #FEE2E2; }

/* ==============================
   前年同月比較 (YoY)
   ============================== */
.yoy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.yoy-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow);
}
.yoy-label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.yoy-value { font-size: 15px; font-weight: 700; }
.yoy-diff { font-size: 11px; margin-top: 4px; font-weight: 600; }
.yoy-diff.positive { color: var(--income-color); }
.yoy-diff.negative { color: var(--expense-color); }

/* ==============================
   年間特別費
   ============================== */
.special-total {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: var(--radius-card);
}
.special-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.special-item:last-child { border-bottom: none; }
.special-item.paid { opacity: 0.6; }
.special-name { font-size: 14px; font-weight: 600; }
.special-date { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.special-amount { font-size: 15px; font-weight: 700; }
.special-amount.expense { color: var(--expense-color); }
.special-amount.income { color: var(--income-color); }

/* ==============================
   季節性マップ
   ============================== */
.seasonal-grid {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
  padding: 4px 0 0;
}
.seasonal-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seasonal-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--primary-light);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 4px;
}
.seasonal-bar {
  width: 100%;
  background: var(--expense-color);
  opacity: 0.7;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.seasonal-label { font-size: 9px; color: var(--text-sub); margin-top: 2px; }
.seasonal-amount { font-size: 9px; color: var(--text-sub); }

/* ==============================
   子ども関連支出トレンド
   ============================== */
.child-exp-list { display: flex; flex-direction: column; gap: 6px; }
.child-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.child-exp-month { font-size: 12px; color: var(--text-sub); width: 30px; flex-shrink: 0; }
.child-exp-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--primary-light);
  border-radius: 7px;
  overflow: hidden;
}
.child-exp-bar {
  height: 100%;
  background: #C084FC;
  border-radius: 7px;
  min-width: 2px;
}
.child-exp-val { font-size: 12px; font-weight: 600; width: 72px; text-align: right; flex-shrink: 0; }

