:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8f5ec;
  background: #080b12;
  --gold: #e8b74c;
  --gold-bright: #ffdb83;
  --ink: #080b12;
  --navy: #102c59;
  --line: rgba(221, 201, 157, .19);
  --muted: #a9b2c3;
  --panel: rgba(15, 20, 31, .74);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 82% -12%, #1c3969 0, transparent 32%), radial-gradient(circle at -5% 72%, #271836 0, transparent 31%), #080b12; }
body::before { position: fixed; z-index: -1; inset: 0; content: ""; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 88%); }
a { color: inherit; }
h1, h2, p { overflow-wrap: anywhere; }
.shell { position: relative; width: min(1120px, 100%); margin: 0 auto; padding: clamp(36px, 7vw, 88px) clamp(20px, 5vw, 58px) 56px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .22em; }
h1 { margin: 0; font-size: clamp(45px, 7vw, 78px); line-height: .91; letter-spacing: -.07em; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.intro { max-width: 580px; margin: 17px 0 0; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); line-height: 1.55; }

/* Signed-in command center */
.hub-shell { isolation: isolate; }
.hub-sigil { position: absolute; z-index: -1; top: -25px; right: -100px; width: min(500px, 55vw); opacity: .075; filter: sepia(1) saturate(1.4) drop-shadow(0 0 60px rgba(224, 176, 70, .22)); transform: rotate(10deg); pointer-events: none; }
.hero { display: flex; align-items: center; gap: 22px; min-height: 208px; padding: 28px clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(112deg, rgba(21, 46, 88, .92), rgba(14, 17, 26, .8) 63%, rgba(24, 18, 38, .72)); box-shadow: 0 26px 65px rgba(0,0,0,.25); overflow: hidden; }
.hero::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(90deg, transparent 70%, rgba(233,183,76,.10)); }
.hero-with-session { position: relative; padding-right: 220px; }
.mark { position: relative; z-index: 1; flex: 0 0 auto; width: clamp(64px, 8vw, 86px); height: auto; filter: drop-shadow(0 12px 25px rgba(0,0,0,.45)); }
.hero > div { position: relative; z-index: 1; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 52px 0 16px; }
.section-heading::after { width: min(250px, 30%); height: 1px; margin-left: 24px; content: ""; background: linear-gradient(90deg, var(--line), transparent); }
.section-heading .eyebrow { margin: 0 14px 0 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-card { position: relative; min-height: 188px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 20px; overflow: hidden; text-decoration: none; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(155deg, rgba(27, 33, 45, .87), rgba(13, 16, 24, .82)); box-shadow: 0 16px 38px rgba(0,0,0,.18); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.service-card::before { position: absolute; top: -58px; right: -48px; width: 150px; height: 150px; border: 1px solid rgba(239,191,86,.10); border-radius: 50%; content: ""; transition: transform .22s ease; }
.service-card:hover { transform: translateY(-5px); border-color: rgba(239,191,86,.62); box-shadow: 0 24px 50px rgba(0,0,0,.34); }
.service-card:hover::before { transform: scale(1.16); }
.service-card:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.primary-card { border-color: rgba(231,181,75,.48); background: linear-gradient(145deg, rgba(24, 54, 104, .96), rgba(24, 25, 35, .92)); }
.admin-card { background: linear-gradient(145deg, rgba(66, 39, 40, .82), rgba(18, 18, 25, .9)); }
.card-icon { position: relative; z-index: 1; width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(239,191,86,.54); border-radius: 12px; color: var(--gold-bright); background: rgba(12, 33, 67, .84); font-size: 23px; line-height: 1; }
.card-copy { position: relative; z-index: 1; display: grid; gap: 7px; }
.card-copy strong { font-size: 17px; letter-spacing: -.02em; }
.card-copy small { color: var(--muted); font-size: 12px; line-height: 1.48; }
.arrow { position: relative; z-index: 1; align-self: flex-end; margin-top: -24px; color: var(--gold-bright); font-size: 22px; }
footer { display: flex; align-items: center; gap: 8px; margin-top: 58px; color: #8490a5; font-size: 12px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #67d99c; box-shadow: 0 0 0 4px rgba(103,217,156,.13), 0 0 18px rgba(103,217,156,.6); }
.session-actions { position: absolute; z-index: 1; top: 29px; right: 32px; display: grid; justify-items: end; gap: 8px; color: #d4d9e3; font-size: 12px; }
.session-label { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.quiet-button { padding: 8px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; color: #f7f5ee; background: rgba(7,10,16,.40); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.quiet-button:hover { border-color: var(--gold); background: rgba(7,10,16,.75); }

/* Sign-in experience */
.login-stage { position: relative; min-height: 100vh; display: grid; place-items: center; padding: clamp(28px, 5vw, 72px); overflow: hidden; background: radial-gradient(circle at 92% 20%, rgba(32,72,134,.48), transparent 31%), radial-gradient(circle at 8% 96%, rgba(71,36,93,.46), transparent 33%), #080b12; }
.login-stage::before, .login-stage::after { position: absolute; content: ""; pointer-events: none; }
.login-stage::before { inset: 0; background: linear-gradient(90deg, rgba(8,11,18,.15), rgba(8,11,18,.76) 74%); }
.login-stage::after { inset: 20px; border: 1px solid rgba(255,255,255,.055); border-radius: 28px; }
.background-sigil { position: absolute; z-index: 0; width: min(780px, 72vw); right: -110px; top: 50%; opacity: .12; filter: sepia(1) saturate(1.5) drop-shadow(0 0 70px rgba(234,187,79,.44)); transform: translateY(-50%) rotate(9deg); pointer-events: none; }
.login-grid { position: relative; z-index: 1; width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: clamp(42px, 10vw, 156px); align-items: center; }
.login-identity { max-width: 650px; padding: clamp(10px, 3vw, 42px) 0; }
.brand-mark { width: 112px; height: 112px; margin-bottom: 34px; filter: drop-shadow(0 16px 32px rgba(0,0,0,.5)); }
.login-identity h1 { font-size: clamp(53px, 7.2vw, 100px); }
.identity-intro { max-width: 490px; margin: 23px 0 0; color: #b0bacb; font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.identity-rule { display: flex; align-items: center; gap: 12px; max-width: 390px; margin-top: 36px; color: var(--gold); }
.identity-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.identity-rule small { font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.identity-foot { margin: 26px 0 0; color: #7f899b; font-size: 12px; }
.login-panel { position: relative; padding: clamp(26px, 4vw, 42px); border: 1px solid rgba(233,191,95,.3); border-radius: 22px; background: linear-gradient(145deg, rgba(27,38,61,.76), rgba(13,17,27,.82)); box-shadow: 0 32px 80px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.08); backdrop-filter: blur(18px); }
.login-panel::before { position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.045); border-radius: 15px; content: ""; pointer-events: none; }
.panel-kicker { position: relative; display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.login-panel h2 { position: relative; margin-top: 25px; font-size: clamp(30px, 4vw, 43px); letter-spacing: -.055em; }
.login-panel > p:not(.form-error) { position: relative; margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.login-form { position: relative; display: grid; gap: 17px; margin-top: 31px; }
.login-form label { display: grid; gap: 8px; color: #dbe2ee; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.login-form input { width: 100%; min-height: 50px; border: 1px solid rgba(191,204,229,.28); border-radius: 10px; padding: 12px 14px; color: #fbf8f0; background: rgba(5,8,14,.54); font: 500 14px/1.3 Inter, ui-sans-serif, sans-serif; transition: border-color .16s ease, background .16s ease; }
.login-form input::placeholder { color: #717b8d; }
.login-form input:focus { border-color: var(--gold-bright); outline: 2px solid rgba(255,215,125,.23); background: rgba(5,8,14,.78); }
.login-form button { min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin-top: 5px; padding: 0 17px; border: 1px solid #f6cd69; border-radius: 10px; color: #17120b; background: linear-gradient(100deg, #e7ae40, #f5d57e); box-shadow: 0 10px 28px rgba(225,165,56,.19); font: 800 14px/1 Inter, ui-sans-serif, sans-serif; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.login-form button:hover { transform: translateY(-2px); box-shadow: 0 15px 32px rgba(225,165,56,.31); }
.login-form button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.form-error { position: relative; margin: 20px 0 -7px !important; padding: 11px 13px; border: 1px solid #a45f64; border-radius: 9px; color: #ffd8d8 !important; background: rgba(127,48,53,.28); font-size: 13px !important; line-height: 1.4; }
.privacy-note { margin-top: 21px !important; color: #8f9aad !important; font-size: 12px !important; line-height: 1.5; }

/* Owner-only access control */
.control-shell { width: min(1240px, 100%); }
.control-hero { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; min-height: 234px; padding: clamp(24px, 4vw, 43px); overflow: hidden; border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(113deg, rgba(26, 52, 94, .93), rgba(14, 17, 28, .86) 63%, rgba(43, 22, 45, .73)); box-shadow: 0 26px 65px rgba(0,0,0,.26); }
.control-hero::before { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(90deg, transparent 54%, rgba(232,183,76,.11)); }
.control-brand, .control-nav { position: relative; z-index: 1; }
.control-brand { display: flex; align-items: center; gap: 21px; }
.control-brand h1 { font-size: clamp(45px, 6vw, 75px); }
.control-nav { display: flex; align-items: center; gap: 10px; }
.control-nav form { margin: 0; }
.quiet-link { padding: 9px 11px; border: 1px solid transparent; border-radius: 9px; color: #dce5f5; font-size: 12px; font-weight: 750; text-decoration: none; }
.quiet-link:hover { border-color: rgba(255,255,255,.21); background: rgba(4,7,13,.25); }
.control-guard { display: flex; align-items: center; gap: 13px; max-width: 660px; margin: 24px 0 -3px; padding: 15px 17px; border: 1px solid rgba(103,217,156,.3); border-radius: 15px; background: rgba(18,62,42,.48); }
.control-guard strong { color: #afe9c7; font-size: 10px; letter-spacing: .14em; }
.control-guard p { margin: 4px 0 0; color: #b9d8c3; font-size: 13px; line-height: 1.45; }
.control-notice { margin: 23px 0 -3px; padding: 13px 16px; border: 1px solid rgba(234,188,84,.45); border-radius: 12px; color: #ffe6aa; background: rgba(79,54,16,.36); font-size: 13px; line-height: 1.45; }
.control-section { margin-top: 54px; }
.control-section .section-heading { margin: 0 0 17px; }
.user-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; align-items: end; max-width: 820px; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(26,32,44,.86), rgba(12,15,23,.76)); }
.user-picker label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user-picker > div { display: flex; gap: 10px; min-width: 0; }
.user-picker select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid rgba(191,204,229,.28); border-radius: 9px; padding: 0 12px; color: #fbf8f0; background: rgba(5,8,14,.64); font: 600 13px/1.3 Inter, ui-sans-serif, sans-serif; }
.user-picker button, .control-button { min-height: 42px; border: 1px solid rgba(237,195,91,.78); border-radius: 9px; padding: 0 13px; color: #19130a; background: linear-gradient(100deg, #e7ae40, #f5d57e); font: 800 12px/1 Inter, ui-sans-serif, sans-serif; cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.user-picker button:hover, .control-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); }
.control-button.danger { border-color: rgba(249,177,166,.44); color: #ffddd8; background: rgba(113, 50, 52, .65); }
.control-button:disabled { border-color: rgba(255,255,255,.15); color: #8690a0; background: rgba(255,255,255,.06); cursor: not-allowed; }
.grant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grant-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; min-height: 172px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(31,34,45,.9), rgba(13,16,24,.84)); }
.grant-card.is-active { border-color: rgba(103,217,156,.4); background: linear-gradient(145deg, rgba(20,54,48,.78), rgba(13,20,25,.9)); }
.grant-card .eyebrow { color: #8ea3bd; }
.grant-card.is-active .eyebrow { color: #83dbad; }
.grant-card h3, .space-card h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.grant-card p:not(.eyebrow), .space-card p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.grant-card form, .inline-control { margin: 0; flex: 0 0 auto; }
.control-copy { max-width: 730px; margin: -5px 0 19px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.space-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.space-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(27,33,45,.9), rgba(12,15,23,.84)); }
.space-card.is-member { border-color: rgba(103,217,156,.38); box-shadow: inset 0 1px rgba(121,239,172,.07); }
.space-card-head { display: flex; gap: 14px; align-items: flex-start; }
.space-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(239,191,86,.55); border-radius: 11px; color: var(--gold-bright); background: rgba(12,33,67,.84); font-size: 21px; }
.space-card .eyebrow { margin-bottom: 5px; color: #8ea3bd; }
.space-card.is-member .eyebrow { color: #83dbad; }
.room-list { margin: 20px 0; padding: 13px 14px; border: 1px solid rgba(255,255,255,.07); border-radius: 11px; background: rgba(4,7,13,.25); }
.room-list p { margin: 0 !important; color: #d6dbe5 !important; font-size: 10px !important; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.room-list ul { display: grid; gap: 5px; margin: 9px 0 0; padding-left: 18px; color: #a8b1c2; font-size: 12px; line-height: 1.4; }
.control-row { display: flex; flex-wrap: wrap; gap: 9px; }
.empty-state { margin: 0; padding: 22px; border: 1px dashed rgba(255,255,255,.18); border-radius: 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 850px) {
  .login-grid { grid-template-columns: 1fr; max-width: 600px; gap: 36px; }
  .login-identity { padding-top: 24px; }
  .background-sigil { width: min(600px, 102vw); right: -160px; opacity: .08; }
  .hero-with-session { padding-right: 205px; }
  .control-hero { display: block; }
  .control-nav { margin-top: 26px; }
}
@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 142px; }
  .section-heading { margin-top: 42px; }
  .grant-grid, .space-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-stage { padding: 22px; place-items: start center; }
  .login-stage::after { inset: 10px; border-radius: 17px; }
  .brand-mark { width: 82px; height: 82px; margin-bottom: 25px; }
  .login-identity h1 { font-size: clamp(48px, 15vw, 72px); }
  .login-panel { padding: 25px 21px; }
  .hero { align-items: flex-start; padding: 26px 21px 102px; }
  .hero-with-session { padding-right: 21px; }
  .session-actions { top: auto; right: auto; bottom: 24px; left: 21px; justify-items: start; }
  .section-heading { display: block; }
  .section-heading::after { display: block; width: 90px; margin: 11px 0 0; }
  h1 { font-size: 48px; }
  .control-brand { align-items: flex-start; }
  .control-brand .mark { width: 58px; }
  .user-picker { grid-template-columns: 1fr; }
  .user-picker > div { display: grid; }
  .grant-card { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .service-card, .login-form button { transition: none; }
}
