:root{
  --bg:#09090c;
  --bg-soft:#0f0f14;
  --surface:#121218;
  --surface-2:#17171f;
  --surface-3:#1e1e28;
  --text:#f7f7fa;
  --muted:#9a9aa8;
  --muted-2:#71717d;
  --line:rgba(255,255,255,.085);
  --line-strong:rgba(255,255,255,.14);
  --accent:#8d7cff;
  --accent-2:#b2a7ff;
  --accent-soft:rgba(141,124,255,.14);
  --success:#77d9ad;
  --danger:#ff7d91;
  --radius:24px;
  --shadow:0 32px 90px rgba(0,0,0,.34);
  --nexi-nav-h:62px;
}

*{box-sizing:border-box}
html{background:var(--bg);scroll-behavior:smooth}
body{margin:0;min-width:320px;background:var(--bg);color:var(--text);font-family:Pretendard,"Pretendard Variable","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.55;letter-spacing:-.018em}
body:before{content:"";position:fixed;inset:0;pointer-events:none;background:radial-gradient(circle at 12% 12%,rgba(111,91,255,.07),transparent 30%),radial-gradient(circle at 88% 82%,rgba(178,167,255,.045),transparent 27%);z-index:-1}
button,input,textarea,select{font:inherit}
button{cursor:pointer;color:inherit}
button:disabled{cursor:not-allowed;opacity:.38}
.hidden{display:none!important}
::selection{background:rgba(141,124,255,.34)}
#app-shell{min-height:100vh}
body.booting #app-shell{visibility:hidden}
body.booting:after{content:"NEXI";position:fixed;inset:0;display:grid;place-items:center;background:var(--bg);color:#f1efff;font-size:13px;font-weight:900;letter-spacing:.16em;z-index:9999}

/* shell / navigation */
.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:40;background:rgba(9,9,12,.78);backdrop-filter:blur(22px);border-bottom:1px solid rgba(255,255,255,.045)}
.brand{display:flex;align-items:center;gap:9px;border:0;background:none;padding:0;font-weight:900;letter-spacing:.14em;color:var(--text)}
.brand-symbol{width:25px;height:25px;border-radius:50%;position:relative;background:radial-gradient(circle at 34% 30%,#d9d4ff 0 8%,#a596ff 24%,#705bff 55%,#27223e 100%);box-shadow:0 0 26px rgba(141,124,255,.34)}
.brand-symbol:after{content:"";position:absolute;inset:6px -3px;border:1px solid rgba(218,212,255,.52);border-radius:50%;transform:rotate(-28deg)}
.brand-word{font-size:15px}
.beta-tag{font-size:8px;letter-spacing:.12em;color:var(--muted-2);border:1px solid var(--line);border-radius:99px;padding:3px 5px;margin-left:1px}
.top-actions{display:flex;align-items:center;gap:4px}
.top-actions.nav-disabled{display:none!important}
.icon-btn{border:0;background:transparent;color:var(--muted);padding:9px 13px;border-radius:12px;font-size:12px;font-weight:750;transition:.16s ease;display:inline-flex;align-items:center;gap:6px}
.icon-btn:hover{color:var(--text);background:rgba(255,255,255,.055)}
.icon-btn.active{color:var(--text);background:rgba(141,124,255,.10)}
.icon-btn.has-alert{position:relative;color:var(--text);background:var(--accent-soft)}
.icon-btn.has-alert:after{content:"";position:absolute;right:7px;top:6px;width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px var(--accent)}
.nav-glyph{font-size:12px;line-height:1}.nav-label{line-height:1}
.screen{display:none;max-width:1180px;margin:0 auto;padding:54px 28px 110px}
.screen.active{display:block}
.screen.narrow{max-width:760px}

/* home */
.home-screen{max-width:none!important;padding:0!important;overflow:hidden}
.home-stage{min-height:calc(100vh - 68px);max-width:1180px;margin:0 auto;padding:72px 28px 84px;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.72fr);gap:74px;align-items:center;position:relative}
.ambient-orb{position:absolute;border-radius:50%;filter:blur(2px);pointer-events:none}
.orb-one{width:410px;height:410px;right:-190px;top:-140px;background:radial-gradient(circle,rgba(116,92,255,.14),rgba(116,92,255,0) 68%)}
.orb-two{width:360px;height:360px;left:-220px;bottom:-180px;background:radial-gradient(circle,rgba(183,168,255,.08),rgba(183,168,255,0) 70%)}
.home-copy{position:relative;z-index:2}
.home-kicker,.section-label{display:inline-flex;align-items:center;gap:7px;color:var(--accent-2);font-size:11px;font-weight:800;letter-spacing:.06em;margin-bottom:18px}
.home-kicker:before,.section-label:before{content:"";width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px rgba(141,124,255,.8)}
.home-copy h1{font-size:clamp(46px,6.2vw,78px);line-height:1.08;letter-spacing:-.064em;margin:0;font-weight:760;max-width:730px}
.home-copy h1 strong{font-weight:760;color:var(--accent-2)}
.home-copy>p{max-width:570px;margin:25px 0 0;color:#b5b5c0;font-size:16px;line-height:1.75}
.nexi-entry-card{position:relative;z-index:2;background:linear-gradient(180deg,rgba(25,25,34,.94),rgba(16,16,22,.96));border:1px solid var(--line-strong);border-radius:32px;padding:34px;box-shadow:var(--shadow);min-height:470px;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden}
.nexi-entry-card:before{content:"";position:absolute;width:340px;height:340px;left:50%;top:-120px;transform:translateX(-50%);background:radial-gradient(circle,rgba(119,95,255,.18),rgba(119,95,255,0) 70%);pointer-events:none}
.nexi-orb{width:138px;height:138px;margin:10px auto auto;position:relative;border-radius:50%;background:radial-gradient(circle at 34% 28%,#f0eeff 0 3%,#c3baff 8%,#8d7cff 28%,#5142b1 51%,#171527 73%);box-shadow:0 0 55px rgba(141,124,255,.23),inset -14px -18px 36px rgba(0,0,0,.28)}
.nexi-orb:before,.nexi-orb:after{content:"";position:absolute;border:1px solid rgba(212,207,255,.34);border-radius:50%;inset:25px -18px;transform:rotate(-30deg)}
.nexi-orb:after{inset:11px -7px;transform:rotate(31deg);opacity:.28}
.nexi-orb span{position:absolute;width:9px;height:9px;border-radius:50%;background:#e6e2ff;right:3px;top:53px;box-shadow:0 0 18px #b7aaff}
.entry-message{margin:26px 0 22px}.entry-name{font-size:10px;font-weight:900;letter-spacing:.16em;color:var(--accent-2)}
.entry-message p{font-size:21px;line-height:1.5;letter-spacing:-.035em;margin:7px 0 0;font-weight:650}
.entry-footnote{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;color:var(--muted-2);font-size:9px;margin-top:14px}.entry-footnote i{width:2px;height:2px;border-radius:50%;background:#555561}

/* buttons / forms */
.primary,.secondary,.ghost,.danger{border:0;border-radius:14px;padding:13px 18px;font-weight:780;transition:transform .16s ease,background .16s ease,border-color .16s ease,opacity .16s ease}
.primary{background:linear-gradient(135deg,#9d8dff,#7664ee);color:#fff;box-shadow:0 10px 28px rgba(100,80,220,.22)}
.primary:hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(135deg,#aa9cff,#7e6cf4)}
.primary.big{padding:16px 22px;font-size:14px}.primary.full,.secondary.full,.danger.full{width:100%}
.secondary{background:#202029;color:#e8e8ee;border:1px solid var(--line)}.secondary:hover{background:#272731}
.ghost{background:transparent;color:var(--muted)}.ghost:hover{color:var(--text);background:rgba(255,255,255,.04)}
.danger{background:rgba(255,92,116,.11);color:#ff9aaa;border:1px solid rgba(255,92,116,.15)}
.page-head{margin-bottom:30px}.page-head h2{font-size:clamp(36px,5vw,54px);line-height:1.12;letter-spacing:-.055em;margin:0 0 12px;font-weight:760}.page-head p{margin:0;max-width:580px;color:var(--muted);font-size:14px;line-height:1.7}
.form-card,.settings-card,.empty-card,.person-card,.chat-main,.insight-panel{background:rgba(18,18,24,.9);border:1px solid var(--line);box-shadow:0 18px 55px rgba(0,0,0,.17)}
.form-card{border-radius:28px;padding:28px;display:flex;flex-direction:column;gap:20px}
.form-section-title{display:flex;align-items:center;gap:10px;margin-bottom:-3px}.form-section-title span{color:var(--accent-2);font-size:10px;font-weight:900;letter-spacing:.09em}.form-section-title strong{font-size:14px}.form-divider{height:1px;background:var(--line);margin:4px 0}
.form-card label>span,legend{display:block;font-size:11px;font-weight:760;margin-bottom:8px;color:#b9b9c4}.form-card small{font-weight:500;color:var(--muted-2)}
input,textarea,select{width:100%;background:#0f0f14;border:1px solid var(--line-strong);border-radius:13px;padding:12px 13px;outline:none;color:var(--text);transition:border-color .16s,box-shadow .16s}
input::placeholder,textarea::placeholder{color:#62626e}select{color-scheme:dark}input:focus,textarea:focus,select:focus{border-color:rgba(141,124,255,.65);box-shadow:0 0 0 3px rgba(141,124,255,.09)}
textarea{resize:none}.field-row.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}fieldset{border:0;margin:0;padding:0}.chip-group{display:flex;flex-wrap:wrap;gap:8px}.chip input{position:absolute;opacity:0}.chip span{display:block!important;margin:0!important;border:1px solid var(--line-strong);border-radius:999px;padding:9px 13px;background:#101015;font-size:12px!important;color:#aaaab6!important;transition:.16s}.chip input:checked+span{background:var(--accent-soft);color:#d9d4ff!important;border-color:rgba(141,124,255,.48)}
.photo-picker{display:flex;gap:15px;align-items:center;padding:4px 0}.photo-picker>input{display:none}.photo-preview{width:88px;height:104px;flex:0 0 auto;border-radius:18px;background:#101015;border:1px dashed rgba(255,255,255,.2);display:flex!important;flex-direction:column;align-items:center;justify-content:center;margin:0!important;background-size:cover;background-position:center}.photo-preview b{font-size:24px;font-weight:400;color:var(--accent-2)}.photo-preview small{font-size:9px;color:var(--muted)}.photo-help{font-size:11px!important;line-height:1.65;color:var(--muted)!important;font-weight:500!important;margin:0!important}.photo-help b{color:#d7d7df}
.consents{display:flex;flex-direction:column;gap:13px;padding:2px 0}.consent-row{position:relative;display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;gap:11px!important;align-items:start!important;padding:2px 0;cursor:pointer}.consent-row>input{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important;margin:0!important}.consent-row>.consent-check{display:block!important;width:20px!important;height:20px!important;margin:0!important;border:1px solid rgba(255,255,255,.20)!important;border-radius:6px!important;background:#0f0f14!important;position:relative}.consent-row>input:checked+.consent-check{background:var(--accent)!important;border-color:var(--accent)!important}.consent-row>input:checked+.consent-check:after{content:"";position:absolute;left:6px;top:3px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}.consent-row>.consent-copy{display:block!important;margin:0!important;padding:1px 0 0!important;font-size:11px!important;line-height:1.55!important;color:#aaaab5!important;font-weight:520!important;min-width:0}.onboarding-submit{margin-top:3px;padding:15px}.form-error{font-size:11px;color:var(--danger);text-align:center;margin:0}

/* chat */
.chat-layout{max-width:1180px;display:none!important;grid-template-columns:minmax(0,1.55fr) minmax(286px,.62fr);gap:16px;padding-top:22px;height:calc(100vh - 68px);padding-bottom:22px}
.chat-layout.active{display:grid!important}.chat-main,.insight-panel{border-radius:25px;min-height:0}.chat-main{display:flex;flex-direction:column;padding:18px}.insight-panel{padding:20px;overflow:auto}
.ai-chat-head{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 14px}.ai-identity{display:flex;align-items:center;gap:10px}.ai-identity strong{display:block;font-size:14px;letter-spacing:.08em}.ai-identity span{display:block;color:var(--muted);font-size:10px;margin-top:1px}.mini-orb{width:36px;height:36px;border-radius:50%;background:radial-gradient(circle at 35% 28%,#e8e4ff 0 6%,#9887ff 27%,#493b9e 58%,#1c192b 78%);box-shadow:0 0 20px rgba(141,124,255,.24);position:relative}.mini-orb:after{content:"";position:absolute;inset:8px -4px;border:1px solid rgba(218,212,255,.3);border-radius:50%;transform:rotate(-30deg)}
.depth-ring{min-width:92px;height:32px;border-radius:999px!important;display:grid;place-items:center;background:var(--accent-soft)!important;border:1px solid rgba(141,124,255,.23);padding:0 11px}.depth-ring:after{display:none!important}.depth-ring span{font-size:9px!important;line-height:1!important;color:#c8c0ff;font-weight:800;white-space:nowrap}.depth-ring small{display:none}.ai-context,.reveal-notice{background:rgba(141,124,255,.085);color:#b9b1e9;border:1px solid rgba(141,124,255,.12);border-radius:13px;padding:9px 12px;font-size:10px}.ai-context span{color:#a999ff;margin-right:3px}
.messages{flex:1 1 0;min-height:180px;overflow-y:auto;overflow-x:hidden;padding:20px 4px 14px;display:flex;flex-direction:column;gap:10px;scrollbar-width:thin;scrollbar-color:#2b2b36 transparent}
.bubble{max-width:76%;padding:11px 13px;border-radius:18px;font-size:15px;line-height:1.62;white-space:pre-wrap}.bubble.me{align-self:flex-end;background:#7f6cf0;color:white;border-bottom-right-radius:6px}.bubble.them{align-self:flex-start;background:#1b1b23;border:1px solid rgba(255,255,255,.045);color:#e7e7ec;border-bottom-left-radius:6px}.bubble.system{align-self:center;background:transparent;color:#73737f;font-size:10px;text-align:center;max-width:95%;border:0}.typing{opacity:.58}
.composer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;border-top:1px solid var(--line);padding-top:12px}.composer textarea{max-height:130px;background:#0e0e13;border-color:var(--line);padding:11px 13px;font-size:15px;line-height:1.55}.composer-actions{display:flex;align-items:center;gap:6px}.composer-actions button{border:0;width:43px;height:43px;border-radius:13px;display:grid;place-items:center}.composer-send{background:var(--accent)!important;color:white!important;font-size:18px}.composer-send span{transform:translateY(-1px)}
.panel-title{display:flex;flex-direction:column;gap:2px;margin-bottom:16px}.panel-title>span{font-size:13px;font-weight:800}.panel-title small{font-size:9px;color:var(--muted);font-weight:500}.trait-cards{display:flex;flex-direction:column;gap:7px}.trait{padding:11px 12px;border:1px solid var(--line);border-radius:14px;background:#101015}.trait small{display:block;color:#6f6f7b;font-size:8px;letter-spacing:.06em;margin-bottom:4px}.trait strong{font-size:11px;color:#d5d5dd}.trait-tags{display:flex;flex-wrap:wrap;gap:5px}.trait-tags span{font-size:9px;background:#1d1d26;color:#b8b8c3;border-radius:999px;padding:4px 7px}.trait.memory{border-color:rgba(141,124,255,.16);background:rgba(141,124,255,.045)}.memory-text{margin:0;color:#d7d4e8;font-size:11px;line-height:1.65;font-weight:570}.trait-empty{color:var(--muted);font-size:11px;padding:20px 2px;line-height:1.7}.mobile-match-ready,.mobile-profile-wrap{display:none}.ai-head-actions,.human-head-actions{display:flex;align-items:center;gap:8px}.ai-match-offer{align-self:flex-start;margin:0 0 4px;padding:0;background:transparent;border:0;max-width:min(390px,88%)}.ai-match-offer-actions{display:flex;gap:8px}.ai-match-offer-actions button{min-height:38px;border-radius:12px;font-size:11px}.ai-match-offer-actions .primary{flex:1;box-shadow:none}

/* match / human profile */
.match-screen{padding-top:46px}.match-head h2{max-width:620px}.empty-card,.person-card{border-radius:28px;overflow:hidden}.empty-card{text-align:center;padding:58px 28px}.waiting-visual{width:94px;height:94px;margin:0 auto 22px;border-radius:50%;position:relative;background:radial-gradient(circle,#262331 0 34%,#15151c 35% 57%,#101015 58%);box-shadow:0 0 42px rgba(141,124,255,.1)}.waiting-visual:before{content:"";position:absolute;inset:7px;border:1px solid rgba(141,124,255,.33);border-radius:50%;border-left-color:transparent;transform:rotate(20deg)}.waiting-visual span{position:absolute;width:9px;height:9px;border-radius:50%;background:var(--accent);right:6px;top:39px;box-shadow:0 0 15px var(--accent)}.empty-card h3{font-size:20px;letter-spacing:-.035em;margin:0 0 8px}.empty-card>p{color:var(--muted);max-width:440px;margin:0 auto;font-size:12px;line-height:1.7}.empty-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:22px}
.person-card{display:grid;grid-template-columns:minmax(280px,.86fr) 1fr;min-height:430px}.reveal-stage{min-height:430px;background:radial-gradient(circle at 50% 30%,#2c2938,#17171f 52%,#0f0f14);position:relative;display:grid;place-items:center;overflow:hidden}.reveal-stage:before{content:"";position:absolute;width:260px;height:260px;border-radius:50%;background:rgba(141,124,255,.07);top:35px}.locked-portrait{width:156px;height:210px;border-radius:90px 90px 48px 48px;background:linear-gradient(180deg,rgba(190,182,255,.12),rgba(91,83,132,.05));position:relative;z-index:2;box-shadow:0 0 55px rgba(141,124,255,.07)}.locked-portrait:before{content:"";position:absolute;width:74px;height:74px;border-radius:50%;left:50%;top:30px;transform:translateX(-50%);background:rgba(206,200,255,.14)}.locked-portrait:after{content:"";position:absolute;width:130px;height:95px;border-radius:70px 70px 18px 18px;left:50%;bottom:13px;transform:translateX(-50%);background:rgba(206,200,255,.09)}.locked-portrait span{display:none}.person-photo{width:100%;height:100%;object-fit:cover;position:absolute;inset:0;z-index:1}.reveal-shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 48%,rgba(9,9,12,.68));z-index:3;pointer-events:none}.reveal-badge{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:4;background:rgba(9,9,12,.72);color:#d1d1da;border:1px solid rgba(255,255,255,.09);backdrop-filter:blur(10px);padding:8px 11px;border-radius:999px;font-size:9px;white-space:nowrap}.person-copy{padding:32px;display:flex;flex-direction:column;justify-content:center}.demo-badge{align-self:flex-start;font-size:8px;letter-spacing:.12em;background:rgba(255,195,94,.09);color:#d8ad64;border:1px solid rgba(255,195,94,.14);border-radius:999px;padding:5px 7px;margin-bottom:10px;font-weight:800}.person-copy h3{font-size:34px;letter-spacing:-.05em;margin:0;font-weight:760}.person-copy>p{color:var(--muted);margin:4px 0 20px;font-size:12px}.reason-box{background:#0f0f14;border:1px solid var(--line);border-radius:17px;padding:15px}.reason-box small{font-size:9px;color:var(--accent-2)}.reason-box p{margin:6px 0 0;color:#d2d2da;font-size:12px;line-height:1.65}.person-intro{border-left:2px solid var(--accent);padding-left:12px!important;color:#c7c7d0!important;margin-top:16px!important}.person-actions{display:flex;gap:8px;margin-top:20px}.person-actions .primary{flex:1}
.human-head{display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:9px;padding:2px 0 13px}.back-btn{border:1px solid var(--line);background:#17171e;width:34px;height:34px;border-radius:11px}.human-head strong{display:block;font-size:13px}.human-head span{display:block;color:var(--muted);font-size:9px}.tiny{font-size:9px;padding:7px 9px}.human-profile{display:flex;flex-direction:column;gap:11px}.profile-photo-lock{height:245px;border-radius:18px;background:radial-gradient(circle at 50% 30%,#24232d,#111116 70%);display:grid;place-items:center;text-align:center;color:#73737f;padding:20px;overflow:hidden;font-size:10px}.profile-photo-lock img{width:100%;height:100%;object-fit:cover}.profile-block{border-top:1px solid var(--line);padding-top:12px}.profile-block small{font-size:8px;color:#6d6d79}.profile-block p{font-size:11px;margin:5px 0;color:#d0d0d8}.profile-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.profile-tags span{background:#1d1d26;padding:4px 7px;border-radius:999px;font-size:9px;color:#aaaab6}

/* settings / admin */
.settings-card{border-radius:20px;padding:20px;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:20px}.settings-card h3{margin:0 0 3px;font-size:13px}.settings-card p{color:var(--muted);font-size:10px;margin:0;line-height:1.6}.danger-zone{border-color:rgba(255,100,124,.11)}
.self-profile-card{display:grid;grid-template-columns:86px 1fr;gap:16px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:16px;margin-bottom:10px}.self-profile-photo{width:86px;height:86px;border-radius:24px;background:radial-gradient(circle at 35% 28%,#282633,#121218 72%);overflow:hidden;display:grid;place-items:center;color:var(--muted);font-size:10px}.self-profile-photo img{width:100%;height:100%;object-fit:cover}.self-profile-copy strong{display:block;font-size:20px;letter-spacing:-.035em}.self-profile-copy p{margin:4px 0 9px;color:var(--muted);font-size:11px}.self-profile-tags,.self-memory-tags{display:flex;gap:5px;flex-wrap:wrap}.self-profile-tags span,.self-memory-tags span{padding:5px 8px;border-radius:999px;background:#1d1d26;color:#c5c5cf;font-size:9px}.self-memory-tags{margin-top:9px}.nexi-memory-settings{align-items:flex-start}.nexi-memory-settings>div{width:100%}.profile-page-head{margin-bottom:18px}.version-value{font-size:13px;color:#bcb3ff}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.62);display:grid;place-items:center;z-index:180;padding:20px;backdrop-filter:blur(8px)}.modal-card{position:relative;width:min(420px,100%);background:#15151c;border:1px solid var(--line-strong);border-radius:24px;padding:25px;display:flex;flex-direction:column;gap:10px;box-shadow:var(--shadow)}.modal-card h3{margin:-6px 0 0;font-size:21px}.modal-card p{font-size:10px;color:var(--muted);margin:0 0 7px}.modal-close{position:absolute;right:14px;top:10px;border:0;background:none;font-size:23px;color:var(--muted)}
.toast{position:fixed;left:50%;bottom:25px;transform:translate(-50%,22px);opacity:0;pointer-events:none;background:#f1f1f4;color:#101014;padding:10px 14px;border-radius:999px;font-size:10px;font-weight:700;transition:.2s;z-index:200;box-shadow:0 15px 40px rgba(0,0,0,.26)}.toast.show{opacity:1;transform:translate(-50%,0)}
.admin-shell{max-width:1000px;margin:0 auto;padding:56px 24px 100px}.admin-login{max-width:470px;display:flex;gap:10px;align-items:end}.admin-login label{flex:1}.admin-login label span{font-size:10px;font-weight:800;display:block;margin-bottom:7px}.admin-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}.admin-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:15px}.admin-card span{display:block;font-size:9px;color:var(--muted)}.admin-card b{display:block;font-size:24px;margin-top:4px}.admin-table-wrap{overflow:auto}.admin-table{width:100%;border-collapse:collapse;font-size:11px}.admin-table th,.admin-table td{text-align:left;border-bottom:1px solid var(--line);padding:9px 7px}.admin-table th{color:var(--muted);font-size:9px}.admin-shell .settings-card{display:block;margin-bottom:12px}.microcopy{font-size:9px;color:var(--muted)}
.admin-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.admin-back-link{text-decoration:none;display:inline-flex}.admin-control-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}.admin-control-card{margin:0!important;display:flex!important;align-items:center;justify-content:space-between}.admin-inline-actions{display:flex;gap:7px;flex-wrap:wrap}.admin-control-card button{white-space:nowrap}.admin-mode-on{background:rgba(105,224,170,.12)!important;border-color:rgba(105,224,170,.22)!important;color:#8ce8ba!important}.switch-row{display:flex;align-items:center;gap:7px;font-size:10px;font-weight:750}.switch-row input{width:16px;height:16px;accent-color:var(--accent)}.admin-status-strip{font-size:10px;color:#c8c2f4;background:rgba(141,124,255,.07);border:1px solid rgba(141,124,255,.11);padding:10px 12px;border-radius:13px;margin-bottom:12px}.test-flag{color:#ffd98a;font-weight:850}.live-flag{color:#84e5b4;font-weight:850}
.admin-menu-wrap{position:relative}.admin-more-btn{width:34px;height:34px;border-radius:11px;border:1px solid var(--line);background:#14141b;color:#aaa8b7;font-size:20px;line-height:1;display:grid;place-items:center;padding:0}.admin-popover{position:absolute;right:0;top:40px;z-index:120;width:210px;background:#17171e;border:1px solid var(--line-strong);border-radius:14px;padding:6px;box-shadow:0 18px 50px rgba(0,0,0,.34)}.admin-popover button{width:100%;border:0;background:transparent;color:#d7d7df;padding:10px 11px;border-radius:9px;text-align:left;font-size:11px}.admin-popover button:hover{background:rgba(255,255,255,.06)}

/* in-app desktop */
body.in-app .topbar{height:48px;justify-content:flex-end;background:rgba(9,9,12,.54);border-bottom:0;padding:0 22px}body.in-app .topbar .brand{display:none}body.in-app .chat-layout{height:calc(100dvh - 48px);padding-top:10px;padding-bottom:10px}body.in-app .chat-main,body.in-app .insight-panel{box-shadow:none}body.in-app .ai-chat-head{border-bottom:1px solid rgba(255,255,255,.055);padding:2px 2px 12px}body.in-app .mini-orb{width:10px;height:10px;background:var(--accent);box-shadow:0 0 14px rgba(141,124,255,.48)}body.in-app .mini-orb:after{display:none}body.in-app .ai-identity{gap:8px}body.in-app .match-ready,body.in-app .mobile-match-ready,body.in-app .depth-ring,body.in-app .ai-context{display:none!important}

@media(max-width:920px){.home-stage{grid-template-columns:1fr;gap:42px;padding-top:54px;max-width:720px}.home-copy{text-align:center}.home-copy>p{margin-left:auto;margin-right:auto}.nexi-entry-card{max-width:520px;width:100%;margin:0 auto;min-height:440px}.person-card{grid-template-columns:1fr}.reveal-stage{min-height:340px}.person-copy{padding:25px}}
@media(max-width:760px){.admin-control-grid{grid-template-columns:1fr}.admin-page-head{align-items:flex-start}.admin-page-head .admin-back-link{margin-top:3px}.ai-head-actions{gap:5px}}
@media(max-width:520px){.home-copy{text-align:left}.home-kicker{font-size:10px}.home-copy h1{font-size:39px;line-height:1.1}.home-copy>p{font-size:13px;margin-top:18px}.nexi-entry-card{min-height:380px;padding:23px 19px}.nexi-orb{width:105px;height:105px}.entry-message{margin:22px 0 18px}.entry-message p{font-size:17px}.entry-footnote{justify-content:flex-start}.page-head h2{font-size:38px}.form-card{padding:19px;border-radius:22px}.field-row.two{grid-template-columns:1fr}.compact-age{grid-template-columns:1fr 1fr!important}.photo-picker{align-items:flex-start}.person-copy{padding:20px}.person-copy h3{font-size:30px}.reveal-stage{min-height:300px}.match-screen{padding-top:28px}}

/* mobile: no keyboard JS, no viewport offsets, no fixed chat shell */
@media(max-width:820px){
  :root{--nexi-nav-h:calc(62px + env(safe-area-inset-bottom))}
  html{width:100%;max-width:100%;background:var(--bg)}
  body{max-width:100%;overflow-x:hidden}
  .topbar{height:54px;padding:0 14px;background:#09090c;backdrop-filter:none}.brand{gap:7px}.brand-symbol{width:18px;height:18px}.brand-symbol:after{inset:5px -2px}.brand-word{font-size:14px}.beta-tag{font-size:6px;padding:2px 4px}
  .screen{padding:18px 11px calc(86px + env(safe-area-inset-bottom))}
  .home-stage{min-height:calc(100vh - 120px);padding:42px 17px 44px}.home-copy h1{font-size:46px}.home-copy>p{font-size:14px}.nexi-entry-card{padding:26px 22px;border-radius:27px;min-height:405px}.nexi-orb{width:118px;height:118px}.entry-message p{font-size:18px}.entry-footnote{font-size:8px}
  .top-actions{position:fixed;z-index:90;left:0;right:0;bottom:0;height:var(--nexi-nav-h);padding:6px 10px max(6px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,1fr);background:rgba(10,10,14,.98);border-top:1px solid rgba(255,255,255,.06)}
  .icon-btn{height:52px!important;display:flex!important;flex-direction:column;justify-content:center;gap:4px!important;padding:0!important;border-radius:13px!important;font-size:10px!important}.icon-btn.hidden{display:none!important}.nav-glyph{font-size:16px}.nav-label{font-size:9px;font-weight:760}.icon-btn.has-alert:after{right:calc(50% - 18px);top:7px}
  .chat-layout{grid-template-columns:1fr}.insight-panel{display:none}.bubble{max-width:90%;font-size:14px;line-height:1.58;padding:10px 12px}.mobile-profile-wrap{display:block;margin-top:7px;border:1px solid var(--line);border-radius:13px;background:#111117}.mobile-profile-wrap summary{cursor:pointer;font-size:11px;padding:10px 11px}.mobile-human-profile{padding:0 11px 11px}.mobile-profile-wrap .human-profile{display:flex!important}.mobile-profile-wrap .profile-photo-lock{height:190px}.human-profile{display:none!important}
  .match-screen{padding-top:20px}.match-head{margin-bottom:18px}.match-head h2{font-size:34px}.empty-card{padding:38px 18px}.empty-actions{flex-direction:column}.empty-actions button{width:100%}.person-card{border-radius:22px}.reveal-stage{min-height:260px}.person-copy{padding:18px}.person-copy h3{font-size:28px}.reason-box p{font-size:11px}.person-actions{flex-direction:column}.person-actions button{width:100%}
  .settings-screen{padding-top:20px}.profile-page-head h2{font-size:34px}.profile-page-head p{font-size:12px}.self-profile-card{grid-template-columns:68px minmax(0,1fr);gap:13px;padding:14px;border-radius:18px}.self-profile-photo{width:68px;height:68px;border-radius:20px}.self-profile-copy{min-width:0;overflow:hidden}.self-profile-copy strong{font-size:18px}.self-profile-copy strong,.self-profile-copy p{max-width:100%;overflow:hidden;text-overflow:ellipsis}.settings-card{padding:16px;border-radius:17px;gap:12px;align-items:flex-start;flex-direction:column}.settings-card h3{font-size:14px}.settings-card p{font-size:11px}.settings-card button{width:100%}.field-row,.photo-picker,.consents{min-width:0;max-width:100%}.consent-row{grid-template-columns:20px minmax(0,1fr)!important;gap:12px!important}.consent-row>.consent-copy{font-size:12px!important;padding-top:0!important}
  .admin-cards{grid-template-columns:repeat(2,1fr)}.admin-login{align-items:stretch;flex-direction:column}.admin-more-btn{width:32px;height:32px}.admin-popover{top:37px;right:-2px;width:205px}.toast{bottom:calc(var(--nexi-nav-h) + 10px);max-width:calc(100vw - 24px);text-align:center}

  /* forms / profile / match: ordinary document scrolling */
  body.in-app.nexi-form-mode{position:static!important;width:100%!important;height:auto!important;min-height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0 0 var(--nexi-nav-h)!important}
  body.in-app.nexi-form-mode #app-shell{position:static!important;width:100%!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
  body.in-app.nexi-form-mode .topbar{height:0!important;min-height:0!important;padding:0!important;margin:0!important;position:static!important;overflow:visible!important;border:0!important;background:transparent!important}
  body.in-app.nexi-form-mode .topbar .brand{display:none!important}
  body.in-app.nexi-form-mode .top-actions{position:fixed!important}
  body.in-app.nexi-form-mode .screen{position:relative!important;inset:auto!important;width:100%!important;max-width:none!important;height:auto!important;min-height:calc(100dvh - var(--nexi-nav-h))!important;margin:0!important;overflow:visible!important;padding:18px 12px calc(24px + var(--nexi-nav-h))!important}
  body.in-app.nexi-form-mode .screen:not(.active){display:none!important}body.in-app.nexi-form-mode .screen.active{display:block!important}
  body.in-app.nexi-form-mode input,body.in-app.nexi-form-mode textarea,body.in-app.nexi-form-mode select{scroll-margin:18px!important}

  /* chat: plain flow. Safari may resize/pan natively; we do not fight it. */
  body.in-app:not(.nexi-form-mode){
    position:static!important;
    width:100%!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    background:var(--bg)!important;
  }
  body.in-app:not(.nexi-form-mode) #app-shell{
    position:static!important;
    width:100%!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    overflow:hidden!important;
    background:var(--bg)!important;
    transform:none!important;
  }
  body.in-app:not(.nexi-form-mode) .topbar{display:contents!important}
  body.in-app:not(.nexi-form-mode) .topbar .brand{display:none!important}
  body.in-app:not(.nexi-form-mode) .top-actions{
    grid-row:2!important;
    position:static!important;
    inset:auto!important;
    width:100%!important;
    height:var(--nexi-nav-h)!important;
    min-height:var(--nexi-nav-h)!important;
    margin:0!important;
    padding:6px 10px max(6px,env(safe-area-inset-bottom))!important;
    transform:none!important;
    transition:none!important;
  }
  body.in-app:not(.nexi-form-mode) .screen.chat-layout{
    grid-row:1!important;
    position:static!important;
    inset:auto!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    display:none!important;
    transform:none!important;
    transition:none!important;
  }
  body.in-app:not(.nexi-form-mode) .screen.chat-layout.active{display:flex!important;flex-direction:column!important}
  body.in-app:not(.nexi-form-mode) .chat-main{
    flex:1 1 auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0 12px!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:var(--bg)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.in-app:not(.nexi-form-mode) .ai-chat-head,
  body.in-app:not(.nexi-form-mode) .human-head{
    flex:0 0 auto!important;
    min-height:56px!important;
    margin:0!important;
    padding:10px 1px!important;
    background:var(--bg)!important;
    border-bottom:1px solid rgba(255,255,255,.06)!important;
    position:relative!important;
    z-index:2!important;
  }
  body.in-app:not(.nexi-form-mode) .reveal-notice,
  body.in-app:not(.nexi-form-mode) .mobile-profile-wrap{flex:0 0 auto!important}
  body.in-app:not(.nexi-form-mode) .messages{
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    margin:0!important;
    padding:14px 1px 10px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y!important;
    overflow-anchor:none!important;
    scroll-behavior:auto!important;
  }
  body.in-app:not(.nexi-form-mode) .messages::-webkit-scrollbar{display:none}
  body.in-app:not(.nexi-form-mode) .composer{
    flex:0 0 auto!important;
    position:static!important;
    inset:auto!important;
    width:100%!important;
    min-height:60px!important;
    margin:0!important;
    padding:8px 0!important;
    background:var(--bg)!important;
    border-top:1px solid rgba(255,255,255,.07)!important;
    transform:none!important;
    transition:none!important;
  }
  body.in-app:not(.nexi-form-mode) .composer textarea{
    min-height:44px!important;
    max-height:112px!important;
    margin:0!important;
    padding:10px 12px!important;
    font-size:16px!important;
    line-height:1.45!important;
    border-radius:14px!important;
    background:#111117!important;
    scroll-margin:0!important;
    transform:none!important;
  }
  body.in-app:not(.nexi-form-mode) .composer-actions{margin:0!important;padding:0!important;align-self:end!important}
  body.in-app:not(.nexi-form-mode) .composer-actions button{width:44px!important;height:44px!important}
}

@media(max-width:430px){.brand-symbol{display:none}.beta-tag{margin-left:0}.ai-identity span{font-size:9px}.self-profile-card{grid-template-columns:64px minmax(0,1fr)}.self-profile-photo{width:64px;height:64px}.self-profile-copy strong{font-size:17px}}
