/* Den shell: black base with the logo's amber arc glow, warm frosted-glass panels, section rail / phone tab bar.
   Load after app.css. Tokens live in app.css :root. */

/* ---------- background: black + ONE soft amber aurora pinned to the top of the viewport ----------
   Fixed (so it never scrolls into a band behind content), well under half the old strength, very wide and feathered,
   and gone by 40% of the viewport height. No ring, no corner glows. */
html { background: var(--bg); }
/* body paints the black too (a transparent body shows whatever the host draws behind it); isolation keeps the
   halo below (z-index -1) painting ABOVE this background instead of under it */
body { background: var(--bg); isolation: isolate; }
body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 40vh; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgb(10 132 255 / .085) 0%, rgb(10 132 255 / .05) 28%, rgb(10 132 255 / .02) 58%, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / .6) 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / .6) 45%, transparent 100%);
  animation: halo 18s ease-in-out infinite alternate;
}
@keyframes halo { from { opacity: .75; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; opacity: .9; } }

/* ---------- glass surfaces ---------- */
.glass, .rail, .side, .members, .mainhead, .composer, .sheet, .popover, .txpanel, .tile, .toast, .callbar {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
/* glass = warm translucent fill + top sheen, 1px hairline, soft inner highlight, deep soft shadow (web approximation) */
.glass { background: linear-gradient(180deg, rgb(255 255 255 / .055), rgb(255 255 255 / 0) 42%), var(--glass);
  border: 1px solid var(--hair); box-shadow: var(--hi), 0 1px 2px rgb(0 0 0 / .4), 0 18px 48px rgb(0 0 0 / .45); border-radius: var(--r-lg); }
.side, .members { background: var(--panel); box-shadow: var(--hi); }
.side { border-right-color: var(--line); }
.mainhead { background: rgb(8 8 10 / .55); }
.composer { background: var(--glass); border-color: var(--hair); box-shadow: var(--hi); }
.sheet, .popover { background: var(--glass-2); border-color: var(--hair); box-shadow: var(--hi), var(--shadow); }
.txpanel, .tile { background: var(--glass); border-color: var(--hair); }
/* no backdrop-filter: solid warm panels instead (same tokens, opaque) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --panel: #151518; --glass: #151518; --glass-2: #1c1c20; }
  .mainhead, .sechead { background: #0b0b0f; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --panel: #151518; --glass: #151518; --glass-2: #1c1c20; }
  .mainhead, .sechead { background: #0b0b0f; }
}

/* type: Outfit for display, Geist for everything else */
h1, h2, h3, .servername, .raillbl, .num, .hnum, .badge { font-family: var(--font-display); }
h1, h2 { letter-spacing: -.015em; }
code, pre, kbd { font-family: var(--font-mono); }

/* bot avatar = Denski logo */
.botav { background: #000; overflow: hidden; box-shadow: 0 0 0 1px var(--hair); }
.botav img { width: 100%; height: 100%; display: block; }
/* AURA (the video-review bot): its own initials on a cool violet, so it never reads as Denski or a person */
.av.aurabot, .avs.aurabot { background: linear-gradient(140deg, hsl(262 70% 72%), hsl(222 72% 64%)); color: hsl(250 60% 12%); font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 1px var(--hair); }
.av.aurabot { font-size: 13px; }
.avs.aurabot { font-size: 9px; }
.msg .botbadge { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; background: hsl(250 60% 70% / .22); color: hsl(255 80% 84%); align-self: center; }
.msg .replyref { display: flex; gap: var(--s2); align-items: baseline; min-width: 0; font-size: var(--fs-sm, 13px); color: var(--dim); margin-bottom: 2px; }
.msg .replyref b { font-weight: 600; flex: none; }
.msg .replyref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sys .avs { width: 22px; height: 22px; }

/* splash / gate */
.gate .logo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 0 48px rgb(10 132 255 / .22); }
.gatepane input { background: var(--glass); border-color: var(--hair); }

/* ---------- shell layout ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100dvh; }
.sections { position: relative; min-width: 0; min-height: 0; height: 100%; }
.sections > .section, .sections > #app { height: 100%; }
.section { overflow: auto; }

.rail { display: flex; flex-direction: column; align-items: center; gap: var(--s1); background: rgb(14 12 10 / .7);
  border-right: 1px solid var(--line); padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s2) var(--s3); z-index: 20; }
.raillogo { width: 40px; height: 40px; border-radius: 11px; margin-bottom: var(--s3); box-shadow: 0 0 22px rgb(10 132 255 / .18); }
.raillist { display: flex; flex-direction: column; gap: var(--s1); width: 100%; }
.railbtn { position: relative; width: 100%; min-height: 56px; border-radius: var(--r-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; color: var(--dim); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .01em; }
.railbtn svg.i { width: 22px; height: 22px; }
.railbtn.on { color: var(--accent); background: rgb(10 132 255 / .1); box-shadow: inset 0 0 0 1px rgb(10 132 255 / .18); }
.railbtn.on::before { content: ""; position: absolute; left: calc(-1 * var(--s2)); top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--glow); box-shadow: 0 0 10px var(--glow); }
@media (hover: hover) { .railbtn:not(.on):hover { color: var(--ink); background: var(--raise); } }
.raildot { position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--glow);
  box-shadow: 0 0 8px var(--glow); }

/* View Transitions between sections: a short cross-fade */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ---------- "coming next" placeholder ---------- */
.soonwrap { display: flex; flex-direction: column; }
.secbody { padding-block: var(--s5) var(--s6); }
.soon { max-width: 560px; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.soonicon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--accent);
  background: rgb(10 132 255 / .1); box-shadow: inset 0 0 0 1px rgb(10 132 255 / .2); }
.soonicon svg.i { width: 22px; height: 22px; }
.soonlead { margin: 0; font-size: var(--fs-lg); line-height: 1.4; max-width: 44ch; }
.soonlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); color: var(--dim); }
.soonlist li { display: flex; gap: var(--s2); align-items: baseline; }
.soonlist li::before { content: ""; width: 6px; height: 1px; background: var(--faint); flex: none; transform: translateY(-4px); }
.soontag { margin-left: 0; }

/* ---------- designed empty chat ---------- */
.empty.designed { display: flex; flex-direction: column; align-items: center; gap: var(--s2); max-width: 36ch; padding: var(--s6) var(--s5); }
.empty.designed b { margin: 0; font-size: var(--fs-xl); font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.emptymark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); margin-bottom: var(--s2);
  background: rgb(10 132 255 / .1); box-shadow: inset 0 0 0 1px rgb(10 132 255 / .22), 0 0 32px rgb(10 132 255 / .08); }
.emptymark svg.i { width: 26px; height: 26px; }
.emptytips { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.emptytips li { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--dim); font-size: var(--fs-sm); }

/* ---------- More sheet (phone) ---------- */
/* sits above the content, BELOW the tab bar (so a tab tap is a real tap on the tab), with a visible scrim + grab handle */
.moresheet { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 38;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: end center; box-sizing: border-box; max-width: 100vw;
  padding: var(--s2) var(--s4); overflow: hidden; background: rgb(0 0 0 / .62); animation: scrimin 180ms var(--ease) both; }
.moresheet .sheet { padding: 0 var(--s2) var(--s2); gap: 2px; width: 100%; max-width: 520px; min-width: 0; box-sizing: border-box; touch-action: none; animation: sheetup 240ms var(--ease) both;
  transition: transform 200ms var(--ease); }
.grab { display: grid; place-items: center; height: 24px; flex: none; }
.grab i { width: 36px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .28); }
@keyframes scrimin { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .moresheet, .moresheet .sheet { animation: none; } }
body.more-open .rail { z-index: 45; }
.moresheet .sheet { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.morerow { display: flex; align-items: center; gap: var(--s3); text-align: left; padding: var(--s2) var(--s3); border-radius: var(--r-md); min-height: 56px; }
.morerow.on { background: rgb(10 132 255 / .1); }
.moreicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raise); color: var(--accent); flex: none; }
.moretext { display: flex; flex-direction: column; min-width: 0; }
.moretext b { font-weight: 600; }
.moretext span { color: var(--dim); font-size: var(--fs-sm); line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.moresep { height: 1px; background: var(--line); margin: var(--s1) var(--s3); flex: none; }
.morerow { width: 100%; }
.morerowdot { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); margin-left: auto; flex: none; }
.moresheet .sheet { background: rgb(20 20 24 / .97); }
.railmore { display: none; }

/* ---------- one page header + one content container for every non-chat section ----------
   Content is 1200px max, centred, 24px gutters (16px on phones). Full-bleed bars (the header) use the same
   inline padding so their content lines up with the page below. */
:root { --gut: var(--s5); --pgmax: 1200px; --pgpad: max(var(--gut), calc((100% - var(--pgmax)) / 2)); }
@media (max-width: 760px) { :root { --gut: var(--s4); } }
.pgwrap { width: 100%; max-width: calc(var(--pgmax) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }

.sechead { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; min-height: 56px;
  padding: env(safe-area-inset-top) var(--pgpad) 0; border-bottom: 1px solid var(--line); background: rgb(8 8 10 / .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); position: sticky; top: 0; z-index: 5; flex: none; }
.sechead h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.2; }
.pghead { height: auto; padding-block: 0; }
.pgh-title { display: flex; align-items: baseline; gap: var(--s3); min-height: 56px; align-items: center; flex: none; }
.pgh-title h2 { font-size: var(--fs-xl); letter-spacing: -.01em; }
.pgh-mid { display: flex; align-items: center; gap: var(--s3); flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.pgh-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.pgh-mid:empty { display: none; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 760px) { .pgh-title .eyebrow { display: none; } .pgh-mid { order: 3; flex-basis: 100%; padding-bottom: var(--s2); } }

/* ---------- phone: bottom tab bar ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sections { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; padding: 0 var(--s1) env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line); background: rgb(12 12 16 / .78); }
  .raillogo { display: none; }
  .railbtn.notab { display: none; }
  .railmore { display: flex; }
  .raillist { flex-direction: row; gap: 0; }
  .railbtn { flex: 1; min-height: var(--tabbar); border-radius: 0; background: none !important; box-shadow: none !important; }
  .railbtn.on::before { left: 30%; right: 30%; top: 0; bottom: auto; width: auto; height: 2px; border-radius: 0 0 2px 2px; }
  .raildot { right: calc(50% - 18px); top: 8px; }
  /* one header pattern on every screen: title left, at most two icon actions right, chips row below; top inset respected */
  .sechead { padding-top: env(safe-area-inset-top); }
  .mainhead, .sec-agents .ag-head { padding-top: calc(var(--s2) + env(safe-area-inset-top)); }
  .pgh-title h2, .mainhead h2, .sec-agents .ag-title { font-size: var(--fs-lg); letter-spacing: -.01em; }
  .pgh-actions { gap: var(--s1); }
  .pgh-actions .iconbtn, .mainhead .iconbtn { width: 44px; height: 44px; min-height: 44px; }
  .composer { margin-bottom: var(--s2); }
  .callbar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s2)); }
  body:has(.app.withcallbar:not([hidden])) .toast { bottom: calc(var(--tabbar) + 88px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(var(--tabbar) + var(--s3) + env(safe-area-inset-bottom)); }
}
