:root {
  --void: #010610;
  --deep: #020b19;
  --navy: #051426;
  --navy-2: #071c33;
  --panel: rgba(5, 20, 39, 0.86);
  --panel-solid: #06172a;
  --line: rgba(73, 178, 255, 0.22);
  --line-bright: rgba(84, 214, 255, 0.5);
  --electric: #198cff;
  --cyan: #37e7ff;
  --ice: #b8f4ff;
  --text: #eafaff;
  --muted: #7192aa;
  --dim: #3e6179;
  --alert: #ff4d61;
  --mono: 'DM Mono', 'Kantumruy Pro', sans-serif;
  --display: 'Oxanium', 'Kantumruy Pro', 'Noto Sans Khmer', sans-serif;
  --body: 'Kantumruy Pro', 'Noto Sans Khmer', 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--void); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 52% 9%, rgba(19, 108, 203, 0.19), transparent 28rem),
    radial-gradient(circle at 84% 58%, rgba(0, 183, 255, 0.07), transparent 30rem),
    linear-gradient(145deg, #01050d, #03101f 54%, #010711);
  font-family: var(--body);
  isolation: isolate;
}
button, a, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }
button[hidden], [hidden] { display: none !important; }

#ai-background, .world-grid, .scanline { position: fixed; inset: 0; pointer-events: none; }
#ai-background { z-index: -3; }
.world-grid {
  z-index: -4;
  opacity: 0.6;
  background-image:
    linear-gradient(rgba(31, 129, 207, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 129, 207, 0.075) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.75) 65%, transparent 100%);
}
.scanline {
  z-index: 20;
  height: 24vh;
  opacity: 0.06;
  background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
  animation: screen-scan 9s linear infinite;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0.1;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(55, 231, 255, .13) 4px);
  mix-blend-mode: screen;
}

.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 18px 14px 15px;
  overflow: hidden;
  border-right: 1px solid rgba(51, 178, 255, 0.2);
  background: linear-gradient(180deg, rgba(2, 13, 26, .97), rgba(2, 9, 19, .94));
  box-shadow: 16px 0 60px rgba(0, 0, 0, .22);
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 93%, rgba(55, 231, 255, .09) 93% 94%, transparent 94%),
    repeating-linear-gradient(to bottom, transparent 0 54px, rgba(44, 125, 188, .04) 55px);
}
.sidebar::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 1px;
  top: 84px;
  right: 0;
  background: linear-gradient(90deg, transparent, var(--cyan));
}
.brand-lockup { display: flex; align-items: center; gap: 10px; min-height: 49px; }
.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-bright);
  background: linear-gradient(145deg, rgba(15, 104, 185, .35), rgba(4, 20, 37, .6));
  clip-path: polygon(0 0, 78% 0, 100% 22%, 100% 100%, 22% 100%, 0 78%);
}
.brand-mark img { width: 31px; height: 31px; object-fit: cover; filter: saturate(1.25) contrast(1.12); }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font: 700 16px/1 var(--display); letter-spacing: .19em; }
.brand-lockup span { margin-top: 6px; color: var(--muted); font: 500 7px/1 var(--mono); letter-spacing: .21em; }
.brand-beacon { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: beacon 1.6s infinite; }
.rail-index { display: flex; justify-content: space-between; margin: 35px 4px 11px; color: var(--dim); font: 500 8px var(--mono); letter-spacing: .14em; }
.rail-index b { color: #6b9bb9; font-weight: 500; }
.nav-list { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr 15px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-left: 1px solid rgba(83, 158, 212, .13);
  background: transparent;
  color: #6e8da5;
  text-align: left;
  transition: color .2s, background .2s, border-color .2s;
}
.nav-item::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22px; height: 1px; background: rgba(70, 159, 221, .2); }
.nav-item i { color: #35556d; font: 400 8px var(--mono); font-style: normal; }
.nav-item span { font: 600 10px var(--body); letter-spacing: .025em; }
.nav-item b { justify-self: end; width: 4px; height: 4px; border: 1px solid currentColor; transform: rotate(45deg); }
.nav-item em { justify-self: end; color: var(--cyan); font: 500 8px var(--mono); font-style: normal; }
.nav-item:hover { color: var(--ice); background: rgba(17, 87, 139, .12); }
.nav-item.active {
  border-left-color: var(--cyan);
  color: #e5fbff;
  background: linear-gradient(90deg, rgba(16, 114, 185, .31), rgba(5, 34, 59, .07));
  box-shadow: inset 5px 0 18px rgba(19, 140, 229, .14);
}
.nav-item.active::before { content: ''; position: absolute; inset: 6px auto 6px 0; width: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.nav-item.active i { color: var(--cyan); }
.nav-item.active b { border: 0; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.rail-telemetry { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin: 30px 5px 0; padding: 14px 10px; border: 1px solid rgba(69, 143, 196, .12); border-right: 0; background: rgba(4, 25, 46, .3); }
.rail-telemetry div span, .rail-telemetry div b { display: block; }
.rail-telemetry div span { color: #3e647e; font: 400 7px var(--mono); letter-spacing: .1em; }
.rail-telemetry div b { margin-top: 5px; color: #79bddf; font: 500 9px var(--mono); }
.signal-bars { display: flex !important; grid-column: 1/-1; align-items: end; gap: 3px; height: 18px; }
.signal-bars i { width: 100%; background: linear-gradient(to top, var(--electric), var(--cyan)); opacity: .55; animation: signal 1.7s ease-in-out infinite alternate; }
.signal-bars i:nth-child(1), .signal-bars i:nth-child(7) { height: 25%; animation-delay: -.8s; }
.signal-bars i:nth-child(2), .signal-bars i:nth-child(6) { height: 50%; animation-delay: -.3s; }
.signal-bars i:nth-child(3), .signal-bars i:nth-child(5) { height: 75%; animation-delay: -1.1s; }
.signal-bars i:nth-child(4) { height: 100%; }
.sidebar-bottom { display: grid; gap: 6px; margin-top: auto; }
.sidebar-bottom > a, .rail-setting { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 6px; border: 0; border-bottom: 1px solid rgba(51, 126, 181, .15); background: transparent; color: #5b829c; font: 500 7px var(--mono); letter-spacing: .1em; }
.sidebar-bottom > a:hover, .rail-setting:hover { color: var(--cyan); border-color: rgba(55, 231, 255, .42); }
.sidebar-bottom > a i, .rail-setting i { font-style: normal; }
.trial { margin-top: 8px; padding: 12px; border: 1px solid rgba(54, 167, 241, .23); background: linear-gradient(135deg, rgba(12, 65, 106, .32), rgba(4, 22, 38, .1)); clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%); }
.trial > span, .trial > b { display: block; }
.trial > span { color: var(--muted); font: 400 7px var(--mono); letter-spacing: .13em; }
.trial > b { margin: 6px 0 9px; font: 500 9px var(--mono); letter-spacing: .08em; }
.trial > div { height: 2px; background: rgba(62, 125, 170, .2); }
.trial > div i { display: block; width: 68%; height: 100%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.trial button { width: 100%; margin-top: 10px; padding: 7px; border: 1px solid rgba(55, 231, 255, .3); background: rgba(8, 70, 112, .25); color: #9aefff; font: 500 7px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.trial button:hover { background: rgba(12, 109, 173, .4); }

.main { min-width: 0; }
.topbar { position: relative; z-index: 9; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 58px; padding: 0 18px; border-bottom: 1px solid rgba(57, 157, 225, .18); background: rgba(2, 11, 22, .76); backdrop-filter: blur(18px); }
.topbar::after { content: ''; position: absolute; bottom: -1px; left: 28%; width: 12%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.breadcrumb { display: flex; align-items: center; gap: 9px; font: 500 8px var(--mono); letter-spacing: .12em; }
.breadcrumb span { color: #416b87; }
.breadcrumb b { color: var(--electric); font-size: 16px; font-weight: 400; }
.breadcrumb strong { color: #9cc6da; font-weight: 500; text-transform: uppercase; }
.topbar-center { display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-right: 1px solid rgba(55, 231, 255, .1); border-left: 1px solid rgba(55, 231, 255, .1); color: #7ba2ba; font: 500 7px var(--mono); letter-spacing: .14em; }
.topbar-center i, .online i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); animation: beacon 1.6s infinite; }
.topbar-center b { color: #4f7891; font-weight: 400; }
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.online { display: flex; align-items: center; gap: 6px; color: #6f9bb5; font: 500 7px var(--mono); letter-spacing: .09em; }
.help, .account-button, .profile { border: 1px solid rgba(58, 154, 221, .23); background: rgba(5, 31, 53, .55); }
.help { min-height: 29px; padding: 0 9px; color: #6f9bb5; font: 500 7px var(--mono); letter-spacing: .08em; }
.help span { margin-right: 5px; color: var(--cyan); }
.account-button { min-height: 30px; padding: 0 13px; color: #b8ecff; font: 500 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.help:hover, .account-button:hover { border-color: var(--cyan); background: rgba(9, 85, 134, .42); color: #fff; }
.profile { width: 31px; height: 31px; border-radius: 50%; color: #00101d; background: var(--cyan); font: 700 8px var(--mono); box-shadow: 0 0 16px rgba(55, 231, 255, .25); }
.menu { display: none; width: 34px; height: 34px; padding: 9px; border: 1px solid var(--line); background: rgba(5, 35, 59, .6); }
.menu i { display: block; height: 1px; margin: 3px 0; background: var(--cyan); }

.view { display: none; }
.view.active { display: block; animation: view-in .45s ease-out both; }
#chat-view { padding: 14px 16px 22px; }
.command-grid { display: grid; grid-template-columns: minmax(174px, .76fr) minmax(380px, 1.95fr) minmax(188px, .86fr); gap: 10px; max-width: 1560px; min-height: 464px; margin: 0 auto; }
.telemetry-column { display: flex; min-width: 0; flex-direction: column; gap: 9px; }
.data-panel { position: relative; padding: 13px; overflow: hidden; border: 1px solid rgba(57, 151, 218, .2); background: linear-gradient(145deg, rgba(6, 29, 52, .82), rgba(3, 15, 29, .7)); clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px)); }
.data-panel::before { content: ''; position: absolute; top: 0; left: 14px; width: 42px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.data-panel::after { content: ''; position: absolute; inset: auto -35px -48px auto; width: 90px; height: 90px; border: 1px solid rgba(52, 163, 233, .1); border-radius: 50%; }
.data-panel header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid rgba(62, 145, 203, .12); color: #729ab2; font: 500 7px var(--mono); letter-spacing: .13em; }
.data-panel header i { color: #356b8e; font-style: normal; }
.credit-panel { min-height: 157px; }
.credit-figure { display: flex; align-items: baseline; gap: 7px; margin-top: 12px; }
.credit-figure b { color: var(--ice); font: 500 clamp(27px, 2.3vw, 39px)/1 var(--display); letter-spacing: -.06em; text-shadow: 0 0 22px rgba(55, 231, 255, .2); }
.credit-figure span { color: var(--cyan); font: 500 6px var(--mono); letter-spacing: .12em; }
.meter { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin: 14px 0 10px; }
.meter i { height: 10px; border: 1px solid rgba(42, 141, 208, .16); background: rgba(17, 83, 128, .14); }
.meter i:nth-child(-n+8) { border-color: rgba(55, 231, 255, .3); background: linear-gradient(to top, rgba(16, 122, 197, .56), rgba(55, 231, 255, .8)); box-shadow: 0 0 5px rgba(55, 231, 255, .14); }
.data-panel p { margin: 0; color: #57788f; font: 400 8px/1.55 var(--mono); }
.account-panel { min-height: 184px; }
.account-glyph { position: relative; width: 58px; height: 58px; margin: 10px auto 9px; border: 1px solid rgba(55, 231, 255, .27); border-radius: 50%; background: radial-gradient(circle, rgba(16, 130, 204, .22), transparent 65%); }
.account-glyph::before, .account-glyph::after { content: ''; position: absolute; inset: 7px; border: 1px dashed rgba(55, 231, 255, .16); border-radius: 50%; animation: spin 15s linear infinite; }
.account-glyph::after { inset: 15px; border-style: solid; animation-direction: reverse; }
.account-glyph span { position: absolute; top: 15px; left: 21px; width: 14px; height: 14px; border: 1px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 9px rgba(55, 231, 255, .35); }
.account-glyph i { position: absolute; bottom: 12px; left: 15px; width: 26px; height: 13px; border: 1px solid var(--cyan); border-bottom: 0; border-radius: 14px 14px 0 0; }
.account-panel .eyebrow { color: #3f6881; font-size: 6px; letter-spacing: .12em; }
.account-panel > b { display: block; margin: 3px 0; color: #9feeff; font: 500 9px var(--mono); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-panel small { color: #476980; font: 400 7px var(--mono); }
.data-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; min-height: 64px; margin-top: auto; background: rgba(41, 126, 184, .13); }
.data-strip span { display: grid; place-content: center; gap: 4px; padding: 7px 2px; background: rgba(3, 17, 31, .94); text-align: center; }
.data-strip i { color: #355d78; font: 400 6px var(--mono); font-style: normal; }
.data-strip b { color: #79bddc; font: 500 7px var(--mono); }

.core-stage { position: relative; display: grid; grid-template-rows: auto minmax(265px, 1fr) auto auto; min-width: 0; min-height: 464px; overflow: hidden; border-top: 1px solid rgba(55, 231, 255, .28); border-bottom: 1px solid rgba(55, 231, 255, .17); background: radial-gradient(circle at 50% 41%, rgba(4, 107, 180, .22), transparent 34%), linear-gradient(180deg, rgba(3, 19, 36, .4), rgba(2, 11, 22, .7)); }
.core-stage::before, .core-stage::after { content: ''; position: absolute; z-index: 2; width: 54px; height: 54px; pointer-events: none; }
.core-stage::before { top: 6px; left: 6px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.core-stage::after { right: 6px; bottom: 6px; border-right: 1px solid var(--cyan); border-bottom: 1px solid var(--cyan); }
.stage-heading { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 13px 19px 0; color: #56829d; font: 500 7px var(--mono); letter-spacing: .15em; }
.stage-heading i { height: 1px; flex: 1; background: linear-gradient(90deg, rgba(55, 231, 255, .28), transparent); }
.stage-heading b { color: #39647e; font-weight: 400; }
.core-visual { position: relative; align-self: center; width: min(100%, 470px); height: 280px; margin: -7px auto -10px; }
.orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(59, 177, 243, .18); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit::before, .orbit::after { content: ''; position: absolute; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(55, 231, 255, .8); }
.orbit-outer { width: 260px; height: 260px; border-style: dashed; animation: spin 24s linear infinite; }
.orbit-outer::before { top: 14px; left: 47px; width: 4px; height: 4px; }
.orbit-outer::after { right: 20px; bottom: 54px; width: 3px; height: 3px; }
.orbit-mid { width: 205px; height: 205px; border-color: rgba(55, 231, 255, .26); animation: spin-reverse 17s linear infinite; }
.orbit-mid::before { top: 39px; right: 17px; width: 3px; height: 3px; }
.orbit-mid::after { left: 6px; bottom: 72px; width: 4px; height: 4px; }
.orbit-inner { width: 148px; height: 148px; border-style: dotted; border-color: rgba(84, 214, 255, .44); animation: spin 10s linear infinite; }
.orbit-inner::before { top: -2px; left: 70px; width: 4px; height: 4px; }
.orbit-inner::after { bottom: 8px; right: 37px; width: 3px; height: 3px; }
.orbit i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #8cefff; box-shadow: 0 0 8px var(--cyan); }
.orbit i:nth-child(1) { top: 15%; left: 51%; }
.orbit i:nth-child(2) { top: 49%; right: 0; }
.orbit i:nth-child(3) { bottom: 8%; left: 27%; }
.orbit i:nth-child(4) { top: 38%; left: 1%; }
.radar-sweep { position: absolute; top: 50%; left: 50%; width: 124px; height: 124px; transform-origin: 0 0; background: conic-gradient(from 0deg, rgba(55, 231, 255, .16), transparent 28deg); animation: radar 5s linear infinite; }
.core-crosshair { position: absolute; top: 50%; left: 50%; background: linear-gradient(90deg, transparent, rgba(55, 231, 255, .28), transparent); }
.core-crosshair-x { width: 360px; height: 1px; transform: translate(-50%, -50%); }
.core-crosshair-y { width: 1px; height: 265px; transform: translate(-50%, -50%); background: linear-gradient(to bottom, transparent, rgba(55, 231, 255, .22), transparent); }
.core-shell { position: absolute; top: 50%; left: 50%; display: grid; width: 112px; height: 112px; place-items: center; border: 1px solid rgba(91, 219, 255, .55); border-radius: 50%; background: radial-gradient(circle, rgba(21, 124, 195, .28), rgba(1, 11, 23, .9) 70%); box-shadow: 0 0 24px rgba(0, 147, 255, .18), inset 0 0 25px rgba(55, 231, 255, .1); transform: translate(-50%, -50%); }
.core-shell::before, .core-shell::after { content: ''; position: absolute; inset: -9px; border: 1px solid transparent; border-top-color: var(--cyan); border-bottom-color: rgba(25, 140, 255, .6); border-radius: 50%; animation: spin 5s linear infinite; }
.core-shell::after { inset: -17px; border-top-color: transparent; border-right-color: rgba(55, 231, 255, .46); animation: spin-reverse 8s linear infinite; }
.core-shell img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; filter: saturate(1.28) contrast(1.17) drop-shadow(0 0 10px rgba(55, 231, 255, .22)); }
.core-pulse { position: absolute; inset: -1px; border: 1px solid var(--cyan); border-radius: 50%; animation: core-pulse 2.8s ease-out infinite; }
.node-label { position: absolute; min-width: 91px; padding: 5px 7px; border-left: 1px solid rgba(55, 231, 255, .34); color: #4d748e; background: linear-gradient(90deg, rgba(6, 41, 68, .58), transparent); font: 400 6px var(--mono); letter-spacing: .08em; }
.node-label::before { content: ''; position: absolute; top: 50%; width: 32px; height: 1px; background: rgba(55, 231, 255, .22); }
.node-label b { display: block; margin-top: 3px; color: #82dff4; font-weight: 500; }
.node-a { top: 35px; left: 13px; }
.node-a::before, .node-c::before { left: 100%; }
.node-b { top: 62px; right: 7px; text-align: right; border-right: 1px solid rgba(55, 231, 255, .34); border-left: 0; background: linear-gradient(270deg, rgba(6, 41, 68, .58), transparent); }
.node-b::before, .node-d::before { right: 100%; }
.node-c { bottom: 39px; left: 10px; }
.node-d { right: 18px; bottom: 30px; text-align: right; border-right: 1px solid rgba(55, 231, 255, .34); border-left: 0; background: linear-gradient(270deg, rgba(6, 41, 68, .58), transparent); }
.core-title { position: relative; z-index: 2; margin-top: -14px; padding: 0 22px 13px; text-align: center; }
.status { display: inline-flex; align-items: center; gap: 7px; color: #88dced; font: 500 7px var(--mono); letter-spacing: .16em; }
.status i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: beacon 1.5s infinite; }
.status i.processing { background: var(--electric); box-shadow: 0 0 10px var(--electric); animation-duration: .55s; }
.status i.error { background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.core-title h1 { margin: 7px 0 4px; font: 600 clamp(25px, 3.1vw, 45px)/.95 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
.core-title h1 em { display: block; color: #63dff7; font: 500 .42em/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; font-style: normal; }
.core-title p { width: min(510px, 86%); margin: 7px auto 0; color: #607f95; font: 400 9px/1.55 var(--mono); }
.core-readout { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 14px 10px; border-top: 1px solid rgba(53, 146, 210, .13); }
.core-readout span { padding: 9px 3px 0; border-right: 1px solid rgba(53, 146, 210, .11); color: #3e657e; font: 400 6px var(--mono); text-align: center; }
.core-readout span:last-child { border-right: 0; }
.core-readout b { margin-left: 4px; color: #73d3e9; font-weight: 500; }

.ai-panel { min-height: 200px; }
.waveform { display: flex; align-items: center; gap: 3px; height: 37px; margin: 6px 0 8px; overflow: hidden; }
.waveform i { width: 100%; height: 20%; background: linear-gradient(to top, var(--electric), var(--cyan)); opacity: .8; animation: waveform 1.4s ease-in-out infinite alternate; }
.waveform i:nth-child(2n) { height: 55%; animation-delay: -.8s; }
.waveform i:nth-child(3n) { height: 90%; animation-delay: -.3s; }
.waveform i:nth-child(5n) { height: 35%; animation-delay: -1.1s; }
.ai-panel dl { margin: 0; }
.ai-panel dl div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(53, 128, 180, .1); font: 400 7px var(--mono); }
.ai-panel dt { color: #4e748d; }
.ai-panel dd { margin: 0; color: #82d8eb; }
.live-pill { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: #9eefff; font: 500 7px var(--mono); letter-spacing: .08em; }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.telegram-panel { min-height: 199px; }
.telegram-orbit { position: relative; display: grid; width: 61px; height: 61px; margin: 11px 0 8px; place-items: center; border: 1px solid rgba(55, 231, 255, .28); border-radius: 50%; }
.telegram-orbit::after { content: ''; position: absolute; inset: 7px; border: 1px dashed rgba(55, 231, 255, .21); border-radius: 50%; animation: spin 9s linear infinite; }
.telegram-orbit span { position: relative; z-index: 2; color: var(--cyan); font: 500 24px var(--display); transform: translate(-1px, 1px); }
.telegram-orbit i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.telegram-orbit i:first-of-type { top: 2px; left: 17px; }
.telegram-orbit i:last-of-type { right: 3px; bottom: 14px; }
.telegram-panel h2 { margin: 0 0 5px; font: 600 14px var(--display); letter-spacing: -.02em; }
.telegram-panel p { max-width: 190px; }
.telegram-panel a { display: flex; justify-content: space-between; margin-top: 10px; padding: 7px 0; border-top: 1px solid rgba(55, 231, 255, .17); color: #84e7f6; font: 500 7px var(--mono); letter-spacing: .08em; }
.telegram-panel a:hover { color: #fff; }
.alert-strip { display: flex; align-items: center; gap: 9px; min-height: 47px; margin-top: auto; padding: 8px 10px; border: 1px solid rgba(255, 77, 97, .18); background: rgba(74, 16, 28, .12); }
.alert-strip > i { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border: 1px solid var(--alert); border-radius: 50%; color: var(--alert); font: 500 9px var(--mono); font-style: normal; }
.alert-strip span { color: #765c65; font: 400 6px/1.5 var(--mono); }
.alert-strip b { display: block; color: #d98a96; font-weight: 500; letter-spacing: .08em; }

.starter-zone { display: grid; grid-template-columns: 142px 1fr; gap: 12px; max-width: 1560px; margin: 10px auto 0; }
.starter-label { display: flex; justify-content: center; flex-direction: column; padding: 0 13px; border-left: 1px solid var(--cyan); background: linear-gradient(90deg, rgba(10, 73, 114, .18), transparent); }
.starter-label span, .starter-label b { display: block; }
.starter-label span { color: #4a758e; font: 400 6px var(--mono); letter-spacing: .13em; }
.starter-label b { margin-top: 5px; color: #80b5ce; font: 500 8px var(--mono); }
.starter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.starter-grid button { position: relative; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 7px; min-height: 54px; padding: 8px 10px; overflow: hidden; border: 1px solid rgba(53, 142, 204, .16); background: linear-gradient(130deg, rgba(6, 30, 53, .72), rgba(3, 16, 29, .4)); text-align: left; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); transition: border-color .2s, background .2s, transform .2s; }
.starter-grid button::before { content: ''; position: absolute; top: 0; left: 0; width: 21%; height: 1px; background: rgba(55, 231, 255, .65); }
.starter-grid button > i { color: #3a789e; font: 400 7px var(--mono); font-style: normal; }
.starter-grid button span b, .starter-grid button span small { display: block; }
.starter-grid button span b { color: #b2ddea; font: 600 9px var(--body); }
.starter-grid button span small { margin-top: 3px; color: #496b80; font: 400 6px var(--mono); }
.starter-grid button em { color: #3f718d; font: 400 12px var(--mono); font-style: normal; }
.starter-grid button:hover { z-index: 2; border-color: rgba(55, 231, 255, .45); background: linear-gradient(130deg, rgba(8, 68, 106, .6), rgba(3, 21, 38, .7)); transform: translateY(-2px); }
.starter-grid button:hover em { color: var(--cyan); }

.pricing-panel {
  position: relative;
  max-width: 1560px;
  margin: 12px auto 0;
  padding: clamp(18px, 2.6vw, 34px);
  overflow: hidden;
  scroll-margin-top: 72px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(18, 43, 67, .72), rgba(5, 16, 31, .78)),
    rgba(8, 25, 44, .68);
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), inset 0 -1px rgba(255, 255, 255, .04), 0 30px 80px rgba(0, 3, 13, .38);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
}
.pricing-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.11), transparent 28%, transparent 72%, rgba(255,91,108,.06));
}
.pricing-aura { position: absolute; width: 260px; height: 260px; border-radius: 50%; filter: blur(16px); pointer-events: none; }
.pricing-aura-one { top: -180px; left: 11%; background: rgba(65, 213, 255, .18); }
.pricing-aura-two { right: -125px; bottom: -190px; background: rgba(255, 57, 78, .2); }
.pricing-heading { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr minmax(260px, 430px); align-items: end; gap: 28px; margin-bottom: 22px; }
.pricing-kicker { color: #79e7ff; font: 500 7px var(--mono); letter-spacing: .18em; }
.pricing-heading h2 { margin: 7px 0 0; font: 600 clamp(28px, 3.4vw, 48px)/.95 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
.pricing-heading p { margin: 0; color: #8aa8b9; font: 400 9px/1.65 var(--mono); }
.pricing-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.price-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 226px;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 25px;
  background: linear-gradient(155deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 18px 35px rgba(0,0,0,.17);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  animation: package-rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.price-card:nth-child(2) { animation-delay: .06s; }
.price-card:nth-child(3) { animation-delay: .12s; }
.price-card:nth-child(4) { animation-delay: .18s; }
.price-card::after { content: ''; position: absolute; top: -42px; right: -42px; width: 90px; height: 90px; border: 1px solid rgba(112, 231, 255, .14); border-radius: 50%; }
.price-card.featured { border-color: rgba(255, 92, 107, .4); background: linear-gradient(155deg, rgba(255,85,103,.16), rgba(255,255,255,.045) 48%, rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.18), 0 20px 45px rgba(54, 0, 10, .22); }
.package-tag { color: #7096aa; font: 500 7px var(--mono); letter-spacing: .14em; }
.featured .package-tag { color: #ff9aa5; }
.package-stars { display: flex; align-items: baseline; gap: 7px; margin-top: 15px; }
.package-stars b { color: #f5fcff; font: 600 clamp(27px, 2.4vw, 38px)/1 var(--display); letter-spacing: -.055em; }
.package-stars span { color: #62dff8; font: 500 7px var(--mono); letter-spacing: .12em; }
.price-card > strong { display: block; margin-top: 5px; color: #c9f7ff; font: 600 13px var(--display); }
.price-card > strong small { color: #51798f; font: 500 6px var(--mono); letter-spacing: .11em; }
.price-card > p { min-height: 33px; margin: 11px 0 16px; color: #708da0; font: 400 8px/1.55 var(--mono); }
.package-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  padding: 0 14px;
  border: 1px solid rgba(255, 164, 173, .4);
  border-radius: 14px;
  background: linear-gradient(135deg, #ff3049, #c80d27);
  color: #fff;
  font: 700 8px var(--mono);
  letter-spacing: .055em;
  box-shadow: inset 0 1px rgba(255,255,255,.27), 0 12px 24px rgba(180, 0, 30, .25);
  transition: transform .18s, filter .18s, box-shadow .18s;
}
.package-buy span { font-size: 13px; }
.package-buy:hover { filter: brightness(1.12); box-shadow: inset 0 1px rgba(255,255,255,.32), 0 16px 28px rgba(205, 0, 34, .34); transform: translateY(-2px); }
.package-buy:disabled { cursor: wait; opacity: .65; filter: saturate(.5); transform: none; }
.pricing-footnote { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 15px; color: #58788c; font: 400 7px var(--mono); }
.pricing-footnote span { display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid rgba(91, 215, 246, .25); border-radius: 50%; color: #7ddff4; }

.conversation { display: grid; gap: 10px; max-width: 920px; margin: 10px auto 0; }
.chat-row { font: 400 11px/1.75 var(--mono); }
.user-message { justify-self: end; max-width: 75%; padding: 11px 14px; border: 1px solid rgba(50, 178, 255, .34); border-right: 2px solid var(--cyan); background: linear-gradient(120deg, rgba(12, 92, 150, .6), rgba(5, 42, 73, .76)); color: #ddf8ff; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); }
.agent-message { position: relative; justify-self: start; max-width: 88%; padding: 13px 15px; border: 1px solid rgba(55, 231, 255, .19); border-left: 2px solid var(--cyan); background: rgba(4, 25, 45, .8); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.agent-message header { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #a8ebf7; font: 500 8px var(--mono); letter-spacing: .1em; }
.agent-message header img { width: 19px; height: 19px; object-fit: cover; }
.agent-message header span { color: #4f829e; font-weight: 400; letter-spacing: 0; }
.agent-message p { margin: 0; color: #a2becd; }

.composer-wrap { max-width: 1100px; margin: 13px auto 0; }
.composer-heading { display: flex; justify-content: space-between; padding: 0 5px 6px; color: #4b7690; font: 500 6px var(--mono); letter-spacing: .14em; }
.composer-heading i { color: #365f79; font-style: normal; }
.composer { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 64px; padding: 7px 8px 7px 13px; border: 1px solid rgba(73, 190, 255, .32); background: linear-gradient(100deg, rgba(4, 28, 50, .93), rgba(5, 40, 67, .74), rgba(3, 21, 39, .92)); box-shadow: 0 13px 42px rgba(0, 0, 0, .26), inset 0 0 32px rgba(25, 140, 255, .035); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.composer::before { content: ''; position: absolute; top: 0; left: 36px; width: 20%; height: 1px; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.prompt-mark { align-self: start; padding-top: 12px; color: var(--cyan); font: 500 13px var(--mono); }
.composer textarea { width: 100%; min-height: 38px; max-height: 180px; padding: 10px 12px; resize: none; border: 0; outline: 0; background: transparent; color: #d9f6ff; font: 400 11px/1.55 var(--mono); }
.composer textarea::placeholder { color: #426b83; }
.composer-tools { display: flex; align-items: center; gap: 6px; }
.tool { min-height: 29px; padding: 0 8px; border: 1px solid rgba(62, 148, 207, .16); background: rgba(6, 37, 62, .4); color: #5d849c; font: 500 7px var(--mono); letter-spacing: .06em; }
.tool:hover { border-color: rgba(55, 231, 255, .38); color: #a4e9f7; }
.tool i { font-style: normal; }
.hint { color: #345d76; font: 400 6px var(--mono); letter-spacing: .07em; }
.send { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 68px; min-height: 42px; border: 1px solid rgba(92, 231, 255, .8); background: linear-gradient(135deg, #0ea6df, #126de7); color: #fff; font: 600 10px var(--mono); box-shadow: 0 0 20px rgba(28, 158, 233, .2); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px)); }
.send span { font-size: 8px; letter-spacing: .08em; }
.send:hover { filter: brightness(1.18); box-shadow: 0 0 27px rgba(55, 231, 255, .34); }
.composer-note { margin: 6px 0 0; color: #355970; font: 400 6px var(--mono); text-align: center; letter-spacing: .04em; }

.secondary-view { min-height: calc(100vh - 58px); padding: clamp(24px, 4vw, 60px); }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; max-width: 1080px; margin: 0 auto 30px; padding-bottom: 22px; border-bottom: 1px solid rgba(53, 153, 220, .2); }
.kicker { color: var(--cyan); font: 500 7px var(--mono); letter-spacing: .16em; }
.page-title h2 { margin: 8px 0 5px; font: 600 clamp(29px, 4vw, 54px)/1 var(--display); letter-spacing: -.05em; text-transform: uppercase; }
.page-title p { margin: 0; color: #628199; font: 400 9px/1.55 var(--mono); }
.solid { padding: 11px 15px; border: 1px solid rgba(55, 231, 255, .42); background: rgba(8, 76, 121, .44); color: #b8f5ff; font: 500 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px)); }
.solid:hover { background: rgba(13, 121, 181, .55); }
.project-list { display: grid; gap: 7px; max-width: 1080px; margin: auto; }
.project-list article { display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 16px; min-height: 78px; padding: 13px 16px; border: 1px solid rgba(53, 145, 207, .18); background: linear-gradient(100deg, rgba(5, 29, 51, .78), rgba(3, 19, 35, .48)); }
.project-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(55, 231, 255, .4); color: var(--cyan); font: 500 9px var(--mono); clip-path: polygon(0 0, 75% 0, 100% 25%, 100% 100%, 0 100%); }
.project-list h3 { margin: 0 0 4px; font: 600 13px var(--display); }
.project-list p { margin: 0; color: #50728a; font: 400 7px var(--mono); }
.project-status { display: flex; align-items: center; gap: 6px; color: #82dceb; font: 500 7px var(--mono); }
.project-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.project-status.muted { color: #57758a; }
.project-status.muted i { background: #57758a; box-shadow: none; }
.project-list article > button { border: 0; background: transparent; color: #5d9fbc; font: 500 8px var(--mono); }
.project-list article > button:hover { color: var(--cyan); }
.empty-state { max-width: 760px; margin: 9vh auto; padding: 55px 30px; border-top: 1px solid rgba(55, 231, 255, .3); border-bottom: 1px solid rgba(55, 231, 255, .14); background: radial-gradient(circle at center, rgba(10, 77, 121, .2), transparent 63%); text-align: center; }
.empty-state > span { color: #36647e; font: 500 7px var(--mono); letter-spacing: .15em; }
.empty-state h3 { margin: 13px 0 7px; font: 600 28px var(--display); text-transform: uppercase; }
.empty-state p { color: #58778d; font: 400 9px var(--mono); }
.empty-state button { margin-top: 15px; padding: 10px 14px; border: 1px solid rgba(55, 231, 255, .3); background: rgba(6, 49, 79, .45); color: #8fe9f8; font: 500 8px var(--mono); }
.activity-list { max-width: 1080px; margin: auto; }
.activity-list p { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 15px; margin: 0; padding: 17px 12px; border-bottom: 1px solid rgba(54, 136, 193, .13); }
.activity-list > p > i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.activity-list span b, .activity-list span small { display: block; }
.activity-list span b { font: 600 10px var(--body); }
.activity-list span small { margin-top: 3px; color: #4a6d83; font: 400 7px var(--mono); }
.activity-list time { color: #47708a; font: 500 7px var(--mono); }

.modal, .auth-modal { position: fixed; inset: 0; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .22s; }
.modal.open, .auth-modal.open { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 4, 12, .82); backdrop-filter: blur(11px); }
.modal > section, .auth-card { position: relative; width: min(440px, calc(100% - 30px)); margin: 10vh auto; padding: 31px; border: 1px solid rgba(55, 231, 255, .31); background: linear-gradient(145deg, rgba(6, 31, 54, .98), rgba(2, 13, 25, .99)); box-shadow: 0 28px 90px rgba(0, 0, 0, .66), inset 0 0 50px rgba(23, 130, 198, .05); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); transform: translateY(12px); transition: transform .22s; }
.modal.open > section, .auth-modal.open .auth-card { transform: none; }
.close { position: absolute; top: 13px; right: 14px; width: 27px; height: 27px; border: 1px solid rgba(77, 157, 210, .22); background: rgba(4, 31, 52, .6); color: #6990a9; font: 400 15px var(--mono); }
.modal h2, .auth-card h2 { margin: 10px 0 9px; font: 600 30px/1 var(--display); letter-spacing: -.045em; text-transform: uppercase; }
.modal ol { display: grid; gap: 5px; margin: 22px 0; padding: 0; list-style: none; }
.modal li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(64, 142, 195, .15); color: #618096; font: 400 8px/1.5 var(--mono); }
.modal li > b { color: var(--cyan); font-weight: 500; }
.modal li strong { display: block; color: #bcebf5; font: 600 10px var(--body); }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 27px; color: #bfeef7; font: 600 10px var(--mono); letter-spacing: .12em; }
.auth-brand img { width: 31px; height: 31px; object-fit: cover; }
.auth-subtitle { margin: 0 0 20px; color: #628096; font: 400 9px/1.65 var(--mono); }
.google-login { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; border: 0; background: #f3fbff; color: #06182a; font: 700 11px var(--body); }
.google-login:hover { background: #fff; box-shadow: 0 0 24px rgba(104, 225, 255, .2); }
.google-login:disabled { opacity: .55; }
.google-mark { display: grid; width: 20px; height: 20px; place-items: center; font: 700 17px Arial, sans-serif; }
.auth-error { min-height: 14px; margin: 12px 0 0; color: var(--alert); font: 400 8px var(--mono); text-align: center; }
.toast { position: fixed; z-index: 60; right: 18px; bottom: 18px; max-width: 360px; padding: 12px 15px; border: 1px solid rgba(55, 231, 255, .4); border-left: 2px solid var(--cyan); background: rgba(4, 26, 46, .96); color: #b8e9f3; font: 500 8px/1.5 var(--mono); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }

@keyframes screen-scan { from { transform: translateY(-30vh); } to { transform: translateY(120vh); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: translate(-50%, -50%) rotate(-360deg); } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes beacon { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes core-pulse { 0% { opacity: .7; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes waveform { from { transform: scaleY(.38); opacity: .42; } to { transform: scaleY(1); opacity: .9; } }
@keyframes signal { from { transform: scaleY(.4); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes package-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .command-grid { grid-template-columns: minmax(160px, .7fr) minmax(350px, 1.65fr) minmax(170px, .76fr); }
  .core-visual { transform: scale(.9); }
  .core-title h1 { font-size: 30px; }
  .node-label { min-width: 78px; }
  .starter-zone { grid-template-columns: 110px 1fr; }
  .starter-grid button { padding: 7px; }
  .starter-grid button span small { display: none; }
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .package-stars b { font-size: 34px; }
  .online { display: none; }
}

@media (max-width: 940px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; min-height: 100%; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 30px 0 70px rgba(0, 0, 0, .7); }
  .sidebar.open { transform: none; }
  .menu { display: block; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 11px; }
  .topbar-center { display: none; }
  .breadcrumb { min-width: 0; }
  .breadcrumb span, .breadcrumb b { display: none; }
  .command-grid { grid-template-columns: 1fr; max-width: 760px; }
  .core-stage { order: 1; min-height: 475px; }
  .telemetry-left { order: 2; display: grid; grid-template-columns: 1fr 1fr; }
  .telemetry-right { order: 3; display: grid; grid-template-columns: 1fr 1fr; }
  .data-strip, .alert-strip { grid-column: 1 / -1; }
  .credit-panel, .account-panel, .ai-panel, .telegram-panel { min-height: 180px; }
  .starter-zone { grid-template-columns: 1fr; max-width: 760px; }
  .starter-label { min-height: 42px; }
  .starter-grid { grid-template-columns: 1fr 1fr; }
  .starter-grid button span small { display: block; }
}

@media (max-width: 620px) {
  #chat-view { padding: 9px 9px 18px; }
  .topbar { min-height: 54px; padding: 0 9px; }
  .breadcrumb { font-size: 7px; }
  .help { display: none; }
  .account-button { padding: 0 9px; font-size: 7px; }
  .command-grid { gap: 8px; }
  .core-stage { min-height: 432px; grid-template-rows: auto 260px auto auto; }
  .stage-heading { padding: 11px 14px 0; }
  .stage-heading span { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .core-visual { width: 100%; height: 260px; transform: scale(.82); }
  .node-a, .node-c { left: -12px; }
  .node-b, .node-d { right: -12px; }
  .core-title { margin-top: -8px; padding: 0 12px 12px; }
  .core-title h1 { font-size: 27px; }
  .core-title p { width: 94%; font-size: 8px; }
  .core-readout { margin-right: 8px; margin-left: 8px; }
  .core-readout span { font-size: 5px; }
  .telemetry-left, .telemetry-right { display: grid; grid-template-columns: 1fr; }
  .data-strip, .alert-strip { grid-column: auto; }
  .starter-grid { grid-template-columns: 1fr; }
  .starter-grid button { min-height: 58px; }
  .starter-grid button span small { display: block; }
  .pricing-panel { padding: 19px 12px; border-radius: 25px; }
  .pricing-heading { grid-template-columns: 1fr; gap: 10px; padding: 0 5px; }
  .pricing-heading p { max-width: 440px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card { min-height: 210px; }
  .package-stars b { font-size: 34px; }
  .composer { grid-template-columns: auto 1fr; align-items: start; padding-top: 8px; }
  .composer-tools { grid-column: 1 / -1; justify-content: flex-end; padding: 0 3px 2px; }
  .tool.mode, .hint { display: none; }
  .composer textarea { font-size: 10px; }
  .send { min-width: 64px; min-height: 36px; }
  .user-message, .agent-message { max-width: 95%; }
  .secondary-view { padding: 26px 13px; }
  .page-title { align-items: start; flex-direction: column; }
  .project-list article { grid-template-columns: 40px 1fr auto; gap: 10px; }
  .project-status { display: none; }
  .project-list article > button { grid-column: 2 / -1; justify-self: start; padding: 0; }
  .modal > section, .auth-card { margin-top: 7vh; padding: 27px 22px; }
}

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

.answer-content { color: #dbeefa; line-height: 1.75; font-size: 14px; }
.answer-content h2, .answer-content h3 { margin: 22px 0 8px; color: #effbff; font-family: var(--display); letter-spacing: -.02em; }
.answer-content h2 { font-size: 20px; }.answer-content h3 { font-size: 16px; }
.inline-code { border: 1px solid rgba(93, 211, 255, .22); border-radius: 5px; background: rgba(3, 19, 34, .9); color: #9beaff; padding: 2px 5px; font: 12px var(--mono); }
.code-block { overflow: hidden; margin: 17px 0; border: 1px solid rgba(68, 195, 248, .3); border-radius: 12px; background: #030914; box-shadow: inset 0 1px rgba(150, 240, 255, .08), 0 12px 28px rgba(0, 0, 0, .24); }
.code-block header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid rgba(67, 179, 235, .18); background: rgba(10, 35, 56, .7); color: #85cce8; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.code-block header button { border: 1px solid rgba(93, 211, 255, .32); border-radius: 5px; background: rgba(14, 86, 122, .3); color: #c9f6ff; padding: 4px 8px; font: 10px var(--mono); cursor: pointer; }
.code-block pre { overflow-x: auto; margin: 0; padding: 16px; color: #cce9f5; font: 12px/1.65 var(--mono); tab-size: 2; }
.code-block code { white-space: pre; }

/* iOS-inspired glass softening for the command center. */
.sidebar, .topbar, .data-panel, .data-strip, .alert-strip, .core-stage,
.composer, .project-list article, .empty-state, .auth-card, .modal > section {
  border-radius: 24px;
}
.nav-item { border-radius: 15px; }
.trial { border-radius: 20px; }
.topbar-center, .online, .help, .account-button, .profile, .send, .solid,
.code-block header button, .tool { border-radius: 999px; }
.agent-message, .user-message { border-radius: 22px; }
.core-stage { box-shadow: 0 24px 72px rgba(0, 13, 32, .42), inset 0 1px rgba(255,255,255,.11); }
.data-panel, .data-strip, .alert-strip { background: linear-gradient(145deg, rgba(11, 36, 61, .84), rgba(5, 17, 33, .72)); box-shadow: inset 0 1px rgba(198, 244, 255, .11), 0 14px 32px rgba(0, 12, 30, .24); }
.credit-panel::after { border-radius: 18px; }

/* Clear, high-contrast iOS control labels. */
button, .sidebar-bottom button, .starter-grid button, .tool, .send, .solid, .telegram-link {
  font-weight: 700;
  letter-spacing: .035em;
}
.telegram-link { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(65, 207, 255, .4); border-radius: 16px; background: linear-gradient(135deg, rgba(14, 80, 133, .55), rgba(5, 32, 66, .72)); color: #c9f6ff; padding: 13px 14px; text-align: left; }
.telegram-link span { font: 700 10px var(--display); color: #58dcff; }.telegram-link i { color: #dffbff; font: 700 9px var(--mono); font-style: normal; }
.nav-item, .starter-grid button, .tool, .send, .solid { color: #c9f7ff; text-shadow: 0 0 14px rgba(55, 231, 255, .22); }
.tool, .send, .solid { min-height: 38px; font-size: 11px; }
@media (max-width: 900px) { .topbar { overflow: visible; } .topbar-actions { min-width: 0; } .online { display: none; } .telemetry-right { min-width: 0; } .data-panel { min-width: 0; } }

.kh-wordmark, .brand-lockup strong.kh-wordmark { display: inline-flex; align-items: baseline; gap: .28em; margin: 0; color: #f4fbff; font: 700 17px/1 'Oxanium', 'Noto Sans Khmer', sans-serif; letter-spacing: -.035em; text-shadow: 0 2px 20px rgba(0, 141, 255, .22); white-space: nowrap; }
.brand-lockup .kh-wordmark span { display: inline; margin: 0; color: #42cfff; font: inherit; text-shadow: 0 0 18px rgba(41, 190, 255, .7); }
.brand-lockup > div > span { font-family: 'Noto Sans Khmer', 'Manrope', sans-serif; letter-spacing: .08em; }

/* Primary chat workspace: calm, build-first desktop shell. */
@supports selector(body:has(*)) {
  body:has(#chat-view.active) { overflow: hidden; }
}

@media (min-width: 941px) {
  .sidebar { position: sticky; top: 0; height: 100svh; min-height: 0; }
}

#chat-view.active {
  display: flex;
  height: calc(100vh - 58px);
  height: calc(100svh - 58px);
  padding: 12px;
  overflow: hidden;
}

.chat-workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(113, 192, 236, .17);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% -12%, rgba(33, 152, 217, .1), transparent 35%),
    linear-gradient(180deg, rgba(10, 21, 35, .97), rgba(5, 12, 23, .98));
  box-shadow: inset 0 1px rgba(255,255,255,.065), 0 24px 70px rgba(0, 2, 10, .42);
}

.chat-workspace::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(rgba(102, 205, 242, .18) .6px, transparent .6px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 42%);
}

.workspace-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(103, 174, 213, .13);
  background: rgba(5, 13, 24, .72);
  backdrop-filter: blur(20px);
}

.workspace-title > span,
.workspace-account span {
  color: #53758a;
  font: 500 7px var(--mono);
  letter-spacing: .12em;
}

.workspace-title > div { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.workspace-title > div > i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(55,231,255,.68); }
.workspace-title strong { color: #eafaff; font: 600 12px var(--body); }
.workspace-title small { color: #63839a; font: 400 8px var(--mono); }

.workspace-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(96, 187, 229, .16);
  border-radius: 999px;
  background: rgba(12, 30, 47, .66);
  color: #a6d9e9;
  font: 500 7px var(--mono);
  letter-spacing: .08em;
}

.workspace-status > i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: beacon 1.6s infinite; }
.workspace-status > i.processing { background: #46aaff; box-shadow: 0 0 10px #46aaff; animation-duration: .55s; }
.workspace-status > i.error { background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.workspace-status .live-pill { margin: 0; padding-left: 8px; border-left: 1px solid rgba(116, 181, 214, .14); color: #5f8196; }
.workspace-status .live-pill i { display: none; }
.workspace-status[data-state="processing"] { border-color: rgba(70, 170, 255, .38); }
.workspace-status[data-state="error"] { border-color: rgba(255, 77, 97, .4); }

.workspace-account { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.workspace-account > div { display: grid; gap: 3px; min-width: 72px; }
.workspace-account b { max-width: 155px; overflow: hidden; color: #d8f4fb; font: 500 9px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.workspace-account button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(76, 202, 241, .28);
  border-radius: 999px;
  background: rgba(13, 76, 108, .28);
  color: #bfefff;
  font: 700 8px var(--mono);
}
.workspace-account button:hover { border-color: var(--cyan); background: rgba(20, 106, 149, .42); }

.chat-scroll {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(82, 148, 180, .45) transparent;
  scrollbar-width: thin;
}

.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 10px; background: rgba(82, 148, 180, .45); background-clip: padding-box; }

.welcome-state {
  display: flex;
  width: min(880px, calc(100% - 40px));
  min-height: max(520px, calc(100% - 82px));
  margin: 0 auto;
  padding: clamp(56px, 8vh, 96px) 0 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: welcome-rise .65s cubic-bezier(.2,.75,.2,1) both;
}

.welcome-mark { position: relative; display: grid; width: 64px; height: 64px; margin-bottom: 20px; place-items: center; border: 1px solid rgba(92, 213, 244, .28); border-radius: 20px; background: linear-gradient(145deg, rgba(18, 84, 122, .38), rgba(4, 15, 27, .8)); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 18px 45px rgba(0,0,0,.3); }
.welcome-mark::before { content: ''; position: absolute; inset: -8px; border: 1px solid rgba(74, 180, 219, .1); border-radius: 25px; }
.welcome-mark img { width: 48px; height: 48px; border-radius: 15px; object-fit: cover; }
.welcome-mark i { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border: 3px solid #07111e; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 13px rgba(55,231,255,.55); }
.welcome-kicker { color: #5ddbf4; font: 500 8px var(--mono); letter-spacing: .18em; }
.welcome-state h1 { margin: 13px 0 12px; color: #f2f9fc; font: 600 clamp(38px, 5.2vw, 70px)/.98 var(--display); letter-spacing: -.06em; }
.welcome-state > p { width: min(650px, 92%); margin: 0; color: #7d98a9; font: 400 13px/1.75 var(--body); }

#chat-view .starter-zone { display: block; width: 100%; margin: 34px 0 0; }
#chat-view .starter-label { display: flex; min-height: 0; padding: 0 2px 10px; flex-direction: row; align-items: center; justify-content: space-between; border: 0; background: transparent; text-align: left; }
#chat-view .starter-label span { color: #55778b; font: 500 7px var(--mono); letter-spacing: .14em; }
#chat-view .starter-label b { margin: 0; color: #496778; font: 400 8px var(--mono); }
#chat-view .starter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
#chat-view .starter-grid button {
  min-height: 82px;
  padding: 13px 15px;
  border: 1px solid rgba(100, 169, 202, .15);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 36, 52, .76), rgba(8, 19, 31, .72));
  clip-path: none;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
#chat-view .starter-grid button::before { top: auto; right: 14px; bottom: 0; left: 14px; width: auto; opacity: 0; background: linear-gradient(90deg, transparent, var(--cyan), transparent); transition: opacity .2s; }
#chat-view .starter-grid button > i { align-self: start; padding-top: 3px; color: #3e718b; font-size: 8px; }
#chat-view .starter-grid button span b { color: #e4f4f9; font: 600 12px var(--body); }
#chat-view .starter-grid button span small { margin-top: 5px; color: #668295; font: 400 9px var(--mono); }
#chat-view .starter-grid button em { color: #5ecde7; }
#chat-view .starter-grid button:hover { border-color: rgba(70, 214, 246, .38); background: linear-gradient(145deg, rgba(20, 59, 78, .78), rgba(8, 27, 42, .82)); transform: translateY(-2px); }
#chat-view .starter-grid button:hover::before { opacity: .8; }
.welcome-foot { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: #466577; font: 400 7px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.welcome-foot i { width: 3px; height: 3px; border-radius: 50%; background: #31566d; }

#chat-view .conversation { display: grid; width: min(780px, calc(100% - 32px)); max-width: none; gap: 16px; margin: 0 auto; padding: 28px 0 56px; }
#chat-view .chat-row { font: 400 13px/1.6 var(--body); }
#chat-view .user-message { justify-self: end; max-width: min(72%, 590px); padding: 10px 13px; border: 1px solid rgba(82, 172, 214, .2); border-radius: 18px 18px 5px 18px; background: linear-gradient(145deg, #123b53, #0b2b40); color: #e8f6fb; clip-path: none; box-shadow: 0 10px 28px rgba(0, 4, 11, .2); }
#chat-view .agent-message { justify-self: center; width: 100%; max-width: 720px; padding: 0; overflow: hidden; border: 1px solid rgba(105, 176, 209, .17); border-radius: 18px; background: rgba(10, 22, 35, .86); clip-path: none; box-shadow: inset 0 1px rgba(255,255,255,.04), 0 16px 38px rgba(0, 3, 10, .24); }
#chat-view .agent-message > header { min-height: 48px; margin: 0; padding: 0 15px; border-bottom: 1px solid rgba(105, 176, 209, .11); background: rgba(13, 29, 43, .66); color: #e0f3f7; font: 600 9px var(--mono); letter-spacing: .08em; }
#chat-view .agent-message > header img { width: 23px; height: 23px; border-radius: 7px; }
#chat-view .agent-message > header span { margin-left: auto; color: #5c7e91; font-size: 7px; text-transform: uppercase; }
#chat-view .agent-message > p,
#chat-view .agent-message .answer-content { padding: 16px 20px; }
#chat-view .agent-message > p { color: #91aab8; }
#chat-view .answer-content { color: #c9dce5; font: 400 13px/1.62 var(--body); }
#chat-view .answer-content h2,
#chat-view .answer-content h3 { color: #eff8fb; font-family: var(--display); }
#chat-view .answer-content h2 { font-size: 23px; }
#chat-view .answer-content h3 { font-size: 17px; }

.response-actions { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 16px; border-top: 1px solid rgba(105, 176, 209, .1); color: #527083; font: 400 7px var(--mono); }
.response-actions button { display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 1px solid rgba(95, 165, 199, .2); border-radius: 999px; background: rgba(18, 42, 58, .58); color: #9dc6d5; font: 500 8px var(--mono); }
.response-actions button:hover { border-color: rgba(55,231,255,.45); color: #e2faff; }
.response-actions button:disabled { cursor: wait; opacity: .5; }

#chat-view .code-block { margin: 20px 0; border-color: rgba(95, 159, 190, .19); border-radius: 14px; background: #050b12; box-shadow: inset 0 1px rgba(255,255,255,.025); }
#chat-view .code-block header { min-height: 42px; padding: 0 9px 0 14px; background: #0a131d; }
#chat-view .code-tab { align-self: stretch; display: flex; align-items: center; padding: 0 7px; border-bottom: 2px solid var(--cyan); color: #b9eaf3; text-transform: none; }
#chat-view .code-block header button { min-height: 27px; padding: 0 10px; border-color: rgba(94, 161, 192, .2); background: #101e2a; color: #8eb6c6; }
#chat-view .code-block pre { padding: 18px; color: #c6dce4; font-size: 12px; }

.telegram-channel { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; margin: -6px 0 20px; padding: 9px 12px; border: 1px solid rgba(64, 207, 246, .26); border-radius: 999px; color: #9ee9f6; font: 600 8px var(--mono); }
.telegram-channel:hover { border-color: var(--cyan); color: #fff; }

#chat-view .composer-wrap {
  position: relative;
  z-index: 5;
  width: min(920px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: 10px 0 13px;
  background: linear-gradient(to top, #07111e 74%, rgba(7,17,30,0));
}
#chat-view .composer { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 66px; padding: 7px; border: 1px solid rgba(91, 177, 216, .3); border-radius: 21px; background: linear-gradient(145deg, rgba(18, 38, 53, .98), rgba(8, 21, 34, .98)); clip-path: none; box-shadow: inset 0 1px rgba(255,255,255,.06), 0 18px 45px rgba(0,0,0,.38); }
#chat-view .composer::before { display: none; }
.composer-add { display: grid; width: 38px; height: 38px; margin-left: 3px; place-items: center; border: 1px solid rgba(101, 170, 201, .18); border-radius: 12px; background: rgba(16, 37, 52, .62); color: #8fbbca; font: 400 19px var(--body); }
.composer-add:hover { border-color: rgba(55,231,255,.45); color: #fff; }
.composer-add.has-image { border-color: var(--cyan); background-position: center; background-size: cover; box-shadow: inset 0 0 0 2px rgba(4, 19, 31, .5), 0 0 16px rgba(55,231,255,.28); color: transparent; }
#chat-view .composer textarea { min-height: 44px; padding: 11px 13px; color: #e0f0f5; font: 400 12px/1.6 var(--body); }
#chat-view .composer textarea::placeholder { color: #5e7989; }
#chat-view .composer-tools { padding-right: 2px; }
#chat-view .tool { min-height: 34px; padding: 0 11px; border-color: rgba(99, 168, 199, .15); background: rgba(14, 33, 47, .5); color: #7497a8; font-size: 8px; }
#chat-view .tool i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(55,231,255,.55); }
#chat-view .send { min-width: 80px; min-height: 42px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #2cc6e7, #148abf); color: #00131c; box-shadow: 0 10px 24px rgba(13, 139, 187, .2); clip-path: none; }
#chat-view .send:hover { box-shadow: 0 12px 30px rgba(26, 186, 226, .3); }
.composer-meta { display: flex; justify-content: space-between; padding: 7px 6px 0; color: #405d6d; font: 400 6px var(--mono); letter-spacing: .05em; }
.composer-meta i { font-style: normal; }

@keyframes welcome-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .workspace-header { grid-template-columns: 1fr auto; }
  .workspace-status { display: none; }
  .workspace-account > div:nth-child(2) { display: none; }
}

@media (max-width: 940px) {
  body:has(#chat-view.active) { overflow: hidden; }
  #chat-view.active { height: calc(100vh - 58px); }
  #chat-view.active { height: calc(100svh - 58px); padding: 8px; }
  .chat-workspace { border-radius: 22px; }
  .workspace-header { min-height: 62px; padding: 9px 13px; }
  .workspace-title > span { display: none; }
  .workspace-title > div { margin: 0; }
  .welcome-state { min-height: max(490px, calc(100% - 60px)); }
}

@media (max-width: 620px) {
  #chat-view.active { height: calc(100vh - 54px); height: calc(100svh - 54px); padding: 0; }
  .chat-workspace { border-width: 1px 0 0; border-radius: 0; }
  .workspace-header { grid-template-columns: 1fr auto; gap: 8px; min-height: 57px; padding: 8px 11px; }
  .workspace-title small { display: none; }
  .workspace-account > div { min-width: 0; }
  .workspace-account > div span { display: none; }
  .workspace-account b { max-width: 72px; font-size: 8px; }
  .workspace-account button { min-height: 30px; padding: 0 9px; font-size: 7px; }
  .welcome-state { width: calc(100% - 24px); min-height: max(510px, calc(100% - 48px)); padding: 40px 0 32px; align-items: flex-start; text-align: left; }
  .welcome-mark { width: 55px; height: 55px; margin-left: 5px; border-radius: 17px; }
  .welcome-mark img { width: 42px; height: 42px; border-radius: 13px; }
  .welcome-state h1 { font-size: clamp(38px, 13vw, 54px); }
  .welcome-state > p { width: 100%; font-size: 12px; }
  #chat-view .starter-zone { margin-top: 26px; }
  #chat-view .starter-label { display: block; }
  #chat-view .starter-label b { display: none; }
  #chat-view .starter-grid { grid-template-columns: 1fr; gap: 7px; }
  #chat-view .starter-grid button { min-height: 67px; padding: 10px 12px; }
  #chat-view .starter-grid button span small { display: block; }
  .welcome-foot { display: none; }
  #chat-view .conversation { width: calc(100% - 20px); gap: 17px; padding: 24px 0 70px; }
  #chat-view .user-message { max-width: 88%; font-size: 12px; }
  #chat-view .agent-message { border-radius: 18px; }
  #chat-view .agent-message > header { min-height: 48px; padding: 0 13px; }
  #chat-view .agent-message > p,
  #chat-view .agent-message .answer-content { padding: 17px 15px; }
  #chat-view .answer-content { font-size: 12px; }
  .response-actions { padding: 7px 10px; }
  #chat-view .composer-wrap { width: calc(100% - 14px); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  #chat-view .composer { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 58px; border-radius: 18px; }
  .composer-add { width: 34px; height: 34px; }
  #chat-view .composer textarea { min-height: 38px; padding: 8px 9px; font-size: 11px; }
  #chat-view .composer-tools { grid-column: auto; padding: 0; }
  #chat-view .tool.mode { display: none; }
  #chat-view .send { min-width: 44px; min-height: 39px; padding: 0 11px; }
  #chat-view .send span { display: none; }
  .composer-meta { justify-content: center; padding-top: 6px; }
  .composer-meta i { display: none; }
}

/* Compact operator toolbar: status, help, protocol, then account. */
.topbar-actions { gap: 8px; white-space: nowrap; }
.online {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(74, 190, 225, .16);
  border-radius: 999px;
  background: rgba(7, 29, 45, .58);
}
.help {
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  color: #b8f4ff;
  font: 700 12px var(--mono);
}
.protocol-pill {
  display: inline-flex;
  min-height: 30px;
  padding: 0 11px;
  align-items: center;
  border: 1px solid rgba(70, 190, 230, .18);
  border-radius: 999px;
  background: rgba(6, 31, 49, .64);
  color: #6f9bb5;
  font: 500 7px var(--mono);
  letter-spacing: .1em;
}
.account-button,
.profile {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-color: #37e7ff;
  border-radius: 50%;
  background: #37e7ff;
  color: #00131d;
  clip-path: none;
  font: 700 8px var(--mono);
  letter-spacing: .04em;
  box-shadow: 0 0 18px rgba(55, 231, 255, .3);
}
.help:hover,
.account-button:hover,
.profile:hover { border-color: #8af2ff; background: #8af2ff; color: #00131d; }

/* Credits are isolated from the primary chat workspace in their own view. */
.billing-view {
  background:
    radial-gradient(circle at 77% 12%, rgba(55, 231, 255, .08), transparent 24rem),
    radial-gradient(circle at 15% 88%, rgba(255, 48, 73, .045), transparent 27rem);
}
.billing-shell { width: min(1240px, 100%); margin: 0 auto; }
.billing-title { max-width: none; }
.billing-balance {
  display: grid;
  min-width: 220px;
  padding: 13px 16px;
  gap: 4px;
  border: 1px solid rgba(68, 198, 237, .2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(14, 61, 84, .44), rgba(5, 23, 38, .74));
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}
.billing-balance span { color: #5f899e; font: 500 7px var(--mono); letter-spacing: .13em; }
.billing-balance b { color: #dffaff; font: 600 25px/1.1 var(--display); letter-spacing: -.04em; }
.billing-balance small { max-width: 220px; overflow: hidden; color: #4f7689; font: 400 7px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.billing-view .pricing-panel { width: 100%; max-width: none; margin: 0; scroll-margin-top: 76px; }
.sidebar { overflow-x: hidden; overflow-y: auto; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-center { display: none; }
  .online { display: flex; }
}

@media (max-width: 940px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 720px) {
  .online span { display: none; }
  .online::after { content: 'NOMINAL'; }
  .online { padding: 0 8px; font-size: 6px; }
  .protocol-pill { padding: 0 8px; font-size: 6px; }
  .billing-balance { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 7px; }
  .breadcrumb { display: none; }
  .topbar-actions { justify-self: end; gap: 5px; }
  .online, .help, .protocol-pill { min-height: 28px; }
  .help { width: 28px; height: 28px; }
  .account-button, .profile { width: 30px; height: 30px; min-height: 30px; }
}

/* Latest account, response, and Khmer accessibility treatment. */
.workspace-account {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 116px auto;
  width: min(100%, 510px);
  padding: 8px 9px;
  gap: 12px;
  align-items: center;
  justify-self: end;
  border: 1px solid rgba(111, 199, 235, .24);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .018)),
    rgba(8, 25, 40, .74);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 12px 34px rgba(0, 5, 14, .26);
  backdrop-filter: blur(22px) saturate(1.2);
}

.workspace-account > div { min-width: 0; }
.workspace-account .workspace-identity {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}
.account-avatar {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(134, 224, 250, .38);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(60, 196, 236, .72), rgba(25, 126, 198, .84));
  color: #00131d;
  box-shadow: inset 0 1px rgba(255,255,255,.32), 0 7px 16px rgba(8, 121, 181, .22);
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar b { font: 700 12px/1 var(--display); }
.account-copy { display: grid; min-width: 0; gap: 3px; }
.workspace-account .account-copy strong {
  overflow: hidden;
  color: #f0fbff;
  font: 650 13px/1.25 var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-account .account-copy small {
  overflow: hidden;
  color: #7898aa;
  font: 500 10px/1.25 var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-badge {
  display: inline-flex;
  min-height: 22px;
  padding: 0 8px;
  align-items: center;
  border: 1px solid rgba(142, 190, 212, .22);
  border-radius: 999px;
  background: rgba(130, 158, 176, .1);
  color: #9db4c0;
  font: 700 8px/1 var(--mono) !important;
  letter-spacing: .06em !important;
}
.plan-badge[data-plan="free"] { color: #b8d1dc; }
.plan-badge[data-plan="pro"] {
  border-color: rgba(255, 194, 102, .36);
  background: rgba(255, 180, 76, .13);
  color: #ffd69b;
}
.workspace-account .account-usage { display: grid; gap: 7px; }
.account-credit-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.workspace-account .account-credit-line span {
  color: #5f8498;
  font: 600 7px/1 var(--mono);
  letter-spacing: .09em;
}
.workspace-account .account-credit-line b {
  color: #e0faff;
  font: 650 12px/1 var(--display);
  letter-spacing: -.02em;
}
.account-credit-meter {
  position: relative;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(125, 197, 225, .18);
  border-radius: 999px;
  background: rgba(1, 10, 18, .62);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55), 0 1px rgba(255,255,255,.04);
}
.account-credit-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1689e8, #44d9f3 72%, #c4f8ff);
  box-shadow: 0 0 12px rgba(55, 231, 255, .48), inset 0 1px rgba(255,255,255,.4);
  transition: width .55s cubic-bezier(.2, .75, .2, 1);
}
.workspace-account .account-credits-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(75, 205, 242, .32);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(36, 150, 196, .3), rgba(13, 67, 101, .4));
  color: #d0f6ff;
  font: 700 9px/1 var(--body);
  white-space: nowrap;
}
.workspace-account .account-credits-button:hover { border-color: var(--cyan); background: rgba(20, 106, 149, .52); }
.profile { background-position: center; background-size: cover; }

#chat-view .chat-row,
#chat-view .user-message,
#chat-view .answer-content { font-size: 13px; }
#chat-view .chat-row { line-height: 1.6; }
#chat-view .answer-content { line-height: 1.62; }
#chat-view .welcome-state > p { font-size: 14px; line-height: 1.6; }
#chat-view .starter-grid button span b { font-size: 13px; }
#chat-view .starter-grid button span small { font: 400 10px/1.45 var(--body); }
#chat-view .composer textarea { font-size: 13px; line-height: 1.5; }

:lang(km),
.khmer-text {
  font-family: 'Noto Sans Khmer', sans-serif;
  letter-spacing: 0 !important;
  line-height: 1.95;
  overflow-wrap: anywhere;
}
:lang(km) h1,
:lang(km) h2,
:lang(km) h3,
:lang(km) strong,
.khmer-text h1,
.khmer-text h2,
.khmer-text h3,
.khmer-text strong {
  font-family: 'Noto Sans Khmer', sans-serif;
  letter-spacing: 0 !important;
  line-height: 1.65;
}
#chat-view .khmer-text.answer-content,
#chat-view .khmer-text .answer-content,
#chat-view .user-message.khmer-text { line-height: 2.05; }
.khmer-text .inline-code,
.khmer-text .code-block,
.khmer-text .code-block * { font-family: var(--mono); }

#chat-view .agent-message {
  border-color: rgba(71, 165, 221, .32);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(14, 35, 55, .94), rgba(7, 18, 33, .95));
  box-shadow: inset 0 1px rgba(255,255,255,.09), 0 24px 64px rgba(0, 6, 20, .36), 0 0 0 1px rgba(20, 121, 196, .06);
}
#chat-view .agent-message > .response-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  min-height: 62px;
  padding: 0 19px;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 193, 108, .2);
  border-radius: 25px 25px 15px 15px;
  background:
    linear-gradient(115deg, rgba(255, 190, 99, .19), rgba(218, 153, 78, .09) 35%, rgba(17, 88, 140, .2) 100%),
    rgba(13, 30, 45, .9);
  box-shadow: inset 0 1px rgba(255, 232, 195, .14), 0 8px 24px rgba(0, 8, 18, .16);
}
.response-lights {
  display: inline-flex;
  margin: 0 !important;
  gap: 7px;
  align-items: center;
  pointer-events: none;
  user-select: none;
}
.response-light {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 50%;
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 2px 7px rgba(0,0,0,.2);
}
.response-light.red { background: #ff625c; }
.response-light.yellow { background: #ffbd44; }
.response-light.green { background: #31c84b; }
.response-brand {
  display: inline-flex;
  margin: 0 !important;
  gap: 9px;
  align-items: center;
  color: #eefaff !important;
}
#chat-view .response-brand img { width: 29px; height: 29px; border-radius: 9px; object-fit: cover; }
.response-brand b { font: 700 10px/1 var(--display); letter-spacing: .065em; }
.response-status {
  justify-self: end;
  margin-left: auto !important;
  color: #80cfe9 !important;
  font: 600 8px/1 var(--mono);
  letter-spacing: .08em !important;
  text-transform: uppercase;
}

#chat-view .code-block {
  overflow: hidden;
  border: 1px solid rgba(51, 155, 218, .42);
  border-radius: 20px;
  background: linear-gradient(145deg, #061525, #03101e);
  box-shadow: inset 0 1px rgba(146, 226, 255, .08), 0 18px 38px rgba(0, 6, 18, .3);
}
#chat-view .code-block header {
  min-height: 48px;
  margin: 0;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid rgba(255, 190, 98, .16);
  background:
    linear-gradient(110deg, rgba(255, 189, 96, .14), transparent 48%),
    rgba(8, 31, 51, .96);
}
#chat-view .code-tab {
  border-bottom-color: #38bfe9;
  color: #bfeeff;
  font-size: 11px;
}
#chat-view .code-block header button {
  min-height: 32px;
  border-color: rgba(83, 186, 226, .28);
  background: rgba(13, 78, 118, .46);
  color: #d4f5ff;
}
#chat-view .code-block pre { padding: 20px; color: #d1ebf5; font-size: 13px; line-height: 1.75; }
.response-actions { font-size: 11px; }
.response-actions button { font-size: 11px; }

/* Compact Khmer UI: humanist glyphs, natural shaping, and mobile-safe density. */
:lang(km), .khmer-text {
  font-family: 'Kantumruy Pro', 'Noto Sans Khmer', sans-serif;
  font-weight: 500;
  font-feature-settings: 'kern', 'liga';
  letter-spacing: 0 !important;
  text-rendering: optimizeLegibility;
}
#chat-view .chat-row, #chat-view .user-message, #chat-view .answer-content { font-size: 13px; }
#chat-view .chat-row, #chat-view .answer-content { line-height: 1.62; }
#chat-view .composer textarea { font-size: 13px; line-height: 1.5; }
#chat-view .user-message { padding: 10px 13px; }
#chat-view .agent-message > .response-header { min-height: 48px; padding: 0 15px; }
#chat-view .agent-message > .answer-content { padding-top: 14px; padding-bottom: 14px; }
#chat-view .response-actions { min-height: 46px; padding: 6px 13px; }
#chat-view .composer-wrap { width: min(780px, calc(100% - 32px)); }
#chat-view .composer { min-height: 58px; }
@media (max-width: 720px) {
  #chat-view { padding: 8px; }
  #chat-view .chat-row, #chat-view .user-message, #chat-view .answer-content { font-size: 13px; }
  #chat-view .chat-row, #chat-view .answer-content { line-height: 1.55; }
  #chat-view .composer { min-height: 50px; padding: 5px 7px 5px 10px; }
  #chat-view .composer textarea { min-height: 31px; padding: 7px 8px; font-size: 13px; }
  #chat-view .agent-message { border-radius: 18px; }
  #chat-view .agent-message > .response-header { min-height: 48px; padding: 0 12px; gap: 8px; border-radius: 17px 17px 12px 12px; }
  #chat-view .response-brand b { font-size: 9px; }
  #chat-view .response-status { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #chat-view .code-block pre { padding: 13px; font-size: 11px; }
}

@media (max-width: 1180px) {
  .workspace-account { width: min(100%, 500px); }
  .workspace-account > div:nth-child(2) { display: grid; }
}

@media (max-width: 940px) {
  .workspace-header { grid-template-columns: minmax(100px, .5fr) minmax(0, 1.5fr); }
  .workspace-account { grid-template-columns: minmax(160px, 1fr) 100px auto; width: 100%; gap: 9px; }
}

@media (max-width: 720px) {
  .workspace-header { grid-template-columns: 1fr; min-height: 116px; padding: 8px 11px; }
  .workspace-title { display: none; }
  .workspace-account {
    grid-template-areas: 'identity button' 'usage usage';
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 8px 10px;
    justify-self: stretch;
  }
  .workspace-identity { grid-area: identity; }
  .account-usage { grid-area: usage; }
  .account-credits-button { grid-area: button; }
  #chat-view .conversation { padding-top: 28px; }
}

@media (max-width: 620px) {
  .workspace-header { grid-template-columns: 1fr; min-height: 112px; }
  .workspace-account { padding: 7px 8px; border-radius: 19px; }
  .workspace-account .workspace-identity { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 7px; }
  .workspace-account > div .account-avatar { display: grid; }
  .workspace-account > div .account-copy { display: grid; }
  .workspace-account > div .plan-badge { display: inline-flex; }
  .account-avatar { width: 36px; height: 36px; border-radius: 12px; }
  .workspace-account .account-copy strong { font-size: 12px; }
  .workspace-account .account-copy small { display: block; font-size: 9px; }
  .plan-badge { min-height: 20px; padding: 0 6px; font-size: 7px !important; }
  .workspace-account .account-credit-line span { display: inline; }
  .workspace-account .account-credit-line b { max-width: none; font-size: 11px; }
  .workspace-account .account-credits-button { min-height: 34px; padding: 0 10px; font-size: 8px; }
  #chat-view .user-message,
  #chat-view .answer-content { font-size: 16px; }
  #chat-view .agent-message > .response-header { min-height: 57px; padding: 0 13px; gap: 10px; }
  .response-lights { gap: 5px; }
  .response-light { width: 9px; height: 9px; }
  #chat-view .response-brand img { width: 26px; height: 26px; }
  .response-brand b { font-size: 9px; }
  .response-status { font-size: 7px; }
  #chat-view .agent-message > p,
  #chat-view .agent-message .answer-content { padding: 20px 17px; }
  #chat-view .composer textarea { font-size: 16px; }
  #chat-view .code-block pre { padding: 16px; font-size: 12px; }
}

@media (max-width: 400px) {
  .workspace-account .account-copy small { max-width: 120px; }
  .response-brand b { display: none; }
  #chat-view .agent-message > .response-header { grid-template-columns: auto auto 1fr; }
}
