/* ========================================================================== */
/* Project STΛRLIɢHT: Ember CoreUI                                            */
/* Stand: Ember CoreUI 0.2.7-alpha                                           */
/* Helles, eigenständiges Ren- und Ayal'ren-Holo-Interface                   */
/* ========================================================================== */

@font-face {
  font-family: "Rajdhani";
  src: url("../assets/fonts/rajdhani_500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Rajdhani";
  src: url("../assets/fonts/rajdhani_600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Rajdhani";
  src: url("../assets/fonts/rajdhani_700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Share Tech Mono";
  src: url("../assets/fonts/share_tech_mono_400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f0f4fafd;
  --panel: rgba(255, 255, 255, 0.85);
  --cx: #5b92ff;
  --amb: #e29b39;
  --txt: #101626;
  --green: #2aaf75;
  --red: #d4505d;
  --violet: #8a6ff2;
  --muted: #66728a;
  --muted-soft: #8994aa;
  --line: rgba(91, 146, 255, 0.25);
  --line-strong: rgba(91, 146, 255, 0.54);
  --line-amber: rgba(226, 155, 57, 0.48);
  --panel-solid: #fbfdff;
  --panel-soft: rgba(246, 250, 255, 0.78);
  --panel-cx: rgba(91, 146, 255, 0.09);
  --panel-amb: rgba(226, 155, 57, 0.1);
  --ink-inverse: #f9fbff;
  --shadow-soft: 0 18px 50px rgba(34, 58, 104, 0.11);
  --shadow-tight: 0 8px 22px rgba(43, 72, 126, 0.1);
  --glow-cx: 0 0 24px rgba(91, 146, 255, 0.34);
  --glow-amb: 0 0 22px rgba(226, 155, 57, 0.35);
  --drawer-expanded: 336px;
  --drawer-collapsed: 88px;
  --header-height: 88px;
  --composer-height: 148px;
  --ease-holo: cubic-bezier(0.22, 0.72, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 146, 255, 0.16), transparent 26rem),
    radial-gradient(circle at 94% 90%, rgba(138, 111, 242, 0.12), transparent 34rem),
    linear-gradient(145deg, #f8fbff 0%, var(--bg) 47%, #edf2fb 100%);
  color: var(--txt);
  user-select: none;
  -webkit-user-select: none;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(16, 22, 38, 0.92) 0.75px, transparent 0.85px);
  background-size: 18px 18px;
  opacity: 0.03;
}

body::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(116deg, transparent 0 46%, rgba(91, 146, 255, 0.045) 46.1% 46.25%, transparent 46.35%),
    linear-gradient(26deg, transparent 0 73%, rgba(226, 155, 57, 0.035) 73.1% 73.24%, transparent 73.34%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amb);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar-control {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ========================================================================== */
/* Sidebar and Ren matrix                                                     */
/* ========================================================================== */

.drawer {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--drawer-expanded);
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.86)),
    var(--panel);
  box-shadow: 20px 0 56px rgba(40, 66, 112, 0.13);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  transition:
    width 420ms var(--ease-holo),
    transform 420ms var(--ease-holo),
    box-shadow 320ms ease;
}

.drawer::before,
.drawer::after {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  content: "";
  pointer-events: none;
}

.drawer::before {
  top: 10px;
  left: 10px;
  border-top: 2px solid var(--amb);
  border-left: 2px solid var(--amb);
}

.drawer::after {
  right: 10px;
  bottom: 10px;
  border-right: 2px solid var(--cx);
  border-bottom: 2px solid var(--cx);
}

.drawer-vector-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.7;
}

.drawer-vector-field::before {
  position: absolute;
  top: 46px;
  left: -92px;
  width: 320px;
  height: 320px;
  content: "";
  border: 1px solid rgba(91, 146, 255, 0.13);
  transform: rotate(45deg);
}

.drawer-vector-field::after {
  position: absolute;
  right: -118px;
  bottom: 112px;
  width: 260px;
  height: 260px;
  content: "";
  border: 1px solid rgba(226, 155, 57, 0.12);
  border-radius: 50%;
}

.drawer-vector-field span {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 146, 255, 0.26), transparent);
  transform-origin: left center;
}

.drawer-vector-field span:nth-child(1) {
  top: 212px;
  left: 22px;
  width: 260px;
  transform: rotate(21deg);
}

.drawer-vector-field span:nth-child(2) {
  top: 336px;
  left: 58px;
  width: 310px;
  transform: rotate(-32deg);
}

.drawer-vector-field span:nth-child(3) {
  right: -10px;
  bottom: 190px;
  width: 250px;
  transform: rotate(62deg);
}

.drawer-vector-field span:nth-child(4) {
  right: -46px;
  bottom: 76px;
  width: 260px;
  transform: rotate(138deg);
}

.drawer-header,
.drawer-content,
.drawer-footer,
.core-ticker {
  position: relative;
  z-index: 2;
}

.drawer-header {
  display: flex;
  min-height: 270px;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 26px 12px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.17);
  background:
    radial-gradient(circle at 50% 33%, rgba(91, 146, 255, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent);
}

.brand-lockup {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.ren-matrix {
  position: relative;
  width: 166px;
  height: 166px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 20px rgba(62, 98, 160, 0.16));
  transition:
    width 380ms var(--ease-holo),
    height 380ms var(--ease-holo),
    margin 380ms var(--ease-holo);
}

.ren-matrix::before {
  position: absolute;
  inset: 14%;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(91, 146, 255, 0.1) 45%, transparent 70%);
  filter: blur(7px);
  animation: matrix-halo 4.2s ease-in-out infinite;
}

.ren-matrix-svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.matrix-guide {
  fill: none;
  stroke: rgba(91, 146, 255, 0.2);
  stroke-width: 0.75;
  stroke-dasharray: 2 5;
}

.matrix-orbit {
  fill: none;
  stroke: rgba(91, 146, 255, 0.66);
  stroke-width: 1.25;
  stroke-dasharray: 4 7;
  transform-box: fill-box;
  transform-origin: center;
}

.matrix-orbit-a {
  animation: matrix-rotate 19s linear infinite;
}

.matrix-orbit-b {
  stroke: rgba(226, 155, 57, 0.66);
  stroke-dasharray: 2 8;
  animation: matrix-rotate-reverse 15s linear infinite;
}

.orbit-node {
  stroke: #ffffff;
  stroke-width: 1.5;
}

.orbit-node-cx {
  fill: var(--cx);
}

.orbit-node-amb {
  fill: var(--amb);
}

.matrix-runes {
  fill: none;
  stroke: var(--amb);
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
  opacity: 0.9;
  animation: rune-pulse 3.6s ease-in-out infinite;
}

.matrix-star .star-outer {
  fill: rgba(91, 146, 255, 0.055);
  stroke: url("#renCoreGradient");
  stroke-width: 1.45;
}

.matrix-star .star-inner {
  fill: rgba(255, 255, 255, 0.55);
  stroke: var(--cx);
  stroke-width: 1.15;
}

.matrix-star .star-diamond {
  fill: rgba(138, 111, 242, 0.055);
  stroke: rgba(138, 111, 242, 0.85);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}

.matrix-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: star-breathe 5.4s ease-in-out infinite;
}

.matrix-core .core-halo {
  fill: url("#renHaloGradient");
  opacity: 0.88;
}

.matrix-core .core-ring {
  fill: rgba(255, 255, 255, 0.86);
  stroke: var(--amb);
  stroke-width: 1.8;
  stroke-dasharray: 3 3;
}

.matrix-core .core-rune {
  fill: none;
  stroke: var(--amb);
  stroke-width: 2.2;
  stroke-linejoin: miter;
}

.matrix-core .core-point {
  fill: #fff7e9;
  stroke: var(--amb);
  stroke-width: 2;
}

.matrix-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: core-pulse 2.8s ease-in-out infinite;
}

.matrix-code {
  fill: rgba(16, 22, 38, 0.62);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 1.1px;
  text-anchor: middle;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  margin-top: -2px;
  text-align: center;
  transition:
    opacity 220ms ease,
    transform 280ms var(--ease-holo);
}

.brand-kicker {
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.brand-title {
  margin-top: 2px;
  color: var(--txt);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.brand-title span {
  color: var(--cx);
  text-shadow: var(--glow-cx);
}

.brand-signature {
  margin-top: 7px;
  color: var(--amb);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.drawer-close {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 15px;
  display: grid;
  width: 32px;
  height: 32px;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(91, 146, 255, 0.38);
  background: rgba(255, 255, 255, 0.78);
  color: var(--cx);
  box-shadow: var(--shadow-tight);
  clip-path: polygon(0 0, 76% 0, 100% 24%, 100% 100%, 24% 100%, 0 76%);
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 260ms var(--ease-holo);
}

.drawer-close:hover {
  background: var(--cx);
  color: #ffffff;
}

.drawer-close span {
  font-family: "Share Tech Mono", monospace;
  font-size: 25px;
  line-height: 1;
  transition: transform 360ms var(--ease-holo);
}

.core-ticker {
  width: 100%;
  height: 31px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 2px solid var(--amb);
  background: var(--txt);
  color: #f5f8ff;
  box-shadow: 0 7px 20px rgba(16, 22, 38, 0.14);
  transition:
    opacity 180ms ease,
    height 260ms var(--ease-holo);
}

.ticker-track {
  display: flex;
  width: max-content;
  min-width: 400%;
  height: 100%;
  align-items: center;
  will-change: transform;
  animation: core-ticker-loop 26s linear infinite;
}

.ticker-unit {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  padding-right: 28px;
  color: #f7f9ff;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.ticker-unit::before {
  width: 5px;
  height: 5px;
  margin: 0 12px 0 2px;
  content: "";
  background: var(--amb);
  box-shadow: 0 0 9px var(--amb);
  transform: rotate(45deg);
}

.drawer-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 10px;
  transition:
    opacity 180ms ease,
    transform 260ms var(--ease-holo);
}

.hud-button {
  position: relative;
  display: flex;
  min-height: 48px;
  cursor: pointer;
  align-items: center;
  border: 0;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
}

.hud-button::before,
.hud-button::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hud-button-primary {
  width: 100%;
  min-height: 68px;
  gap: 12px;
  padding: 11px 18px;
  border: 1px solid rgba(91, 146, 255, 0.48);
  background:
    linear-gradient(100deg, rgba(91, 146, 255, 0.17), rgba(255, 255, 255, 0.86) 48%, rgba(226, 155, 57, 0.08)),
    #ffffff;
  color: var(--txt);
  box-shadow: var(--shadow-tight);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hud-button-primary::before {
  top: 0;
  right: 18px;
  width: 32%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amb));
}

.hud-button-primary::after {
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--amb);
  border-bottom: 2px solid var(--amb);
}

.hud-button-primary:hover {
  border-color: var(--cx);
  box-shadow: var(--shadow-tight), var(--glow-cx);
  transform: translateY(-2px);
}

.hud-button-primary:active {
  transform: translateY(0);
}

.hud-button-glyph {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(226, 155, 57, 0.5);
  background: var(--panel-amb);
  color: var(--amb);
  font-family: "Share Tech Mono", monospace;
  font-size: 19px;
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.hud-button-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.hud-button-copy strong {
  color: var(--txt);
  font-size: 15px;
  line-height: 1.1;
}

.hud-button-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.session-zone {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.section-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 0 3px 8px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.2);
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
}

.section-rune {
  color: var(--amb);
  font-size: 14px;
  text-shadow: var(--glow-amb);
}

.section-count {
  min-width: 30px;
  padding: 2px 5px;
  border: 1px solid rgba(91, 146, 255, 0.25);
  background: rgba(91, 146, 255, 0.07);
  color: var(--cx);
  text-align: center;
}

.session-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0 3px 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(91, 146, 255, 0.42) transparent;
  scrollbar-width: thin;
}

.session-list::-webkit-scrollbar {
  width: 4px;
}

.session-list::-webkit-scrollbar-thumb {
  background: rgba(91, 146, 255, 0.42);
}

.session-item {
  position: relative;
  display: grid;
  min-height: 53px;
  cursor: pointer;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 2px 10px;
  padding: 9px 12px 9px 15px;
  border: 1px solid rgba(91, 146, 255, 0.15);
  background: rgba(255, 255, 255, 0.52);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.session-item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  content: "";
  background: rgba(91, 146, 255, 0.35);
}

.session-item:hover {
  border-color: rgba(91, 146, 255, 0.45);
  background: rgba(91, 146, 255, 0.08);
  transform: translateX(3px);
}

.session-item.active {
  border-color: rgba(226, 155, 57, 0.56);
  background:
    linear-gradient(90deg, rgba(226, 155, 57, 0.13), rgba(255, 255, 255, 0.76)),
    #ffffff;
  box-shadow: 0 8px 18px rgba(82, 75, 57, 0.09);
}

.session-item.active::before {
  background: var(--amb);
  box-shadow: 0 0 10px rgba(226, 155, 57, 0.68);
}

.session-item-title {
  overflow: hidden;
  color: var(--txt);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item-meta {
  align-self: center;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.drawer-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 18px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(91, 146, 255, 0.18);
  background: rgba(247, 250, 255, 0.68);
  transition: padding 300ms var(--ease-holo);
}

.drawer-system-line {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.drawer-system-line i {
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.14), rgba(91, 146, 255, 0.45), rgba(226, 155, 57, 0.18));
}

.hud-button-quiet {
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(91, 146, 255, 0.2);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 11px;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.hud-button-quiet:hover {
  border-color: rgba(91, 146, 255, 0.52);
  background: rgba(91, 146, 255, 0.08);
  color: var(--cx);
}

.btn-logout:hover {
  border-color: rgba(212, 80, 93, 0.46);
  background: rgba(212, 80, 93, 0.07);
  color: var(--red);
}

/* Collapsed desktop rail */

#sidebarControl:not(:checked) ~ .drawer {
  width: var(--drawer-collapsed);
}

#sidebarControl:not(:checked) ~ .drawer .drawer-header {
  min-height: 138px;
  padding: 36px 10px 8px;
}

#sidebarControl:not(:checked) ~ .drawer .ren-matrix {
  width: 70px;
  height: 70px;
}

#sidebarControl:not(:checked) ~ .drawer .brand-copy,
#sidebarControl:not(:checked) ~ .drawer .core-ticker,
#sidebarControl:not(:checked) ~ .drawer .drawer-content,
#sidebarControl:not(:checked) ~ .drawer .drawer-system-line {
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#sidebarControl:not(:checked) ~ .drawer .drawer-close {
  top: 12px;
  right: 11px;
}

#sidebarControl:not(:checked) ~ .drawer .drawer-close span {
  transform: rotate(180deg);
}

#sidebarControl:not(:checked) ~ .drawer .drawer-footer {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px 20px;
}

#sidebarControl:not(:checked) ~ .drawer .hud-button-quiet {
  width: 58px;
  min-height: 52px;
  padding: 0;
  font-size: 18px;
}

#sidebarControl:not(:checked) ~ .drawer .hud-button-quiet span:last-child {
  display: none;
}

/* ========================================================================== */
/* Main shell and top bar                                                     */
/* ========================================================================== */

.app-shell {
  position: relative;
  z-index: 2;
  display: flex;
  width: auto;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  margin-left: var(--drawer-expanded);
  overflow: hidden;
  transition: margin-left 420ms var(--ease-holo);
}

#sidebarControl:not(:checked) ~ .app-shell {
  margin-left: var(--drawer-collapsed);
}

.app-header {
  position: relative;
  z-index: 12;
  display: grid;
  min-height: var(--header-height);
  flex: 0 0 auto;
  grid-template-columns: minmax(310px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 12px 25px 12px 20px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.8)),
    var(--panel);
  box-shadow: 0 12px 36px rgba(41, 67, 112, 0.08);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.app-header::before {
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 35%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--cx) 52%, var(--amb));
  opacity: 0.72;
}

.app-header::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  content: "";
  border-top: 2px solid var(--amb);
  border-right: 2px solid var(--amb);
}

.header-leading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
}

.header-menu-btn {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  cursor: pointer;
  place-content: center;
  gap: 5px;
  border: 1px solid rgba(91, 146, 255, 0.42);
  background: rgba(255, 255, 255, 0.74);
  color: var(--cx);
  box-shadow: var(--shadow-tight);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition:
    background 160ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.header-menu-btn::before,
.header-menu-btn::after {
  position: absolute;
  width: 10px;
  height: 10px;
  content: "";
}

.header-menu-btn::before {
  top: 4px;
  left: 4px;
  border-top: 1px solid var(--amb);
  border-left: 1px solid var(--amb);
}

.header-menu-btn::after {
  right: 4px;
  bottom: 4px;
  border-right: 1px solid var(--cx);
  border-bottom: 1px solid var(--cx);
}

.header-menu-btn:hover {
  background: rgba(91, 146, 255, 0.1);
  box-shadow: var(--shadow-tight), var(--glow-cx);
  transform: translateY(-1px);
}

.header-menu-btn span {
  display: block;
  width: 19px;
  height: 1.5px;
  background: currentColor;
  transition: width 180ms ease, transform 180ms ease;
}

.header-menu-btn span:nth-child(2) {
  width: 13px;
}

.header-menu-btn:hover span:nth-child(2) {
  width: 19px;
}

.header-title-block {
  min-width: 0;
}

.header-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.header-rune {
  color: var(--amb);
  font-size: 12px;
  text-shadow: var(--glow-amb);
}

.header-title-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  margin-top: 3px;
}

.header-title {
  margin: 0;
  color: var(--txt);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}

.header-divider {
  width: 24px;
  height: 1px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, var(--cx), var(--amb));
}

.header-session-name {
  min-width: 0;
  overflow: hidden;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-shadow: 0 0 14px rgba(91, 146, 255, 0.27);
  white-space: nowrap;
}

.header-telemetry {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(91, 146, 255, 0.18);
  background: rgba(255, 255, 255, 0.52);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.telemetry-cell {
  display: flex;
  min-width: 76px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border-right: 1px solid rgba(91, 146, 255, 0.14);
}

.telemetry-cell:last-child {
  border-right: 0;
}

.telemetry-key {
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.telemetry-cell strong {
  margin-top: 2px;
  color: var(--txt);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.header-status {
  display: flex;
  min-width: 175px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.status-dot {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(212, 80, 93, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 45%, rgba(212, 80, 93, 0.11) 47% 68%, transparent 70%),
    rgba(255, 255, 255, 0.76);
  color: var(--red);
  box-shadow: 0 0 0 5px rgba(212, 80, 93, 0.055), 0 8px 22px rgba(42, 52, 78, 0.12);
  transition:
    color 240ms ease,
    border-color 240ms ease,
    background 240ms ease,
    box-shadow 240ms ease;
}

.power-orbit {
  position: absolute;
  inset: 4px;
  border: 1px dashed currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.power-orbit::before,
.power-orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: currentColor;
  transform: translate(-50%, -50%);
}

.power-orbit::before {
  width: 4px;
  height: 4px;
  margin-top: -19px;
  border-radius: 50%;
  box-shadow: 0 38px 0 currentColor;
}

.power-orbit::after {
  width: 3px;
  height: 3px;
  margin-left: -19px;
  border-radius: 50%;
  box-shadow: 38px 0 0 currentColor;
}

.power-glyph {
  position: relative;
  z-index: 2;
  font-family: "Share Tech Mono", monospace;
  font-size: 25px;
  line-height: 1;
  text-shadow: 0 0 10px currentColor;
}

.status-dot.waiting,
.status-dot.thinking,
.status-dot.streaming {
  border-color: rgba(226, 155, 57, 0.7);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 43%, rgba(226, 155, 57, 0.19) 45% 68%, transparent 70%),
    rgba(255, 255, 255, 0.8);
  color: var(--amb);
  box-shadow: 0 0 0 5px rgba(226, 155, 57, 0.08), 0 0 25px rgba(226, 155, 57, 0.46);
  animation: power-thinking 1.4s linear infinite;
}

.status-dot.online,
.status-dot.replied {
  border-color: rgba(42, 175, 117, 0.68);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 43%, rgba(42, 175, 117, 0.16) 45% 68%, transparent 70%),
    rgba(255, 255, 255, 0.8);
  color: var(--green);
  box-shadow: 0 0 0 5px rgba(42, 175, 117, 0.07), 0 0 25px rgba(42, 175, 117, 0.38);
}

.status-dot.replied {
  animation: power-replied 10s ease-out 1 both;
}

.status-dot.error {
  border-color: rgba(212, 80, 93, 0.68);
  color: var(--red);
  box-shadow: 0 0 0 5px rgba(212, 80, 93, 0.07), 0 0 22px rgba(212, 80, 93, 0.28);
}

.status-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.status-kicker {
  color: var(--txt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}

.status-label {
  max-width: 150px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================================== */
/* Message feed                                                               */
/* ========================================================================== */

.messages-area {
  position: relative;
  z-index: 2;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-color: rgba(91, 146, 255, 0.45) transparent;
  scrollbar-width: thin;
}

.messages-area::-webkit-scrollbar {
  width: 6px;
}

.messages-area::-webkit-scrollbar-track {
  background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(91, 146, 255, 0.42);
}

.messages-area::before {
  position: fixed;
  z-index: -1;
  inset: var(--header-height) 0 var(--composer-height) var(--drawer-expanded);
  content: "";
  pointer-events: none;
  background:
    linear-gradient(30deg, transparent 0 48.8%, rgba(91, 146, 255, 0.04) 49% 49.15%, transparent 49.3%) 0 0 / 88px 88px,
    linear-gradient(150deg, transparent 0 48.8%, rgba(138, 111, 242, 0.03) 49% 49.15%, transparent 49.3%) 0 0 / 88px 88px;
  transition: left 420ms var(--ease-holo);
}

#sidebarControl:not(:checked) ~ .app-shell .messages-area::before {
  left: var(--drawer-collapsed);
}

.feed-vector {
  position: fixed;
  z-index: -1;
  width: 430px;
  height: 430px;
  pointer-events: none;
  border: 1px solid rgba(91, 146, 255, 0.06);
  transform: rotate(45deg);
}

.feed-vector::before,
.feed-vector::after {
  position: absolute;
  content: "";
}

.feed-vector::before {
  inset: 62px;
  border: 1px dashed rgba(91, 146, 255, 0.07);
}

.feed-vector::after {
  inset: 124px;
  border: 1px solid rgba(226, 155, 57, 0.06);
  border-radius: 50%;
}

.feed-vector-a {
  top: 16%;
  right: -260px;
}

.feed-vector-b {
  bottom: -310px;
  left: 8%;
}

.feed-shell {
  position: relative;
  width: min(1120px, calc(100% - 64px));
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 0 54px;
}

.feed-shell::before,
.feed-shell::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.feed-shell::before {
  top: 19px;
  bottom: 36px;
  left: -24px;
  width: 12px;
  border-top: 1px solid var(--cx);
  border-bottom: 1px solid var(--cx);
  border-left: 1px solid var(--cx);
  opacity: 0.35;
}

.feed-shell::after {
  top: 70px;
  right: -23px;
  width: 12px;
  height: 128px;
  border-top: 1px solid var(--amb);
  border-right: 1px solid var(--amb);
  border-bottom: 1px solid var(--amb);
  opacity: 0.38;
}

.feed-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.feed-header-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.feed-rune {
  color: var(--amb);
  font-size: 14px;
  text-shadow: var(--glow-amb);
}

.feed-header-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.55), rgba(91, 146, 255, 0.08), rgba(226, 155, 57, 0.28));
}

.feed-header-code {
  color: var(--muted-soft);
  font-size: 8px;
}

.messages-inner {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  gap: 21px;
}

.msg-row {
  position: relative;
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 13px;
  animation: message-arrive 360ms var(--ease-holo) both;
}

.msg-row.user {
  flex-direction: row-reverse;
}

.msg-row.system {
  justify-content: center;
  padding: 2px 0;
}

.msg-avatar-col {
  display: flex;
  width: 44px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.msg-avatar {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(91, 146, 255, 0.52);
  background:
    linear-gradient(135deg, rgba(91, 146, 255, 0.18), rgba(255, 255, 255, 0.88)),
    #ffffff;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  box-shadow: 0 7px 18px rgba(65, 93, 145, 0.14);
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.msg-avatar::before,
.msg-avatar::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.msg-avatar::before {
  inset: 5px;
  border: 1px dashed rgba(91, 146, 255, 0.31);
  clip-path: inherit;
}

.msg-avatar::after {
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(42, 175, 117, 0.68);
  transform: rotate(45deg);
}

.msg-row.user .msg-avatar {
  border-color: rgba(226, 155, 57, 0.55);
  background:
    linear-gradient(135deg, rgba(226, 155, 57, 0.16), rgba(255, 255, 255, 0.9)),
    #ffffff;
  color: #9b651e;
}

.msg-level {
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.03em;
  line-height: 1;
  text-align: center;
}

.msg-row.user .msg-level {
  color: #a16924;
}

.msg-content {
  display: flex;
  width: fit-content;
  max-width: min(78%, 820px);
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.msg-row.user .msg-content {
  align-items: flex-end;
}

.msg-name {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 7px 5px;
  color: var(--cx);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.msg-row.user .msg-name {
  color: #9b651e;
}

.msg-gender {
  display: inline-grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  font-family: "Share Tech Mono", monospace;
  font-size: 13px;
  letter-spacing: 0;
}

.msg-gender.male,
.msg-gender[data-gender="m"] {
  color: #3f8feb;
}

.msg-gender.female,
.msg-gender[data-gender="f"] {
  color: #e26da9;
}

.msg-bubble {
  position: relative;
  min-width: 52px;
  padding: 14px 17px 15px;
  border: 1px solid rgba(91, 146, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.84)),
    var(--panel);
  color: var(--txt);
  box-shadow: var(--shadow-tight);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.54;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}

.msg-bubble::before {
  position: absolute;
  top: 0;
  left: 16px;
  width: 32%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--cx), transparent);
}

.msg-row.user .msg-bubble {
  border-color: rgba(226, 155, 57, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 250, 242, 0.96), rgba(255, 255, 255, 0.88)),
    var(--panel);
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 15px);
}

.msg-row.user .msg-bubble::before {
  right: 16px;
  left: auto;
  background: linear-gradient(90deg, transparent, var(--amb));
}

.msg-row.system .msg-bubble {
  min-width: 0;
  max-width: min(92%, 760px);
  padding: 8px 20px;
  border: 1px solid rgba(91, 146, 255, 0.2);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  box-shadow: none;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-align: center;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.msg-row.system .msg-bubble::before {
  display: none;
}

.msg-time {
  margin: 6px 7px 0;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.typing-dots {
  display: inline-flex;
  min-height: 14px;
  align-items: center;
  gap: 5px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cx);
  box-shadow: 0 0 7px rgba(91, 146, 255, 0.48);
  animation: typing-wave 1.25s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 280ms;
}

.ember-countdown {
  align-self: center;
  margin: -4px auto 2px;
  padding: 6px 12px;
  border: 1px solid rgba(226, 155, 57, 0.28);
  background: rgba(255, 250, 240, 0.68);
  color: #9d681f;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 18px rgba(226, 155, 57, 0.09);
  animation: countdown-pulse 1.8s ease-in-out infinite;
}

.msg-image {
  display: block;
  width: min(100%, 620px);
  max-height: 520px;
  margin-top: 9px;
  border: 1px solid rgba(91, 146, 255, 0.3);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  object-fit: contain;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

audio.msg-image {
  min-width: min(360px, 75vw);
  height: 52px;
  padding: 5px;
  clip-path: none;
}

.msg-file {
  display: flex;
  width: min(100%, 460px);
  min-width: 270px;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(91, 146, 255, 0.28);
  background: rgba(255, 255, 255, 0.78);
  color: var(--txt);
  box-shadow: var(--shadow-tight);
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.msg-file:hover {
  border-color: var(--cx);
  background: rgba(91, 146, 255, 0.08);
  transform: translateY(-1px);
}

.msg-file-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(226, 155, 57, 0.35);
  background: var(--panel-amb);
  font-size: 17px;
}

.msg-file-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.msg-file-name {
  overflow: hidden;
  color: var(--txt);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-file-sub {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================================== */
/* Thinking, RAG, memory and browse panels                                    */
/* ========================================================================== */

.thinking-panel {
  position: relative;
  width: min(100%, 720px);
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.27);
  background: rgba(248, 251, 255, 0.8);
  box-shadow: 0 7px 18px rgba(50, 79, 131, 0.08);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
}

.thinking-panel::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 36%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--cx), transparent);
}

.thinking-toggle {
  display: flex;
  width: 100%;
  min-height: 38px;
  cursor: pointer;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 0;
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.1), rgba(255, 255, 255, 0.44));
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-align: left;
}

.thinking-toggle:hover {
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.16), rgba(255, 255, 255, 0.48));
}

.thinking-toggle-icon {
  display: inline-grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid rgba(91, 146, 255, 0.32);
  color: var(--cx);
  font-size: 8px;
  transform: rotate(0deg);
  transition: transform 220ms var(--ease-holo);
}

.thinking-toggle.open .thinking-toggle-icon {
  transform: rotate(90deg);
}

.thinking-toggle.running {
  color: #9c681f;
  background: linear-gradient(90deg, rgba(226, 155, 57, 0.14), rgba(255, 255, 255, 0.5));
}

.thinking-toggle.running .thinking-toggle-icon {
  border-color: rgba(226, 155, 57, 0.42);
  color: var(--amb);
  animation: thinking-spin 1.4s linear infinite;
}

.thinking-body {
  max-height: 0;
  padding: 0 14px;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 0 solid rgba(91, 146, 255, 0.16);
  color: #40506b;
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  opacity: 0;
  transition:
    max-height 320ms var(--ease-holo),
    padding 250ms ease,
    opacity 220ms ease,
    border-width 220ms ease;
  scrollbar-color: rgba(91, 146, 255, 0.4) transparent;
  scrollbar-width: thin;
}

.thinking-body.open,
.thinking-toggle.open + .thinking-body,
.thinking-toggle.running + .thinking-body {
  max-height: 230px;
  padding: 12px 14px 14px;
  border-top-width: 1px;
  opacity: 1;
}

.thinking-body::-webkit-scrollbar {
  width: 4px;
}

.thinking-body::-webkit-scrollbar-thumb {
  background: rgba(91, 146, 255, 0.4);
}

.browse-row .msg-content {
  width: min(100%, 860px);
  max-width: calc(100% - 57px);
}

.browse-live {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.48);
  background: rgba(238, 245, 255, 0.94);
  box-shadow: 0 18px 42px rgba(40, 69, 115, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.browse-live::before,
.browse-live::after {
  position: absolute;
  z-index: 5;
  width: 22px;
  height: 22px;
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

.browse-live::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--amb);
  border-left: 1px solid var(--amb);
}

.browse-live::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid var(--cx);
  border-bottom: 1px solid var(--cx);
}

.browse-live-chrome {
  display: grid;
  min-height: 43px;
  padding: 8px 17px 8px 16px;
  align-items: center;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 9px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.28);
  background: linear-gradient(90deg, rgba(255, 252, 246, 0.98), rgba(245, 249, 255, 0.97));
  font-family: "Share Tech Mono", monospace;
}

.browse-live-mark {
  color: var(--amb);
  font-size: 15px;
  filter: drop-shadow(0 0 5px rgba(226, 155, 57, 0.45));
}

.browse-live-title {
  color: #9b671f;
  font-size: 10px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.browse-live-url {
  min-width: 0;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #65738c;
  font-size: 9px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-live-state {
  min-width: 54px;
  padding: 6px 8px;
  border: 1px solid rgba(42, 175, 117, 0.38);
  background: rgba(42, 175, 117, 0.08);
  color: #20865a;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
}

.browse-live.running .browse-live-state {
  animation: browse-live-breathe 1.4s ease-in-out infinite;
}

.browse-live.complete .browse-live-state {
  border-color: rgba(91, 146, 255, 0.32);
  background: rgba(91, 146, 255, 0.08);
  color: #386fda;
}

.browse-live-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 900;
  overflow: hidden;
  background:
    linear-gradient(rgba(91, 146, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 146, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, #ffffff 0, #eaf2ff 72%, #dce8f8 100%);
  background-size: 26px 26px, 26px 26px, auto;
}

.browse-live-shot {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity 220ms ease;
}

.browse-live-shot.ready {
  opacity: 1;
}

.browse-live-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #526888;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.12em;
  text-align: center;
  transition: opacity 240ms ease;
}

.browse-live-placeholder.hidden {
  opacity: 0;
  pointer-events: none;
}

.browse-live-placeholder strong {
  font-size: 10px;
  font-weight: 400;
}

.browse-live-placeholder small {
  color: #8796ad;
  font-size: 8px;
}

.browse-live-orbit {
  width: 58px;
  height: 58px;
  margin-bottom: 5px;
  border: 1px solid rgba(91, 146, 255, 0.38);
  border-top-color: var(--amb);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px rgba(91, 146, 255, 0.04), 0 0 22px rgba(91, 146, 255, 0.14);
  animation: thinking-spin 1.4s linear infinite;
}

.browse-scanline {
  position: absolute;
  z-index: 3;
  top: -8%;
  right: 0;
  left: 0;
  height: 7%;
  background: linear-gradient(180deg, transparent, rgba(91, 146, 255, 0.11), transparent);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
  animation: browse-scan 5.2s linear infinite;
}

.browse-ghost-cursor {
  position: absolute;
  z-index: 4;
  top: 32%;
  left: 65%;
  width: 15px;
  height: 22px;
  opacity: 0.9;
  pointer-events: none;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.98)) drop-shadow(0 2px 3px rgba(16, 22, 38, 0.58)) drop-shadow(0 0 5px rgba(91, 146, 255, 0.76));
  transform: translate(-3px, -3px) rotate(-15deg);
  transition: left 300ms cubic-bezier(0.22, 0.72, 0.2, 1), top 300ms cubic-bezier(0.22, 0.72, 0.2, 1), opacity 160ms ease;
}

.browse-ghost-cursor::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(145deg, #101626 8%, #234d93 64%, #5b92ff 100%);
  clip-path: polygon(0 0, 100% 68%, 62% 71%, 82% 100%, 64% 100%, 46% 74%, 20% 100%);
}

.browse-ghost-cursor::after {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--amb);
  background: rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: rotate(15deg) scale(0.4);
}

.browse-ghost-cursor.active {
  opacity: 0.96;
}

.browse-ghost-cursor.clicking::after {
  animation: browse-click-ripple 620ms ease-out both;
}

.browse-live-footer {
  display: grid;
  min-height: 37px;
  padding: 8px 17px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  border-top: 1px solid rgba(226, 155, 57, 0.24);
  background: rgba(255, 255, 255, 0.9);
  color: #53627a;
  font-family: "Share Tech Mono", monospace;
}

.browse-live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(42, 175, 117, 0.6);
}

.browse-live.running .browse-live-pulse {
  animation: capability-pulse 1.2s ease-in-out infinite;
}

.browse-live-status {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-live-code {
  color: #9b671f;
  font-size: 8px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

@keyframes browse-scan {
  from { transform: translateY(0); }
  to { transform: translateY(1540%); }
}

@keyframes browse-live-breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(42, 175, 117, 0); }
  50% { box-shadow: 0 0 15px rgba(42, 175, 117, 0.22); }
}

@keyframes browse-click-ripple {
  0% { opacity: 1; transform: rotate(15deg) scale(0.35); }
  100% { opacity: 0; transform: rotate(15deg) scale(3.4); }
}

/* Future parser panels for Step 3. They are harmless until JS emits them. */

.tool-panel,
.rag-panel,
.memory-panel {
  position: relative;
  width: min(100%, 760px);
  margin: 7px 0 11px;
  padding: 13px 15px;
  border: 1px solid rgba(91, 146, 255, 0.26);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-tight);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}

.tool-panel-title,
.rag-panel-title,
.memory-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.tool-panel-body,
.rag-panel-body,
.memory-panel-body {
  color: #3f4e69;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.memory-panel {
  border-color: rgba(226, 155, 57, 0.32);
  background: rgba(255, 251, 244, 0.78);
}

.memory-panel-title {
  color: #9b671f;
}

/* ========================================================================== */
/* Composer                                                                   */
/* ========================================================================== */

.composer {
  position: relative;
  z-index: 15;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 8px clamp(18px, 3.4vw, 48px) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(91, 146, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(246, 250, 255, 0.72), rgba(255, 255, 255, 0.96)),
    var(--panel);
  box-shadow: 0 -18px 46px rgba(45, 70, 114, 0.08);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
}

.composer::before {
  position: absolute;
  top: -2px;
  left: 0;
  width: 28%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--amb), var(--cx), transparent);
}

.capability-strip {
  display: flex;
  width: min(1120px, 100%);
  min-height: 24px;
  align-items: center;
  align-self: center;
  gap: 7px;
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.capability-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 3px;
  color: var(--muted);
}

.capability-label > span:first-child {
  color: var(--amb);
  font-size: 11px;
}

.capability-item {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(91, 146, 255, 0.14);
  background: rgba(255, 255, 255, 0.55);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.capability-item i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cx);
  box-shadow: 0 0 6px rgba(91, 146, 255, 0.5);
}

.capability-item[data-state="active"] {
  border-color: rgba(226, 155, 57, 0.38);
  background: rgba(226, 155, 57, 0.08);
  color: #99661e;
}

.capability-item[data-state="active"] i {
  background: var(--amb);
  box-shadow: 0 0 8px rgba(226, 155, 57, 0.68);
  animation: capability-pulse 1.2s ease-in-out infinite;
}

.capability-item[data-state="done"] i {
  background: var(--green);
  box-shadow: 0 0 7px rgba(42, 175, 117, 0.58);
}

.capability-item[data-state="error"] i {
  background: var(--red);
  box-shadow: 0 0 7px rgba(212, 80, 93, 0.5);
}

.composer-attach {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr) minmax(80px, 160px) auto;
  align-items: center;
  align-self: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 7px 9px 7px 12px;
  border: 1px solid rgba(226, 155, 57, 0.36);
  background: rgba(255, 251, 244, 0.92);
  box-shadow: var(--shadow-tight);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.attach-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(226, 155, 57, 0.32);
  background: rgba(226, 155, 57, 0.08);
  font-size: 14px;
}

.attach-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.attach-name {
  overflow: hidden;
  color: var(--txt);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-sub {
  margin-top: 1px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
}

.attach-bar {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(226, 155, 57, 0.13);
}

.attach-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--amb), var(--cx));
  box-shadow: 0 0 8px rgba(91, 146, 255, 0.4);
  transition: width 160ms ease;
}

.attach-remove {
  display: grid;
  width: 31px;
  height: 31px;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(212, 80, 93, 0.22);
  background: rgba(255, 255, 255, 0.62);
  color: var(--red);
  font-family: "Share Tech Mono", monospace;
  font-size: 17px;
  transition: background 160ms ease, border-color 160ms ease;
}

.attach-remove:hover {
  border-color: rgba(212, 80, 93, 0.5);
  background: rgba(212, 80, 93, 0.08);
}

.composer-frame {
  position: relative;
  width: min(1120px, 100%);
  align-self: center;
  padding: 0 14px;
}

.composer-bracket {
  position: absolute;
  z-index: 3;
  top: -6px;
  bottom: -6px;
  width: 18px;
  pointer-events: none;
}

.composer-bracket-left {
  left: 0;
  border-top: 2px solid var(--cx);
  border-bottom: 2px solid var(--cx);
  border-left: 2px solid var(--cx);
}

.composer-bracket-right {
  right: 0;
  border-top: 2px solid var(--amb);
  border-right: 2px solid var(--amb);
  border-bottom: 2px solid var(--amb);
}

.composer-inner {
  position: relative;
  display: grid;
  min-height: 62px;
  grid-template-columns: 52px minmax(0, 1fr) 56px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.36);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.composer-inner::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 74px;
  width: 23%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--cx), transparent);
}

.composer-attach-btn,
.composer-send {
  position: relative;
  display: grid;
  min-width: 0;
  cursor: pointer;
  place-items: center;
  border: 0;
  background: transparent;
}

.composer-attach-btn {
  border-right: 1px solid rgba(91, 146, 255, 0.17);
  color: var(--cx);
  transition: background 160ms ease, color 160ms ease;
}

.composer-attach-btn:hover {
  background: rgba(91, 146, 255, 0.1);
  color: #356fdc;
}

.composer-attach-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.7;
}

.composer-field {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 16px 14px 7px;
}

.composer-field-label {
  position: absolute;
  top: 7px;
  left: 14px;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.composer-input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 3px 0 0;
  border: 0;
  background: transparent;
  color: var(--txt);
  caret-color: var(--cx);
  font-family: "Rajdhani", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.composer-input::placeholder {
  color: #8e98ab;
  opacity: 0.9;
}

.composer-input:focus {
  outline: 0;
}

.composer-send {
  overflow: hidden;
  border-left: 1px solid rgba(91, 146, 255, 0.18);
  background: linear-gradient(145deg, rgba(91, 146, 255, 0.12), rgba(226, 155, 57, 0.08));
  color: var(--cx);
  transition:
    background 170ms ease,
    color 170ms ease,
    box-shadow 170ms ease;
}

.composer-send::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px dashed rgba(91, 146, 255, 0.28);
  transform: rotate(45deg);
}

.composer-send:hover {
  background: linear-gradient(145deg, var(--cx), #7c76eb);
  color: #ffffff;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.18), var(--glow-cx);
}

.composer-send:disabled {
  cursor: not-allowed;
  color: var(--muted-soft);
  filter: grayscale(0.65);
  opacity: 0.55;
}

.composer-send svg {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.5;
}

.send-rune {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: var(--amb);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
}

.composer-footer-line {
  display: flex;
  width: min(1090px, calc(100% - 30px));
  align-items: center;
  align-self: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.composer-footer-line i {
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.3), rgba(91, 146, 255, 0.05));
}

.composer-glyphs {
  color: var(--amb);
  letter-spacing: 0.12em;
}

.jump-latest {
  position: fixed;
  z-index: 18;
  right: clamp(24px, 3.6vw, 52px);
  bottom: calc(var(--composer-height) + 18px);
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(91, 146, 255, 0.5);
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  background: rgba(255, 255, 255, 0.9);
  color: var(--cx);
  box-shadow: var(--shadow-tight), var(--glow-cx);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.88);
  transition:
    opacity 220ms ease,
    transform 260ms var(--ease-holo),
    background 160ms ease,
    color 160ms ease;
}

.jump-latest.visible,
.jump-latest.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.jump-latest:hover {
  background: var(--cx);
  color: #ffffff;
}

.jump-latest > span:first-child {
  position: relative;
  z-index: 2;
  font-family: "Share Tech Mono", monospace;
  font-size: 20px;
}

.jump-latest-ring {
  position: absolute;
  inset: 5px;
  border: 1px dashed currentColor;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  opacity: 0.48;
  animation: matrix-rotate 12s linear infinite;
}

/* ========================================================================== */
/* Drawer overlay and responsive layout                                       */
/* ========================================================================== */

.drawer-overlay {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: none;
  background: rgba(26, 36, 58, 0.22);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.drawer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1220px) {
  .app-header {
    grid-template-columns: minmax(290px, 1fr) auto;
  }

  .header-telemetry {
    display: none;
  }
}

@media (max-width: 899px) {
  :root {
    --header-height: 78px;
    --composer-height: 142px;
  }

  .drawer,
  #sidebarControl:not(:checked) ~ .drawer {
    width: min(88vw, 350px);
    transform: translateX(-105%);
  }

  .drawer.open {
    transform: translateX(0);
  }

  .drawer-overlay {
    display: block;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-header,
  .drawer .drawer-header {
    min-height: 248px;
    padding: 14px 24px 10px;
  }

  #sidebarControl:not(:checked) ~ .drawer .ren-matrix,
  .drawer .ren-matrix {
    width: 148px;
    height: 148px;
  }

  #sidebarControl:not(:checked) ~ .drawer .brand-copy,
  #sidebarControl:not(:checked) ~ .drawer .core-ticker,
  #sidebarControl:not(:checked) ~ .drawer .drawer-content,
  #sidebarControl:not(:checked) ~ .drawer .drawer-system-line {
    visibility: visible;
    height: auto;
    margin: initial;
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
  }

  #sidebarControl:not(:checked) ~ .drawer .brand-copy {
    display: flex;
    margin-top: -2px;
  }

  #sidebarControl:not(:checked) ~ .drawer .core-ticker {
    display: block;
    height: 31px;
    margin: 0;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-content {
    display: flex;
    flex: 1 1 auto;
    padding: 20px 18px 10px;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-system-line {
    display: flex;
    grid-column: 1 / -1;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-close {
    top: 18px;
    right: 15px;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-close span {
    transform: none;
  }

  #sidebarControl:not(:checked) ~ .drawer .drawer-footer,
  .drawer .drawer-footer {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 18px max(18px, env(safe-area-inset-bottom));
  }

  #sidebarControl:not(:checked) ~ .drawer .hud-button-quiet {
    width: auto;
    min-height: 48px;
    padding: 8px 10px;
    font-size: 11px;
  }

  #sidebarControl:not(:checked) ~ .drawer .hud-button-quiet span:last-child {
    display: inline;
  }

  .app-shell,
  #sidebarControl:not(:checked) ~ .app-shell {
    margin-left: 0;
  }

  .messages-area::before,
  #sidebarControl:not(:checked) ~ .app-shell .messages-area::before {
    left: 0;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 15px;
  }

  .header-menu-btn {
    width: 43px;
    height: 43px;
  }

  .header-status {
    min-width: 50px;
  }

  .status-copy {
    display: none;
  }

  .status-dot {
    width: 46px;
    height: 46px;
  }

  .feed-shell {
    width: calc(100% - 38px);
    padding-top: 22px;
  }

  .feed-shell::before {
    left: -12px;
  }

  .feed-shell::after {
    right: -11px;
  }

  .composer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .jump-latest {
    right: 18px;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 72px;
    --composer-height: 136px;
  }

  .app-header {
    min-height: var(--header-height);
    padding: 9px 11px;
  }

  .header-leading {
    gap: 10px;
  }

  .header-menu-btn {
    width: 41px;
    height: 41px;
  }

  .header-eyebrow {
    font-size: 7px;
    letter-spacing: 0.11em;
  }

  .header-title {
    font-size: 19px;
    letter-spacing: 0.09em;
  }

  .header-divider {
    width: 12px;
  }

  .header-session-name {
    max-width: 84px;
    font-size: 9px;
  }

  .status-dot {
    width: 42px;
    height: 42px;
  }

  .power-glyph {
    font-size: 22px;
  }

  .feed-header {
    grid-template-columns: auto 1fr;
    margin-bottom: 22px;
  }

  .feed-header-code {
    display: none;
  }

  .messages-inner {
    gap: 18px;
  }

  .msg-row {
    gap: 9px;
  }

  .msg-avatar,
  .msg-avatar-col {
    width: 38px;
  }

  .msg-avatar {
    height: 38px;
    font-size: 10px;
  }

  .msg-content {
    max-width: calc(100% - 47px);
  }

  .msg-bubble {
    padding: 12px 14px 13px;
    font-size: 14px;
    line-height: 1.48;
  }

  .thinking-panel {
    width: 100%;
  }

  .capability-label {
    display: none;
  }

  .capability-strip {
    justify-content: center;
    gap: 4px;
  }

  .capability-item {
    padding: 3px 6px;
    font-size: 6px;
  }

  .composer {
    padding-top: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .composer-frame {
    padding: 0 9px;
  }

  .composer-bracket {
    width: 12px;
  }

  .composer-inner {
    min-height: 58px;
    grid-template-columns: 46px minmax(0, 1fr) 50px;
  }

  .composer-field {
    padding-right: 9px;
    padding-left: 9px;
  }

  .composer-field-label {
    left: 9px;
  }

  .composer-input {
    font-size: 15px;
  }

  .composer-footer-line {
    width: calc(100% - 18px);
    font-size: 6px;
  }

  .composer-footer-line > span:nth-of-type(2) {
    display: none;
  }

  .composer-attach {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .composer-attach .attach-bar {
    position: absolute;
    right: 48px;
    bottom: 5px;
    left: 53px;
  }

  .jump-latest {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    right: 13px;
    bottom: calc(var(--composer-height) + 12px);
  }
}

@media (max-width: 420px) {
  .header-title-row {
    gap: 6px;
  }

  .header-title {
    font-size: 17px;
  }

  .header-divider,
  .header-session-name {
    display: none;
  }

  .feed-shell {
    width: calc(100% - 24px);
  }

  .feed-shell::before,
  .feed-shell::after {
    display: none;
  }

  .feed-header-title {
    font-size: 8px;
  }

  .msg-avatar,
  .msg-avatar-col {
    width: 34px;
  }

  .msg-avatar {
    height: 34px;
    font-size: 9px;
  }

  .msg-content {
    max-width: calc(100% - 41px);
  }

  .browse-row .msg-content {
    max-width: calc(100% - 43px);
  }

  .browse-live-chrome {
    min-height: 39px;
    padding: 7px 11px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .browse-live-title {
    display: none;
  }

  .browse-live-url {
    padding: 6px 8px;
    font-size: 8px;
  }

  .browse-live-state {
    min-width: 45px;
    padding: 5px;
    font-size: 8px;
  }

  .browse-live-footer {
    padding: 7px 11px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .browse-live-code {
    display: none;
  }

  .msg-file {
    min-width: 220px;
  }

  .capability-item:nth-last-child(2) {
    display: none;
  }
}

@media (max-height: 660px) and (min-width: 900px) {
  .drawer-header {
    min-height: 218px;
    padding-top: 9px;
  }

  .ren-matrix {
    width: 126px;
    height: 126px;
  }

  .drawer-content {
    gap: 10px;
    padding-top: 12px;
  }

  .hud-button-primary {
    min-height: 58px;
  }
}

/* ========================================================================== */
/* Splash, login and protocol compatibility                                   */
/* ========================================================================== */

.splash,
.login-page,
.protocols-page {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(91, 146, 255, 0.17), transparent 25rem),
    linear-gradient(145deg, #fbfdff, #edf3fc);
}

.splash::before,
.splash::after {
  position: absolute;
  width: min(70vw, 560px);
  aspect-ratio: 1 / 1;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(91, 146, 255, 0.13);
  transform: rotate(45deg);
}

.splash::after {
  width: min(48vw, 390px);
  border-color: rgba(226, 155, 57, 0.16);
  border-radius: 50%;
}

.splash-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 146, 255, 0.2), transparent 67%);
  filter: blur(12px);
  animation: matrix-halo 3.6s ease-in-out infinite;
}

.splash-logo {
  position: relative;
  z-index: 2;
  width: min(220px, 46vw);
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(46, 76, 132, 0.18));
}

.splash-title {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  color: var(--txt);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.splash-sub {
  position: relative;
  z-index: 2;
  margin-top: 7px;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.splash-bar {
  position: relative;
  z-index: 2;
  width: min(360px, 72vw);
  height: 5px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.23);
  background: rgba(255, 255, 255, 0.62);
}

.splash-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cx), var(--violet), var(--amb));
  box-shadow: var(--glow-cx);
  transition: width 360ms var(--ease-holo);
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  background-position: center;
  background-size: cover;
  place-items: center;
}

.login-overlay,
.protocols-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(245, 249, 255, 0.93), rgba(238, 244, 252, 0.82)),
    radial-gradient(circle at 50% 20%, rgba(91, 146, 255, 0.14), transparent 34rem);
  backdrop-filter: blur(9px) saturate(112%);
  -webkit-backdrop-filter: blur(9px) saturate(112%);
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  padding: 38px 40px 42px;
  border: 1px solid rgba(91, 146, 255, 0.39);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 80px rgba(39, 65, 112, 0.19);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.login-card::before,
.login-card::after {
  position: absolute;
  width: 38px;
  height: 38px;
  content: "";
}

.login-card::before {
  top: 10px;
  left: 10px;
  border-top: 2px solid var(--amb);
  border-left: 2px solid var(--amb);
}

.login-card::after {
  right: 10px;
  bottom: 10px;
  border-right: 2px solid var(--cx);
  border-bottom: 2px solid var(--cx);
}

.login-card .logo {
  display: block;
  width: min(190px, 58%);
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 11px 18px rgba(45, 75, 130, 0.16));
}

.login-brand {
  color: var(--txt);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1;
  text-align: center;
}

.login-brand-sub {
  margin-top: 6px;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.17em;
  text-align: center;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 22px;
}

.login-field-group + .login-field-group {
  margin-top: 15px;
}

.login-field-group label {
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.login-field-group input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid rgba(91, 146, 255, 0.28);
  border-radius: 0;
  background: rgba(248, 251, 255, 0.88);
  color: var(--txt);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-field-group input:focus {
  border-color: var(--cx);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(91, 146, 255, 0.1), var(--glow-cx);
  outline: 0;
}

.login-error {
  margin-top: 15px;
  padding: 9px 11px;
  border: 1px solid rgba(212, 80, 93, 0.3);
  background: rgba(212, 80, 93, 0.07);
  color: #a53340;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  line-height: 1.45;
}

#loginBtn {
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
  cursor: pointer;
  border: 1px solid var(--cx);
  border-radius: 0;
  background: linear-gradient(135deg, var(--cx), #7b76ed);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(91, 146, 255, 0.26);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.13em;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

#loginBtn:hover {
  box-shadow: 0 13px 28px rgba(91, 146, 255, 0.32), var(--glow-cx);
  transform: translateY(-1px);
}

#loginBtn:disabled {
  cursor: wait;
  filter: grayscale(0.4);
  opacity: 0.64;
}

.protocols-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  background-position: center;
  background-size: cover;
}

.protocols-wrap {
  position: relative;
  z-index: 2;
  width: min(940px, 100%);
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  margin: 0 auto;
  border: 1px solid rgba(91, 146, 255, 0.34);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.proto-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 22px;
  padding: 15px 22px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.24);
  background: rgba(248, 251, 255, 0.72);
}

.proto-back {
  min-height: 40px;
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid rgba(91, 146, 255, 0.3);
  background: rgba(255, 255, 255, 0.65);
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  transition: background 160ms ease, border-color 160ms ease;
}

.proto-back:hover {
  border-color: var(--cx);
  background: rgba(91, 146, 255, 0.09);
}

.proto-title {
  color: var(--txt);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.proto-body {
  padding: 24px;
}

.proto-loading,
.proto-empty {
  padding: 40px 18px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: center;
}

.proto-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proto-entry {
  position: relative;
  padding: 16px 18px;
  border: 1px solid rgba(91, 146, 255, 0.2);
  background: rgba(255, 255, 255, 0.64);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.proto-entry::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  content: "";
  background: var(--cx);
}

.proto-entry:hover {
  border-color: rgba(91, 146, 255, 0.48);
  background: rgba(91, 146, 255, 0.07);
  transform: translateX(3px);
}

.proto-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.proto-entry-title {
  color: var(--txt);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.proto-entry-date,
.proto-entry-meta {
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.05em;
}

.proto-entry-meta {
  margin-top: 5px;
  color: var(--cx);
}

@media (max-width: 620px) {
  .login-page,
  .protocols-page {
    padding: 14px;
  }

  .login-card {
    padding: 30px 24px 34px;
  }

  .login-brand {
    font-size: 25px;
  }

  .protocols-wrap {
    min-height: calc(100vh - 28px);
    min-height: calc(100dvh - 28px);
  }

  .proto-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 16px;
  }

  .proto-title {
    font-size: 20px;
  }

  .proto-body {
    padding: 14px;
  }

  .proto-entry-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* ========================================================================== */
/* Motion                                                                     */
/* ========================================================================== */

@keyframes core-ticker-loop {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-25%);
  }
}

@keyframes matrix-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes matrix-rotate-reverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes matrix-halo {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes rune-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(226, 155, 57, 0.64));
  }
}

@keyframes star-breathe {
  0%,
  100% {
    opacity: 0.84;
    transform: scale(0.98) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.025) rotate(1.5deg);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes power-thinking {
  0% {
    transform: rotate(0deg) scale(0.97);
    filter: brightness(0.94);
  }
  50% {
    transform: rotate(180deg) scale(1.04);
    filter: brightness(1.12);
  }
  100% {
    transform: rotate(360deg) scale(0.97);
    filter: brightness(0.94);
  }
}

@keyframes power-replied {
  0% {
    box-shadow: 0 0 0 5px rgba(42, 175, 117, 0.08), 0 0 36px rgba(42, 175, 117, 0.58);
  }
  18%,
  100% {
    box-shadow: 0 0 0 5px rgba(42, 175, 117, 0.07), 0 0 25px rgba(42, 175, 117, 0.38);
  }
}

@keyframes message-arrive {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing-wave {
  0%,
  60%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@keyframes thinking-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes countdown-pulse {
  0%,
  100% {
    opacity: 0.68;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(226, 155, 57, 0.18);
  }
}

@keyframes capability-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.84);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================================================== */
/* CRITICAL MOBILE VIEWPORT FIX (Ember CoreUI v0.2.7-alpha)                  */
/* ========================================================================== */

@media (max-width: 899px) {
  /* App exakt auf der Displaybreite halten und horizontales Scrollen sperren. */
  html,
  body,
  .app-body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Mobile Drawer vollstaendig ausserhalb des Viewports parken. */
  .drawer {
    position: fixed !important;
    z-index: 999 !important;
    inset: 0 auto 0 0 !important;
    width: 290px !important;
    max-width: 100vw !important;
    transform: translateX(-100%) !important;
    transition: transform 380ms cubic-bezier(0.22, 0.72, 0.2, 1) !important;
  }

  /* .open bleibt mobil die einzige Quelle fuer den sichtbaren Drawer-Zustand. */
  .drawer.open {
    transform: translateX(0) !important;
    box-shadow: 25px 0 60px rgba(16, 22, 38, 0.25) !important;
  }

  .drawer-overlay {
    z-index: 998 !important;
  }

  /* Die App-Shell wird bei keinem Checkbox-Zustand seitlich verschoben. */
  .app-shell,
  #sidebarControl:not(:checked) ~ .app-shell,
  #sidebarControl:checked ~ .app-shell {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .drawer {
    transition-duration: 0.01ms !important;
  }
}

/* ========================================================================== */
/* Starlight Unit Studios branding                                            */
/* ========================================================================== */

.studio-mark {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(91, 146, 255, 0.52);
  background: #020307;
  box-shadow:
    0 18px 44px rgba(25, 39, 73, 0.2),
    0 0 28px rgba(91, 146, 255, 0.15);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.studio-mark::before,
.studio-mark::after {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  content: "";
  pointer-events: none;
}

.studio-mark::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--amb);
  border-left: 1px solid var(--amb);
}

.studio-mark::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid var(--cx);
  border-bottom: 1px solid var(--cx);
}

.studio-mark img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.studio-mark-splash {
  z-index: 2;
  width: min(460px, 78vw);
  padding: 5px;
}

.studio-mark-splash .splash-logo {
  width: 100%;
  filter: none;
}

.splash-copyright {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-align: center;
}

.studio-mark-login {
  width: min(320px, 100%);
  margin: 0 auto 21px;
  padding: 4px;
}

.login-card .studio-mark-login .logo {
  width: 100%;
  margin: 0;
  filter: none;
}

.login-copyright {
  margin-top: 18px;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: center;
}

.btn-settings {
  grid-column: 1 / -1;
}

.drawer-copyright {
  grid-column: 1 / -1;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}

#sidebarControl:not(:checked) ~ .drawer .drawer-copyright {
  display: none;
}

.proto-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.proto-kicker {
  margin-bottom: 2px;
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.proto-settings {
  min-height: 40px;
  padding: 11px 14px;
  border: 1px solid rgba(226, 155, 57, 0.32);
  background: rgba(255, 255, 255, 0.65);
  color: #9b671f;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.proto-settings:hover {
  border-color: var(--amb);
  background: rgba(226, 155, 57, 0.08);
}

.proto-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(91, 146, 255, 0.16);
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ========================================================================== */
/* Settings matrix                                                            */
/* ========================================================================== */

.settings-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.settings-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.settings-page::before,
.settings-page::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.settings-page::before {
  top: 150px;
  right: -170px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(91, 146, 255, 0.11);
  transform: rotate(45deg);
}

.settings-page::after {
  bottom: -210px;
  left: -120px;
  width: 480px;
  height: 480px;
  border: 1px dashed rgba(226, 155, 57, 0.13);
  border-radius: 50%;
}

.settings-vector-field {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.settings-vector-field span {
  position: absolute;
  width: 46vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 146, 255, 0.15), transparent);
  transform-origin: left center;
}

.settings-vector-field span:nth-child(1) {
  top: 29%;
  left: 4%;
  transform: rotate(23deg);
}

.settings-vector-field span:nth-child(2) {
  top: 62%;
  left: 41%;
  transform: rotate(-31deg);
}

.settings-vector-field span:nth-child(3) {
  top: 82%;
  left: 6%;
  background: linear-gradient(90deg, transparent, rgba(226, 155, 57, 0.14), transparent);
  transform: rotate(-12deg);
}

.settings-header {
  position: relative;
  display: grid;
  min-height: 102px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 58px);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 38px rgba(44, 69, 112, 0.09);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.settings-header::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 38%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--cx), var(--amb));
}

.settings-back,
.settings-action {
  cursor: pointer;
  border: 1px solid rgba(91, 146, 255, 0.28);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.settings-back {
  min-height: 42px;
  padding: 9px 14px;
}

.settings-back:hover,
.settings-action:hover {
  border-color: var(--cx);
  background: rgba(91, 146, 255, 0.09);
  transform: translateY(-1px);
}

.settings-title-block {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.settings-rune {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(226, 155, 57, 0.38);
  background: var(--panel-amb);
  color: var(--amb);
  font-family: "Share Tech Mono", monospace;
  font-size: 21px;
  box-shadow: var(--glow-amb);
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
}

.settings-kicker {
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.settings-title-block h1 {
  margin: 2px 0 0;
  color: var(--txt);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0.14em;
  line-height: 1;
}

.settings-version {
  color: var(--amb);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.09em;
}

.settings-grid {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px auto 0;
}

.settings-panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(91, 146, 255, 0.25);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.78)),
    var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.settings-panel::before {
  position: absolute;
  top: 0;
  left: 22px;
  width: 31%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--cx), transparent);
}

.settings-panel-chat::before,
.settings-panel-account::before {
  background: linear-gradient(90deg, var(--amb), transparent);
}

.settings-panel-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.17);
}

.settings-panel-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.settings-panel-head span:not(.settings-panel-glyph) {
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.13em;
}

.settings-panel-head h2,
.about-copy h2 {
  margin: 2px 0 0;
  color: var(--txt);
  font-size: 19px;
  letter-spacing: 0.11em;
  line-height: 1.05;
}

.settings-panel-glyph {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(91, 146, 255, 0.32);
  background: var(--panel-cx);
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 16px;
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.settings-panel-glyph.amber {
  border-color: rgba(226, 155, 57, 0.36);
  background: var(--panel-amb);
  color: var(--amb);
}

.settings-panel-glyph.green {
  border-color: rgba(42, 175, 117, 0.34);
  background: rgba(42, 175, 117, 0.08);
  color: var(--green);
}

.settings-panel-glyph.violet {
  border-color: rgba(138, 111, 242, 0.34);
  background: rgba(138, 111, 242, 0.08);
  color: var(--violet);
}

.setting-row {
  display: grid;
  min-height: 72px;
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(91, 146, 255, 0.12);
}

.setting-row:last-of-type {
  border-bottom: 0;
}

.setting-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.setting-copy strong {
  color: var(--txt);
  font-size: 13px;
  letter-spacing: 0.07em;
}

.setting-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.015em;
  line-height: 1.45;
}

.settings-switch {
  position: relative;
  display: block;
  width: 50px;
  height: 27px;
  flex: 0 0 auto;
}

.settings-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.settings-switch i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(91, 146, 255, 0.32);
  background: rgba(91, 146, 255, 0.07);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.settings-switch i::before {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 15px;
  height: 15px;
  content: "";
  background: var(--muted-soft);
  box-shadow: 0 0 7px rgba(102, 114, 138, 0.22);
  transform: rotate(45deg);
  transition: left 200ms var(--ease-holo), background 180ms ease, box-shadow 180ms ease;
}

.settings-switch input:checked + i {
  border-color: rgba(91, 146, 255, 0.64);
  background: rgba(91, 146, 255, 0.15);
  box-shadow: 0 0 16px rgba(91, 146, 255, 0.14);
}

.settings-switch input:checked + i::before {
  left: 28px;
  background: var(--cx);
  box-shadow: 0 0 10px rgba(91, 146, 255, 0.62);
}

.settings-switch input:focus-visible + i {
  outline: 2px solid var(--amb);
  outline-offset: 3px;
}

.settings-local-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(226, 155, 57, 0.22);
  background: rgba(226, 155, 57, 0.06);
  color: var(--muted);
}

.settings-local-note > span {
  color: var(--amb);
  font-size: 16px;
}

.settings-local-note p {
  margin: 0;
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  line-height: 1.5;
}

.settings-action {
  min-height: 39px;
  padding: 8px 12px;
}

.settings-action.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 8px;
}

.settings-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.settings-action.danger {
  border-color: rgba(212, 80, 93, 0.28);
  color: var(--red);
}

.settings-action.danger:hover {
  border-color: var(--red);
  background: rgba(212, 80, 93, 0.08);
}

.health-summary {
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 146, 255, 0.2);
  background: rgba(91, 146, 255, 0.06);
  color: var(--cx);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-align: center;
}

.health-summary.ok {
  border-color: rgba(42, 175, 117, 0.3);
  background: rgba(42, 175, 117, 0.07);
  color: #1f8c5d;
}

.health-summary.error {
  border-color: rgba(212, 80, 93, 0.3);
  background: rgba(212, 80, 93, 0.07);
  color: #a53340;
}

.health-summary.checking {
  animation: capability-pulse 1.4s ease-in-out infinite;
}

.health-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}

.health-facts > div {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(91, 146, 255, 0.14);
  background: rgba(255, 255, 255, 0.56);
}

.health-facts span,
.health-facts strong {
  display: block;
  overflow: hidden;
  font-family: "Share Tech Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-facts span {
  color: var(--muted-soft);
  font-size: 7px;
  letter-spacing: 0.09em;
}

.health-facts strong {
  margin-top: 3px;
  color: var(--txt);
  font-size: 9px;
}

.health-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.health-node {
  display: grid;
  min-width: 0;
  min-height: 37px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(91, 146, 255, 0.13);
  background: rgba(255, 255, 255, 0.5);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
}

.health-node-light {
  width: 6px;
  height: 6px;
  background: var(--red);
  box-shadow: 0 0 8px rgba(212, 80, 93, 0.45);
  transform: rotate(45deg);
}

.health-node.ok .health-node-light {
  background: var(--green);
  box-shadow: 0 0 8px rgba(42, 175, 117, 0.55);
}

.health-node-name {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-node strong {
  color: var(--red);
}

.health-node.ok strong {
  color: var(--green);
}

.account-ident {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid rgba(138, 111, 242, 0.2);
  background: rgba(138, 111, 242, 0.055);
}

.account-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(138, 111, 242, 0.38);
  background: rgba(255, 255, 255, 0.74);
  color: var(--violet);
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.account-ident > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.account-ident > div span {
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.09em;
}

.account-ident > div strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--txt);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-level {
  padding: 5px 7px;
  border: 1px solid rgba(226, 155, 57, 0.3);
  color: #9b671f;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.settings-panel-about {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(240px, 390px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 4vw, 54px);
}

.studio-mark-settings {
  width: 100%;
  padding: 5px;
}

.about-copy h2 {
  margin-top: 6px;
  font-size: clamp(20px, 2.5vw, 29px);
}

.about-copy p {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  line-height: 1.6;
}

.about-copy .copyright-line {
  color: #9b671f;
  letter-spacing: 0.04em;
}

.settings-footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  align-items: center;
  gap: 10px;
  margin: 20px auto 0;
  color: var(--muted-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.settings-footer i {
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, rgba(91, 146, 255, 0.28), rgba(226, 155, 57, 0.2));
}

.settings-save-state {
  position: fixed;
  z-index: 20;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 10px 14px;
  border: 1px solid rgba(42, 175, 117, 0.38);
  background: rgba(247, 255, 251, 0.94);
  color: #1f8c5d;
  box-shadow: 0 12px 32px rgba(30, 76, 57, 0.16);
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 220ms var(--ease-holo);
}

.settings-save-state.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================================================== */
/* Persistente Anzeigeoptionen                                                */
/* ========================================================================== */

.pref-hide-telemetry .header-telemetry {
  display: none !important;
}

.pref-hide-telemetry .app-header {
  grid-template-columns: minmax(310px, 1fr) auto;
}

.pref-compact-feed .messages-inner {
  gap: 12px;
}

.pref-compact-feed .msg-row {
  gap: 9px;
}

.pref-compact-feed .msg-bubble {
  padding: 10px 13px 11px;
  font-size: 14px;
  line-height: 1.4;
}

.pref-compact-feed .msg-avatar,
.pref-compact-feed .msg-avatar-col {
  width: 36px;
}

.pref-compact-feed .msg-avatar {
  height: 36px;
  font-size: 10px;
}

.pref-live-static .browse-scanline,
.pref-live-static .browse-live-orbit {
  display: none;
}

.pref-live-static .browse-live-shot,
.pref-live-static .browse-ghost-cursor {
  transition-duration: 0.01ms !important;
}

.pref-reduced-motion *,
.pref-reduced-motion *::before,
.pref-reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 899px) {
  .pref-hide-telemetry .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .studio-mark-splash {
    width: min(430px, 86vw);
  }

  .splash-title {
    margin-top: 19px;
    font-size: clamp(25px, 8vw, 37px);
  }

  .login-card {
    padding-top: 30px;
  }

  .proto-header {
    align-items: stretch;
  }

  .proto-settings {
    text-align: center;
  }

  .settings-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 13px 15px;
  }

  .settings-back {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 35px;
  }

  .settings-title-block {
    gap: 10px;
  }

  .settings-rune {
    width: 41px;
    height: 41px;
  }

  .settings-version {
    font-size: 7px;
  }

  .settings-grid {
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 14px;
  }

  .settings-panel {
    padding: 17px;
  }

  .settings-panel-about {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .studio-mark-settings {
    width: min(430px, 100%);
    margin: 0 auto;
  }

  .settings-footer {
    width: calc(100% - 24px);
    font-size: 7px;
  }
}

@media (max-width: 480px) {
  .settings-title-block h1 {
    font-size: 22px;
  }

  .settings-kicker,
  .settings-version {
    font-size: 6px;
  }

  .settings-panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .settings-panel-head .settings-action.compact {
    width: 100%;
  }

  .setting-row {
    gap: 10px;
  }

  .health-facts,
  .health-checks,
  .settings-actions {
    grid-template-columns: 1fr;
  }

  .account-ident {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-level {
    grid-column: 2;
    justify-self: start;
  }

  .settings-footer span:last-child {
    display: none;
  }
}
