:root {
  --bg: #ecece6;
  --surface: #f6f5f0;
  --surface-strong: #edece5;
  --ink: #1b1f2a;
  --ink-2: #353b4c;
  --muted: #6d7385;
  --muted-2: #9ca1b0;
  --line: #d8d6cc;
  --safe: #3f5b50;
  --safe-soft: #d2ddd5;
  --warn: #8e7235;
  --warn-soft: #e6dcbe;
  --danger: #9b4a47;
  --danger-soft: #e5cfcd;
  --accent: #3c4a78;
  --accent-soft: #c6ccde;
  --paper: #fbfcfa;
  --tape: rgba(178, 184, 196, 0.42);
  --shadow: 0 10px 22px rgba(22, 33, 45, 0.055);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(246, 245, 240, 0.72), rgba(236, 236, 230, 0.92)),
    var(--bg);
  color: var(--ink);
  font-family: "Zen Maru Gothic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 52px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.header-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
  padding: 0;
  list-style: none;
}

.trust-strip li {
  border: 1px solid rgba(60, 74, 120, 0.14);
  border-radius: 999px;
  background: rgba(251, 252, 250, 0.78);
  color: var(--ink-2);
  padding: 8px 13px;
  font-size: 0.8rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.privacy-badge,
.months-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.82);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 700;
}

.privacy-badge {
  text-decoration: none;
}

.privacy-badge[href]:hover {
  border-color: rgba(60, 74, 120, 0.36);
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 18px;
  align-items: start;
}

@media (min-width: 921px) {
  body[data-active-view="notes"] .layout {
    grid-template-columns: 1fr;
  }

  body[data-active-view="notes"] .side-column {
    display: none;
  }

  body[data-active-view="notes"] .results-board {
    padding: 34px;
  }

  body[data-active-view="notes"] .note-board {
    grid-template-columns: minmax(360px, 0.42fr) minmax(0, 1fr);
    gap: 36px;
  }

  body[data-active-view="notes"] .note-board-month-notes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  body[data-active-view="notes"] .month-note {
    min-height: 172px;
    padding: 24px 20px 18px;
  }

  body[data-active-view="notes"] .note-balance {
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  }

  /* note-balance--sm は notes-view の大きめフォント指定より優先させる */
  body[data-active-view="notes"] .note-balance--sm {
    font-size: clamp(0.72rem, 1.1vw, 0.92rem);
  }
}

.layout > *,
.panel,
.metric-card,
.month-table-wrap,
.projection-table-wrap,
.balance-chart {
  min-width: 0;
}

.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.input-panel {
  position: static;
  background: var(--paper);
  border-radius: 28px;
  padding: 24px;
}

.side-column {
  display: grid;
  gap: 14px;
}

.input-panel .section-title {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.panel-copy {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.label-help {
  display: block;
  color: var(--muted-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
}

.input-panel .grid-three {
  grid-template-columns: 1fr;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.compact-title {
  margin-bottom: 10px;
}

fieldset {
  min-width: 0;
  min-inline-size: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field-help {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.extra-plans {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(60, 74, 120, 0.035), transparent 42%),
    rgba(237, 236, 229, 0.55);
}

.extra-header {
  display: grid;
  gap: 10px;
}

.extra-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.extra-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.extra-pane .field-help {
  margin: 0 0 10px;
}

.extra-pane {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(216, 214, 204, 0.72);
  border-radius: 20px;
  background: rgba(246, 245, 240, 0.78);
}

.optional-months summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
}

.optional-months[open] summary {
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(47, 111, 115, 0.22);
  outline-offset: 2px;
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.month-table-wrap,
.projection-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.month-input-table input {
  min-width: 112px;
  min-height: 36px;
  padding: 6px 8px;
}

.optional-months .month-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.month-label {
  color: var(--ink);
  font-weight: 800;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 800;
}

button[type="reset"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.inline-link,
.text-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.document-shell {
  max-width: 860px;
}

.document-panel {
  display: grid;
  gap: 10px;
}

.document-panel h2 {
  margin: 14px 0 0;
  font-size: 1.05rem;
}

.document-panel p {
  margin: 0;
  color: var(--muted);
}

.template-box {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  line-height: 1.7;
}

.results-board {
  display: block;
  padding: 28px;
  border-radius: 30px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(60, 74, 120, 0.032) 0,
      rgba(60, 74, 120, 0.032) 1px,
      transparent 1px,
      transparent 18px
    ),
    var(--surface-strong);
}

.switch-panel {
  min-width: 0;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 252, 250, 0.7);
}

.view-tab {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  white-space: nowrap;
  box-shadow: none;
  font-size: 0.82rem;
}

.view-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.view-pane {
  min-width: 0;
}

.view-pane.is-active#view-now {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: start;
}

.view-pane[hidden] {
  display: none !important;
}

.results-column {
  display: grid;
  gap: 14px;
}

.results-board.has-result .status-panel,
.results-board.has-result .overview-notes-panel,
.results-board.has-result .summary-grid,
.results-board.has-result .note-board {
  animation: result-reveal 280ms ease-out both;
}

.results-board.has-result .overview-notes-panel {
  animation-delay: 70ms;
}

.results-board.has-result .summary-grid {
  animation-delay: 120ms;
}

@media (prefers-reduced-motion: reduce) {
  .results-board.has-result .status-panel,
  .results-board.has-result .overview-notes-panel,
  .results-board.has-result .summary-grid,
  .results-board.has-result .note-board,
  .goal-track span,
  .dial-progress,
  .dial-needle {
    animation: none;
    transition: none;
  }
}

.ad-area {
  margin-top: 18px;
}

.ad-slot {
  display: grid;
  gap: 8px;
  min-height: 120px;
  border: 1px dashed rgba(109, 115, 133, 0.4);
  border-radius: 8px;
  background: rgba(246, 245, 240, 0.7);
  padding: 14px;
}

.ad-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ad-creative {
  min-height: 72px;
}

.ad-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 14px 16px;
  align-items: start;
  min-width: 0;
  padding: 34px 28px 24px;
  background: var(--paper);
  border-radius: 26px;
  box-shadow: 0 8px 18px rgba(22, 33, 45, 0.045);
  transition: background 180ms ease-out, border-color 180ms ease-out, transform 180ms ease-out;
}

.status-panel::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 92px;
  width: 92px;
  height: 19px;
  border-radius: 4px;
  background: var(--tape);
  transform: rotate(-2deg);
}

.status-panel::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 28px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.92;
}

.results-board.is-empty .status-panel {
  background:
    linear-gradient(135deg, rgba(60, 74, 120, 0.045), transparent 58%),
    rgba(251, 252, 250, 0.74);
  box-shadow: none;
}

.results-board.is-empty .months-badge,
.results-board.is-empty .summary-grid,
.results-board.is-empty .overview-notes-panel,
.results-board.is-empty .fund-ruler,
.results-board.is-empty .goal-progress,
.results-board.is-empty .lowest-hint,
.results-board.is-empty .basis-note {
  display: none;
}

/* 白紙状態は「半分空いたボード」ではなく、中央寄せの軽い案内にする */
.results-board.is-empty .view-pane.is-active#view-now {
  grid-template-columns: 1fr;
}

.results-board.is-empty .status-panel {
  justify-items: center;
  padding: 46px 28px 40px;
  text-align: center;
}

.results-board.is-empty .status-topline {
  align-items: center;
}

.results-board.is-empty .status-heading {
  flex-direction: column;
  gap: 14px;
}

.results-board.is-empty .futokoro-mark {
  width: 72px;
  height: 72px;
}

.results-board.is-empty .status-message {
  max-width: 560px;
  margin-inline: auto;
}

.empty-hints {
  display: none;
}

.results-board.is-empty .empty-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.empty-hints span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid rgba(60, 74, 120, 0.16);
  border-radius: 999px;
  background: rgba(251, 252, 250, 0.82);
  color: var(--ink-2);
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 800;
}

.empty-hints span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.55;
}

.notice-panel,
.feedback-panel {
  background: #fbfcfa;
  box-shadow: none;
}

.notice-panel p,
.feedback-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.faq-panel {
  margin-top: 18px;
  box-shadow: none;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.faq-grid details {
  min-width: 0;
  border: 1px solid rgba(216, 214, 204, 0.82);
  border-radius: 16px;
  background: rgba(251, 252, 250, 0.68);
  padding: 12px;
}

.faq-grid summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.faq-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 14px;
  border: 1px solid rgba(60, 74, 120, 0.32);
  border-radius: 999px;
  color: var(--accent);
  padding: 7px 13px;
  font-weight: 800;
  text-decoration: none;
}

.panel-link:hover {
  background: rgba(60, 74, 120, 0.08);
}

.notice-details {
  margin-top: 10px;
}

.notice-details summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.status-panel.safe {
  background: var(--paper);
  border-color: rgba(63, 91, 80, 0.26);
}

.status-panel.warn {
  background: var(--paper);
  border-color: rgba(142, 114, 53, 0.26);
}

.status-panel.danger {
  background: var(--paper);
  border-color: rgba(155, 74, 71, 0.26);
}

#view-now .status-panel {
  grid-template-columns: 1fr;
  min-height: 100%;
}

#view-now .fund-ruler,
#view-now .goal-progress,
#view-now .basis-note {
  grid-column: 1;
  grid-row: auto;
}

.status-topline {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  grid-column: 1;
}

.status-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.futokoro-mark {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  padding: 7px;
  border: 1px solid rgba(60, 74, 120, 0.14);
  border-radius: 16px;
  background: rgba(246, 245, 240, 0.8);
}

.pouch-body {
  fill: rgba(63, 91, 80, 0.36);
  stroke: rgba(60, 74, 120, 0.34);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.pouch-mouth {
  fill: rgba(251, 252, 250, 0.92);
  stroke: rgba(60, 74, 120, 0.28);
  stroke-width: 2;
  stroke-linejoin: round;
}

.pouch-fold,
.pouch-string {
  fill: none;
  stroke: rgba(60, 74, 120, 0.48);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.pouch-knot {
  fill: var(--accent);
  stroke: rgba(251, 252, 250, 0.86);
  stroke-width: 1.4;
}

.status-topline h2 {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.status-message {
  margin: 12px 0 0;
  color: var(--ink-2);
  grid-column: 1;
}

.lowest-hint {
  grid-column: 1;
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.fund-ruler {
  grid-column: 2;
  grid-row: 1 / span 5;
  margin-top: 0;
  padding: 18px;
  border: 1px solid rgba(60, 74, 120, 0.13);
  border-radius: 24px;
  background: rgba(246, 245, 240, 0.68);
}

.ruler-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ruler-copy strong {
  color: var(--ink);
  font-size: 1rem;
}

.dial-wrap {
  display: grid;
  place-items: center;
  margin-top: 10px;
  width: min(100%, 300px);
  aspect-ratio: 1.18;
  margin-inline: auto;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.92) 0 33%, transparent 34%),
    linear-gradient(180deg, rgba(198, 204, 222, 0.36), rgba(251, 252, 250, 0.58));
  border: 1px solid rgba(216, 214, 204, 0.66);
  padding: 16px 18px 0;
}

.fund-dial {
  width: min(100%, 280px);
  min-height: 150px;
  overflow: hidden;
}

.fund-dial text {
  fill: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.dial-base,
.dial-progress {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
}

.dial-base {
  stroke: var(--surface-strong);
}

.dial-progress {
  stroke: var(--accent);
  transition: stroke-dasharray 160ms ease-out;
}

.dial-needle {
  transition: transform 160ms ease-out;
  transform-box: fill-box;
  transform-origin: center;
}

.dial-needle line {
  stroke: var(--safe);
  stroke-width: 5;
  stroke-linecap: round;
}

.dial-needle circle {
  fill: var(--surface);
  stroke: var(--safe);
  stroke-width: 5;
}

.ruler-stage {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.ruler-formula {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.goal-progress {
  display: grid;
  gap: 10px;
  grid-column: 1;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(60, 74, 120, 0.13);
  border-radius: 18px;
  background: rgba(251, 252, 250, 0.62);
}

.goal-progress-row {
  display: grid;
  gap: 7px;
}

.goal-progress-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.goal-progress-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.goal-progress-row strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.goal-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(216, 214, 204, 0.74);
}

.goal-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--safe), var(--accent));
  transition: width 180ms ease-out;
}

.basis-note {
  display: grid;
  gap: 6px;
  grid-column: 1;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(60, 74, 120, 0.15);
  border-radius: 18px;
  background: rgba(251, 252, 250, 0.62);
  color: var(--muted);
  font-size: 0.8rem;
}

.basis-note strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.basis-note p {
  margin: 0;
}

.basis-note a {
  color: var(--accent);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#view-now .summary-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-notes-panel {
  min-width: 0;
  padding: 10px 0 0;
}

.overview-notes-panel .section-title {
  margin: 0 0 14px;
  padding-inline: 4px;
}

.metric-card {
  min-height: 110px;
  padding: 18px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 7px 16px rgba(22, 33, 45, 0.04);
}

.metric-card.highlight {
  border-color: rgba(47, 111, 115, 0.42);
  background:
    linear-gradient(135deg, rgba(60, 74, 120, 0.18), rgba(198, 204, 222, 0.72)),
    var(--accent-soft);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.month-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.overview-month-notes {
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.note-board {
  display: grid;
  grid-template-columns: minmax(280px, 0.44fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.note-summary-card {
  position: sticky;
  top: 18px;
  min-width: 0;
  padding: 32px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 7px 16px rgba(22, 33, 45, 0.04);
}

.note-summary-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 106px;
  height: 18px;
  border-radius: 4px;
  background: rgba(178, 184, 196, 0.44);
  transform: translateX(-50%) rotate(-2deg);
}

.note-summary-pin {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
}

.note-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 18px;
  border-radius: 999px;
  background: var(--safe-soft);
  color: var(--safe);
  padding: 5px 16px;
  font-size: 0.9rem;
  font-weight: 900;
}

.note-summary-card > strong {
  display: inline-block;
  color: var(--ink);
  font-size: clamp(4.2rem, 7vw, 6.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.note-summary-card > #noteBoardLabel {
  display: inline-block;
  margin: 0 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-weight: 900;
}

.note-summary-formula {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.note-summary-card > #noteBoardMessage {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 800;
}

.note-summary-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed rgba(109, 115, 133, 0.24);
}

.note-summary-bottom span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.note-summary-bottom strong {
  color: var(--accent);
  font-size: 1.08rem;
}

.note-board-main {
  min-width: 0;
}

.note-board-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.note-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.note-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 900;
}

.legend-income {
  background: var(--safe-soft);
  color: var(--safe);
}

.legend-card {
  background: rgba(198, 204, 222, 0.5);
  color: var(--accent);
}

.legend-expense {
  background: var(--danger-soft);
  color: var(--danger);
}

.note-board-month-notes {
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 18px;
  margin-top: 0;
}

.month-note {
  position: relative;
  min-height: 128px;
  padding: 20px 16px 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 7px 16px rgba(22, 33, 45, 0.04);
}

.month-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 22px;
  width: 54px;
  height: 11px;
  border-radius: 3px;
  background: rgba(109, 115, 133, 0.22);
  transform: rotate(-3deg);
}

.month-note.has-income {
  border-color: rgba(63, 91, 80, 0.24);
  background: var(--safe-soft);
}

.month-note.has-income::before {
  background: rgba(63, 91, 80, 0.28);
}

.month-note.has-card,
.month-note.has-expense {
  border-color: rgba(155, 74, 71, 0.26);
  background: var(--danger-soft);
}

.month-note.has-card::before,
.month-note.has-expense::before {
  background: rgba(60, 74, 120, 0.3);
}

.month-note.lowest {
  outline: 2px solid rgba(60, 74, 120, 0.24);
  outline-offset: 2px;
}

.note-month {
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 900;
}

.note-balance {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
/* 10文字超の金額（8桁以上）はフォントを縮小して1行に収める */
.note-balance--sm {
  font-size: clamp(0.72rem, 1.1vw, 0.92rem);
}

.note-caption,
.note-empty,
.note-event {
  color: var(--muted);
  font-size: 0.76rem;
}

.note-events {
  display: grid;
  gap: 3px;
  margin: 10px 0 0;
}

.note-event {
  font-weight: 800;
}

.note-event.income {
  color: var(--safe);
}

.note-event.outgoing {
  color: var(--danger);
}

.balance-chart {
  display: grid;
  gap: 8px;
  min-height: 260px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(251, 252, 250, 0.96), rgba(246, 245, 240, 0.84));
}

.chart-svg {
  display: block;
  width: 100%;
  height: 250px;
  overflow: visible;
}

.chart-area {
  fill: rgba(60, 74, 120, 0.14);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 4;
}

.chart-dot.lowest {
  fill: var(--warn-soft);
  stroke: var(--warn);
}

.chart-guide {
  stroke: rgba(109, 115, 133, 0.28);
  stroke-dasharray: 7 8;
  stroke-linecap: round;
}

.chart-guide-label,
.chart-month-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chart-month-label {
  text-anchor: middle;
}

.chart-lowest-label {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.projection-table {
  font-size: 0.84rem;
}

.negative {
  color: var(--danger);
  font-weight: 800;
}

.positive {
  color: var(--safe);
  font-weight: 800;
}

.action-list {
  margin: 0;
  padding-left: 1.25rem;
}

.action-list li + li {
  margin-top: 8px;
}

.chart-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.evidence-panel {
  margin-top: 18px;
  box-shadow: none;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evidence-grid article {
  min-width: 0;
  border: 1px solid rgba(216, 214, 204, 0.82);
  border-radius: 16px;
  background: rgba(251, 252, 250, 0.68);
  padding: 12px;
}

.evidence-grid span {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
}

.evidence-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.evidence-grid a {
  color: var(--accent);
  font-weight: 800;
  text-underline-offset: 3px;
}

@keyframes result-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: contents;
  }

  .input-panel {
    order: -2;
    position: static;
  }

  .results-column {
    order: -1;
  }

  .support-panel {
    order: 1;
  }

  .feedback-panel {
    order: 2;
  }

  .notice-panel {
    order: 3;
  }

  .results-board {
    grid-template-columns: 1fr;
  }

  .view-pane.is-active#view-now {
    grid-template-columns: 1fr;
  }

  .note-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .note-summary-card {
    position: relative;
    top: auto;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .fund-ruler,
  .goal-progress,
  .basis-note {
    grid-column: 1;
    grid-row: auto;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .app-header,
  .section-title,
  .status-topline {
    align-items: start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .view-header {
    flex-direction: column;
  }

  .view-switch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .view-tab {
    width: auto;
    padding-inline: 8px;
  }

  .grid-three,
  .summary-grid,
  #view-now .summary-grid {
    grid-template-columns: 1fr;
  }

  .month-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-board-heading {
    flex-direction: column;
  }

  .note-legend {
    justify-content: flex-start;
  }

  .note-board-month-notes,
  .overview-month-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .balance-chart {
    max-width: 100%;
    overflow: hidden;
  }

  .chart-svg {
    height: 230px;
  }
}
