:root {
  --bg: #06080d;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #f1f5f9;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --primary-soft: rgba(59, 130, 246, 0.1);
  --secondary: #10b981;
  --accent: #f59e0b;
  --error: #ef4444;
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] {
  --bg: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-hover: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(59, 130, 246, 0.28);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.22);
  --primary-soft: rgba(37, 99, 235, 0.08);
  --secondary: #059669;
  --accent: #d97706;
  --error: #dc2626;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 60%);
  animation: bgPulse 14s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ── Background wave (Hokusai style) ── */
.bg-wave {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  mask-image: linear-gradient(to top, #000 30%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 90%);
}

.bg-wave svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 60vh;
  animation: waveFloat 16s ease-in-out infinite alternate;
}

@keyframes waveFloat {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-8px) translateX(-12px); }
  100% { transform: translateY(4px) translateX(8px); }
}

.wave-curl {
  transform-origin: 460px 355px;
  animation: curlPulse 6s ease-in-out infinite alternate;
}

@keyframes curlPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0.85; }
}

.hero-header {
  position: relative;
  padding: 24px 20px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero-decoration {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 800px;
  height: 300px;
  opacity: 0.03;
  pointer-events: none;
}

.hero-decoration svg {
  width: 100%;
  height: 100%;
}

.topbar {
  max-width: 1100px;
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.brand {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  transition: var(--transition);
}

.brand:hover { opacity: 0.85; }

.brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-text small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 22px;
  box-shadow: 0 0 24px var(--primary-glow);
  transition: var(--transition);
}

.brand:hover .brand-mark {
  box-shadow: 0 0 32px var(--primary-glow);
  transform: scale(1.05);
}

.brand-dot {
  color: var(--primary);
  font-style: normal;
  font-weight: 900;
  margin: 0 4px;
  opacity: 0.8;
}

.rates {
  display: flex;
  gap: 8px;
}

.rates span {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--transition);
}

.rates span:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
}

.rates b { color: var(--text); font-weight: 700; }

.theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.theme-icon {
  width: 19px;
  height: 19px;
  position: absolute;
  transition: opacity var(--transition), transform var(--transition);
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-45deg) scale(0.75);
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body[data-theme="light"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body[data-theme="light"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(45deg) scale(0.75);
}

.admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 20px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transition: var(--transition);
}

.admin-link:hover {
  color: var(--text);
  background: var(--panel);
}

.hero {
  position: relative;
  z-index: 1;
}

.japan-sun {
  position: absolute;
  top: -26px;
  left: 50%;
  width: 150px;
  height: 150px;
  translate: -50% 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.04) 58%, transparent 70%);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 900;
  margin: 0 auto 20px;
  max-width: 820px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, rgba(148, 163, 184, 0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleReveal 0.8s ease-out;
}

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

.lead {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.7;
  animation: titleReveal 0.8s ease-out 0.15s both;
}

.layout {
  max-width: 1100px;
  margin: -40px auto 60px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  padding: 0 20px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin: 0 0 28px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

form { display: grid; gap: 22px; }

.field {
  display: grid;
  gap: 8px;
  position: relative;
}

.field-label,
.field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

input[type="number"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  width: 100%;
  transition: var(--transition);
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.field-unit,
.field > em {
  position: absolute;
  right: 16px;
  bottom: 15px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
  pointer-events: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.switches {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}

.switch {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
  user-select: none;
}

.switch:hover { color: var(--text); }

.switch input { display: none; }

.switch-track {
  width: 46px;
  height: 26px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.switch input:checked ~ .switch-track {
  background: var(--primary);
}

.switch input:checked ~ .switch-track::after {
  transform: translateX(20px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  border: none;
  padding: 18px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 24px var(--primary-glow);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.primary-btn:hover::after {
  transform: translateX(100%);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-btn:disabled::after { display: none; }

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.primary-btn.is-loading .btn-spinner { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-card {
  min-height: 500px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.result-head-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

#totalValue {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

#totalValue.total-placeholder {
  color: var(--text-muted);
  font-size: 34px;
  letter-spacing: -0.02em;
  opacity: 0.45;
}

.result-caption {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

.calc-summary {
  display: grid;
  grid-template-columns: minmax(108px, 1.28fr) minmax(62px, 0.62fr) minmax(62px, 0.62fr) minmax(96px, 0.9fr) minmax(78px, 0.72fr);
  gap: 8px;
  margin-bottom: 28px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.calc-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.calc-summary span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.calc-summary b {
  min-width: 0;
  font-size: clamp(13px, 1.18vw, 15px);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-summary b.summary-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.calc-summary b.summary-type svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--primary);
}

.steps-timeline {
  position: relative;
  padding-left: 36px;
}

.steps-timeline::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--border), var(--secondary));
  border-radius: 1px;
}

.step {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  animation: stepIn 0.4s ease-out both;
}

.step:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
  transform: translateX(4px);
}

.step::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  transition: var(--transition);
}

.step:hover::before {
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
  transform: scale(1.3);
}

.step.step-duty {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.04);
}

.step.step-duty::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.step.step-total {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.04);
  margin-top: 16px;
}

.step.step-total::before {
  background: var(--secondary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.step-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.step-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.step-formula {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-value {
  font-weight: 800;
  font-size: 18px;
  color: var(--secondary);
  white-space: nowrap;
  text-align: right;
}

.step-choice {
  display: block;
  padding: 20px;
}

.step-choice .step-note {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}

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

.duty-choice-or {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.duty-choice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: var(--transition);
}

.duty-choice:hover {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.04);
}

.duty-choice span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.duty-choice b {
  font-size: 18px;
  color: var(--accent);
  font-weight: 800;
}

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

.total-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.total-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.total-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.total-card small {
  display: block;
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.total-card strong {
  display: block;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--text);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.total-single {
  font-size: 44px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
}

.steps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 20px;
  padding: 80px 40px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.steps-empty:hover {
  border-color: var(--border-hover);
}

.empty-illustration {
  width: 100px;
  height: 100px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: float 4s ease-in-out infinite;
}

.empty-illustration svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

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

.steps-empty strong {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
}

.steps-empty p {
  font-size: 14px;
  max-width: 320px;
  line-height: 1.6;
}

.share-panel {
  display: flex;
  gap: 8px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: inherit;
}

.share-icon-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-icon-btn svg { fill: currentColor; }

.share-url {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 18px;
  border-radius: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.15);
  word-break: break-all;
  transition: var(--transition);
}

.share-url:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.share-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  animation: fadeIn 0.3s ease-out;
}

.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.site-footer {
  text-align: center;
  padding: 60px 20px 40px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
}

.site-footer a:hover { color: #60a5fa; }

.bot-note {
  max-width: 1100px;
  margin: -34px auto 24px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.bot-note a {
  width: fit-content;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: var(--transition);
}

.bot-note a:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.bot-note-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.bot-note b,
.bot-note small {
  display: block;
}

.bot-note b {
  font-size: 13px;
  line-height: 1.2;
}

.bot-note small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.hidden { display: none !important; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

body[data-theme="light"] .bg-wave {
  opacity: 0.7;
  filter: saturate(1.15);
  mask-image: linear-gradient(to top, #000 22%, transparent 86%);
  -webkit-mask-image: linear-gradient(to top, #000 22%, transparent 86%);
}

body[data-theme="light"]::before {
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(5, 150, 105, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(217, 119, 6, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f3f7ff 45%, #eef6ff 100%);
}

body[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, #0f172a 20%, #334155 55%, rgba(37, 99, 235, 0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body[data-theme="light"] input[type="number"] {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

body[data-theme="light"] .switch-track {
  background: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .card {
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .card:hover {
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .step {
  background: rgba(255, 255, 255, 0.68);
}

body[data-theme="light"] .steps-timeline::before {
  background: linear-gradient(to bottom, rgba(37, 99, 235, 0.75), rgba(15, 23, 42, 0.12), rgba(5, 150, 105, 0.75));
}

body[data-theme="light"] .calc-summary,
body[data-theme="light"] .duty-choice {
  background: rgba(255, 255, 255, 0.54);
}

body[data-theme="light"] .calc-summary > div {
  border-color: rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.56);
}

body[data-theme="light"] .share-url {
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    margin-top: -30px;
  }

  .hero-header { padding: 20px 16px 60px; }
  .topbar { margin-bottom: 32px; }
  .hero h1 { font-size: 36px; }

  .result-card { min-height: auto; }

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

@media (max-width: 640px) {
  .hero-header { padding: 16px 12px 50px; }

  .topbar {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
  }

  .rates { flex-wrap: wrap; justify-content: center; }

  .field-grid { grid-template-columns: 1fr; }

  .card { padding: 24px; }

  #totalValue { font-size: 38px; }

  .result-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .total-grid { grid-template-columns: 1fr; }

  .brand-text strong { font-size: 16px; }

  .brand-text small { font-size: 9px; }

  .japan-sun {
    width: 110px;
    height: 110px;
    top: -16px;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: center;
  }

  .calc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .calc-summary > div {
    padding: 10px;
  }

  .steps-timeline { padding-left: 28px; }
  .step { padding: 14px 16px; }
  .step::before { left: -22px; }
  .steps-timeline::before { left: 9px; }

  .layout { margin-top: -30px; }
}
