body.auth-pending > :not(.auth-gate) { visibility: hidden; }
body.auth-ready > :not(.auth-gate) { visibility: visible; }
#travelerGate { display: none !important; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 76% 18%, rgba(92,214,192,.2), transparent 30%),
    linear-gradient(135deg, #071923 0%, #102f3c 58%, #163b49 100%);
  color: #fff;
}
.auth-gate.open { display: grid; }
.auth-card {
  position: relative;
  width: min(900px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 28px;
  background: rgba(7,25,35,.72);
  box-shadow: 0 40px 120px rgba(0,0,0,.48);
  backdrop-filter: blur(22px);
}
.auth-journey {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.08), transparent 58%);
}
.auth-journey:after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -250px;
  bottom: -210px;
  border: 62px solid rgba(255,189,91,.15);
  border-radius: 50%;
}
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand img { width: 58px; height: 58px; object-fit: contain; }
.auth-brand b { display: block; font: 500 20px Georgia, serif; }
.auth-brand span { color: #ffbd5b; font: 900 9px ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.auth-journey h1 { margin: 58px 0 16px; max-width: 440px; font: 500 clamp(42px,6vw,68px)/.94 Georgia,serif; letter-spacing: -.045em; }
.auth-journey p { max-width: 410px; color: #b9cdd4; font-size: 15px; }
.auth-route { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; }
.auth-route span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #c9d9de; font-size: 10px; font-weight: 800; }
.auth-form-wrap { display: grid; align-content: center; padding: 42px; background: #fffdf8; color: #16212a; }
.auth-kicker { margin-bottom: 8px; color: #e66b4e; font: 900 10px ui-monospace,monospace; letter-spacing: .14em; text-transform: uppercase; }
.auth-form-wrap h2 { margin: 0 0 7px; color: #17324d; font: 500 36px/1 Georgia,serif; }
.auth-form-wrap > p { margin: 0 0 26px; color: #66747f; font-size: 13px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: #17324d; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.auth-form input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #d9d4c8;
  border-radius: 11px;
  background: #fff;
  color: #16212a;
  font: 700 15px Inter,system-ui,sans-serif;
}
.auth-form input:focus { outline: 3px solid rgba(30,120,152,.2); border-color: #1e7898; }
.auth-submit { min-height: 48px; border: 0; border-radius: 11px; background: #e66b4e; color: #fff; font: 900 13px Inter,system-ui,sans-serif; cursor: pointer; }
.auth-submit:hover { background: #d85d42; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-error { min-height: 20px; margin: 0 !important; color: #b53d36 !important; font-size: 12px !important; font-weight: 800; }
.auth-help { margin-top: 17px; padding-top: 14px; border-top: 1px solid #e5dfd3; color: #7a858d; font-size: 11px; }

.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(4,18,27,.84);
  backdrop-filter: blur(16px);
}
.account-sheet.open { display: grid; }
.account-card {
  width: min(720px,100%);
  max-height: min(92dvh,900px);
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 26px;
  background: #0a2230;
  box-shadow: 0 36px 110px rgba(0,0,0,.52);
}
.account-sheet.is-admin .account-card { width: min(1040px,100%); }
.account-hero { display: flex; align-items: center; gap: 18px; padding: 25px 30px; color: #fff; background: radial-gradient(circle at 90% 0,rgba(92,214,192,.18),transparent 35%),#0a2230; }
.account-hero .auth-kicker { color: #66dfc6; }
.account-hero h2 { margin: 2px 0 6px; font: 500 34px/1 Georgia,serif; letter-spacing: -.025em; }
.account-hero p { margin: 0; color: #a9c0c9; font-size: 12px; }
.account-stamp { position: relative; display: grid; flex: 0 0 58px; width: 58px; height: 58px; place-items: center; border: 1px dashed rgba(255,255,255,.42); border-radius: 50%; background: #e66b4e; color: #fff; font: 700 25px Georgia,serif; box-shadow: 0 0 0 6px rgba(230,107,78,.13); }
.account-stamp:after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; }
.account-scroll { min-height: 0; overflow: auto; padding: 22px; background: #eef2f0; }
.self-access { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(340px,1.3fr); gap: 22px; align-items: center; padding: 20px; border: 1px solid #d6dfdc; border-radius: 17px; background: #fff; }
.access-section-head { display: grid; gap: 6px; }
.access-section-head > span,.vault-head span { color: #d85d42; font: 900 9px ui-monospace,monospace; letter-spacing: .13em; text-transform: uppercase; }
.access-section-head h3,.vault-head h3 { margin: 0; color: #17324d; font: 500 23px/1.05 Georgia,serif; }
.access-section-head p,.vault-head p { margin: 0; color: #687982; font-size: 11px; line-height: 1.5; }
.password-form { grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.password-form .auth-error { grid-column: 1/-1; min-height: 0; }
.password-form .auth-submit { min-width: 155px; padding: 0 16px; }
.access-vault { margin-top: 22px; }
.vault-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 13px; padding: 0 3px; }
.vault-head > div { display: grid; gap: 5px; }
.vault-head > b { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #17324d; color: #fff; font: 900 9px ui-monospace,monospace; text-transform: uppercase; letter-spacing: .08em; }
.vault-warning { display: flex; gap: 10px 18px; align-items: baseline; margin-bottom: 12px; padding: 10px 13px; border-left: 3px solid #e4a847; background: #fff7e7; color: #66573f; font-size: 10px; }
.vault-warning b { color: #714c13; white-space: nowrap; }
.access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.access-pass { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; overflow: hidden; padding: 17px; border: 1px solid #d6dfdc; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(15,42,52,.05); }
.access-pass:before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(#5cd6c0,#1e7898); }
.access-pass header { grid-column: 1/-1; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed #ccd7d3; }
.person-token { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #17324d; color: #fff; font: 700 17px Georgia,serif; }
.access-pass header div:nth-child(2) { min-width: 0; flex: 1; }
.access-pass header b { display: block; color: #17324d; font: 600 17px Georgia,serif; }
.access-pass header span { display: block; margin-top: 2px; color: #708089; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.access-pass header i { width: 9px; height: 9px; border-radius: 50%; background: #2f9a72; box-shadow: 0 0 0 4px #e4f4ed; }
.access-pass header i.pending { background: #dd9b2b; box-shadow: 0 0 0 4px #fff3da; }
.access-pass header i.locked { background: #c74f45; box-shadow: 0 0 0 4px #fbe5e1; }
.access-pass.is-locked { border-color: #e2aaa3; background: #fffaf9; }
.access-pass label { display: grid; gap: 5px; color: #52646d; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.access-pass input { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #cad5d1; border-radius: 9px; background: #f9fbfa; color: #132c3c; font: 750 13px Inter,system-ui,sans-serif; }
.access-pass input:focus { outline: 3px solid rgba(92,214,192,.22); border-color: #258b84; }
.password-field { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.password-field input { border-radius: 9px 0 0 9px; }
.password-field button { position: relative; width: 42px; border: 1px solid #cad5d1; border-left: 0; border-radius: 0 9px 9px 0; background: #eef4f2; color: #17324d; cursor: pointer; }
.password-toggle:before { content: ""; position: absolute; width: 17px; height: 11px; left: 50%; top: 50%; border: 2px solid currentColor; border-radius: 70% 30% 70% 30%; transform: translate(-50%,-50%) rotate(45deg); }
.password-toggle:after { content: ""; position: absolute; width: 5px; height: 5px; left: 50%; top: 50%; border-radius: 50%; background: currentColor; transform: translate(-50%,-50%); }
.password-toggle:not(.visible) { color: #76878e; }
.password-toggle:not(.visible):after { width: 20px; height: 2px; border-radius: 2px; background: #76878e; transform: translate(-50%,-50%) rotate(-45deg); }
.password-toggle:focus-visible { outline: 3px solid rgba(30,120,152,.22); outline-offset: 2px; }
.pass-tools { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,auto) 1fr; gap: 7px; }
.pass-tools button { min-height: 37px; padding: 0 11px; border: 1px solid #cad5d1; border-radius: 9px; background: #fff; color: #17324d; font-size: 10px; font-weight: 900; cursor: pointer; }
.pass-tools .save-access { border-color: #17324d; background: #17324d; color: #fff; }
.pass-tools button:hover { transform: translateY(-1px); }
.pass-tools button:disabled { opacity: .5; cursor: wait; transform: none; }
.account-actions { display: flex; gap: 8px; padding: 14px 22px; background: #0a2230; }
.account-actions button { flex: 1; min-height: 43px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(255,255,255,.07); color: #dce7ea; font-weight: 850; cursor: pointer; }
.account-actions button:hover { background: rgba(255,255,255,.12); }
.account-actions .danger { color: #ff9b86; }

.concierge-launch {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 7px 16px 7px 7px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: #071923;
  color: #fff;
  box-shadow: 0 18px 50px rgba(7,25,35,.3);
  cursor: pointer;
}
.concierge-launch i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #5cd6c0; color: #071923; font: 900 18px Georgia,serif; font-style: normal; }
.concierge-launch b { display: block; font-size: 12px; }
.concierge-launch span { display: block; margin-top: 1px; color: #91aab2; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.concierge-badge { position: absolute; top: -5px; right: -5px; display: none; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 999px; background: #e66b4e; color: #fff; font: 900 9px ui-monospace,monospace; }
.concierge-badge.show { display: grid; }

.concierge {
  position: fixed;
  z-index: 2000;
  top: 0;
  right: 0;
  width: min(470px,100vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  transform: translateX(104%);
  transition: transform .28s ease;
  background: #f8f5ed;
  box-shadow: -28px 0 80px rgba(7,25,35,.28);
}
.concierge.open { transform: translateX(0); }
.concierge-head { position: relative; padding: 23px 58px 19px 25px; background: #071923; color: #fff; }
.concierge-head:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(#ffbd5b,#e66b4e); }
.concierge-head small { display: block; margin-bottom: 4px; color: #5cd6c0; font: 900 9px ui-monospace,monospace; letter-spacing: .13em; text-transform: uppercase; }
.concierge-head h2 { margin: 0; font: 500 28px Georgia,serif; }
.concierge-head p { margin: 4px 0 0; color: #9eb3ba; font-size: 11px; }
.concierge-close { position: absolute; top: 18px; right: 17px; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; font-size: 22px; cursor: pointer; }
.concierge-tabs { display: grid; grid-template-columns: repeat(3,1fr); padding: 7px; border-bottom: 1px solid #d9d4c8; background: #fffdf8; }
.concierge-tabs button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: #66747f; font-size: 11px; font-weight: 900; cursor: pointer; }
.concierge-tabs button.active { background: #eaf3f2; color: #17324d; }
.concierge-panel { min-height: 0; display: none; }
.concierge-panel.active { display: grid; }
.chat-panel { grid-template-rows: 1fr auto; }
.chat-feed { min-height: 0; overflow: auto; padding: 18px; }
.chat-empty { padding: 18px; border: 1px dashed #c9c4b9; border-radius: 14px; background: rgba(255,255,255,.5); }
.chat-empty b { display: block; color: #17324d; font: 500 20px Georgia,serif; }
.chat-empty p { margin: 5px 0 13px; color: #66747f; font-size: 12px; }
.chat-prompts { display: grid; gap: 7px; }
.chat-prompts button { padding: 9px 10px; border: 1px solid #d9d4c8; border-radius: 9px; background: #fff; color: #17324d; text-align: left; font-size: 11px; font-weight: 800; cursor: pointer; }
.chat-message { max-width: 88%; margin-bottom: 12px; padding: 11px 13px; border-radius: 13px; background: #fff; color: #28353d; box-shadow: 0 5px 16px rgba(23,50,77,.06); font-size: 13px; white-space: pre-wrap; }
.chat-message.user { margin-left: auto; border-bottom-right-radius: 3px; background: #17324d; color: #fff; }
.chat-message.assistant { border-bottom-left-radius: 3px; }
.chat-sources { display: grid; gap: 5px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #ece7dc; }
.chat-sources a { color: #1e7898; font-size: 10px; font-weight: 800; text-decoration: none; }
.chat-saved { display: inline-block; margin-top: 8px; color: #2f7b62; font-size: 10px; font-weight: 900; }
.chat-composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid #d9d4c8; background: #fffdf8; }
.chat-composer textarea { min-height: 48px; max-height: 130px; resize: vertical; padding: 11px 12px; border: 1px solid #d9d4c8; border-radius: 11px; font: 13px/1.4 Inter,system-ui,sans-serif; }
.chat-composer button { width: 48px; border: 0; border-radius: 11px; background: #e66b4e; color: #fff; font-size: 20px; cursor: pointer; }
.chat-composer button:disabled { opacity: .55; cursor: wait; }

.proposal-panel { overflow: auto; padding: 18px; align-content: start; }
.proposal-form { display: grid; gap: 11px; padding: 16px; border-radius: 15px; background: #fffdf8; border: 1px solid #d9d4c8; }
.proposal-form h3 { margin: 0; color: #17324d; font: 500 22px Georgia,serif; }
.proposal-form p { margin: -5px 0 4px; color: #66747f; font-size: 11px; }
.proposal-form input,.proposal-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #d9d4c8; border-radius: 9px; font: 12px Inter,system-ui,sans-serif; }
.proposal-form textarea { min-height: 92px; resize: vertical; }
.affected-people { display: flex; flex-wrap: wrap; gap: 6px; }
.affected-people label { display: flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid #d9d4c8; border-radius: 999px; background: #fff; color: #17324d; font-size: 10px; font-weight: 850; }
.proposal-form button { min-height: 42px; border: 0; border-radius: 9px; background: #17324d; color: #fff; font-weight: 900; cursor: pointer; }
.proposal-list { display: grid; gap: 10px; margin-top: 14px; }
.proposal-card { padding: 15px; border: 1px solid #d9d4c8; border-radius: 14px; background: #fffdf8; }
.proposal-card header { display: flex; justify-content: space-between; gap: 9px; align-items: start; }
.proposal-card h4 { margin: 0; color: #17324d; font: 500 18px Georgia,serif; }
.proposal-status { padding: 4px 7px; border-radius: 999px; background: #fff1d7; color: #8a5b0e; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.proposal-status.approved { background: #e5f3ed; color: #2f7b62; }
.proposal-status.rejected { background: #fae9e6; color: #b53d36; }
.proposal-card > p { margin: 7px 0; color: #4f5e67; font-size: 11px; white-space: pre-wrap; }
.proposal-meta { color: #7b878e; font-size: 9px; }
.proposal-votes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.proposal-votes span { padding: 4px 6px; border-radius: 6px; background: #edf1ef; color: #466056; font-size: 9px; font-weight: 800; }
.vote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.vote-actions button { min-height: 34px; border: 1px solid #d9d4c8; border-radius: 8px; background: #fff; color: #17324d; font-size: 10px; font-weight: 900; cursor: pointer; }
.vote-actions .reject { color: #b53d36; }

.activity-panel { overflow: auto; padding: 18px; align-content: start; }
.activity-list { display: grid; gap: 8px; }
.activity-item { display: grid; grid-template-columns: 34px 1fr; gap: 9px; padding: 11px; border-radius: 12px; background: #fffdf8; border: 1px solid #e1dcd1; }
.activity-item i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eaf3f2; color: #17324d; font-style: normal; font-weight: 900; }
.activity-item b { display: block; color: #17324d; font-size: 11px; }
.activity-item span { display: block; color: #7b878e; font-size: 9px; }
.empty-state { padding: 24px 16px; text-align: center; color: #66747f; font-size: 12px; }
.toast { position: fixed; z-index: 4000; left: 50%; bottom: 22px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; padding: 11px 15px; border-radius: 10px; background: #071923; color: #fff; font-size: 11px; font-weight: 800; transition: .2s; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 720px) {
  .auth-card { grid-template-columns: 1fr; min-height: 0; }
  .auth-journey { min-height: 210px; padding: 25px; }
  .auth-journey h1 { margin: 28px 0 8px; font-size: 40px; }
  .auth-journey p,.auth-route { display: none; }
  .auth-form-wrap { padding: 26px; }
  .account-sheet { padding: 0; align-items: end; }
  .account-card,.account-sheet.is-admin .account-card { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .account-hero { padding: 19px 20px; }
  .account-hero h2 { font-size: 27px; }
  .account-stamp { flex-basis: 48px; width: 48px; height: 48px; }
  .account-scroll { padding: 14px; }
  .self-access { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .password-form { grid-template-columns: 1fr; }
  .password-form .auth-error { grid-column: 1; }
  .access-grid { grid-template-columns: 1fr; }
  .access-pass { grid-template-columns: 1fr; }
  .access-pass header,.pass-tools { grid-column: 1; }
  .vault-head { align-items: start; }
  .vault-warning { display: grid; }
  .concierge-launch { right: 72px; bottom: 18px; grid-template-columns: 38px; padding: 6px; min-height: 50px; border-radius: 16px; }
  .concierge-launch i { width: 38px; height: 38px; }
  .concierge-launch b,.concierge-launch > span { display: none; }
  .concierge { top: auto; bottom: 0; height: min(88dvh,780px); border-radius: 22px 22px 0 0; transform: translateY(104%); }
  .concierge.open { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .concierge,.toast { transition: none; }
}

@media print {
  .auth-gate,.account-sheet,.concierge-launch,.concierge,.toast { display: none !important; }
}
