/* DevChat — the Alpha look (alpha.darksgames.app): violet night, hot-pink accents, condensed italic display type.
   Tokens and self-hosted OFL fonts are the Alpha ones (alpha.css:8-43). */
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-800i.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-600.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-700.woff2) format("woff2"); }

:root {
  --bg: #0a0616; --bg2: #120a24; --panel: rgba(28, 16, 52, 0.62); --line: rgba(190, 120, 255, 0.16);
  --text: #f3eefc; --dim: #a99cc8; --hot: #ff2d95; --hot2: #ff5fc8; --violet: #7b3cff; --cyan: #b04dff; --amber: #ffd23f; --ok: #5be3a0;
  --grad: linear-gradient(115deg, #ff2d95, #d03cff 50%, #7b3cff);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; --ui: "Rajdhani", system-ui, sans-serif;
  --glow: 0 0 0 1px rgba(255, 45, 149, 0.55), 0 0 22px rgba(255, 45, 149, 0.35);
  --frame: 1px solid rgba(160, 110, 255, 0.28);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: radial-gradient(120% 80% at 70% -10%, #2a0d4a 0%, var(--bg) 55%) fixed, var(--bg); color: var(--text); }
body { font-family: var(--ui); font-weight: 600; font-size: 17px; line-height: 1.35; overscroll-behavior: none; }
#app { height: 100%; }
h1, h2 { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; margin: 0; }
button, textarea, input { font: inherit; color: inherit; }

.btn { font-family: var(--ui); font-weight: 700; border-radius: 8px; border: 1px solid transparent; padding: 0.5rem 0.9rem; cursor: pointer; background: transparent; min-height: 40px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn.ghost { border-color: rgba(160, 110, 255, 0.4); color: var(--text); }
.btn.danger { border-color: rgba(255, 90, 90, 0.6); color: #ff9a9a; }
.input { width: 100%; background: rgba(10, 6, 22, 0.7); border: var(--frame); border-radius: 8px; padding: 0.55rem 0.7rem; resize: none; }
.input:focus-visible, .btn:focus-visible { outline: 2px solid var(--hot2); outline-offset: 1px; }

.gate { min-height: 100%; display: grid; place-items: center; padding: 1rem; }
.gate-card { width: min(420px, 100%); background: var(--panel); border: var(--frame); border-radius: 12px; padding: 1.5rem; display: grid; gap: 0.8rem; text-align: center; justify-items: center; }
.gate-card p { margin: 0; color: var(--dim); }
.err { color: #ff9a9a; margin: 0; min-height: 1em; }

.shell { height: 100%; display: grid; grid-template-columns: 260px 1fr; }
.side { display: flex; flex-direction: column; border-right: var(--frame); background: rgba(18, 10, 36, 0.8); padding-top: var(--safe-t); min-height: 0; }
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.wordmark { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-list { flex: 1; overflow-y: auto; padding: 0.5rem; display: grid; align-content: start; gap: 2px; }
.proj { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; text-align: left; background: transparent; border: 0; border-radius: 10px; padding: 0.6rem 0.8rem; cursor: pointer; color: var(--dim); }
.proj:hover { background: rgba(123, 60, 255, 0.12); }
.proj.on { color: var(--text); background: rgba(255, 45, 149, 0.12); box-shadow: inset 2px 0 0 var(--hot); }
.pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.new { background: var(--hot); box-shadow: 0 0 8px var(--hot); }
.dot.work { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.side-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem; padding-bottom: calc(0.7rem + var(--safe-b)); border-top: 1px solid var(--line); }
.me { flex: 1; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.bar { display: flex; align-items: center; gap: 0.7rem; padding: calc(0.6rem + var(--safe-t)) 1rem 0.6rem; border-bottom: 1px solid var(--hot); background: linear-gradient(180deg, rgba(42, 13, 74, 0.7), rgba(10, 6, 22, 0.4)); }
.menu { display: none; padding: 0.3rem 0.7rem; }
.title { font-size: 1.6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.live.off { background: #777; }
.chips { display: flex; gap: 0.4rem; margin-left: auto; flex-wrap: wrap; }
.chip { font-size: 0.85rem; padding: 0.15rem 0.6rem; border-radius: 999px; border: var(--frame); background: var(--panel); }
.chip.st-running, .chip.st-starting { border-color: var(--amber); color: var(--amber); }
.chip.st-waiting { border-color: var(--hot); color: var(--hot2); box-shadow: var(--glow); }

.thread { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-height: 0; }
.day { align-self: center; color: var(--dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0.4rem 0; }
.msg { max-width: min(760px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.8rem; }
.msg header { display: flex; gap: 0.6rem; align-items: baseline; }
.who { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--hot2); }
.msg time { color: var(--dim); font-size: 0.8rem; }
.body { margin: 0.15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
.msg.mentions { border-color: rgba(255, 45, 149, 0.45); }
.msg-chip .who, .msg-progress .who, .msg-result .who, .msg-permission .who { color: var(--cyan); }
.msg-progress { opacity: 0.85; }
.tools { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--dim); font-size: 0.9rem; font-family: ui-monospace, monospace; }
.msg-notice { align-self: center; background: transparent; border: 0; color: var(--dim); font-size: 0.9rem; padding: 0.1rem; }
.msg-result { border-color: rgba(91, 227, 160, 0.35); }
.outcome { margin: 0.3rem 0 0; color: var(--dim); font-size: 0.9rem; }
.msg-permission { border: var(--frame); }
.msg-permission.card-open { border-color: var(--hot); box-shadow: var(--glow); }
.msg-permission.card-denied { border-color: rgba(255, 90, 90, 0.4); }
.msg-permission.card-allowed { border-color: rgba(91, 227, 160, 0.4); }
pre.input { margin: 0.4rem 0 0; max-height: 9rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; font-family: ui-monospace, monospace; font-weight: 400; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; justify-content: flex-end; }
.msg .actions { justify-content: flex-start; }

.composer { display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.7rem 1rem; padding-bottom: calc(0.7rem + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(18, 10, 36, 0.8); }
.composer-in { max-height: 160px; }

.sheet { width: min(560px, calc(100vw - 2rem)); background: var(--bg2); color: var(--text); border: var(--frame); border-radius: 16px; padding: 1.2rem; box-shadow: var(--glow); }
.sheet::backdrop { background: rgba(5, 2, 12, 0.75); }
.sheet label { display: grid; gap: 0.3rem; margin-top: 0.8rem; color: var(--dim); }
.sheet blockquote { margin: 0; padding: 0.5rem 0.8rem; border-left: 3px solid var(--hot); color: var(--text); background: var(--panel); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7rem; overflow: auto; }
.summary { min-height: 9rem; resize: vertical; color: var(--text); }

.toast { position: fixed; left: 50%; bottom: calc(5rem + var(--safe-b)); transform: translateX(-50%); background: var(--bg2); border: var(--glow); border-radius: 10px; padding: 0.6rem 1rem; z-index: 10; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 25% 0 0; z-index: 5; transform: translateX(-102%); transition: transform 0.2s; min-width: 240px; }
  .shell.drawer .side { transform: none; box-shadow: 0 0 40px #000; }
  .menu { display: inline-block; }
  .body { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .dot.work { animation: none; } .side { transition: none; } }
