:root {
  --color-primary: #2f9f95;
  --color-primary-dark: #166b69;
  --color-primary-light: #e5f7f2;
  --color-accent: #f3b34e;
  --color-warning: #e96e61;
  --color-danger: #c84e43;
  --color-sky: #dff0ff;
  --color-lavender: #eee8ff;
  --color-bg: #fbfaf6;
  --color-surface: #ffffff;
  --color-text: #263132;
  --color-muted: #657174;
  --color-border: #dfe9e5;
  --shadow-soft: 0 20px 60px rgba(43, 80, 72, 0.12);
  --shadow-lift: 0 24px 70px rgba(43, 80, 72, 0.18);
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(243, 179, 78, 0.18), transparent 260px),
    linear-gradient(180deg, rgba(229, 247, 242, 0.78), transparent 420px),
    var(--color-bg);
  color: var(--color-text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.nav-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  transition: grid-template-columns 220ms ease;
}

.nav-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.tool-content {
  min-width: 0;
  grid-column: 2;
}

.sidebar-collapsed .tool-content {
  grid-column: 2;
}

.tool-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 40px);
  padding: 18px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  animation: surfaceIn 420ms ease both;
  overflow: hidden;
  width: 100%;
  transition:
    width 220ms ease,
    padding 220ms ease,
    background 220ms ease;
}

.tool-sidebar.collapsed {
  padding: 16px 0;
  width: 76px;
}

.sidebar-scroll {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 159, 149, 0.48) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(47, 159, 149, 0.42);
  border-radius: 999px;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.sidebar-brand-mark,
.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.sidebar-brand-mark {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 800;
}

.sidebar-brand-copy {
  min-width: 0;
  overflow: hidden;
  transition:
    opacity 160ms ease,
    width 220ms ease;
}

.sidebar-brand strong {
  color: var(--color-text);
  font-size: 1.15rem;
  line-height: 1.25;
  white-space: nowrap;
}

.sidebar-brand span {
  display: block;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.sidebar-toggle {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-primary-dark);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 159, 149, 0.48);
  background: var(--color-primary-light);
}

.sidebar-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-sidebar.collapsed .sidebar-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
  width: 100%;
}

.tool-sidebar.collapsed .sidebar-brand-copy {
  display: none;
}

.tool-sidebar.collapsed .sidebar-brand-mark,
.tool-sidebar.collapsed .sidebar-toggle {
  width: 44px;
  height: 44px;
}

.sidebar-group {
  display: grid;
  gap: 8px;
}

.sidebar-group h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--color-muted);
  font-size: 0.76rem;
  transition:
    opacity 160ms ease,
    height 220ms ease,
    margin 220ms ease;
}

.tool-sidebar.collapsed .sidebar-group {
  justify-items: center;
  gap: 8px;
  width: 100%;
}

.tool-sidebar.collapsed .sidebar-group h2 {
  display: none;
}

.sidebar-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.sidebar-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(47, 159, 149, 0.12), transparent 62%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.sidebar-item:hover {
  transform: translateX(2px);
  border-color: rgba(47, 159, 149, 0.48);
  box-shadow: 0 10px 24px rgba(43, 80, 72, 0.09);
}

.sidebar-item.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary-light), #fff8e9);
  color: var(--color-primary-dark);
  box-shadow: 0 12px 30px rgba(47, 159, 149, 0.16);
}

.sidebar-item.active::after {
  opacity: 1;
}

.sidebar-item.disabled {
  color: var(--color-muted);
}

.sidebar-label {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    opacity 160ms ease,
    width 220ms ease;
}

.sidebar-badge {
  position: relative;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  transition:
    opacity 160ms ease,
    width 220ms ease,
    padding 220ms ease;
}

.sidebar-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: currentColor;
}

.sidebar-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-sidebar.collapsed .sidebar-scroll {
  gap: 8px;
  justify-items: center;
  width: 100%;
  padding-right: 0;
  overflow-x: hidden;
}

.tool-sidebar.collapsed .sidebar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-template-columns: 1fr;
  width: 48px;
  min-height: 48px;
  height: 48px;
  padding: 0;
}

.tool-sidebar.collapsed .sidebar-item:hover {
  transform: none;
}

.tool-sidebar.collapsed .sidebar-icon {
  width: 100%;
  height: 100%;
}

.tool-sidebar.collapsed .sidebar-label,
.tool-sidebar.collapsed .sidebar-badge {
  display: none;
}

.tool-sidebar.collapsed .sidebar-icon svg {
  display: block;
}

.top-screen,
.panel-page,
.result-page,
.tool-page {
  display: grid;
  gap: 24px;
}

.hero,
.result-hero,
.step-card,
 .chart-card,
 .timeline-card,
 .talk-card,
 .hint-card,
 .comparison-card,
 .article-card,
.table-card,
.summary-card,
.validation-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero {
  min-height: 420px;
  padding: clamp(32px, 7vw, 72px);
  display: grid;
  align-content: center;
  gap: 18px;
  overflow: hidden;
  animation: surfaceIn 480ms ease both;
}

.visual-hero {
  position: relative;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
  align-items: center;
  background:
    radial-gradient(circle at 86% 18%, rgba(243, 179, 78, 0.24), transparent 190px),
    linear-gradient(135deg, white 0%, #f3fbf8 56%, #fff6e7 100%);
}

.lifeplan-hero {
  background:
    radial-gradient(circle at 90% 20%, rgba(47, 159, 149, 0.18), transparent 180px),
    linear-gradient(135deg, white 0%, #f2faf7 100%);
}

.hero-copy-block {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  position: relative;
  min-height: 320px;
}

.floating-panel {
  position: absolute;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(14px);
  animation: floatPanel 5.4s ease-in-out infinite;
}

.floating-panel span {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.floating-panel strong {
  color: var(--color-primary-dark);
  font-size: 1.35rem;
}

.primary-panel {
  left: 48px;
  top: 72px;
  width: 230px;
}

.primary-panel strong {
  color: var(--color-danger);
  font-size: 2.3rem;
  line-height: 1;
}

.mini-panel {
  width: 150px;
}

.mini-panel.top {
  right: 18px;
  top: 34px;
  animation-delay: 520ms;
}

.mini-panel.bottom {
  right: 74px;
  bottom: 42px;
  animation-delay: 920ms;
}

.orbit-line {
  position: absolute;
  inset: 54px 20px 46px 36px;
  border: 1px solid rgba(47, 159, 149, 0.28);
  border-radius: 999px;
  transform: rotate(-12deg);
}

.eyebrow {
  margin: 0;
  color: var(--color-primary);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

h3 {
  margin-bottom: 8px;
}

.hero-copy,
.lead,
.muted,
.chart-note,
.disclaimer {
  color: var(--color-muted);
  line-height: 1.8;
}

.hero-copy {
  max-width: 660px;
  font-size: 1.04rem;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(43, 80, 72, 0.13);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.button-primary:hover {
  background: var(--color-primary-dark);
}

.button-secondary {
  color: var(--color-primary-dark);
  background: white;
  border-color: var(--color-border);
}

.button-ghost {
  color: var(--color-muted);
  background: transparent;
  border-color: var(--color-border);
}

.button-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.feature-grid,
.summary-grid,
.kpi-grid,
.article-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: 22px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
  animation: cardIn 460ms ease both;
}

.tool-card::before {
  content: "";
  width: 46px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
}

.tool-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(47, 159, 149, 0.08);
  transition: transform 220ms ease;
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(47, 159, 149, 0.5);
  box-shadow: var(--shadow-lift);
}

.tool-card:hover::after {
  transform: scale(1.25);
}

.tool-card:nth-child(2) {
  animation-delay: 70ms;
}

.tool-card:nth-child(3) {
  animation-delay: 140ms;
}

.tool-card:nth-child(4) {
  animation-delay: 210ms;
}

.tool-card:nth-child(5) {
  animation-delay: 280ms;
}

.tool-card:nth-child(6) {
  animation-delay: 350ms;
}

.tool-card-category {
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.tone-coral::before {
  background: var(--color-warning);
}

.tone-coral::after {
  background: rgba(233, 110, 97, 0.1);
}

.tone-sky::before {
  background: #5798d5;
}

.tone-sky::after {
  background: var(--color-sky);
}

.tone-lavender::before {
  background: #8b78d8;
}

.tone-lavender::after {
  background: var(--color-lavender);
}

.tone-gold::before {
  background: var(--color-accent);
}

.tone-gold::after {
  background: rgba(243, 179, 78, 0.14);
}

.tool-card h2 {
  font-size: 1.3rem;
}

.tool-card p {
  color: var(--color-muted);
  line-height: 1.7;
}

.tool-card .button,
.tool-card em {
  align-self: end;
  justify-self: start;
  margin-top: auto;
}

.tool-card em {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.tool-card.disabled {
  box-shadow: none;
  opacity: 0.86;
}

.feature-grid article,
.kpi-card,
.article-grid a {
  padding: 20px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.feature-grid span,
.kpi-card span,
.article-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-card,
.chart-card,
.talk-card,
.hint-card,
.comparison-card,
.article-card,
.table-card,
.result-hero,
.step-card {
  padding: clamp(20px, 4vw, 32px);
  animation: surfaceIn 420ms ease both;
}

.timeline-card.compact {
  box-shadow: none;
  margin-top: 20px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: start;
  padding-left: 34px;
  min-height: 32px;
}

.timeline-item strong {
  color: var(--color-primary-dark);
}

.timeline-item small {
  grid-column: 2 / -1;
  color: var(--color-muted);
}

.timeline-item button {
  border: none;
  background: transparent;
  color: var(--color-muted);
  text-decoration: underline;
}

.timeline-dot {
  position: absolute;
  left: 2px;
  top: 6px;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px white;
}

.category-housing,
.category-car {
  background: var(--color-warning);
}

.category-education {
  background: var(--color-accent);
}

.category-retirement {
  background: #7e8bd4;
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-muted);
  background: white;
  font-size: 0.9rem;
  font-weight: 700;
}

.step-pill span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.76rem;
}

.step-pill.active {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.form-grid,
.event-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.compact-grid {
  margin-top: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field.full,
.full {
  grid-column: 1 / -1;
}

.form-field label,
.form-field > span {
  font-weight: 700;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  color: var(--color-text);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(47, 159, 149, 0.14);
  outline: none;
}

.form-field small {
  color: var(--color-muted);
  line-height: 1.6;
}

.number-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.number-control > button {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 1.25rem;
  font-weight: 700;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.number-control > button:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
  background: #d9f2ec;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.input-with-unit:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(47, 159, 149, 0.14);
}

.input-with-unit input {
  border: 0;
  height: 46px;
  min-width: 0;
}

.input-with-unit em {
  padding: 0 12px 0 8px;
  color: var(--color-muted);
  font-style: normal;
  font-size: 0.9rem;
  white-space: nowrap;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.template-list button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.detail-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: rgba(232, 246, 245, 0.42);
}

.detail-panel h2 {
  font-size: 1.1rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.validation-box {
  box-shadow: none;
  padding: 18px 20px;
}

.validation-box p {
  margin: 0;
}

.validation-box p + p {
  margin-top: 8px;
}

.error-text {
  color: var(--color-danger);
}

.warning-text {
  color: #8b5f14;
}

.summary-grid,
.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  box-shadow: none;
}

.summary-card button {
  align-self: start;
  border: none;
  background: transparent;
  color: var(--color-primary);
  text-decoration: underline;
}

.result-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(243, 179, 78, 0.18), transparent 180px),
    linear-gradient(135deg, white, var(--color-primary-light));
}

.kpi-card strong {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.kpi-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
  animation: cardIn 420ms ease both;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 159, 149, 0.48);
  box-shadow: var(--shadow-lift);
}

.kpi-emphasis {
  background: linear-gradient(135deg, #fff, #fff3ed);
  border-color: rgba(233, 110, 97, 0.24);
}

.kpi-emphasis strong {
  color: var(--color-danger);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.section-heading strong {
  font-size: 1.6rem;
  color: var(--color-primary-dark);
}

.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: #edf4f4;
  stroke-width: 1;
  pointer-events: none;
}

.positive-zone {
  fill: rgba(57, 154, 160, 0.08);
  pointer-events: none;
}

.negative-zone {
  fill: rgba(233, 110, 97, 0.1);
  pointer-events: none;
}

.chart-zero {
  stroke: var(--color-warning);
  stroke-dasharray: 6 8;
  stroke-width: 2;
  pointer-events: none;
}

.asset-path {
  stroke: var(--color-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.asset-point {
  fill: white;
  stroke: var(--color-primary);
  stroke-width: 2;
  pointer-events: none;
}

.event-marker {
  fill: var(--color-warning);
  stroke: white;
  stroke-width: 3;
  pointer-events: all;
}

.event-tooltip,
.axis-label,
.axis-tick,
.zero-label {
  fill: var(--color-muted);
  font-size: 13px;
  pointer-events: none;
}

.axis-label {
  font-weight: 700;
}

.zero-label {
  fill: var(--color-warning);
  font-weight: 700;
}

.y-axis-tick {
  text-anchor: end;
}

.event-marker-group {
  outline: none;
}

.event-tooltip {
  pointer-events: none;
  opacity: 0;
  paint-order: stroke;
  stroke: white;
  stroke-width: 5px;
  stroke-linejoin: round;
  font-weight: 700;
}

.event-marker-group:hover .event-tooltip,
.event-marker-group:focus .event-tooltip {
  opacity: 1;
}

.result-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tool-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.wedding-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: center;
  overflow: hidden;
}

.wedding-hero p {
  max-width: 740px;
  color: var(--color-muted);
  line-height: 1.8;
}

.wedding-hero-meter {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  animation: floatPanel 5s ease-in-out infinite;
}

.wedding-hero-meter span,
.wedding-hero-meter small {
  color: var(--color-muted);
  font-weight: 700;
}

.wedding-hero-meter strong {
  color: var(--color-primary-dark);
  font-size: 1.8rem;
  line-height: 1;
}

.new-life-hero {
  background:
    linear-gradient(135deg, rgba(248, 252, 255, 0.94), rgba(237, 250, 244, 0.9)),
    #f9fcff;
}

.new-life-hero-meter strong,
.new-life-total strong {
  color: #147a6f;
}

.birth-hero {
  background:
    linear-gradient(135deg, rgba(255, 250, 252, 0.94), rgba(245, 241, 255, 0.92)),
    #fffafb;
}

.birth-hero-meter strong,
.birth-total strong {
  color: #7a4db8;
}

.baby-goods-hero {
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.94), rgba(246, 250, 255, 0.92)),
    #fffdf8;
}

.baby-goods-hero-meter strong,
.baby-goods-total strong {
  color: #9a6416;
}

.home-purchase-hero {
  background:
    linear-gradient(135deg, rgba(246, 251, 255, 0.94), rgba(232, 246, 245, 0.9)),
    #f7fbff;
}

.home-purchase-hero-meter strong,
.home-purchase-total strong {
  color: #196f8f;
}

.parental-leave-hero {
  background:
    linear-gradient(135deg, rgba(255, 250, 252, 0.94), rgba(237, 250, 244, 0.9)),
    #fffafa;
}

.parental-leave-hero-meter strong,
.parental-leave-total strong {
  color: #b25571;
}

.daycare-return-hero {
  background:
    linear-gradient(135deg, rgba(248, 255, 252, 0.94), rgba(246, 250, 255, 0.9)),
    #f8fffc;
}

.daycare-return-hero-meter strong,
.daycare-return-total strong {
  color: #207d68;
}

.education-cost-hero {
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.94), rgba(237, 250, 244, 0.9)),
    #fffdf8;
}

.education-cost-hero-meter strong,
.education-cost-total strong {
  color: #946214;
}

.household-sharing-hero {
  background:
    linear-gradient(135deg, rgba(248, 255, 252, 0.94), rgba(246, 250, 255, 0.9)),
    #f8fffc;
}

.household-sharing-hero-meter strong,
.household-sharing-total strong {
  color: #176f75;
}

.allowance-hero {
  background:
    linear-gradient(135deg, rgba(255, 250, 252, 0.94), rgba(246, 250, 255, 0.9)),
    #fffafa;
}

.allowance-hero-meter strong,
.allowance-total strong {
  color: #8a4f9f;
}

.nisa-hero {
  background:
    linear-gradient(135deg, rgba(248, 255, 252, 0.96), rgba(236, 249, 241, 0.92)),
    #f7fff9;
}

.nisa-hero-meter strong,
.nisa-total strong {
  color: #16705f;
}

.input-group + .input-group {
  margin-top: 26px;
}

.input-group h3 {
  color: var(--color-primary-dark);
}

.text-button {
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
}

.wedding-total {
  padding: 20px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 243, 237, 0.84)),
    var(--color-primary-light);
  border: 1px solid rgba(233, 110, 97, 0.16);
}

.wedding-total span {
  display: block;
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.wedding-total strong {
  display: block;
  margin: 8px 0;
  color: var(--color-danger);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.wedding-total p {
  margin-bottom: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.new-life-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(237, 250, 244, 0.86)),
    #f3fbf7;
  border-color: rgba(20, 122, 111, 0.16);
}

.birth-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(245, 241, 255, 0.9)),
    #fbf7ff;
  border-color: rgba(122, 77, 184, 0.18);
}

.baby-goods-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 230, 0.9)),
    #fffaf0;
  border-color: rgba(154, 100, 22, 0.18);
}

.home-purchase-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(232, 246, 245, 0.86)),
    #f3fbff;
  border-color: rgba(25, 111, 143, 0.18);
}

.parental-leave-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 241, 245, 0.9)),
    #fff7fa;
  border-color: rgba(178, 85, 113, 0.18);
}

.daycare-return-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(232, 246, 245, 0.9)),
    #f6fffb;
  border-color: rgba(32, 125, 104, 0.18);
}

.education-cost-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 230, 0.9)),
    #fffaf0;
  border-color: rgba(148, 98, 20, 0.18);
}

.household-sharing-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(232, 246, 245, 0.9)),
    #f6fffb;
  border-color: rgba(23, 111, 117, 0.18);
}

.allowance-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(245, 241, 255, 0.9)),
    #fbf7ff;
  border-color: rgba(138, 79, 159, 0.18);
}

.nisa-total {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(232, 246, 239, 0.92)),
    #f5fcf8;
  border-color: rgba(22, 112, 95, 0.18);
}

.nisa-limit-note {
  margin: 22px 0 0;
  padding: 14px 16px;
  border-left: 4px solid #2f9f95;
  background: #f3fbf7;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.line-item-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.line-item > div {
  flex: 1;
  min-width: 0;
}

.line-item span {
  color: var(--color-muted);
}

.line-item-bar {
  width: min(var(--bar-width), 100%);
  height: 7px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transform-origin: left;
  animation: barGrow 480ms ease both;
}

.negative-bar {
  background: linear-gradient(90deg, #8b78d8, #5798d5);
}

.home-purchase-bar {
  background: linear-gradient(90deg, #196f8f, var(--color-primary));
}

.parental-leave-bar {
  background: linear-gradient(90deg, #b25571, var(--color-accent));
}

.daycare-return-bar {
  background: linear-gradient(90deg, #207d68, #5798d5);
}

.education-cost-bar {
  background: linear-gradient(90deg, #946214, var(--color-accent));
}

.household-sharing-bar {
  background: linear-gradient(90deg, #176f75, var(--color-primary));
}

.allowance-bar {
  background: linear-gradient(90deg, #8a4f9f, var(--color-accent));
}

.nisa-bar {
  background: linear-gradient(90deg, #16705f, #56b88e);
}

.line-item strong {
  color: var(--color-text);
}

.birth-action-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.birth-action-box p {
  margin: 0;
  color: var(--color-primary-dark);
  font-weight: 700;
}

.comparison-grid,
.hint-list {
  display: grid;
  gap: 14px;
}

.comparison-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.comparison-item,
.hint-item {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.comparison-item:hover,
.hint-item:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 159, 149, 0.42);
  box-shadow: 0 18px 38px rgba(43, 80, 72, 0.11);
}

.comparison-item span,
.hint-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.comparison-item strong,
.hint-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--color-primary-dark);
  font-size: 1.25rem;
}

.comparison-item p,
.hint-item p {
  color: var(--color-muted);
  line-height: 1.65;
}

.comparison-item dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.comparison-item dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}

.comparison-item dt {
  color: var(--color-muted);
}

.comparison-item dd {
  margin: 0;
  font-weight: 700;
}

.priority-high {
  border-left: 4px solid var(--color-danger);
}

.priority-medium {
  border-left: 4px solid var(--color-accent);
}

.priority-low {
  border-left: 4px solid var(--color-primary);
}

.talk-list {
  display: grid;
  gap: 12px;
}

.talk-item {
  padding: 16px;
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  background: var(--color-primary-light);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.talk-item:hover {
  transform: translateX(4px);
  box-shadow: 0 14px 28px rgba(43, 80, 72, 0.1);
}

.talk-item p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.level-warning {
  border-left-color: var(--color-accent);
  background: #fff8e9;
}

.level-danger {
  border-left-color: var(--color-danger);
  background: #fff1ef;
}

.hint-card ul {
  margin: 0;
  padding-left: 1.4rem;
  line-height: 1.9;
}

.article-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-grid strong {
  display: block;
  margin-bottom: 8px;
}

.article-grid p {
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--color-muted);
  font-size: 0.84rem;
}

.row-warning {
  background: #fffaf0;
}

.row-danger {
  background: #fff1ef;
}

.disclaimer {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 640px);
    padding-top: 16px;
  }

  .feature-grid,
  .tool-card-grid,
  .summary-grid,
  .kpi-grid,
  .article-grid,
  .comparison-grid,
  .result-two-column,
  .tool-two-column,
  .form-grid,
  .event-form {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    grid-template-columns: 1fr;
  }

  .tool-content {
    grid-column: 1;
  }

  .sidebar-toggle {
    align-self: start;
  }

  .tool-sidebar {
    position: static;
    max-height: 64vh;
    min-height: auto;
  }

  .sidebar-scroll {
    max-height: calc(64vh - 128px);
  }

  .visual-hero,
  .wedding-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 260px;
  }

  .primary-panel {
    left: 10px;
    top: 54px;
  }

  .mini-panel.top {
    right: 8px;
    top: 22px;
  }

  .mini-panel.bottom {
    right: 24px;
    bottom: 28px;
  }

  .wedding-hero-meter {
    width: min(100%, 280px);
  }

  .step-progress {
    grid-template-columns: 1fr;
  }

  .step-pill {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .timeline-item {
    grid-template-columns: 76px 1fr auto auto;
  }

  .timeline-item button {
    grid-column: 2;
    justify-self: start;
  }

  .button-row {
    justify-content: stretch;
  }

  .button-row .button {
    flex: 1 1 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

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

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

@keyframes floatPanel {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes barGrow {
  from {
    transform: scaleX(0.08);
  }
  to {
    transform: scaleX(1);
  }
}
