:root {
  --bg: #fcf9f2;
  --bg-accent: #eef6ef;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text: #222222;
  --muted: #495057;
  --line: rgba(0, 50, 131, 0.14);
  --green: #008837;
  --green-light: #3bba6e;
  --orange: #ef8200;
  --orange-light: #f7ba7d;
  --red: #e60012;
  --red-light: #ef848c;
  --blue: #003283;
  --blue-light: #7899ce;
  --shadow: 0 24px 60px rgba(0, 50, 131, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  position: relative;
  padding: 0 28px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-stripe {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 0 -28px 20px;
  height: 10px;
}

.brand-stripe-green {
  background: var(--green);
}

.brand-stripe-orange {
  background: var(--orange);
}

.brand-stripe-red {
  background: var(--red);
}

.mode-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.mode-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(0, 50, 131, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.mode-link.is-active {
  background: rgba(0, 136, 55, 0.12);
  color: var(--green);
  border-color: rgba(0, 136, 55, 0.22);
}

.panel-label,
.share-label,
.summary-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.panel-header h2 {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--blue);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  text-wrap: pretty;
}

.notice-strip {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(230, 0, 18, 0.2);
  background: #fff;
  color: var(--red);
  font-size: 0.92rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.controls-form {
  display: grid;
  gap: 18px;
}

.range-picker {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.range-picker legend {
  margin-bottom: 4px;
  padding: 0;
  font-weight: 700;
  color: var(--blue);
}

.range-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  cursor: pointer;
}

.range-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.draw-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.draw-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  padding: 0 22px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: var(--orange);
  box-shadow: none;
}

.draw-button:hover {
  opacity: 0.94;
}

.secondary-button {
  min-height: 50px;
  padding: 0 18px;
  color: var(--blue);
  font-weight: 700;
  background: rgba(0, 50, 131, 0.08);
}

.status-message {
  min-height: 1.6em;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.is-hidden {
  display: none;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 136, 55, 0.12);
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 800;
}

.summary-card,
.share-card,
.result-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
}

.summary-card {
  border-top: 4px solid var(--green);
}

.summary-card {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 20px;
}

.summary-total {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--blue);
}

.summary-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.result-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}

.item-name,
.item-type,
.item-price {
  margin: 0;
}

.item-name {
  font-weight: 800;
  color: var(--blue);
}

.item-type {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.item-price {
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 800;
}

.share-card {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border-top: 4px solid var(--blue);
}

.share-url {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.share-button {
  min-width: 186px;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 960px);
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero {
    padding-top: 0;
  }

  .brand-stripe {
    margin: 0 -18px 16px;
  }

  .mode-nav {
    gap: 8px;
    margin-bottom: 16px;
  }

  .mode-link {
    width: 100%;
    justify-content: center;
  }

  .panel-header,
  .result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-price {
    font-size: 1rem;
  }

  .share-actions {
    width: 100%;
  }

  .share-actions > * {
    width: 100%;
  }
}
