:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-soft: #f9f7f3;
  --surface-blue: #eef5fb;
  --text: #0f1822;
  --muted: #64748b;
  --line: #e3dfd6;
  --line-strong: #c5beac;
  --blue: #0b65b1;
  --blue-dark: #06477f;
  --red: #d91f2f;
  --red-dark: #a9101f;
  --gold: #f59e0b;
  --gold-dark: #b76e0b;
  --navy: #0f2a44;
  --navy-dark: #07182a;
  --success: #0f766e;
  --warning: #b45309;
  --x-black: #0f1419;
  --shadow: 0 14px 30px rgba(24, 39, 58, 0.08);
  --shadow-strong: 0 24px 50px rgba(15, 42, 68, 0.18);
  font-family: "Segoe UI", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

button:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 101, 177, 0.12);
}

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

.primary-button {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

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

.ghost-button {
  background: #fff;
  color: var(--blue-dark);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 38px;
  outline: none;
  padding: 0 11px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 101, 177, 0.13);
}

textarea {
  line-height: 1.6;
  min-height: 286px;
  padding: 12px;
  resize: vertical;
}

h1,
h2,
p,
figure {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

label {
  display: grid;
  gap: 7px;
}

label > span,
.section-kicker,
.load-message,
.condition-help,
.error-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.hero {
  background:
    radial-gradient(circle at 18% 0%, rgba(245, 158, 11, 0.18), transparent 55%),
    radial-gradient(circle at 90% 30%, rgba(11, 101, 177, 0.18), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 24px clamp(16px, 3vw, 36px) 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.04), transparent 60%);
  content: "";
  inset: 0;
  position: absolute;
  pointer-events: none;
}

.hero-inner {
  margin: 0 auto;
  max-width: 880px;
  position: relative;
  text-align: center;
}

.hero-brand {
  align-items: center;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  text-decoration: none;
}

.hero-logo {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.hero-brand-text {
  display: inline-block;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(28px, 5vw, 50px);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 auto 14px;
  max-width: 720px;
}

.hero-accent {
  background: linear-gradient(90deg, #ffd24a 0%, var(--gold) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(14px, 1.8vw, 17px);
  margin: 0 auto 28px;
}

.hero-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: var(--shadow-strong);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin: 0 auto;
  max-width: 640px;
  padding: 10px;
}

.hero-input input {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: clamp(15px, 1.6vw, 17px);
  font-weight: 500;
  height: 52px;
  min-height: 0;
  padding: 0 18px;
  width: 100%;
}

.hero-input input::placeholder {
  color: #9aa3b1;
}

.hero-input input:focus {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45);
  outline: none;
}

.hero-cta {
  align-items: center;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: var(--navy-dark);
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  gap: 8px;
  height: 52px;
  letter-spacing: 0.01em;
  min-height: 0;
  padding: 0 22px;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.hero-cta:hover {
  background: #ffb43a;
  border: none;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.hero-cta:active {
  transform: translateY(0);
}

.hero-meta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 18px auto 0;
}

.hero-sample {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 700;
  min-height: 32px;
  padding: 0 14px;
  transition: background 0.16s, border-color 0.16s;
}

.hero-sample:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.hero-tagline {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.hero-status {
  color: rgba(255, 215, 100, 0.95);
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 0;
  min-height: 20px;
}

.hero-steps {
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 36px auto 0;
  max-width: 720px;
  padding: 0;
}

.hero-steps li {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
  letter-spacing: 0.01em;
  padding: 12px 14px;
}

.step-num {
  align-items: center;
  background: var(--gold);
  border-radius: 999px;
  color: var(--navy-dark);
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 12px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.eyebrow,
.section-kicker {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  margin-bottom: 4px;
}

.app-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(340px, 0.88fr) minmax(480px, 1.28fr);
  margin: -32px auto 0;
  max-width: 1480px;
  padding: 0 clamp(14px, 3vw, 36px) 36px;
  position: relative;
  z-index: 2;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 18px;
}

.input-panel {
  grid-column: 1;
}

.calc-panel {
  grid-column: 2;
}

.results-panel,
.deck-panel {
  grid-column: 1 / -1;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.result-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.result-actions button {
  min-height: 38px;
  padding: 0 12px;
}

.share-cta {
  align-items: center;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--navy-dark);
  display: inline-flex;
  font-weight: 800;
  gap: 6px;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, transform 0.12s;
}

.share-cta:hover {
  background: #ffb43a;
  border-color: #ffb43a;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.share-cta:active {
  transform: translateY(0);
}

.share-cta-x {
  background: var(--x-black);
  border-color: var(--x-black);
  color: #ffffff;
}

.share-cta-x:hover {
  background: #2c3338;
  border-color: #2c3338;
  box-shadow: 0 6px 14px rgba(15, 20, 25, 0.32);
}

.share-cta:disabled {
  background: var(--line);
  border-color: var(--line);
  box-shadow: none;
  color: var(--muted);
  transform: none;
}

.summary-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.summary-strip div {
  background: linear-gradient(180deg, #fff, var(--surface-blue));
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
  padding: 12px;
}

.summary-strip span {
  color: var(--blue-dark);
  display: block;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.summary-strip small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.url-loader {
  display: none;
}

.load-message {
  min-height: 20px;
  margin-bottom: 10px;
}

.raw-deck-input {
  display: none;
}

.input-actions {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  margin-top: 12px;
}

.deck-image-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  overflow: hidden;
}

.deck-image-panel.hidden {
  display: none;
}

.deck-image-panel img {
  background: var(--surface-soft);
  display: block;
  width: 100%;
}

.deck-image-panel figcaption {
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
}

.share-preview {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 14px;
  overflow: hidden;
}

.share-preview.hidden {
  display: none;
}

.share-preview img {
  display: block;
  width: 100%;
}

.share-preview figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
}

.columns,
.results-grid,
.deck-grid {
  display: grid;
  gap: 12px;
}

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

.condition-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  margin: -2px 0 14px;
  overflow-x: auto;
  padding-bottom: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
}

.condition-tab {
  background: var(--surface-soft);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  color: var(--muted);
  flex: 0 0 auto;
  min-width: 142px;
}

.condition-tab.active {
  background: #fff;
  border-color: var(--blue);
  border-bottom-color: #fff;
  color: var(--blue-dark);
}

.condition-card,
.result-card,
.card-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.condition-card {
  display: none;
  gap: 13px;
  padding: 14px;
}

.condition-card.active {
  display: grid;
}

.condition-head,
.filter-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.condition-head {
  justify-content: space-between;
}

.condition-title {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.condition-kind-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 3px;
}

.enable-condition,
.disable-condition {
  align-items: center;
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.enable-condition input,
.disable-condition input {
  accent-color: var(--red);
  min-height: auto;
  width: auto;
}

.enable-condition span,
.disable-condition span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.disable-condition {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  justify-self: start;
  padding: 8px 10px;
}

.condition-selection {
  display: grid;
  gap: 8px;
}

.selected-condition-cards {
  align-items: flex-start;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 112px;
  padding: 10px;
}

.condition-token {
  position: relative;
  width: 70px;
}

.condition-token img {
  aspect-ratio: 3 / 4.2;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.condition-token-name {
  color: var(--muted);
  display: block;
  font-size: 10px;
  line-height: 1.25;
  margin-top: 4px;
  overflow-wrap: anywhere;
  text-align: center;
}

.condition-remove {
  background: var(--red);
  border-color: var(--red);
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  position: absolute;
  right: -7px;
  top: -7px;
  width: 24px;
}

.condition-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.picker-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.picker-tab {
  background: var(--surface-soft);
  color: var(--muted);
  flex: 0 0 auto;
  min-height: 33px;
}

.picker-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.picker-tabs.locked .picker-tab:not(.active) {
  display: none;
}

.quick-picks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(176px, 100%), 1fr));
  max-height: 268px;
  overflow: auto;
  padding-right: 2px;
}

.quick-picks button {
  background: #fff;
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: 34px 1fr auto;
  justify-items: start;
  min-height: 52px;
  padding: 6px 8px;
  text-align: left;
}

.pick-thumb,
.card-thumb {
  align-items: center;
  aspect-ratio: 3 / 4.2;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.pick-thumb {
  border-radius: 4px;
  width: 34px;
}

.pick-thumb img,
.card-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.pick-name {
  line-height: 1.3;
  min-width: 0;
}

.pick-name small,
.card-main small {
  color: var(--muted);
}

.pick-count,
.count-badge {
  background: #fff5d6;
  border: 1px solid #f1cf70;
  border-radius: 999px;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}

.result-card {
  display: grid;
  gap: 9px;
  min-height: 142px;
  padding: 16px;
}

.result-card.combined {
  background: linear-gradient(135deg, var(--blue-dark), #12385e);
  border-color: #12385e;
  color: #fff;
  grid-column: 1 / -1;
}

.result-card.combined .result-value {
  color: #fff5d6;
}

.result-card.combined .result-meta,
.result-card.combined .result-top span {
  color: #dce8f4;
}

.result-card.deck-validation {
  border-color: var(--warning);
  grid-column: 1 / -1;
}

.result-card.deck-validation .result-value {
  color: var(--warning);
}

.validation-list {
  color: var(--warning);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  padding-left: 20px;
}

.result-top {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.result-top strong,
.card-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-top span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
}

.result-value {
  color: var(--red);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.result-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.warning-text {
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}

.result-card.combined .warning-text {
  color: #fff5d6;
}

.deck-title {
  align-items: start;
}

.filter-row {
  flex: 1 1 280px;
  flex-wrap: wrap;
  justify-content: end;
  max-width: none;
}

.filter-row input {
  flex: 1 1 280px;
  min-width: 180px;
}

.filter-row select {
  flex: 0 0 150px;
}

.filter-row button {
  flex: 0 0 auto;
}

.deck-code-message {
  margin: -4px 0 12px;
}

.deck-code-message a {
  color: var(--blue-dark);
  font-weight: 800;
}

.official-search {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

.official-search-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1fr) 150px auto;
}

.official-search-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  max-height: 300px;
  overflow: auto;
}

.official-card-button {
  background: #fff;
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: 42px 1fr;
  justify-items: start;
  min-height: 64px;
  padding: 7px;
  text-align: left;
}

.official-card-button span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.regulation-ok {
  color: var(--success);
}

.deck-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  max-height: 720px;
  overflow: auto;
  padding-right: 2px;
}

.card-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px 1fr auto;
  min-height: 80px;
  padding: 8px;
}

.card-thumb {
  border-radius: 6px;
}

.card-thumb span {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.card-main {
  min-width: 0;
}

.card-main strong {
  display: block;
  line-height: 1.3;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

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

.card-row.is-zero {
  opacity: 0.58;
}

.count-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 30px 36px 30px;
}

.count-button {
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 800;
  min-height: 30px;
  padding: 0;
}

.count-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.count-value {
  background: #fff5d6;
  border: 1px solid #f1cf70;
  border-radius: 999px;
  color: #7a4d00;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 8px 0;
  text-align: center;
}

@media (max-width: 1080px) {
  .app-shell,
  .input-panel,
  .calc-panel,
  .results-panel,
  .deck-panel {
    grid-column: 1;
  }

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

  .hero-steps {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .hero {
    padding: 18px 16px 48px;
  }

  .hero-title {
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.25;
  }

  .hero-input {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .hero-input input {
    height: 48px;
    padding: 0 14px;
  }

  .hero-cta {
    height: 48px;
    justify-content: center;
    width: 100%;
  }

  .hero-meta-row {
    flex-direction: column;
    gap: 8px;
  }

  .panel {
    padding: 14px;
  }

  .input-actions {
    grid-template-columns: 1fr;
  }

  /* summary-strip は 3 列のまま、フォントを縮める */
  .summary-strip span {
    font-size: 26px;
  }

  .summary-strip small {
    font-size: 11px;
    line-height: 1.3;
  }

  .summary-strip div {
    padding: 10px 6px;
  }

  /* タイトル行（h2 と操作群）は縦に分ける */
  .panel-title,
  .deck-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  /* 結果エリアのボタン群: 2x2 グリッド（再計算/画像保存/Xシェア/その他で共有） */
  .result-actions {
    display: grid;
    flex-direction: initial;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    justify-content: stretch;
  }

  .result-actions button {
    max-width: none;
    min-width: 0;
    padding: 0 8px;
    width: auto;
  }

  /* カード一覧のフィルター行: 検索を 1 行目フル、2 行目に select + button */
  .filter-row {
    align-items: stretch;
    display: grid;
    flex: 1 1 auto;
    flex-wrap: initial;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    max-width: none;
    width: 100%;
  }

  .filter-row input {
    flex: initial;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .filter-row select {
    flex-basis: auto;
    min-width: 0;
  }

  .filter-row button {
    width: 100%;
  }

  /* 公式検索行も同じパターン */
  .official-search-row {
    grid-template-columns: 1fr 1fr;
  }

  .official-search-row input {
    grid-column: 1 / -1;
  }

  /* デッキ一覧は 1 カラム化、ただし card-row は横並びを維持 */
  .deck-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .summary-strip span {
    font-size: 24px;
  }

  .result-value {
    font-size: 30px;
  }

  .hero-brand-text {
    font-size: 13px;
  }

  .panel {
    padding: 12px;
  }

  .card-row {
    gap: 8px;
    padding: 6px;
  }

  .count-control {
    grid-template-columns: 28px 32px 28px;
    gap: 4px;
  }
}

.disclaimer-banner {
  background: #fff8e6;
  border: 1px solid #f0c674;
  border-radius: 8px;
  color: #5b4400;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 16px 0;
  padding: 12px 16px;
}

.disclaimer-banner strong {
  color: #8b5e00;
  margin-right: 6px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  margin: 48px auto 24px;
  max-width: 1200px;
  padding: 24px 24px 0;
}

.site-footer .footer-disclaimer {
  margin: 0 0 12px;
}

.site-footer .footer-disclaimer a {
  color: var(--blue);
}

.site-footer .footer-meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin: 16px 0 0;
  opacity: 0.8;
}

/* ---- Reference guides panel on the calculator page ---- */
.guides-panel {
  background: var(--surface-soft);
}

.guides-lede {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 18px;
}

.guides-link-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.guides-link-grid li {
  margin: 0;
}

.guides-link-grid a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 16px 16px 18px;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.guides-link-grid a:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(11, 101, 177, 0.12);
  transform: translateY(-2px);
}

.guides-link-tag {
  background: var(--blue);
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  width: max-content;
}

.guides-link-grid strong {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
}

.guides-link-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---- Satellite guide pages ---- */
.guide-shell {
  margin: 0 auto;
  max-width: 760px;
  padding: 32px clamp(16px, 4vw, 36px) 48px;
}

.guide-nav {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.guide-nav a {
  color: var(--blue);
  text-decoration: none;
}

.guide-nav a:hover {
  text-decoration: underline;
}

.guide-shell article > h1 {
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.guide-shell article > .guide-lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.guide-shell h2 {
  border-left: 4px solid var(--gold);
  font-size: 22px;
  margin-top: 36px;
  padding-left: 12px;
}

.guide-shell h3 {
  font-size: 17px;
  margin-top: 24px;
}

.guide-shell p,
.guide-shell li {
  font-size: 15.5px;
  line-height: 1.85;
}

.guide-shell ul,
.guide-shell ol {
  padding-left: 22px;
}

.guide-shell code {
  background: var(--surface-soft);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 6px;
}

.guide-cta-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-radius: 12px;
  color: #ffffff;
  margin: 36px 0 28px;
  padding: 24px 22px;
  text-align: center;
}

.guide-cta-card strong {
  display: block;
  font-size: 19px;
  margin-bottom: 6px;
}

.guide-cta-card p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  margin: 0 0 16px;
}

.guide-cta-card a {
  background: var(--gold);
  border-radius: 999px;
  color: var(--navy-dark);
  display: inline-block;
  font-weight: 900;
  padding: 10px 24px;
  text-decoration: none;
  transition: background 0.16s, transform 0.12s;
}

.guide-cta-card a:hover {
  background: #ffb43a;
  transform: translateY(-1px);
}

.guide-table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
}

.guide-table th,
.guide-table td {
  border: 1px solid var(--line);
  font-size: 14px;
  padding: 8px 12px;
  text-align: left;
}

.guide-table th {
  background: var(--surface-soft);
  font-weight: 800;
}

.guide-related {
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 20px;
}

.guide-related h2 {
  border-left: none;
  padding-left: 0;
}

.guide-related ul {
  list-style: none;
  padding: 0;
}

.guide-related li {
  margin: 8px 0;
}

.guide-related a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.guide-related a:hover {
  text-decoration: underline;
}
