:root {
  color-scheme: dark;
  --ink-950: #080e22;
  --ink-900: #0d1530;
  --ink-850: #111a35;
  --ink-800: #172142;
  --ink-700: #26345c;
  --ink-500: #7180a9;
  --ink-300: #b4bfdc;
  --paper: #f3f0e9;
  --white: #fbfaf7;
  --amber: #f4b65c;
  --amber-deep: #d78438;
  --sunset: #ee7b65;
  --green: #73d29b;
  --green-bg: rgba(71, 185, 119, 0.16);
  --amber-bg: rgba(244, 182, 92, 0.16);
  --gray-bg: rgba(173, 185, 213, 0.13);
  --line: rgba(192, 204, 239, 0.13);
  --shadow: 0 22px 70px rgba(1, 4, 18, 0.33);
  --radius-lg: 28px;
  --radius-md: 19px;
  --radius-sm: 13px;
}

/* FantaBadr and profile photos */
.optional-label { color: var(--muted, #9ba6bf); font-weight: 400; }
.photo-picker { display: flex; gap: 1rem; align-items: center; }
.photo-preview, .avatar, .presence-avatar, .team-avatar, .action-avatar, .quotation-avatar { flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: rgba(255,255,255,.09); object-fit: cover; }
.photo-preview { width: 88px; height: 88px; display: grid; place-items: center; border: 1px dashed rgba(244,182,92,.65); color: #f4b65c; font-size: 2rem; }
.photo-preview-image { width: 100%; height: 100%; object-fit: cover; }
.presence-person { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.presence-avatar { width: 26px; height: 26px; display: grid; place-items: center; font-size: .7rem; }
.avatar-fallback { color: #f4b65c; font-weight: 800; }
.fanta-content { display: grid; gap: 1rem; margin-top: 1rem; }
.fanta-rules { padding: 0; overflow: hidden; }
.fanta-rules summary { cursor: pointer; padding: 1rem 1.1rem; font-weight: 800; color: #f4b65c; }
.rules-grid { display: grid; gap: .65rem; padding: 0 1.1rem 1.1rem; }
.rules-grid p { margin: 0; line-height: 1.45; }
.phase-banner, .winner-card { padding: 1.1rem 1.2rem; border-radius: 20px; background: linear-gradient(135deg, rgba(244,182,92,.2), rgba(112,84,190,.2)); border: 1px solid rgba(244,182,92,.35); display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.phase-banner span, .winner-card span { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; color: #f4b65c; }
.winner-card { flex-direction: column; text-align: center; padding: 1.6rem; }
.winner-card strong { font-size: 1.8rem; }
.winner-card b { color: #f4b65c; }
.budget-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; padding: 1rem; }
.budget-card > div { display: grid; gap: .2rem; }
.budget-card small { color: var(--muted, #9ba6bf); }
.budget-card strong { font-size: 1.25rem; }
.budget-card .available strong { color: #78d6a0; }
.budget-card ul { grid-column: 1 / -1; margin: .25rem 0 0; padding-left: 1.2rem; font-size: .85rem; }
.refund-note { grid-column: 1 / -1; margin: 0; color: #78d6a0; font-size: .82rem; }
.fratello-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.fratello-card { overflow: hidden; border-radius: 22px; background: rgba(13,21,48,.92); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.fratello-photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 0; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(145deg, #26345c, #141d3c); }
img.fratello-photo { object-fit: cover; }
.fratello-body, .preview-card .fratello-name { padding: .85rem; }
.fratello-name { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; }
.fratello-name strong { min-width: 0; overflow-wrap: anywhere; }
.fratello-name span { color: var(--muted, #9ba6bf); font-size: .68rem; text-align: right; }
.bid-ranking { margin: .7rem 0; padding-left: 1.25rem; font-size: .78rem; }
.bid-ranking li { padding: .18rem 0; }
.bid-ranking li span { margin-right: .3rem; }
.bid-ranking .is-yours { color: #f4b65c; }
.bid-ranking .no-bids { list-style: none; margin-left: -1.25rem; color: var(--muted, #9ba6bf); }
.minimum-bid, .bid-form label, .bid-result { font-size: .72rem; }
.minimum-bid { color: var(--muted, #9ba6bf); }
.bid-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem; }
.bid-control input { min-width: 0; padding: .6rem; }
.bid-control .button { padding: .6rem .7rem; }
.bid-result.lost { color: #78d6a0; }
.fanta-section { display: grid; gap: .7rem; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.subheading h3 { margin: 0; }
.team-strip { display: flex; gap: .65rem; overflow-x: auto; padding: .2rem 0 .5rem; }
.team-person { flex: 0 0 76px; text-align: center; display: grid; justify-items: center; gap: .25rem; font-size: .7rem; }
.team-avatar { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.2rem; }
.team-person small { color: #f4b65c; }
.leaderboard-stack, .action-feed { display: grid; gap: .65rem; }
.leaderboard-card, .action-card, .action-form { padding: .9rem; border-radius: 18px; background: rgba(13,21,48,.88); border: 1px solid rgba(255,255,255,.09); }
.leaderboard-card.is-leading { border-color: rgba(244,182,92,.55); }
.leaderboard-heading { display: flex; align-items: center; gap: .7rem; }
.leaderboard-heading > b { margin-left: auto; color: #f4b65c; font-size: 1.2rem; }
.leaderboard-heading div { display: grid; }
.leaderboard-heading small { color: var(--muted, #9ba6bf); }
.leaderboard-rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(244,182,92,.15); color: #f4b65c; font-weight: 800; }
.trade-photos { display: flex; }
.trade-photos .action-avatar + .action-avatar { margin-left: -.45rem; }
.quotation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.quotation-grid article { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: .45rem; padding: .55rem; border-radius: 14px; background: rgba(255,255,255,.05); font-size: .75rem; }
.quotation-avatar { width: 34px; height: 34px; display: grid; place-items: center; }
.quotation-grid strong { color: #f4b65c; }
.action-form { display: grid; gap: .55rem; }
.action-target { display: flex; align-items: center; gap: .6rem; }
.action-target div { display: grid; }
.action-target small { color: var(--muted, #9ba6bf); }
.action-target b { margin-left: auto; font-size: 1.3rem; color: #f4b65c; }
.action-avatar { width: 44px; height: 44px; display: grid; place-items: center; }
.action-card p { margin: .65rem 0; }
.action-card.is-rejected { opacity: .6; }
.action-card.is-rejected p { text-decoration: line-through; }
.action-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted, #9ba6bf); font-size: .72rem; }
.action-meta .mini-action { margin-left: auto; }

@media (max-width: 380px) {
  .tab-nav { overflow-x: auto; justify-content: flex-start; }
  .tab-button { flex: 0 0 25%; min-width: 82px; }
  .fratello-grid { grid-template-columns: 1fr; }
}

/* V2 presence and entry flow */
.entry-chooser { display: grid; gap: 1rem; }
.entry-choice { min-height: 112px; padding: 1.25rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .055); color: var(--paper); text-align: left; cursor: pointer; }
.entry-choice strong, .entry-choice span { display: block; }
.entry-choice strong { margin-bottom: .35rem; font-size: 1.15rem; }
.entry-choice span { color: var(--ink-300); }
.entry-choice:hover { border-color: var(--amber); transform: translateY(-2px); }
.tab-lock { display: block; font-size: .58rem; line-height: 1; color: var(--ink-300); }
.tab-button.is-locked { opacity: .55; cursor: not-allowed; }
.slot-table-wrap, .presence-matrix-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.slot-table, .presence-matrix { width: 100%; min-width: 320px; border-collapse: collapse; table-layout: fixed; }
.slot-table th, .slot-table td, .presence-matrix th, .presence-matrix td { padding: .55rem .2rem; border-bottom: 1px solid var(--line); text-align: center; }
.slot-table th { font-size: .72rem; }
.slot-table th small { display: block; margin-top: .25rem; color: var(--ink-300); font-size: .55rem; }
.slot-table input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.slot-table label { position: relative; display: grid; place-items: center; width: 38px; height: 38px; margin: auto; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.slot-table label span { opacity: 0; color: var(--ink-950); font-weight: 900; }
.slot-table label.is-checked { background: var(--amber); border-color: var(--amber); }
.slot-table label.is-checked span { opacity: 1; }
.presence-matrix-wrap { margin-top: 1rem; }
.presence-matrix { table-layout: auto; }
.presence-matrix th:first-child { min-width: 120px; padding-left: .75rem; text-align: left; }
.presence-matrix thead th:not(:first-child) { width: 40px; font-size: .63rem; white-space: nowrap; }
.presence-matrix tbody th { font-size: .82rem; }
.presence-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: var(--ink-950); font-weight: 900; }
.button-danger { background: transparent; color: #ff9b98; border: 1px solid rgba(255, 107, 103, .5); }
@media (min-width: 700px) { .entry-chooser { grid-template-columns: 1fr 1fr; } }

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-950);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 87% 4%, rgba(107, 83, 156, 0.23), transparent 25rem),
    radial-gradient(circle at 11% 53%, rgba(20, 84, 117, 0.16), transparent 24rem),
    var(--ink-950);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button,
a,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
label,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(244, 182, 92, 0.8);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.gate-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem 1.25rem;
  isolation: isolate;
}

.gate-art {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0;
  left: 0;
  height: min(46vw, 330px);
  min-height: 180px;
  opacity: 0.82;
  pointer-events: none;
}

.gate-art svg,
.mountain-header svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mountain-back {
  fill: #151f41;
}

.mountain-front {
  fill: #0e1732;
}

.mountain-snow {
  fill: rgba(244, 182, 92, 0.54);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(28, 42, 82, 0.92), rgba(15, 24, 52, 0.94));
  box-shadow: var(--shadow);
}

.gate-card {
  width: min(100%, 465px);
  padding: clamp(2rem, 8vw, 4.5rem) clamp(1.4rem, 7vw, 3.8rem) 2.2rem;
  text-align: center;
}

.eyebrow,
.card-kicker {
  margin: 0 0 0.55rem;
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.gate-card h1,
.site-header h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

.gate-card h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(3.2rem, 16vw, 5.7rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.title-dot {
  color: var(--sunset);
}

.gate-copy {
  max-width: 31rem;
  margin: 1.3rem auto 2rem;
  color: var(--ink-300);
  font-size: 0.98rem;
}

.field-label {
  display: block;
  margin-bottom: 0.48rem;
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(181, 196, 238, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(7, 13, 32, 0.44);
  color: var(--white);
}

input,
select {
  min-height: 48px;
  padding: 0.65rem 0.85rem;
}

textarea {
  min-height: 92px;
  padding: 0.8rem 0.85rem;
  resize: vertical;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 17px) 21px, calc(100% - 11px) 21px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 2rem;
}

option {
  background: var(--ink-800);
  color: var(--white);
}

input::placeholder,
textarea::placeholder {
  color: #7f8cac;
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(244, 182, 92, 0.75);
  background-color: rgba(10, 17, 39, 0.68);
  box-shadow: 0 0 0 4px rgba(244, 182, 92, 0.07);
  outline: none;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--amber);
  color: #30200e;
  box-shadow: 0 10px 24px rgba(244, 182, 92, 0.18);
}

.button-primary:hover {
  background: #ffca75;
  box-shadow: 0 13px 30px rgba(244, 182, 92, 0.28);
}

.button-quiet {
  border-color: rgba(181, 196, 238, 0.2);
  background: transparent;
  color: var(--ink-300);
}

.button-quiet:hover {
  border-color: rgba(244, 182, 92, 0.5);
  color: var(--white);
}

.button-arrow {
  font-size: 1.1rem;
}

.form-error {
  margin: 0.85rem 0 0;
  color: #ffaf9f;
  font-size: 0.82rem;
}

.site-header {
  position: relative;
  overflow: visible;
  border-bottom: 1px solid rgba(192, 204, 239, 0.08);
  background: linear-gradient(180deg, rgba(14, 22, 49, 0.97), rgba(12, 19, 42, 0.84));
}

.header-inner {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 1180px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 1.55rem 1.1rem 0.75rem;
}

.brand-lockup h1 {
  max-width: 17rem;
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.brand-lockup .eyebrow {
  max-width: 20rem;
  margin-bottom: 0.5rem;
  color: var(--ink-300);
}

.logout-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-300);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: lowercase;
}

.logout-link:hover {
  color: var(--amber);
}

.mountain-header {
  height: 88px;
  margin-top: -0.7rem;
  opacity: 0.9;
  pointer-events: none;
}

.tab-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.15rem;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--ink-900);
  box-shadow: 0 -1px 0 rgba(192, 204, 239, 0.07);
}

.tab-button {
  position: relative;
  display: grid;
  min-height: 64px;
  place-items: center;
  gap: 0.18rem;
  border: 0;
  background: transparent;
  color: #8593b6;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tab-button::before {
  position: absolute;
  top: 0;
  right: 18%;
  left: 18%;
  height: 3px;
  border-radius: 0 0 5px 5px;
  background: transparent;
  content: "";
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--white);
  background: rgba(107, 124, 185, 0.1);
}

.tab-button.is-active::before {
  background: var(--amber);
}

.tab-icon {
  display: block;
  color: var(--amber);
  font-size: 1.05rem;
  line-height: 1;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.content-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.8rem 1.1rem 3.5rem;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading,
.subsection-heading,
.form-intro,
.transport-heading,
.car-heading,
.car-meta,
.night-card-header,
.seeking-row,
.participant-topline,
.participant-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading {
  align-items: end;
  margin: 0 0 1.35rem;
}

.section-heading h2,
.subsection-heading h3,
.form-intro h3 {
  margin: 0;
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.section-heading h2 {
  font-size: clamp(2rem, 9vw, 3.1rem);
  line-height: 0.98;
}

.heading-mark {
  flex: 0 0 auto;
  color: rgba(244, 182, 92, 0.65);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.small-mark {
  font-size: 1.2rem;
  line-height: 1;
}

.form-card {
  padding: 1.25rem;
}

.form-intro {
  align-items: center;
  margin-bottom: 1.45rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.form-intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.7rem;
}

.form-intro h3 {
  font-size: 1.45rem;
}

.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
}

.text-button:hover {
  color: var(--white);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

.identity-link-row {
  margin-top: 0.25rem;
  text-align: center;
}

.identity-flow {
  border: 1px solid rgba(244, 182, 92, 0.24);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(244, 182, 92, 0.055);
}

.identity-flow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.identity-flow-heading h4 {
  margin: 0;
  color: var(--white);
  font-size: 1rem;
}

.identity-flow .form-actions {
  margin-top: 0.9rem;
}

.compact-grid {
  gap: 0.9rem;
}

.transport-leg-fields {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.full-span {
  min-width: 0;
}

.fieldset-reset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-help {
  margin: 0.45rem 0 0;
  color: var(--ink-500);
  font-size: 0.73rem;
}

.segmented {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(181, 196, 238, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(7, 13, 32, 0.35);
}

.segment {
  position: relative;
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 0.4rem 0.25rem;
  color: var(--ink-300);
  font-size: clamp(0.67rem, 2.5vw, 0.84rem);
  font-weight: 800;
  text-align: center;
}

.segment + .segment {
  border-left: 1px solid rgba(181, 196, 238, 0.14);
}

.segment input,
.choice-card input,
.night-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.segment:has(input:checked) {
  color: var(--white);
  background: rgba(244, 182, 92, 0.16);
}

.night-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.night-option {
  position: relative;
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(181, 196, 238, 0.17);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  background: rgba(7, 13, 32, 0.31);
  color: var(--ink-300);
}

.night-option:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 182, 92, 0.45);
}

.night-option:has(input:checked) {
  border-color: rgba(244, 182, 92, 0.65);
  background: rgba(244, 182, 92, 0.12);
  color: var(--white);
}

.night-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.night-check {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid rgba(181, 196, 238, 0.35);
  border-radius: 8px;
  color: #3a2a15;
  font-size: 0.8rem;
  font-weight: 900;
}

.night-option:has(input:checked) .night-check {
  border-color: var(--amber);
  background: var(--amber);
}

.night-option:has(input:checked) .night-check::before {
  content: "✓";
}

.night-copy {
  min-width: 0;
}

.night-copy strong,
.night-copy small {
  display: block;
}

.night-copy strong {
  overflow: hidden;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.night-copy small {
  margin-top: 0.15rem;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.transport-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.choice-card {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(181, 196, 238, 0.17);
  border-radius: var(--radius-sm);
  padding: 0.72rem;
  background: rgba(7, 13, 32, 0.31);
  color: var(--ink-300);
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 182, 92, 0.45);
}

.choice-card.is-checked {
  border-color: rgba(244, 182, 92, 0.7);
  background: rgba(244, 182, 92, 0.12);
  color: var(--white);
}

.choice-icon,
.mini-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 11px;
  background: rgba(244, 182, 92, 0.12);
  color: var(--amber);
  font-size: 1.1rem;
  font-weight: 800;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  font-size: 0.77rem;
}

.choice-card small {
  margin-top: 0.18rem;
  color: var(--ink-500);
  font-size: 0.68rem;
  line-height: 1.2;
}

.transport-fields {
  border: 1px solid rgba(244, 182, 92, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(244, 182, 92, 0.055);
}

.transport-heading {
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.95rem;
}

.transport-heading h4 {
  margin: 0;
  color: var(--white);
  font-size: 0.92rem;
}

.transport-heading p {
  margin: 0.2rem 0 0;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.subsection,
.ride-seeking-section {
  margin-top: 2.8rem;
}

.subsection-heading {
  align-items: end;
  margin-bottom: 1rem;
}

.subsection-heading h3 {
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  line-height: 1;
}

.count-label {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: 0.74rem;
}

.participant-stack,
.night-stack,
.car-stack {
  display: grid;
  gap: 0.75rem;
}

.participant-card,
.night-card,
.car-card,
.seeking-card,
.empty-state,
.cars-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(20, 31, 65, 0.72);
  box-shadow: 0 13px 34px rgba(1, 4, 18, 0.14);
}

.participant-card {
  padding: 1rem;
}

.participant-topline {
  align-items: center;
}

.participant-name {
  min-width: 0;
  margin: 0;
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.participant-meta,
.transport-hint,
.participant-note {
  color: var(--ink-300);
  font-size: 0.75rem;
}

.participant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.night-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(244, 182, 92, 0.22);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: #f3c983;
  font-size: 0.65rem;
}

.transport-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.72rem;
  color: var(--ink-300);
}

.transport-hint .hint-icon {
  color: var(--amber);
  font-size: 0.95rem;
}

.participant-note {
  margin: 0.72rem 0 0;
  color: var(--ink-500);
  font-style: italic;
}

.participant-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(192, 204, 239, 0.08);
}

.mini-action {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(181, 196, 238, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: transparent;
  color: var(--ink-300);
  font-size: 0.68rem;
  font-weight: 800;
}

.mini-action:hover {
  background: rgba(244, 182, 92, 0.15);
  color: var(--amber);
}

.mini-action.delete:hover {
  background: rgba(238, 123, 101, 0.14);
  color: #ff9d8b;
}

.empty-state {
  padding: 1.55rem 1.1rem;
  color: var(--ink-300);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 0.65rem;
  place-items: center;
  border-radius: 14px;
  background: rgba(244, 182, 92, 0.11);
  color: var(--amber);
  font-size: 1.35rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.82rem;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.counter-card {
  min-height: 105px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  background: rgba(20, 31, 65, 0.72);
}

.counter-card span:last-child {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-300);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15;
}

.counter-number {
  display: block;
  color: var(--white);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.counter-confirmed {
  border-top: 3px solid var(--green);
}

.counter-maybe {
  border-top: 3px solid var(--amber);
}

.counter-no {
  border-top: 3px solid #8994ad;
}

.night-card {
  padding: 1.15rem;
}

.night-card-header {
  align-items: end;
}

.night-card h3 {
  margin: 0;
  color: var(--white);
  font-size: 1.08rem;
  letter-spacing: -0.025em;
}

.night-date {
  margin: 0.25rem 0 0;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
}

.occupancy-copy {
  flex: 0 0 auto;
  color: var(--ink-300);
  font-size: 0.73rem;
  text-align: right;
}

.occupancy-copy strong {
  display: block;
  color: var(--white);
  font-size: 0.92rem;
}

.occupancy-track {
  position: relative;
  display: flex;
  height: 12px;
  margin: 1.2rem 0 0.6rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(6, 12, 30, 0.65);
}

.occupancy-fill {
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #9ddb89);
}

.occupancy-fill + .occupancy-fill {
  border-radius: 0 999px 999px 0;
}

.occupancy-fill.occupancy-maybe {
  border-left: 1px solid rgba(8, 14, 34, 0.45);
  background: linear-gradient(90deg, rgba(115, 210, 155, 0.42), rgba(157, 219, 137, 0.5));
}

.occupancy-track.near-full .occupancy-confirmed {
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
}

.occupancy-track.near-full .occupancy-maybe {
  background: linear-gradient(90deg, rgba(215, 132, 56, 0.5), rgba(244, 182, 92, 0.58));
}

.occupancy-track.over-capacity {
  outline: 2px solid rgba(238, 123, 101, 0.72);
  outline-offset: 3px;
}

.occupancy-track.over-capacity .occupancy-confirmed {
  background: linear-gradient(90deg, #e96758, #ff9a69);
}

.occupancy-track.over-capacity .occupancy-maybe {
  background: linear-gradient(90deg, rgba(233, 103, 88, 0.52), rgba(255, 154, 105, 0.62));
}

.occupancy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
  color: var(--ink-500);
  font-size: 0.65rem;
}

.occupancy-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-swatch {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--green);
}

.legend-swatch.maybe {
  background: rgba(115, 210, 155, 0.45);
  border: 1px solid rgba(115, 210, 155, 0.75);
}

.over-capacity-label {
  margin: 0 0 0.8rem;
  color: #ff9d8b;
  font-size: 0.73rem;
  font-weight: 800;
}

.name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.name-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(181, 196, 238, 0.1);
  color: var(--ink-300);
  font-size: 0.7rem;
  font-weight: 700;
}

.name-chip.si {
  background: var(--green-bg);
  color: var(--green);
}

.name-chip.forse {
  background: var(--amber-bg);
  color: var(--amber);
}

.name-chip.no {
  background: var(--gray-bg);
  color: var(--ink-300);
}

.cars-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(115deg, rgba(244, 182, 92, 0.13), rgba(20, 31, 65, 0.72));
}

.summary-label {
  color: var(--ink-300);
  font-size: 0.75rem;
}

.summary-number {
  color: var(--amber);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.car-card {
  padding: 1.15rem;
}

.car-card-header,
.car-leg-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.car-card-header h3,
.car-leg h4 {
  margin: 0;
}

.car-card-header p,
.car-leg p {
  margin: 0.3rem 0 0;
  color: var(--ink-300);
}

.car-legs {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.car-leg {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(192, 204, 239, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(5, 11, 31, 0.24);
}

.car-leg .seat-dots {
  justify-content: flex-start;
}

.car-heading {
  align-items: center;
}

.driver-badge {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  background: rgba(244, 182, 92, 0.14);
  color: var(--amber);
  font-size: 1.35rem;
}

.car-title-block {
  min-width: 0;
  flex: 1;
}

.car-title-block h3 {
  overflow: hidden;
  margin: 0;
  color: var(--white);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-city,
.car-route {
  color: var(--ink-300);
  font-size: 0.74rem;
}

.car-city {
  margin: 0.2rem 0 0;
}

.car-capacity {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: right;
}

.car-meta {
  align-items: stretch;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(192, 204, 239, 0.08);
}

.car-route {
  display: grid;
  gap: 0.25rem;
}

.car-route span {
  display: block;
}

.seat-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  max-width: 10rem;
}

.seat-dot {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(244, 182, 92, 0.7);
  border-radius: 50%;
}

.seat-dot.taken,
.seat-dot.is-taken {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 8px rgba(244, 182, 92, 0.35);
}

.passenger-list {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.passenger-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  color: var(--ink-300);
  font-size: 0.76rem;
}

.passenger-list li::before {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.passenger-list li.forse::before {
  background: var(--amber);
}

.passenger-list li.no::before {
  background: #8994ad;
}

.board-wrap {
  margin-top: 1rem;
}

.board-button {
  width: 100%;
}

.board-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.board-panel {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid rgba(244, 182, 92, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(7, 13, 32, 0.4);
}

.board-panel label {
  color: var(--ink-300);
  font-size: 0.72rem;
  font-weight: 700;
}

.board-panel select {
  margin-top: 0.25rem;
}

.board-panel .button {
  min-height: 42px;
}

.ride-seeking-section {
  padding-top: 0.3rem;
}

.seeking-card {
  padding: 0.9rem 1rem;
}

.seeking-row {
  align-items: center;
}

.seeking-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
}

.seeking-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(238, 123, 101, 0.14);
  color: #ffad99;
  font-size: 0.85rem;
  font-weight: 800;
}

.seeking-name,
.seeking-city {
  display: block;
}

.seeking-name {
  overflow: hidden;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seeking-city {
  margin-top: 0.1rem;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.seeking-status {
  flex: 0 0 auto;
  color: #ffad99;
  font-size: 0.68rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 1rem;
  bottom: 5.8rem;
  left: 1rem;
  max-width: 430px;
  margin: 0 auto;
  border: 1px solid rgba(255, 157, 139, 0.35);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  background: rgba(58, 24, 36, 0.96);
  box-shadow: var(--shadow);
  color: #ffd0c6;
  font-size: 0.8rem;
  font-weight: 700;
}

.toast.is-success {
  border-color: rgba(115, 210, 155, 0.4);
  background: rgba(20, 69, 61, 0.96);
  color: #c8f5d8;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 600px) {
  .content-wrap {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .form-card {
    padding: 1.65rem;
  }

  .transport-fields {
    padding: 1.15rem;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-bottom: 0;
  }

  .brand-lockup h1 {
    max-width: none;
    white-space: nowrap;
  }

  .header-inner {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .mountain-header {
    height: 112px;
  }

  .tab-nav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    max-width: 1180px;
    margin: -0.05rem auto 0;
    padding: 0 1.5rem;
    border-top: 1px solid rgba(192, 204, 239, 0.07);
    box-shadow: 0 12px 26px rgba(5, 9, 25, 0.18);
  }

  .tab-button {
    display: flex;
    min-height: 56px;
    justify-content: center;
    gap: 0.55rem;
    font-size: 0.76rem;
  }

  .tab-button::before {
    right: 35%;
    left: 35%;
  }

  .tab-icon {
    font-size: 1rem;
  }

  .content-wrap {
    padding-top: 2.7rem;
  }

  .form-card {
    border-radius: var(--radius-lg);
  }

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

  .full-span {
    grid-column: 1 / -1;
  }

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

  .counter-grid {
    max-width: 620px;
  }

  .participant-stack,
  .night-stack,
  .car-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .night-stack,
  .car-stack {
    gap: 1rem;
  }

  .night-card,
  .car-card {
    padding: 1.35rem;
  }

  .toast {
    right: 1.5rem;
    bottom: 1.5rem;
    left: auto;
    margin: 0;
  }
}

@media (min-width: 1020px) {
  .content-wrap {
    padding-right: 2.2rem;
    padding-left: 2.2rem;
  }

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

  .night-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .header-inner,
  .content-wrap {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .form-card {
    padding: 1rem;
  }

  .choice-card {
    min-height: 82px;
    gap: 0.4rem;
    padding: 0.55rem;
  }

  .choice-icon {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    border-radius: 9px;
    font-size: 0.95rem;
  }

  .choice-card strong {
    font-size: 0.7rem;
  }

  .choice-card small {
    font-size: 0.61rem;
  }

  .night-options {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  input,
  select,
  textarea {
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }

  .button {
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .logout-link {
    transition: color 160ms ease;
  }

  .tab-button {
    transition: color 160ms ease, background 160ms ease;
  }

  .tab-button::before {
    transition: background 160ms ease, transform 160ms ease;
  }

  .view {
    animation: view-in 240ms ease both;
  }

  .segment {
    transition: color 160ms ease, background 160ms ease;
  }

  .night-option,
  .choice-card {
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  }

  .mini-action {
    transition: background 160ms ease, color 160ms ease;
  }

  .occupancy-fill {
    transition: width 350ms ease, background 200ms ease;
  }

  .toast {
    animation: toast-in 180ms ease both;
  }
}
