:root {
  --ink: #101816;
  --muted: #5c6b64;
  --paper: #f6f4ef;
  --white: #fff;
  --tea: #1a4a46;
  --tea-2: #2d6a64;
  --line: rgba(16, 24, 22, 0.1);
  --gold: #c4a574;
  --font-d: "Fraunces", Georgia, serif;
  --font: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--ink); background: var(--paper); max-width: 100%; }
button, input { font: inherit; font-size: 16px; }
[hidden] { display: none !important; }

/* Gate */
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.gate-visual {
  background-color: #10221f;
  background-size: cover;
  background-position: center;
  color: #f4f1ea;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.gate-visual p { margin: 0 0 8px; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; opacity: 0.8; }
.gate-visual h1 { font-family: var(--font-d); font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 0; font-weight: 500; }
.gate-panel {
  display: flex;
  align-items: center;
  padding: 40px clamp(24px, 5vw, 64px);
  background: var(--white);
}
.gate-panel h2 { font-family: var(--font-d); font-weight: 500; margin: 0 0 8px; font-size: 1.8rem; }
.gate-panel .hint { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.gate-panel input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 16px;
}
.err { color: #b42318; font-size: 0.9rem; margin: 0 0 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 46px;
}
.btn-fill { background: var(--tea); color: #f6f4ef; width: 100%; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* App */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px clamp(20px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-d); font-size: 1.15rem; text-decoration: none; color: inherit; }
.brand small { display: block; font-family: var(--font); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tea); font-weight: 600; }
.top-links { display: flex; gap: 8px; flex-wrap: wrap; }

.hero {
  padding: 36px clamp(20px, 4vw, 48px) 8px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: end;
  max-width: 1200px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-d);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.05;
}
.hero .lede { margin: 0; color: var(--muted); max-width: 36rem; line-height: 1.55; font-size: 1.05rem; }
.hero-total {
  background: var(--tea);
  color: #f6f4ef;
  border-radius: 20px;
  padding: 22px 24px;
}
.hero-total span { display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.hero-total strong { font-family: var(--font-d); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 500; }

.shell { max-width: 1200px; margin: 0 auto; padding: 12px clamp(20px, 4vw, 48px) calc(128px + env(safe-area-inset-bottom, 0px)); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 28px; }

.h-sec {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 10px;
  font-weight: 600;
}

.table {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(16, 24, 22, 0.05);
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem minmax(12rem, auto);
  gap: 12px 16px;
  align-items: start;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row-copy { min-width: 0; }
.row h2 { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.row .why { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.idr {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  padding-top: 2px;
  line-height: 1.3;
}
.row-act {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.row a {
  color: var(--tea);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}
.tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tea);
  text-align: center;
  line-height: 1.3;
}

.sw {
  position: relative;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
}
.sw input { opacity: 0; width: 46px; height: 28px; margin: 0; cursor: pointer; position: absolute; inset: 0; z-index: 2; }
.sw i {
  display: block;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #d5ddd9;
  position: relative;
  pointer-events: none;
  transition: background 0.15s;
}
.sw i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}
.sw input:checked + i { background: var(--tea); }
.sw input:checked + i::after { transform: translateX(18px); }

.foot-note { color: var(--muted); font-size: 0.92rem; margin-top: 22px; max-width: 40rem; line-height: 1.5; }

.host-card {
  background: var(--white);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(16, 24, 22, 0.05);
}
.host-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.host-card .why { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.host-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.host-opts div {
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 16px;
}
.host-opts strong { display: block; margin-bottom: 4px; }
.host-opts span { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

.dock {
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  background: var(--ink);
  color: #f6f4ef;
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  z-index: 30;
}
.dock-copy { min-width: 0; }
.dock-copy span { display: block; font-size: 0.88rem; }
.dock-copy small { display: block; margin-top: 2px; opacity: 0.7; font-size: 0.75rem; }
.dock strong { font-family: var(--font-d); font-size: clamp(1.05rem, 4vw, 1.35rem); font-weight: 500; white-space: nowrap; }

@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; }
  .gate-visual { min-height: 28vh; padding: 24px; }
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
  }
  .row-act { grid-column: 1 / -1; justify-content: space-between; }
  .host-opts { grid-template-columns: 1fr; }
  .shell { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 16px;
    gap: 10px;
  }
  .top-links .btn { min-height: 40px; padding: 8px 12px; font-size: 0.85rem; }
  .hero { padding: 20px 16px 8px; }
  .hero h1 { font-size: clamp(1.85rem, 9vw, 2.6rem); }
  .hero .lede { font-size: 0.95rem; }
  .hero-total { padding: 16px 18px; }
  .shell { padding-left: 16px; padding-right: 16px; }
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .idr { text-align: left; }
  .toolbar .btn { flex: 1 1 calc(50% - 8px); min-width: 0; font-size: 0.85rem; padding: 10px 12px; }
  .dock {
    width: calc(100% - 16px);
    padding: 12px 14px;
    border-radius: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .dock strong { font-size: 1.05rem; margin-left: auto; }
  .gate-panel { padding: 28px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .host-card { padding: 16px; }
}
