/* ============================================================
   デリログ アプリ本体 + サポートページ
   デザイン: LP(lp.css)と同系統のダーク・プレミアム
   注意: クラス名・IDは script.js が参照するため変更しない
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --bg: #F6F7F9;
  --bg-soft: #FFFFFF;
  --surface: #FFFFFF;
  --surface-strong: #F0F2F5;
  --border: #E5E9EF;
  --border-strong: #D6DCE4;
  --text: #181D25;
  --text-2: #6B7480;
  --text-3: #98A1AC;
  --brand: #10B981;
  --brand-2: #0E9F6E;
  --brand-grad: linear-gradient(135deg, #10B981 0%, #0E9F6E 100%);
  --brand-soft: #E7F8F1;
  --glow: rgba(16, 185, 129, 0.25);
  --red: #EF4444;
  --red-soft: #FDEBEB;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  --goal-progress: 0%;
  color-scheme: light;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 32% at 50% -6%, rgba(16, 185, 129, 0.08) 0%, transparent 70%),
    var(--bg);
}

/* ===== ヘッダー ===== */
.app-header {
  padding: 40px 20px 8px;
  max-width: 1080px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}
.app-header h1 {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.header-copy { color: var(--text-2); font-size: 13.5px; margin-top: 4px; font-weight: 500; }

/* ===== レイアウト・画面切替 ===== */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: grid;
  gap: 16px;
}
.app-screen { display: none; }
.app-screen.is-active {
  display: grid;
  gap: 16px;
  animation: screenIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 今日のダッシュボード ===== */
.today-dashboard { display: grid; gap: 12px; }
.today-main-card {
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  background: var(--brand);
  border: none;
  box-shadow: 0 14px 36px rgba(16, 185, 129, 0.3);
}
.today-main-card span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
}
.today-main-card strong {
  display: block;
  font-size: clamp(44px, 10vw, 56px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 4px;
  color: #FFFFFF;
}
.today-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.today-card {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}
.today-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.today-card span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.today-card strong { display: block; font-size: 24px; font-weight: 900; letter-spacing: -0.01em; margin-top: 4px; }

/* ===== パネル共通 ===== */
.panel,
.hero-card,
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}
.section-heading h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.section-heading p { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.section-heading { margin-bottom: 16px; }

/* ===== 入力フォーム ===== */
.entry-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.entry-form label,
.settings-card > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.entry-form .full-width { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa5b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type='date'], input[type='time'], input[type='month'] { min-height: 46px; }

/* ===== ボタン ===== */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-grad);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.primary-button:active { transform: translateY(0) scale(0.98); }
.primary-button.full-width { width: 100%; }
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.ghost-button:hover { background: var(--surface-strong); border-color: var(--border-strong); transform: translateY(-1px); }
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 18px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.danger-button:hover { background: rgba(239, 68, 68, 0.2); transform: translateY(-1px); }

/* ===== 今月サマリーヒーロー ===== */
.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--surface);
  border-color: rgba(16, 185, 129, 0.35);
}
.hero-card span { font-size: 12.5px; font-weight: 700; color: var(--brand-2); }
.hero-card strong {
  display: block;
  font-size: clamp(34px, 7vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2px;
}
.hero-card p { color: var(--text-2); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.goal-meter { text-align: center; }
.goal-meter p { font-size: 11px; color: var(--text-2); margin-top: 8px; font-weight: 600; }
.goal-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(#10B981 var(--goal-progress), #E9EDF2 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}
.goal-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}
.goal-ring span { position: relative; font-size: 18px; font-weight: 900; }

/* ===== 設定カード ===== */
.inline-control { display: flex; gap: 10px; }
.inline-control input { flex: 1; }
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.support-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.support-links a {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.support-links a:hover { color: var(--text); }

/* ===== 集計カード ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.summary-card span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.summary-card strong { display: block; font-size: 21px; font-weight: 900; margin-top: 4px; letter-spacing: -0.01em; }
.summary-card.accent { border-color: rgba(16, 185, 129, 0.35); }
.summary-card.accent strong { color: var(--brand); }
.summary-card.profit strong { color: var(--brand); }

/* ===== 分析カード ===== */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.analysis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.analysis-card span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.analysis-card strong { display: block; font-size: 21px; font-weight: 900; margin-top: 4px; }
.analysis-card p { font-size: 10.5px; color: var(--text-3); margin-top: 4px; font-weight: 600; }
.analysis-card.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background:
    radial-gradient(90% 140% at 20% 0%, rgba(16, 185, 129, 0.14) 0%, transparent 65%),
    rgba(255, 255, 255, 0.03);
}
.analysis-card.highlight strong { color: var(--brand); }

/* ===== 効率ランキング ===== */
.efficiency-section { margin-top: 22px; }
.efficiency-heading h3 { font-size: 15px; font-weight: 800; }
.efficiency-heading p { font-size: 12px; color: var(--text-2); margin: 2px 0 14px; }
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.ranking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.ranking-card h3 { font-size: 13px; font-weight: 800; color: var(--text-2); margin-bottom: 10px; }
.ranking-list { display: grid; gap: 8px; }
.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ranking-rank {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-3);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.ranking-row:first-child .ranking-rank { color: #B45309; }
.ranking-main { flex: 1; min-width: 0; }
.ranking-main strong { display: block; font-size: 13px; font-weight: 700; }
.ranking-main span { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; }
.ranking-meta { font-size: 13.5px; font-weight: 900; color: var(--brand); white-space: nowrap; }

/* ===== 月次レポート ===== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.report-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.report-item span { display: block; font-size: 11px; font-weight: 700; color: var(--text-2); }
.report-item strong { display: block; font-size: 19px; font-weight: 900; margin-top: 3px; }

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.breakdown-grid h3 { font-size: 13px; font-weight: 800; color: var(--text-2); margin-bottom: 8px; }
.breakdown-list { display: grid; gap: 6px; }
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.breakdown-row span { color: var(--text-2); font-weight: 600; }
.breakdown-row strong { font-weight: 800; }

/* ===== プラットフォーム別 ===== */
.platform-section { margin-top: 20px; }
.platform-section h3 { font-size: 13px; font-weight: 800; color: var(--text-2); margin-bottom: 10px; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.platform-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.platform-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.platform-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.platform-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.platform-0 { background: #10B981; }
.platform-1 { background: #f97316; }
.platform-2 { background: #F59E0B; }
.platform-3 { background: #0EA5E9; }
.platform-4 { background: #a78bfa; }
.platform-share { font-size: 13px; font-weight: 900; color: var(--brand); }
.platform-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.platform-stat span { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.platform-stat strong { display: block; font-size: 14px; font-weight: 800; }

/* ===== 確定申告補助 ===== */
.tax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.tax-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.tax-card span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.tax-card strong { display: block; font-size: 21px; font-weight: 900; margin-top: 4px; }
.tax-notes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12px;
  color: var(--text-2);
  display: grid;
  gap: 8px;
}

/* ===== 記録一覧 ===== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .section-heading { margin-bottom: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.filters input, .filters select { padding: 9px 12px; font-size: 13.5px; min-height: 0; }
.records-list { display: grid; gap: 10px; }
.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.2s;
}
.record-card:hover { border-color: var(--border-strong); }
.record-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.record-title strong { font-size: 14.5px; font-weight: 800; display: block; }
.record-title span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge.sales { background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.expense { background: var(--red-soft); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.record-amount { font-size: 18px; font-weight: 900; color: var(--brand); white-space: nowrap; }
.record-amount.expense { color: var(--red); }
.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px 14px;
}
.record-field span { display: block; font-size: 10px; color: var(--text-3); font-weight: 700; }
.record-field strong { display: block; font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.record-field.full-width { grid-column: 1 / -1; }
.record-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.delete-button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.delete-button:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--red-soft);
}
.empty-state {
  display: none;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding: 36px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin-top: 10px;
}
.empty-state.is-visible { display: block; }

/* ===== ボトムナビ ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 6px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
.nav-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 800;
  padding: 8px 0 7px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-ico { font-size: 17px; line-height: 1; }
.nav-button:hover { color: var(--text); }
.nav-button.is-active {
  color: #FFFFFF;
  background: var(--brand-grad);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
}

/* ============================================================
   サポートページ（contact / feedback / terms / privacy）
   ============================================================ */
.marketing-page { padding-bottom: 0; }
.marketing-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 24px 40px;
  text-align: center;
}
.marketing-hero.compact { padding-top: 72px; }
.marketing-hero h1 {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 10px;
}
.marketing-hero p { color: var(--text-2); font-size: 15px; max-width: 520px; margin: 0 auto; }
.marketing-hero .eyebrow { margin-bottom: 12px; }
.marketing-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  gap: 16px;
}
.marketing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}
.marketing-card h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.01em; }
.marketing-card p { color: var(--text-2); font-size: 14px; margin-bottom: 10px; }
.marketing-card p:last-child { margin-bottom: 0; }
.legal-copy h2 { font-size: 15px; margin-top: 18px; }
.legal-copy h2:first-child { margin-top: 0; }
.legal-copy p, .legal-copy li { color: var(--text-2); font-size: 13.5px; }
.legal-copy ul, .legal-copy ol { padding-left: 20px; margin-bottom: 10px; }
.feedback-form { display: grid; gap: 14px; }
.feedback-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.feedback-form textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: 12px; color: var(--text-3); }
.marketing-footer {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 24px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.marketing-footer a {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.marketing-footer a:hover { color: var(--text); }
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-grad);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.primary-link:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.secondary-link:hover { background: var(--surface-strong); }

/* ===== ホームの合算表示 ===== */
.today-sub {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.today-sub b { color: #FFFFFF; font-weight: 800; }

/* ===== カレンダー ===== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cal-nav-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 18px;
  flex-shrink: 0;
}
.cal-title-wrap { text-align: center; min-width: 0; }
.cal-title-wrap strong { display: block; font-size: 17px; font-weight: 900; }
.cal-title-wrap span { display: block; font-size: 11px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.cal-view-toggle { margin-bottom: 14px; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}
.cal-weekday { text-align: center; font-size: 11px; font-weight: 700; }
.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 7px;
  gap: 2px;
  transition: border-color 0.15s, transform 0.15s;
}
.cal-cell:active { transform: scale(0.95); }
.cal-cell.is-blank { background: none; border: none; cursor: default; }
.cal-cell.is-today { border-color: rgba(16, 185, 129, 0.6); }
.cal-cell.is-selected { border-color: #B45309; }
.cal-day-num { font-size: 12.5px; font-weight: 700; line-height: 1; }
.cal-day-amt { font-size: 9px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.cal-day-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.yr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.yr-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, transform 0.15s;
}
.yr-cell:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.yr-cell.is-current { border-color: rgba(16, 185, 129, 0.5); }
.yr-cell .cal-day-num { font-size: 13.5px; }
.yr-cell .cal-day-amt { font-size: 12px; }
.day-detail-list { display: grid; gap: 8px; }
.day-rec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.day-rec-main { min-width: 0; }
.day-rec-main strong { display: block; font-size: 13.5px; font-weight: 800; }
.day-rec-main span { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; }
.day-rec-amount { font-size: 15px; font-weight: 900; color: var(--brand); white-space: nowrap; }
.day-rec-amount.is-expense { color: var(--red); }

/* ===== かんたんUI（ホームCTA・種類トグル・折りたたみ） ===== */
.big-cta {
  width: 100%;
  font-size: 17px;
  padding: 18px 24px;
  margin-top: 4px;
}
.home-hint {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 10px;
}
.share-cta {
  width: 100%;
  margin-top: 10px;
  padding: 14px 24px;
  font-size: 14.5px;
}
.scan-block { display: grid; gap: 6px; }
.scan-button {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  border-style: dashed;
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--brand);
}
.scan-button:disabled { opacity: 0.6; cursor: wait; }
.scan-status { font-size: 12px; color: var(--brand); font-weight: 600; line-height: 1.6; min-height: 0; }
.scan-status.is-error { color: var(--red); }
.hidden-field { display: none !important; }
.type-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
}
.type-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 800;
  padding: 12px 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.type-btn.is-active {
  background: var(--brand-grad);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}
.amount-field input {
  font-size: 26px;
  font-weight: 800;
  padding: 14px 16px;
}
.more-fields {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}
.more-fields summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s, background 0.2s;
}
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary::before {
  content: '▸';
  color: var(--brand);
  font-size: 13px;
  transition: transform 0.2s;
}
.more-fields[open] summary::before { transform: rotate(90deg); }
.more-fields summary:hover { color: var(--text); background: var(--surface); }
.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 4px 16px 18px;
}
.more-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.more-grid .full-width { grid-column: 1 / -1; }
.panel-collapse { padding: 0; overflow: hidden; }
.panel-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px;
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}
.panel-collapse > summary::-webkit-details-marker { display: none; }
.panel-collapse > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-3);
  transition: transform 0.25s;
}
.panel-collapse[open] > summary::after { transform: rotate(180deg); color: var(--brand); }
.panel-collapse > summary:hover { background: var(--surface); }
.collapse-body { padding: 0 20px 22px; }

/* ===== レスポンシブ ===== */
@media (min-width: 720px) {
  .today-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .app-header { padding-top: 28px; }
  .entry-form { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .data-actions .ghost-button, .data-actions .danger-button { flex: 1 1 45%; }
}
@media (prefers-reduced-motion: reduce) {
  .app-screen.is-active { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ===== ナイトモード（端末設定に自動追従） ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --bg-soft: #1C1F23;
    --surface: #1C1F23;
    --surface-strong: #26292E;
    --border: #2E3237;
    --border-strong: #3A3F45;
    --text: #F2F4F6;
    --text-2: #9BA2AB;
    --text-3: #6E7681;
    --brand-soft: rgba(16, 185, 129, 0.16);
    --red-soft: rgba(248, 113, 113, 0.16);
    color-scheme: dark;
  }
  .bottom-nav { background: rgba(28, 31, 35, 0.94); }
  .goal-ring { background: conic-gradient(#10B981 var(--goal-progress), #2E3237 0); }
}
