:root{color-scheme:dark;--blue:#37baff;--pale:#cceeff;--gold:#ffd38c;--edge:#1269a6;--bg:#030b19}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 55% 2%,#143c67 0,#06162b 35%,#020817 75%);color:#f4faff;font:16px system-ui,-apple-system,Segoe UI,sans-serif}button,input,textarea{font:inherit}button{cursor:pointer;color:inherit}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #ffe09a;outline-offset:3px}#app{max-width:980px;min-height:100dvh;margin:auto;padding-bottom:94px}.top{height:86px;display:flex;align-items:center;justify-content:space-between;padding:12px 19px;background:#031020eb;border-bottom:1px solid #114269;position:sticky;top:0;z-index:5;backdrop-filter:blur(12px)}.brand{display:flex;align-items:center;gap:12px;text-align:left;border:0;background:none;padding:0;min-width:0}.brand strong{display:block;letter-spacing:.18em;font-size:clamp(17px,4vw,28px);color:#d2f1ff;text-shadow:0 0 13px #299fff}.brand small{display:block;font-size:clamp(8px,1.9vw,11px);letter-spacing:.09em;color:var(--gold);font-weight:700}.mini-logo{width:51px;height:51px;flex-shrink:0;border:1px solid #b58a50;border-radius:13px;display:grid;place-items:center;background:radial-gradient(circle at 50% 18%,#ffe3a3,#17385d 28%,#020914 65%);color:#a9e7ff;font-size:34px;text-shadow:0 0 10px #00aaff}.head-actions{display:flex;gap:8px}.head-actions button,.iconbtn{background:#03142a;border:1px solid #125287;border-radius:13px;width:45px;height:45px;color:#a8e7ff;font-size:28px}.bottom{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,980px);z-index:6;display:grid;grid-template-columns:repeat(5,1fr);background:#041226f5;border-top:1px solid #1d608e;box-shadow:0 -10px 30px #0008;padding:10px 3px calc(9px + env(safe-area-inset-bottom))}.bottom button{border:0;background:transparent;color:#bdd3e7;font-size:11px;min-width:0;padding:4px 0}.bottom button span{display:block;font-size:28px;color:#89dfff;line-height:1.3}.bottom button.active{color:white;text-shadow:0 0 10px var(--blue);border-bottom:2px solid var(--blue)}main{padding:16px}.hero,.panel,.tile,.chat-shell{border:1px solid #1884c6;border-radius:23px;background:linear-gradient(145deg,#061a32ed,#020917f2);box-shadow:0 0 22px #005b9b38, inset 0 0 25px #0b4d7a24}.hero{position:relative;min-height:370px;overflow:hidden;padding:26px 22px 24px;display:flex;flex-direction:column;justify-content:end;background:radial-gradient(circle at 69% 26%,#8a5c32 0,#12395e 15%,transparent 39%),linear-gradient(140deg,#051326,#061c39 55%,#010710)}.hero:before{content:'';position:absolute;right:7%;top:3%;width:57%;height:62%;border:3px solid #e6ad61;border-radius:50%;box-shadow:0 0 30px #e9b168,0 0 65px #a56c37;opacity:.72}.hero:after{content:'✦  ·  ✧  ·  ✦';position:absolute;right:7%;top:13%;font-size:27px;letter-spacing:13px;color:#ffe6ad;opacity:.8}.hero-logo{position:absolute;right:4%;top:19%;width:55%;max-width:390px;filter:drop-shadow(0 0 13px #2caaff);text-align:center}.hero-logo svg{width:100%}.hero-logo b{display:block;font-size:clamp(32px,8vw,66px);line-height:1;letter-spacing:.13em;color:#a6e7ff;text-shadow:0 0 15px #008cff,0 2px 0 #fff}.hero-content{position:relative;z-index:2;max-width:410px;text-shadow:0 2px 9px #000}.eyebrow{font-size:12px;letter-spacing:.3em;color:var(--gold);font-weight:800}.hero h1{font-size:clamp(38px,8vw,64px);line-height:1.04;margin:12px 0}.hero h1 em{font-style:normal;color:var(--blue)}.hero p{max-width:310px;color:#e2f2ff;line-height:1.45}.primary{background:linear-gradient(110deg,#a6eaff,#36b7fa);color:#00172a;border:1px solid #d3faff;border-radius:30px;font-weight:800;padding:13px 24px;box-shadow:0 0 17px #00aaff8a}.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:25px 2px 12px}.section-title h2{font-size:21px;margin:0}.link{background:none;border:0;color:var(--blue);font-weight:700}.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.tile{padding:0;overflow:hidden;text-align:left;min-height:163px;display:flex;flex-direction:column;justify-content:end;position:relative}.tile .art{position:absolute;inset:0;opacity:.78;background-size:cover;background-position:center}.tile:after{content:'';position:absolute;inset:0;background:linear-gradient(transparent 25%,#010817f5 95%)}.tile .tiletext{position:relative;z-index:1;padding:45px 12px 13px}.tile strong{display:block;font-size:19px}.tile small{display:block;color:#c4dded;font-size:12px;margin-top:4px}.tile .glyph{display:block;font-size:27px;color:#67d1ff;text-shadow:0 0 10px #00aeff}.departments{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.panel{padding:18px;margin-bottom:15px}.panel h2,.panel h3{margin-top:0}.muted{color:#aac4d9}.status{font-size:12px;color:#a9e8ff;border:1px solid #246c97;border-radius:20px;padding:5px 9px;display:inline-block}.chat-shell{height:calc(100dvh - 213px);min-height:370px;display:flex;flex-direction:column;overflow:hidden}.chat-head{display:flex;align-items:center;justify-content:space-between;padding:14px;border-bottom:1px solid #15527e;gap:8px}.chat-head h2{margin:0;font-size:22px}.chat-head p{margin:3px 0 0;font-size:12px;color:#a8c5d8}.messages{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.bubble{max-width:87%;border-radius:16px;padding:11px 14px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.bubble.user{align-self:flex-end;background:#0a5484}.bubble.mock{align-self:flex-start;background:#102a45;border:1px solid #24658b}.composer{display:flex;gap:8px;padding:12px;border-top:1px solid #15527e}.composer input{flex:1;min-width:0;border:1px solid #256b96;background:#06182b;border-radius:23px;padding:12px;color:white}.composer button{min-width:52px}.smallbtn{background:#0c2b46;border:1px solid #23638e;border-radius:12px;padding:9px 13px}.actions{display:flex;flex-wrap:wrap;gap:9px}.data-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 0;border-bottom:1px solid #1c4565}.data-row:last-child{border-bottom:0}.warning{color:#ffda9e;font-size:13px}.empty{padding:30px 10px;text-align:center;color:#aac8dc}.search-input{width:100%;border:1px solid #2876a5;border-radius:14px;background:#061a31;padding:14px;color:white;margin-bottom:16px}.feed-card{padding:17px;border:1px solid #1b6795;border-radius:18px;background:#071b31;margin-bottom:12px}.feed-card h3{margin:0 0 8px}@media(min-width:700px){.tiles{grid-template-columns:repeat(4,1fr)}.departments{grid-template-columns:repeat(5,1fr)}.hero{min-height:440px}.tile{min-height:190px}}@media(max-width:380px){.brand strong{letter-spacing:.09em}.mini-logo{width:42px;height:42px}.top{padding:10px}.head-actions button{width:38px;height:42px}.hero-logo{opacity:.75}.hero h1{font-size:38px}}
/* v1.1: one chat surface per department; composer stays inside its room. */
#view:has(.chat-shell){padding:12px 12px 0}
#view:has(.chat-shell) .chat-shell{height:calc(100dvh - 86px - 91px - env(safe-area-inset-bottom) - 24px);min-height:260px;max-height:none}
.chat-shell{isolation:isolate}.chat-shell .messages{min-height:0;overscroll-behavior:contain}.chat-shell .composer{position:relative;flex-shrink:0;background:#041529;z-index:1}.chat-shell .chat-head{flex-shrink:0}
@media(max-height:540px){#view:has(.chat-shell) .chat-shell{min-height:180px}.chat-head{padding:7px 12px}.composer{padding:7px}}
/* Atlas Social v2 — unified companion room */
:root{--room-accent:#5bd7ff}
body.in-chat{overflow:hidden}
body.in-chat #app{height:100dvh;min-height:0;padding-bottom:0;display:flex;flex-direction:column;overflow:hidden}
body.in-chat .top{height:70px;min-height:70px;position:relative;flex-shrink:0}
body.in-chat #view{flex:1;min-height:0;display:flex;padding:8px 10px 0!important;overflow:hidden}
body.in-chat .bottom{position:relative;left:auto;bottom:auto;transform:none;width:100%;flex-shrink:0;padding-bottom:calc(8px + env(safe-area-inset-bottom));min-height:74px}
body.in-chat .chat-shell{width:100%;height:100%!important;min-height:0!important;max-height:none;position:relative;isolation:isolate;overflow:hidden;border-color:#40bbff;background:radial-gradient(circle at 72% 25%,#f7b76585 0%,transparent 17%),radial-gradient(ellipse at 52% 55%,#0758a1 0%,#042349 35%,#020c23 77%);box-shadow:inset 0 0 35px #1289e455,0 0 16px #008bff55;}
/* Decorative landscape, contained behind the actual chat controls. */
body.in-chat .chat-shell:before{content:'';position:absolute;inset:74px 0 70px;pointer-events:none;opacity:.86;background:radial-gradient(circle at 70% 17%,#ffe5a4 0 2%,#e5a94c88 3%,transparent 17%),linear-gradient(135deg,transparent 40%,#d7efff 40.4%,#197ed0 43%,#021b45 60%,transparent 60.4%) 54% 48%/115% 72% no-repeat,linear-gradient(30deg,transparent 36%,#a1e6ff 36.3%,#1167b1 40%,#021b45 63%,transparent 63.3%) 0 72%/110% 65% no-repeat,linear-gradient(to top,#021124 0%,#06416f 13%,transparent 35%);mask-image:linear-gradient(to bottom,#000 10%,#000 85%,transparent 100%)}
body.in-chat .chat-shell:after{content:'';position:absolute;inset:75px 0 80px;pointer-events:none;opacity:.35;background-image:radial-gradient(#fff 1px,transparent 1.5px),radial-gradient(#8adfff 1px,transparent 1.5px);background-size:43px 57px,67px 83px;background-position:4px 8px,26px 39px}
.chat-head{position:relative;z-index:2;min-height:74px;display:flex;gap:10px;padding:10px 12px!important;background:#03172bdc;backdrop-filter:blur(8px);border-bottom:1px solid #2c9de0}
.room-avatar{width:49px;height:49px;flex:0 0 49px;display:grid;place-items:center;border-radius:50%;color:#d8f8ff;font-size:29px;background:radial-gradient(circle at 50% 25%,#ffe9b3,#0a8bd3 30%,#031633 74%);border:1px solid var(--room-accent);box-shadow:0 0 12px var(--room-accent)}
.room-identity{min-width:0;flex:1}.chat-head h2{font-size:clamp(16px,4.5vw,23px);line-height:1.2}.chat-head p{color:#77e6cf;font-size:11px}.chat-head .smallbtn{font-size:12px;padding:9px;white-space:nowrap}
body.in-chat .messages{position:relative;z-index:1;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:15px 13px;scrollbar-width:thin;scrollbar-color:#56bdf5 transparent}
body.in-chat .bubble{background:#04274abf;backdrop-filter:blur(5px);border:1px solid #299de3;box-shadow:0 0 9px #007dd04a;color:#f1faff;font-size:14px}
body.in-chat .bubble.user{background:#08649ac9;border-color:var(--room-accent)}
body.in-chat .composer{position:relative;z-index:3;flex-shrink:0;display:flex;align-items:center;gap:9px;padding:10px;background:#031b37ed;border-top:1px solid #43baff}
body.in-chat .composer input{height:53px;border:2px solid #2ea8ed;box-shadow:inset 0 0 9px #005d9c,0 0 8px #008bff44;background:#06294a;border-radius:30px;font-size:15px}
.send-button{display:grid;place-items:center;flex:0 0 54px;width:54px;height:54px;min-width:54px;padding:0;margin:0;border-radius:50%;background:linear-gradient(145deg,#c4faff,#31d5fb);color:#005079;border:2px solid #d7fcff;box-shadow:0 0 15px #00baff}
.send-button svg{display:block;width:26px;height:26px;transform:translate(1px,0);overflow:visible}
@media(max-height:620px){body.in-chat .top{height:56px;min-height:56px}.chat-head{min-height:59px}.room-avatar{width:38px;height:38px;flex-basis:38px}.send-button{height:46px;width:46px;flex-basis:46px}.composer input{height:46px!important}}
