.one-mode { grid-template-columns: minmax(0, 1fr); }
.one-mode .segmented-thumb { display: none; }
.preview-progress { display: block; width: 100%; height: 8px; accent-color: #1760b7; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

:root:has(.gate-stack) { scrollbar-gutter: auto; }

.gate-stack {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}

.gate-card {
  padding: 38px 34px 34px;
  text-align: center;
}

.gate-card .state-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
}

.gate-card .state-icon.is-blue {
  border-color: #dbe6ff;
  background: #f5f8ff;
  color: var(--accent);
}

.gate-card .state-icon.is-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.gate-card .state-icon.is-warn {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.gate-card .state-icon .icon { width: 24px; height: 24px; }

.gate-card h1 {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--ink);
}

.gate-card .sheet-desc {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.gate-card .example-box,
.gate-card .info-list {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
  text-align: start;
}

.gate-card .example-box { padding: 14px 16px; }

.gate-card .example-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.gate-card .example-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: 600 13.5px/1.3 ui-monospace, "Cascadia Code", "SF Mono", monospace;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.gate-card .example-host { min-width: 0; }

.gate-card .example-token {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f5f8ff;
  color: var(--accent);
  font-weight: 700;
}

.gate-card .info-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 15px;
  font-size: 13px;
}

.gate-card .info-list > div + div { border-top: 1px solid var(--line); }
.gate-card .info-list dt { flex: none; color: var(--muted); }

.gate-card .info-list dd {
  min-width: 0;
  color: var(--ink);
  font-weight: 650;
  text-align: end;
  overflow-wrap: anywhere;
}

.gate-stack .contact-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 19, 22, 0.04);
  text-align: start;
}

.gate-stack .contact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.gate-stack .contact-card-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.gate-stack .contact-card-title .icon {
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
}

.gate-stack .contact-card-sub {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
}

.gate-stack .contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gate-stack .contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
}

.gate-stack .contact-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gate-stack .contact-item-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.gate-stack .contact-item-val {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate-stack .contact-link {
  color: var(--accent);
  text-decoration: none;
}

.gate-stack .contact-link:hover { text-decoration: underline; }

.gate-stack .mini-copy {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.14s, color 0.14s, border-color 0.14s;
}

.gate-stack .mini-copy:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.gate-card .pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e9e8e2;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.gate-card .pill-danger { background: #fef2f2; color: #dc2626; }
.gate-card .pill-warning { background: var(--warning-bg); color: var(--warning); }

.gate-card .footnote {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.gate-contact-toast {
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  padding: 9px 16px;
}

.gate-stack .contact-grid[data-count="1"] { grid-template-columns: 1fr; }
.gate-stack .contact-grid[data-count="3"] .contact-item:last-child { grid-column: 1 / -1; }

@media (min-width: 521px) {
  .gate-stack :is(.contact-grid[data-count="1"] .contact-item, .contact-grid[data-count="3"] .contact-item:last-child) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
  }
  .gate-stack :is(.contact-grid[data-count="1"] .contact-item, .contact-grid[data-count="3"] .contact-item:last-child) .contact-item-top { display: contents; }
  .gate-stack :is(.contact-grid[data-count="1"] .contact-item, .contact-grid[data-count="3"] .contact-item:last-child) .contact-item-label { order: 1; white-space: nowrap; }
  .gate-stack :is(.contact-grid[data-count="1"] .contact-item, .contact-grid[data-count="3"] .contact-item:last-child) .contact-item-val { order: 2; text-align: end; }
  .gate-stack :is(.contact-grid[data-count="1"] .contact-item, .contact-grid[data-count="3"] .contact-item:last-child) .mini-copy { order: 3; }
}

@media (max-width: 520px) {
  .gate-card { padding: 30px 20px 26px; border-radius: 20px; }
  .gate-card h1 { font-size: 21px; }
  .gate-stack .contact-card { padding: 15px 16px; border-radius: 16px; }
  .gate-stack .contact-grid { grid-template-columns: 1fr; }
  .gate-stack .contact-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .gate-stack .contact-item-top { display: contents; }
  .gate-stack .contact-item-label { order: 1; white-space: nowrap; }
  .gate-stack .contact-item-val { order: 2; text-align: end; }
  .gate-stack .mini-copy { order: 3; }
}
