* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "ヒラギノ角ゴ ProN", "Yu Gothic", "メイリオ", sans-serif;
  background: #e5e7f3;
  color: #222;
}

/* レイアウト全体 */
.layout {
  min-height: 100vh;
  display: flex;
}

/* ==========================
   ▼ サイドバー（PC）
========================== */
.sidebar {
  width: 230px;
  padding: 20px 16px;
  background: #0f172a;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-header {
  margin-bottom: 8px;
}

.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.logo span {
  color: #38bdf8;
}

.sidebar-caption {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.nav-section-label {
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-item {
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    transform 0.05s ease;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.18);
}

.nav-item.active {
  background: #2563eb;
  color: #fff;
}

/* ==========================
   ▼ メインエリア
========================== */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* SPヘッダー（PCでは非表示） */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #0f172a;
  color: #e5e7eb;
}

.menu-toggle {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
}

.mobile-title {
  font-size: 15px;
  font-weight: 600;
}

/* 中央のカード */
.app {
  max-width: 720px;
  margin: 40px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

h1 {
  font-size: 24px;
  margin: 0 0 8px;
  text-align: center;
}

.description {
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-bottom: 24px;
}

/* タブコンテンツ共通 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================
   ▼ フォーム共通
========================== */
form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 14px;
}

.inline-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="number"],
select {
  padding: 8px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

select {
  flex: 0 0 auto;
}

.suffix {
  font-size: 14px;
  color: #555;
}

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.radio-group input {
  margin-right: 4px;
}

.note {
  font-size: 11px;
  color: #777;
  line-height: 1.5;
}

.primary-button {
  margin-top: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease,
    box-shadow 0.15s ease;
  align-self: flex-start;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.primary-button:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

.primary-button:active {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

/* ==========================
   ▼ 結果カード
========================== */
.result-card {
  margin-top: 24px;
  padding: 16px 18px 14px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.result-card h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  padding: 4px 0;
}

.result-row span:first-child {
  color: #555;
}

.result-row span:last-child {
  font-weight: 600;
}

.result-row.total {
  font-size: 15px;
  margin-top: 6px;
}

.result-row.total span:last-child {
  font-size: 18px;
  color: #16a34a;
}

.result-card hr {
  border: none;
  border-top: 1px dashed #e5e7eb;
  margin: 10px 0;
}

.bottom-note {
  margin-top: 10px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.6;
}

.hidden {
  display: none;
}

/* ==========================
   ▼ SP用ドロワー
========================== */
.mobile-drawer {
  position: fixed;
  inset: 0 40% 0 0;
  max-width: 320px;
  background: #0f172a;
  color: #e5e7eb;
  transform: translateX(-100%);
  transition: transform 0.2s ease-out;
  z-index: 40;
}

.mobile-drawer-inner {
  height: 100%;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
}

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

.drawer-close {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 22px;
  cursor: pointer;
}

.mobile-nav-list {
  margin-top: 8px;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 30;
}

.mobile-drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.no-scroll {
  overflow: hidden;
}

/* ==========================
   ▼ レスポンシブ
========================== */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .layout {
    flex-direction: column;
  }

  .app {
    margin: 20px auto 24px;
    padding: 18px;
  }

  h1 {
    font-size: 20px;
  }

  .description {
    font-size: 13px;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .result-row.total span:last-child {
    font-size: 16px;
  }

  .mobile-drawer {
    inset: 0 0 0 0;
    max-width: none;
  }
}

.disclaimer {
  max-width: 960px;      /* app と揃える場合 */
  margin: 20px auto 40px;
  padding: 16px 20px;
  background: #f8f8f8;
  border-top: 1px solid #ddd;
  font-size: 12px;
  color: #555;
  line-height: 1.6;
}
.disclaimer p {
  margin: 0;
}
