:root {
  color-scheme: dark;
  --bg: #0c1813;
  --surface: #14271e;
  --surface-2: #1d3428;
  --ink: #f4f7ef;
  --muted: #afc1b4;
  --line: #315040;
  --lime: #d9f08c;
  --lime-ink: #142012;
  --warm: #f0c483;
  --danger: #ff9d9d;
  --max: 47rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 95% 0, #244b35 0, transparent 30rem), var(--bg); font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--lime); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: white; color: black; padding: .7rem 1rem; border-radius: .6rem; }
.skip:focus { top: 1rem; }
.app-shell { width: min(100%, var(--max)); min-height: 100dvh; margin-inline: auto; position: relative; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.topbar { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 8; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.portal-brand { display: flex; gap: .7rem; align-items: center; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.03em; }
.portal-brand small { display: block; color: var(--lime); font-size: .65rem; letter-spacing: .17em; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; aspect-ratio: 1; background: var(--lime); color: var(--lime-ink); border-radius: .8rem; font-size: .75rem; letter-spacing: -.04em; }
.status-cluster { display: flex; gap: .65rem; align-items: center; }
.connection { color: var(--muted); font-size: .75rem; max-width: 8rem; text-align: right; }
.icon-button, .pill-button { border: 1px solid var(--line); background: var(--surface); min-height: 2.75rem; border-radius: 99px; cursor: pointer; }
.icon-button { min-width: 2.75rem; padding: .3rem; font-weight: 850; }
.pill-button { padding: .55rem .9rem; font-weight: 750; }
main { padding: 0 1.1rem 7rem; }
.view { display: none; animation: appear .24s ease-out; }
.view.active { display: block; }
.portal-hero { padding: clamp(2rem, 8vw, 4rem) .2rem 2rem; }
.eyebrow { color: var(--lime); text-transform: uppercase; letter-spacing: .15em; font-size: .7rem; font-weight: 850; margin: 0 0 .65rem; }
h1 { font-size: clamp(2.5rem, 13vw, 4.8rem); line-height: .95; letter-spacing: -.07em; margin: 0 0 1.2rem; }
h2 { font-size: 1.35rem; letter-spacing: -.035em; margin: 0 0 .65rem; }
h3 { margin: 0; }
p { overflow-wrap: anywhere; }
.portal-hero > p:last-child { color: var(--muted); font-size: 1.08rem; max-width: 34rem; }
.feature-grid, .signal-list { display: grid; gap: .85rem; }
.feature-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; text-align: left; padding: 1.15rem; border: 1px solid var(--line); background: var(--surface); border-radius: 1.4rem; cursor: pointer; }
.feature-card strong, .feature-card small { display: block; }
.feature-card strong { font-size: 1.18rem; }
.feature-card small { color: var(--muted); margin-top: .2rem; line-height: 1.35; }
.feature-zam { background: linear-gradient(135deg, #254833, #183126); }
.feature-icon { display: grid; place-items: center; width: 3rem; height: 3rem; background: var(--lime); color: var(--lime-ink); border-radius: 1rem; font-size: 1.4rem; font-weight: 850; }
.trust-card, .info-card, .gate-card, .signal-summary, .forecast-panel, .panel-card { border: 1px solid var(--line); border-radius: 1.35rem; background: var(--surface); padding: 1.2rem; }
.trust-card { margin-top: 1.2rem; color: var(--muted); }
.trust-card strong { color: var(--ink); }
.trust-card p:last-child { margin-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; padding: 2.25rem .1rem 1.4rem; }
.section-heading h1 { font-size: clamp(2.5rem, 12vw, 4.2rem); margin-bottom: 0; }
.gate-card:empty, .signal-summary:empty, .forecast-panel:empty { display: none; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; background: var(--surface); border-radius: 99px; margin: 1rem 0; }
.segmented button { border: 0; border-radius: 99px; min-height: 2.75rem; background: transparent; cursor: pointer; color: var(--muted); font-weight: 750; }
.segmented button[aria-selected="true"] { background: var(--lime); color: var(--lime-ink); }
.tab-panel { padding-block: .3rem 1rem; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; translate: -50% 0; width: min(100%, var(--max)); display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; padding: .5rem max(.7rem, env(safe-area-inset-right)) calc(.45rem + env(safe-area-inset-bottom)) max(.7rem, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(20px); z-index: 10; }
.bottom-nav button { border: 0; background: transparent; color: var(--muted); min-height: 3.4rem; border-radius: 1rem; cursor: pointer; }
.bottom-nav button span, .bottom-nav button small { display: block; }
.bottom-nav button span { font-size: 1.25rem; line-height: 1; }
.bottom-nav button small { font-size: .68rem; margin-top: .35rem; }
.bottom-nav button.active { color: var(--lime); background: var(--surface); }
dialog { width: min(calc(100% - 1.5rem), 35rem); max-height: calc(100dvh - 2rem); border: 1px solid var(--line); border-radius: 1.6rem; color: var(--ink); background: var(--surface); padding: 0; box-shadow: 0 1.5rem 5rem #000a; }
dialog::backdrop { background: #000b; backdrop-filter: blur(5px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { margin: 0; }
#modal-body { padding: 1.2rem; }
.form-stack { display: grid; gap: 1rem; }
.compact-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.static-row { cursor: default; align-items: center; }
.static-row:hover { transform: none; border-color: var(--line); }
.code-line, .invite-code { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
.invite-code { padding: .75rem; border-radius: .7rem; background: var(--surface-2); color: var(--ink); }
.team-chat { margin-top: 1rem; max-height: 18rem; }
.team-chat .bubble { display: grid; gap: .2rem; }
details > summary { cursor: pointer; font-weight: 800; }
label { display: grid; gap: .35rem; font-weight: 720; }
label small, .help-text { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: .8rem; padding: .75rem .8rem; min-height: 3rem; }
textarea { min-height: 6rem; resize: vertical; }
.check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .65rem; font-weight: 450; }
.check input { width: 1.2rem; min-height: 1.2rem; margin-top: .15rem; }
.primary, .secondary, .danger-button { width: 100%; min-height: 3.1rem; border-radius: 99px; padding: .65rem 1rem; font-weight: 800; cursor: pointer; }
.primary { border: 0; background: var(--lime); color: var(--lime-ink); }
.secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.danger-button { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.button-row { display: flex; gap: .65rem; flex-wrap: wrap; }
.button-row > * { flex: 1 1 9rem; }
.error { color: var(--danger); }
.success { color: var(--lime); }
.muted { color: var(--muted); }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(5rem + env(safe-area-inset-bottom)); translate: -50% 0; width: min(calc(100% - 2rem), 32rem); background: var(--ink); color: var(--bg); border-radius: 1rem; padding: .9rem 1rem; font-weight: 720; box-shadow: 0 .7rem 2rem #0008; }
.profile-card { border: 1px solid var(--line); border-radius: 1.7rem; overflow: hidden; background: var(--surface); touch-action: pan-y; transition: transform .18s ease, opacity .18s ease; }
.profile-visual { min-height: 20rem; display: flex; align-items: end; padding: 1.3rem; background: linear-gradient(140deg, #315b40, #182a20 65%); position: relative; }
.profile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-visual::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, #07100de8); }
.profile-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 8rem; color: color-mix(in srgb, var(--lime) 40%, transparent); font-weight: 900; }
.profile-title { position: relative; z-index: 1; text-shadow: 0 2px 10px #000; }
.profile-title h2 { font-size: 2rem; margin: 0; }
.profile-title p { margin: .2rem 0 0; }
.profile-body { padding: 1.15rem; }
.profile-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: .7rem; margin-top: 1rem; }
.prompt-card { display: grid; gap: .25rem; padding: .85rem; border-radius: 1rem; background: var(--surface-2); }
.prompt-card small { color: var(--muted); }
.match-list, .request-list, .team-list { display: grid; gap: .7rem; }
.list-row { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 1rem; padding: .9rem; cursor: pointer; }
.list-row strong, .list-row small { display: block; }
.list-row small { color: var(--muted); margin-top: .25rem; }
.chat-log { display: flex; flex-direction: column; gap: .6rem; max-height: 48dvh; overflow: auto; padding: .4rem; }
.bubble { max-width: 85%; padding: .65rem .8rem; border-radius: 1rem; background: var(--surface-2); }
.bubble.mine { align-self: end; background: var(--lime); color: var(--lime-ink); }
.chat-image { display: block; width: min(100%, 18rem); max-height: 22rem; margin-top: .4rem; border-radius: .65rem; object-fit: contain; }
.signal-card { border: 1px solid var(--line); background: var(--surface); border-radius: 1.2rem; padding: 1rem; }
.forecast-panel { margin-bottom: .85rem; background: linear-gradient(140deg, #274b37, var(--surface) 72%); }
.forecast-score { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.forecast-score strong { font-size: clamp(2.2rem, 12vw, 4rem); letter-spacing: -.06em; line-height: .9; }
.forecast-basis { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
.moderation-photo { width: 100%; max-height: 24rem; object-fit: contain; border-radius: 1rem; background: var(--bg); }
.signal-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.signal-meter { height: .65rem; border-radius: 99px; overflow: hidden; background: var(--bg); margin: .75rem 0; }
.signal-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--warm)); border-radius: inherit; }
.badge { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: .2rem .55rem; color: var(--muted); font-size: .75rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: 1.2rem; }
.info-card { margin-top: 1rem; color: var(--muted); }
.info-card h2 { color: var(--ink); }
.noscript { margin: 2rem; padding: 1rem; border: 2px solid var(--danger); }
@keyframes appear { from { opacity: 0; translate: 0 .35rem; } }
@media (min-width: 44rem) {
  main { padding-inline: 1.6rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid .feature-card:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view, .profile-card { animation: none; transition: none; }
}
