@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/MonaSans.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f7f9fd;
  --surface: #ffffff;
  --surface-soft: #eef3fb;
  --ink: #0e1526;
  --muted: #56617b;
  --faint: var(--muted);
  --line: #dfe6f1;
  --line-strong: #cdd7e7;
  --night: #0a0e2b;
  --night-muted: #a7b1de;
  --brand: #1a63d6;
  --brand-deep: #124ba9;
  --cyan: #35c5ea;
  --green: #0e9f6e;
  --amber: #8a5a14;
  --red: #a33443;
  --gradient: linear-gradient(105deg, #35c5ea, #24a6fa 40%, #5d70e8);
  --font: "Mona Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-small: 10px;
  --shadow: 0 18px 48px -30px rgba(15, 29, 65, 0.36);
  --shadow-small: 0 3px 12px -7px rgba(15, 29, 65, 0.28);
  --wrap: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(70% 42% at 95% -8%, rgba(53, 197, 234, 0.12), transparent 70%),
    var(--paper);
  font-family: var(--font);
  font-weight: 440;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button,
input,
select,
textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  z-index: 100;
  top: -60px;
  left: 12px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

:where(a, button, input, textarea, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(223, 230, 241, 0.86);
  background: rgba(247, 249, 253, 0.88);
  backdrop-filter: blur(15px) saturate(1.3);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand img { width: 34px; height: 34px; object-fit: contain; }
.topbar nav { display: flex; gap: 20px; margin-left: auto; color: var(--muted); font-size: 0.91rem; }
.topbar nav a { min-height: 44px; display: inline-flex; align-items: center; }
.topbar nav a:hover { color: var(--ink); }
.topbar__account { display: inline-flex; align-items: center; gap: 8px; }
.topbar__account::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 620;
  line-height: 1.15;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--brand); box-shadow: 0 12px 24px -15px rgba(26, 99, 214, 0.85); }
.button--primary:hover { background: var(--brand-deep); }
.button--secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-small); }
.button--secondary:hover { background: var(--surface-soft); border-color: var(--brand); }
.button--quiet { min-height: 42px; padding: 8px 13px; color: var(--brand-deep); background: transparent; border-color: transparent; }
.button--danger { color: #fff; background: var(--red); }
.button:disabled { cursor: wait; opacity: 0.58; transform: none; }

.mono-label,
.eyebrow {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 17px; }
.eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 4px; background: var(--gradient); }

.page-main {
  /* Route changes focus main for screen readers; keep that context move quiet while
     the existing :focus-visible rule continues to mark keyboard interactions. */
  padding: 48px max(20px, calc((100vw - var(--wrap)) / 2)) 88px;
  outline: none;
}
.page-main--narrow { padding-top: 56px; }
.page-main__head { max-width: 700px; margin-bottom: 30px; }
.page-main h1 { margin: 0 0 14px; font-size: clamp(2.6rem, 6vw, 4.7rem); font-weight: 790; line-height: 0.99; letter-spacing: -0.06em; text-wrap: balance; }
.page-main h2 { margin: 0 0 11px; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.08; letter-spacing: -0.04em; }
.page-main h3 { margin: 0 0 7px; font-size: 1.07rem; line-height: 1.2; }
.lede { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.28rem); line-height: 1.6; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-small);
}
.notice strong { display: block; margin-bottom: 2px; color: var(--ink); }
.notice p { margin: 0; }
.notice--success { border-left-color: var(--green); }
.notice--warning { border-left-color: var(--amber); }
.notice--error { color: #71303a; border-left-color: var(--red); }
.notice--error strong { color: var(--red); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}
.card p { margin: 0; color: var(--muted); }
.card__label { display: block; margin-bottom: 14px; color: var(--faint); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.03em; text-transform: uppercase; }

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 34px;
}
.account-hero__mark {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(231, 239, 252, 0.9));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.account-hero__mark img { width: min(216px, 66%); height: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 48px 0 18px; }
.section-heading p { max-width: 560px; margin: 0; color: var(--muted); }
.section-heading h2 { margin: 0; }

.host-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.host-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
button.host-card:hover,
button.host-card[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 14px 32px -22px rgba(26, 99, 214, 0.72); transform: translateY(-1px); }
.host-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.host-card__badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; color: var(--brand-deep); background: #eaf2ff; border-radius: 999px; font-family: var(--mono); font-size: 0.68rem; }
.host-card__copy { color: var(--muted); font-size: 0.91rem; }
.host-card__status { color: var(--faint); font-family: var(--mono); font-size: 0.69rem; }
.host-card.is-saving { border-color: var(--brand); box-shadow: 0 14px 32px -22px rgba(26, 99, 214, 0.72); }
.host-choice-feedback { margin: 14px 0 0; color: var(--muted); font-size: 0.86rem; }
.host-choice-feedback.notice { margin-bottom: 0; }
.host-choice-feedback .button { margin-top: 12px; }

.setup-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.setup-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}
.setup-item__number { display: grid; place-items: center; width: 30px; height: 30px; color: var(--brand-deep); background: #eaf2ff; border-radius: 50%; font-family: var(--mono); font-size: 0.72rem; }
.setup-item.is-done .setup-item__number { color: #fff; background: var(--green); }
.setup-item strong { display: block; }
.setup-item span { color: var(--muted); font-size: 0.88rem; }
.resources-section { margin-top: 34px; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.panel > p { color: var(--muted); }
.panel--dark { color: var(--on-night); background: var(--night); border-color: var(--night); }
.panel--dark p { color: var(--night-muted); }
.panel--dark h2, .panel--dark h3 { color: #fff; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 0.87rem; font-weight: 620; }
.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus,
.field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 99, 214, 0.12); outline: 0; }
.field__hint { color: var(--faint); font-size: 0.78rem; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0; color: var(--muted); font-size: 0.88rem; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.form-actions .form-status { color: var(--muted); font-size: 0.83rem; }

.error-page { max-width: 620px; margin: 12vh auto 0; text-align: center; }
.error-page h1 { margin-bottom: 16px; }
.error-page p { color: var(--muted); }

.loading-shell { max-width: var(--wrap); margin-inline: auto; }
.loading-shell__grid { margin-top: 34px; }
.loading-shell__hint { margin: 18px 0 0; color: var(--faint); font-size: 0.82rem; }
.loading-panel { display: grid; gap: 14px; min-height: 220px; align-content: start; }
.loading-skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-soft), #f8fbff 50%, var(--surface-soft)); background-size: 200% 100%; animation: loading-shimmer 1.6s ease-in-out infinite; }
.loading-skeleton--label { width: 30%; height: 12px; }
.loading-skeleton--title { width: 72%; height: 32px; }
.loading-skeleton--copy { width: 94%; height: 14px; }
.loading-skeleton--copy-short { width: 64%; }
.loading-skeleton--button { width: 130px; height: 46px; margin-top: 8px; border-radius: 999px; }
@keyframes loading-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.danger-zone { margin-top: 44px; border-color: #e5bec5; }
.danger-zone h2 { color: var(--red); }
.danger-zone p { color: #71303a; }
.danger-zone .field { max-width: 360px; }

.site-footer { padding: 26px 0 34px; color: #aeb8d7; background: var(--night); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.site-footer .brand { color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 42px; }
.site-footer nav a:hover { color: #fff; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; margin-top: 21px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: #7784ab; font-size: 0.75rem; }

@media (min-width: 761px) {
  /* Keep the first sign-in action in the initial desktop viewport without
     changing the mobile reading rhythm or the activation controls. */
  .page-main { padding-top: 32px; }
  .page-main__head { margin-bottom: 20px; }
  .panel--dark .hero-actions { margin-top: 16px; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, var(--wrap)); }
  .topbar__inner { gap: 12px; min-height: 64px; }
  .topbar nav { gap: 9px; margin-left: auto; }
  .topbar nav a { font-size: 0.78rem; }
  .topbar__account-label { display: none; }
  .page-main { padding-top: 34px; padding-inline: 14px; }
  .account-hero { grid-template-columns: 1fr; gap: 20px; }
  .account-hero__mark { min-height: 180px; order: -1; }
  .account-hero__mark img { width: 150px; }
  .card-grid, .host-grid, .split-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .setup-item { grid-template-columns: 30px minmax(0, 1fr); }
  .setup-item .button { grid-column: 2; justify-self: start; }
  .site-footer__inner { align-items: flex-start; }
}

@media (max-width: 460px) {
  .topbar .brand { font-size: 1rem; }
  .topbar .brand img { width: 30px; height: 30px; }
  .topbar nav a:not(:last-child) { display: none; }
  .topbar__account { min-width: 34px; justify-content: center; }
  .topbar__account::before { width: 9px; height: 9px; }
  .hero-actions, .form-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button, .form-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .button:hover, button.host-card:hover { transform: none; }
  .loading-skeleton { animation: none; }
}
