:root {
  color-scheme: dark;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --canvas: #0b1017;
  --panel: #131a23;
  --raised: #18222d;
  --field: #101720;
  --text: #edf3f3;
  --muted: #a2b0bb;
  --line: #293542;
  --line-soft: #25313c;
  --accent: #ff5200;
  --accent-soft: #ffab80;
  --focus: #dfaf93;
  --action: #de764b;
  --action-hover: #e48155;
  --action-pressed: #d46c44;
  --action-ink: #241610;
  --green: #bdeea1;
  --green-wash: #263a2b;
  --red: #ffb2b5;
  --red-wash: #432933;
  --ochre: #f3d299;
  --ochre-wash: #433824;
  --radius: 1.3rem;
  --shadow: 0 15px 38px #04070d38;
  background: var(--canvas);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 17rem; margin: 0; position: relative; isolation: isolate; }
[hidden] { display: none !important; }
a { color: var(--accent-soft); text-underline-offset: .2em; }
a:hover { color: #ffd5bd; }
button, select, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 4.15vw, 3.55rem); font-weight: 690; letter-spacing: -.065em; line-height: 1.03; }
h2 { font-size: 1.18rem; font-weight: 660; letter-spacing: -.027em; line-height: 1.23; }
h3 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.018em; line-height: 1.35; }
strong { font-weight: 665; }
.muted, .empty { color: var(--muted); }
.mono, time, .metric strong { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, monospace; font-size: .8125rem; }
.rail-nav svg, .button svg { flex: none; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }

.glass { background: #151f29; border: 1px solid #ffffff23; box-shadow: var(--shadow); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: #141e28b8; -webkit-backdrop-filter: blur(22px) saturate(145%); backdrop-filter: blur(22px) saturate(145%); }
}

.layout { width: min(100%, 100rem); margin-inline: auto; padding: 1.25rem; display: grid; gap: 1.25rem; min-height: 100dvh; grid-template-columns: 13.9rem minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; position: sticky; top: 1.25rem; align-self: start; min-height: 32rem; height: calc(100dvh - 2.5rem); padding: 1.05rem .78rem .8rem; border-radius: 1.48rem; }
.brand { display: flex; align-items: center; gap: .72rem; min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .96rem; line-height: 1.18; font-weight: 710; letter-spacing: -.025em; }
.brand small { font-size: .67rem; font-weight: 650; letter-spacing: .10em; color: var(--muted); margin-top: .25rem; line-height: 1.15; }
.brand s { text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.rail .brand { padding: .36rem .25rem .95rem; }
.mark { position: relative; isolation: isolate; display: grid; flex: 0 0 auto; place-items: center; width: 2.7rem; aspect-ratio: 1; border: 1px solid #866350; border-radius: .86rem; color: #ffc39c; background: radial-gradient(circle at 24% 4%, #65402f 0, #3c2826 46%, #201b23 100%); }
.mark::before, .mark::after { content: ''; position: absolute; top: 50%; left: 50%; aspect-ratio: 1; border: 1px solid; border-radius: 50%; transform: translate(-50%, -50%); }
.mark::before { width: 66%; border-color: #ffba8c60; }
.mark::after { width: 37%; border-color: #ffba8c87; }
.mark i { z-index: 1; width: .24rem; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.mark b { position: absolute; z-index: 1; top: 24%; left: 75%; width: .3rem; aspect-ratio: 1; border-radius: 50%; background: #ff995f; transform: translate(-50%, -50%); }

.rail-nav { --active: 0; --nav-size: 2.7rem; --nav-gap: .23rem; position: relative; isolation: isolate; display: grid; gap: var(--nav-gap); margin: .7rem 0 1rem; }
.rail-nav[data-active="signals"] { --active: 1; }
.rail-nav[data-active="moderation"] { --active: 2; }
.rail-nav[data-active="categories"] { --active: 3; }
.rail-nav[data-active="sources"] { --active: 4; }
.rail-nav[data-active="codes"] { --active: 5; }
.rail-nav[data-active="settings"] { --active: 6; }
.nav-lens { position: absolute; inset: 0 0 auto; z-index: -1; height: var(--nav-size); border: 1px solid #ffb48a44; border-radius: .88rem; pointer-events: none; background: linear-gradient(162deg, #ffad752e, #c6896821 34%, #a9898015 60%, #f2986730); box-shadow: inset 0 1px #ffe3cf32, inset 1px 0 #ffe3cf10, inset 0 -1px #10151c70, 0 5px 15px #080a1135; transform: translateY(calc(var(--active) * (var(--nav-size) + var(--nav-gap)))); transition: transform 330ms cubic-bezier(.2,.8,.2,1); }
.rail-nav button { display: flex; align-items: center; gap: .68rem; min-width: 0; height: var(--nav-size); padding: 0 .7rem; border: 1px solid transparent; border-radius: .88rem; background: transparent; text-align: left; font-size: .9rem; font-weight: 565; color: #b8c5ce; transition: background 165ms ease, color 165ms ease; }
.rail-nav button:hover { background: #e7f7ff0c; color: var(--text); }
.rail-nav button[aria-current="page"] { color: #fff0e6; font-weight: 675; }
.rail-nav button[aria-current="page"] svg { color: var(--accent-soft); }
.count { margin-inline-start: auto; font-size: .75rem; border-radius: 1rem; min-width: 1.22rem; text-align: center; font-weight: 680; background: var(--red-wash); color: var(--red); padding: .05rem .3rem; }
.rail-actions { --rail-action-size: 2.4rem; display: flex; align-items: center; gap: .45rem; align-self: stretch; margin-top: auto; }

.content { width: 100%; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem 1rem; }
.content > .page-head { position: relative; isolation: isolate; overflow: hidden; min-height: 7.9rem; margin-bottom: .95rem; padding: 1.12rem 1.37rem; border-radius: var(--radius); border: 1px solid #69819143; background: #17242bd4; box-shadow: var(--shadow); }
.layout[data-view="overview"] .content > .page-head { min-height: 9rem; padding-inline: 1.44rem; }
.content > .page-head > div:not(.header-light) { position: relative; }
.page-head p { margin-top: .5rem; max-width: 48ch; line-height: 1.4; }
.header-light { display: none; position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 94% 60%, #8a3b223f, transparent 66%); }
.layout[data-view="overview"] .header-light { display: block; }
.header-light i { position: absolute; display: block; border-radius: 50%; animation: header-bokeh 19s ease-in-out infinite alternate; filter: blur(25px); }
.header-light i:nth-child(1) { width: 19rem; height: 19rem; right: 3%; top: -10rem; background: radial-gradient(circle, #ff8640bd 0, #ff601d65 46%, transparent 71%); }
.header-light i:nth-child(2) { width: 15rem; height: 15rem; right: 15%; bottom: -9rem; background: radial-gradient(circle, #ffac697e 0, #c7554363 45%, transparent 71%); animation-duration: 24s; animation-delay: -8s; }
.header-light i:nth-child(3) { width: 13rem; height: 13rem; right: -4%; bottom: -7rem; background: radial-gradient(circle, #e771608e 0, #8d4b7b57 45%, transparent 72%); animation-duration: 20s; animation-delay: -13s; }
@keyframes header-bokeh {
  from { transform: translate3d(-32px, -13px, 0) scale(.92); }
  to { transform: translate3d(54px, 25px, 0) scale(1.14); }
}
.header-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .55rem; flex: 0 0 auto; }
.connection { display: inline-flex; align-items: center; gap: .48rem; padding: .48rem .75rem; border: 1px solid #deedff2b; border-radius: 2rem; background: #142129d9; color: #d0d9dd; font-size: .8125rem; font-weight: 650; white-space: nowrap; box-shadow: inset 0 1px #ffffff14; }
.connection:empty { display: none; }
.connection::before { content: ''; flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: #adb9c4; }
.connection[data-state="ready"]::before { background: var(--accent); }
.connection[data-state="pending"]::before { background: var(--ochre); }
#refresh { background: #1e303cd9; border-color: #e3fdff32; }
#refresh:hover { background: #2b4351; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .46rem; min-height: 2.4rem; padding: .44rem .79rem; appearance: none; -webkit-tap-highlight-color: transparent; border: 1px solid #3c4d5a; border-radius: .72rem; background: #202c37; font-size: .875rem; font-weight: 650; white-space: nowrap; box-shadow: inset 0 1px #ffffff0c; transition: background-color 155ms ease, border-color 155ms ease; }
.button:hover { background: #2b3b49; border-color: #607485; }
.button:active:not(:disabled) { box-shadow: inset 0 2px 4px #080d144d; }
.button.primary { background-color: var(--action); color: var(--action-ink); border-color: transparent; box-shadow: none; }
.button.primary:hover { background-color: var(--action-hover); border-color: transparent; }
.button.primary:active:not(:disabled) { background-color: var(--action-pressed); box-shadow: none; }
.button.primary:focus-visible { outline-color: #572d1e; outline-offset: -4px; }
.button.secondary, .button.logout { background: #ffffff08; border-color: #74899b3d; }
.button.secondary:hover, .button.logout:hover { background: #ffffff12; }
.rail-actions .button { min-height: var(--rail-action-size); }
.rail-actions .logout { flex: 1; }
.button.telegram-link { background-color: #83c9ef; border-color: transparent; color: #102b3d; text-decoration: none; box-shadow: none; }
.button.telegram-link:hover { background-color: #9bd7f4; border-color: transparent; color: #102b3d; }
.button.telegram-link:active { background-color: #74badd; box-shadow: none; }
.button.telegram-link:focus-visible { outline-color: #28516a; outline-offset: -4px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.button .telegram-logo { width: 1.25rem; height: 1.25rem; stroke: none; }
.button.rail-bot-link { flex: none; inline-size: var(--rail-action-size); padding: 0; background-color: #fff; }
.button.rail-bot-link:hover { background-color: #f0f7fc; }
.button.rail-bot-link:active:not(:disabled) { background-color: #e2eef7; box-shadow: none; }
.rail-bot-link .telegram-logo { width: 1.5rem; height: 1.5rem; }
.button.danger { color: var(--red); }
.notice { margin-block: .55rem 1rem; font-size: .9rem; color: var(--green); }
.notice.error { color: var(--red); }
.notice:empty { margin: 0; }

.overview { --dashboard-gap: .85rem; display: flex; flex-direction: column; gap: var(--dashboard-gap); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--dashboard-gap); }
.metric, .card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 1px #ffffff08; }
.metric { display: grid; align-content: start; justify-items: start; gap: .25rem; padding: .9rem 1.05rem .8rem; color: var(--muted); font-size: .875rem; text-align: left; }
.metric strong { color: var(--text); font-size: clamp(1.95rem, 3.55vw, 2.9rem); font-weight: 665; letter-spacing: -.065em; line-height: 1.13; }
.metric:first-child { border-color: #bc795866; background: linear-gradient(150deg, #3a2823 0, #252024 55%, #181c25 100%); }
.metric:first-child strong { color: #ffd0b4; }
.metric[data-view] { transition: background-color 170ms ease, border-color 170ms ease; }
.metric[data-view]:hover { border-color: #cc8a68; background-color: #302522; }
.metric-label, .metric-top { display: flex; align-items: center; gap: .45rem; }
.metric small { font-size: .75rem; color: var(--muted); }
.card { padding: 1.02rem 1.06rem; }
.overview-grid, .two-columns { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(17.5rem, 1fr); gap: .85rem; }
.two-columns { align-items: start; }
.overview-grid { grid-template-areas: "activity health" "activity feedback"; grid-template-rows: 1fr auto; gap: var(--dashboard-gap); }
.overview-grid > * { min-width: 0; }
.activity-card { grid-area: activity; }
.health-card { grid-area: health; }
.feedback-card { grid-area: feedback; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem .85rem; margin-bottom: .62rem; }
.panel-head .button { min-height: 2.12rem; padding: .28rem .64rem; font-size: .8125rem; }
.activity-list, .health-list { padding: 0; margin: 0; list-style: none; }
.activity-list li + li, .health-list li + li { border-top: 1px solid var(--line-soft); }
.activity-row { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left; gap: .45rem .9rem; padding: .78rem .24rem; font-size: .925rem; border: 0; background: none; border-radius: .58rem; }
.activity-row:hover { background: #ffffff0b; }
.activity-row:focus-visible { outline-offset: -2px; }
.activity-copy { display: grid; min-width: 0; gap: .16rem; }
.activity-copy strong { overflow-wrap: anywhere; }
.activity-copy small, .activity-copy .muted { color: var(--muted); font-size: .78rem; }
.activity-meta { color: var(--muted); font-size: .78rem; }
.activity-row .tag { flex: none; }
.health-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .45rem; padding: .63rem 0; font-size: .85rem; }
.health-list .muted, .health-list time { color: var(--muted); font-size: .78rem; }
.health-list li > small, .health-list li > p { grid-column: 1 / -1; }
.health-card > .empty, .health-card > p { margin-top: .52rem; }
.feedback-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin: .8rem 0 0; }
.feedback-stat { display: grid; gap: .28rem; padding-inline: .55rem .2rem; border-inline-start: 1px solid var(--line); }
.feedback-stat:first-child { padding-inline-start: 0; border-inline-start: 0; }
.feedback-stat dt { color: var(--muted); font-size: .78rem; }
.feedback-stat dd { margin: 0; font-weight: 660; font-size: 1.48rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gap { margin-top: 1rem; }
.body-copy { margin-top: .6rem; line-height: 1.52; }
.empty { border: 1px dashed #506172; border-radius: var(--radius); padding: 1rem; }
.empty.bare { border: 0; padding: .3rem 0; }
.toolbar, .form-actions { display: flex; gap: .55rem .75rem; align-items: end; flex-wrap: wrap; margin-bottom: .8rem; }
.toolbar > label { min-width: 10rem; }
.toolbar > label.grow { flex: 1; }
.toolbar .tail { margin-inline-start: auto; }

.table-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .875rem; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: .74rem .84rem; vertical-align: middle; }
thead { background: #202c37; }
th { font-weight: 660; color: #c4d2da; white-space: nowrap; }
tbody tr:hover { background: #ffffff06; }
tr:last-child td { border-bottom: 0; }
td p + p { margin-top: .18rem; }
td .clip { max-width: min(25rem, 33vw); overflow: hidden; text-overflow: ellipsis; display: inline-block; white-space: nowrap; vertical-align: middle; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.line-list { list-style: none; padding: 0; margin: .7rem 0 0; }
.line-list li { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding-block: .45rem; border-bottom: 1px solid var(--line); }
.line-list li:last-child { border-bottom: 0; }
.tag { display: inline-flex; align-items: center; gap: .22rem; border-radius: 1rem; padding: .24rem .49rem; white-space: nowrap; line-height: 1.16; font-size: .75rem; font-weight: 675; background: #273542; color: #d3e1eb; }
.tag.green { background: var(--green-wash); color: var(--green); }
.tag.red { background: var(--red-wash); color: var(--red); }
.tag.ochre { background: var(--ochre-wash); color: var(--ochre); }

.signal-list { display: grid; gap: .62rem; }
details.signal { background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) - .17rem); scroll-margin-top: 1rem; }
details.signal[open] { border-color: #637c7691; }
details.signal > summary { position: relative; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .52rem 1rem; cursor: pointer; padding: .95rem 1.04rem; border-radius: inherit; }
details.signal > summary::-webkit-details-marker { display: none; }
details.signal > summary:hover { background: #1b2732; }
details.signal > summary::after { content: '+'; grid-area: 1 / 2; align-self: center; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; font-size: 1.08rem; line-height: 1; background: #263540; color: #eff5f5; border-radius: 50%; }
details.signal[open] > summary::after { content: '−'; color: var(--accent); }
.signal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem .6rem; color: var(--muted); margin-top: .35rem; font-size: .8125rem; }
.signal-detail { border-top: 1px solid var(--line); padding: .9rem 1.04rem 1rem; }
.signal-detail h3 { margin-top: .85rem; }
.signal-detail ul { padding-inline-start: 1.25rem; margin-block: .55rem .75rem; }
.signal-detail li + li { margin-top: .33rem; }
.signal-detail .actions { margin-top: .85rem; }

label { display: grid; gap: .3rem; font-size: .875rem; font-weight: 610; }
input:not([type="checkbox"]), select, textarea { color: var(--text); min-height: 2.55rem; padding: .42rem .66rem; background: var(--field); border: 1px solid #445762; border-radius: .71rem; width: 100%; min-width: 0; }
select {
  appearance: none;
  padding-inline-end: 2rem;
  background-image:
    linear-gradient(45deg, transparent 39%, var(--muted) 40% 60%, transparent 61%),
    linear-gradient(135deg, transparent 39%, var(--muted) 40% 60%, transparent 61%);
  background-repeat: no-repeat;
  background-position: right 1rem center, right .67rem center;
  background-size: .34rem .34rem;
}
@media (forced-colors: active) {
  select { appearance: auto; padding-inline-end: .66rem; background-image: none; }
}
input::placeholder, textarea::placeholder { color: #8799a5; }
textarea { resize: vertical; }
input[readonly] { background: #1e2a34; }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; }
.fields { display: grid; gap: .8rem 1rem; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: .53rem; }
dialog { width: min(36rem, calc(100vw - 1.4rem)); max-height: calc(100dvh - 1.4rem); padding: 1.25rem; border: 1px solid #5e798776; border-radius: 1.5rem; color: var(--text); background: #18232c; box-shadow: 0 28px 100px #03050d9c, inset 0 1px #dae8f320; }
dialog::backdrop { background: #080c15b9; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog .page-head { margin-bottom: 1.05rem; }
.form-actions { margin: .95rem 0 0; }
dialog .form-actions { justify-content: end; }
.settings { max-width: 39rem; }
.bot-access-controls { margin: .8rem 0 0; }
.fresh-codes textarea { min-height: 6rem; font-family: ui-monospace, monospace; resize: vertical; }
.code-issue { min-width: 0; margin: 1rem 0 0; padding: 0; border: 0; }
.manual-codes { max-width: 39rem; }
.manual-codes > summary { width: fit-content; cursor: pointer; font-size: .875rem; font-weight: 650; }
.manual-codes > summary:hover { color: var(--accent); }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; }
.inline-form input { max-width: 8rem; }

.login { display: grid; min-height: 100dvh; place-items: center; padding: 1.2rem; }
.login-shell { width: min(100%, 47rem); border-radius: 1.8rem; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-card { display: grid; gap: 1.12rem; align-content: center; padding: clamp(1.3rem, 4vw, 2.35rem); min-height: 24rem; }
.login-card h1 { font-size: clamp(1.8rem, 3.3vw, 2.55rem); margin-block: .5rem .1rem; }
.login-card label, .login-card button { width: 100%; }
.login-card .button { min-height: 2.75rem; }
.login-card .notice { margin-block: 0; }
.login-visual { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; border-inline-start: 1px solid #ffd0b11d; background: radial-gradient(ellipse at 48% 48%, #85533679, transparent 70%), radial-gradient(ellipse at 92% 100%, #5747657d, transparent 60%), #251e25; }
.radar { position: relative; width: min(79%, 16rem); aspect-ratio: 1; display: grid; place-items: center; }
.radar i { position: absolute; width: 100%; aspect-ratio: 1; border: 1px solid #ffc29d53; border-radius: 50%; }
.radar i:nth-child(2) { width: 75%; }
.radar i:nth-child(3) { width: 50%; border-color: #ffc29d72; }
.radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 46deg, transparent 0deg 247deg, #ff8b4805 260deg, #ff9b6240 350deg, #ffb47d9c 359deg, transparent 360deg); animation: scan 21s linear infinite; }
.radar::after { position: absolute; content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: #ffd9bd; }
.radar b { position: absolute; top: 20%; right: 24%; width: .44rem; height: .44rem; border-radius: 50%; background: #ffac78; animation: shimmer 5s ease-in-out infinite alternate; }
@keyframes scan { to { transform: rotate(360deg); } }
@keyframes shimmer { from { opacity: .5; } to { opacity: 1; } }

@media (width > 51rem) {
  .layout[data-view="overview"] .content, .layout[data-view="overview"] #panel, .activity-card, .health-card { display: flex; flex-direction: column; }
  .layout[data-view="overview"] #panel, .overview, .overview-grid, .activity-list, .health-list { flex: 1 0 auto; }
  .activity-list, .health-list { display: grid; }
  .activity-row { height: 100%; }
  .activity-card > .empty { flex: 1; display: grid; place-content: center; text-align: center; }
}
@media (max-width: 66rem) {
  .layout { grid-template-columns: 12rem minmax(0, 1fr); gap: .9rem; padding: .92rem; }
  .rail { top: .92rem; height: calc(100dvh - 1.84rem); padding-inline: .58rem; }
  .rail .brand { gap: .5rem; }
  .overview-grid, .two-columns { grid-template-columns: minmax(0, 1.2fr) minmax(14rem, 1fr); }
  .activity-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .22rem .45rem; }
  .activity-copy { display: contents; }
  .activity-copy strong { grid-column: 1 / -1; }
  .health-list li { grid-template-columns: 1fr; justify-items: start; }
  .header-actions { max-width: 44%; }
}
@media (max-width: 51rem) {
  .layout { display: block; padding: .65rem; }
  .rail { z-index: 3; top: .65rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; height: auto; padding: .55rem .55rem .32rem; border-radius: 1.13rem; }
  .rail .brand { padding: 0 .25rem; }
  .rail .mark { width: 2.17rem; height: 2.17rem; border-radius: .68rem; }
  .rail-nav { display: flex; grid-row: 2; grid-column: 1 / -1; gap: .25rem; margin: .35rem 0 0; padding: .18rem .18rem .3rem; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #536976 transparent; }
  .nav-lens { display: none; }
  .rail-nav button { min-width: max-content; height: 2.45rem; padding-inline: .56rem; font-size: .8125rem; gap: .38rem; }
  .rail-nav button svg { width: .94rem; height: .94rem; }
  .rail-nav button[aria-current="page"] { background: #ffad7529; border-color: #ffb48a44; box-shadow: inset 0 1px #ffe3cf25; }
  .rail-actions { --rail-action-size: 2.03rem; grid-row: 1; grid-column: 2; margin: 0; align-self: center; }
  .rail-actions .logout { min-inline-size: clamp(4.5rem, 21vw, 5.5rem); }
  .rail-bot-link .telegram-logo { width: 1.25rem; height: 1.25rem; }
  .content { margin-top: .7rem; }
  .overview { --dashboard-gap: .65rem; }
  .overview-grid, .two-columns { grid-template-columns: 1fr; }
  .overview-grid { grid-template-areas: "activity" "health" "feedback"; grid-template-rows: none; }
  .health-list li { grid-template-columns: minmax(0, 1fr) auto; justify-items: stretch; }
  details.signal { scroll-margin-top: 7.8rem; }
  th, td { padding-inline: .65rem; }
  .table-frame table { min-width: 42rem; }
  td .clip { max-width: 16rem; }
  .toolbar .tail { margin-inline-start: 0; }
}
@media (max-width: 35rem) {
  .content > .page-head, .layout[data-view="overview"] .content > .page-head { min-height: auto; padding: .96rem; display: grid; border-radius: 1.15rem; }
  .header-actions { max-width: none; justify-content: start; }
  .page-head p { font-size: .9rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: .72rem .78rem; }
  .card { padding: .82rem .88rem; }
  .panel-head { flex-wrap: wrap; }
  .health-list li { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .toolbar > label { min-width: 8.2rem; flex: 1; }
  .toolbar > label.grow { min-width: 100%; }
  .fields.two { gap: .65rem; }
  .login-shell { grid-template-columns: 1fr; max-width: 24rem; }
  .login-card { min-height: 0; padding: 1.35rem; }
  .login-visual { display: none; }
}
.cursor-firefly { display: none; }
@media (any-hover: hover) and (any-pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor-firefly {
    position: fixed;
    display: block;
    z-index: -1;
    inset: 0 auto auto 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms ease;
  }
  .cursor-firefly.is-visible { opacity: .76; }
  .cursor-firefly::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: clamp(21rem, 41vw, 34rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #ffc08fa3 0, #f89c6770 25%, #d2876144 48%, #ad716020 64%, transparent 78%);
    filter: blur(46px);
    transform: translate(-50%, -50%);
    animation: firefly-glow 4s ease-in-out infinite alternate paused;
  }
  .cursor-firefly.is-visible::before { animation-play-state: running; }
  .metric, .card { background-color: #131a23d0; }
  .metric:first-child { background: linear-gradient(150deg, #3a2823dc, #252024da 55%, #181c25dd); }
  .table-frame { background-color: #131a23de; }
}
@keyframes firefly-glow {
  from { opacity: .84; transform: translate(-50%, -50%) scale(.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .header-light i, .radar::before, .radar b { animation: none; }
  .nav-lens, .button, .metric, .rail-nav button { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .layout[data-view="overview"] .header-light, .cursor-firefly { display: none; }
  .metric, .card, .table-frame { background-color: var(--panel); }
  .metric:first-child { background: linear-gradient(150deg, #3a2823 0, #252024 55%, #181c25 100%); }
  .glass, .content > .page-head, .connection, #refresh { background: #18232d; -webkit-backdrop-filter: none; backdrop-filter: none; }
  dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
