:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #050505;
  --surface: #0a0a0a;
  --line: #f5f1e8;
  --line-soft: rgba(245, 241, 232, .28);
  --text: #faf9f6;
  --muted: #a9a6a0;
  --red: #ff4655;
  --cyan: #35d7c6;
  --yellow: #f5d36b;
  --shadow: none;
  --mx: 50%;
  --my: 18%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 70, 85, .18), transparent 26vw),
    radial-gradient(circle at calc(100% - var(--mx)) calc(var(--my) + 28%), rgba(53, 215, 198, .14), transparent 28vw),
    linear-gradient(180deg, #050505, #000 34%, #020202);
  color: var(--text);
  font-family: "Arial Narrow", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), #000, transparent 68%);
  mask-image: radial-gradient(circle at var(--mx) var(--my), #000, transparent 68%);
  opacity: .9;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .96;
}

.scan-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 40%, rgba(255, 255, 255, .08) 48%, transparent 56%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
  opacity: .48;
  animation: scanSweep 9s linear infinite;
}

@keyframes scanSweep {
  0% { transform: translateX(-55%); }
  100% { transform: translateX(55%); }
}

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

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 0 40px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 88px;
  padding: 18px 0 16px;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4.2vw, 72px);
  line-height: .95;
  font-weight: 900;
  text-shadow: 0 0 28px rgba(255, 255, 255, .08);
}

.brand-mark {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--red);
  box-shadow: 34px 0 0 var(--cyan);
}

.subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

.quick-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .72);
  border-radius: 0;
}

.quick-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  color: var(--text);
  text-decoration: none;
  border-radius: 0;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
}

.quick-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 7px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}

.quick-nav a:hover::after {
  transform: scaleX(1);
}

.quick-nav a + a {
  border-left: 1px solid var(--line);
}

.quick-nav a:hover {
  color: #000;
  background: var(--text);
}

.module {
  position: relative;
  margin-top: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: moduleRise .7s ease both;
  transform-style: preserve-3d;
}

.module::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,70,85,.22), transparent 28%, transparent 72%, rgba(53,215,198,.18)),
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.08), transparent 34%);
  z-index: 0;
  opacity: .5;
  transition: opacity .2s ease;
}

.module:hover::before {
  opacity: .72;
}

.module-head,
.sensitivity-grid,
.crosshair-layout {
  position: relative;
  z-index: 1;
}

@keyframes moduleRise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.module-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 86px);
  line-height: .94;
  font-weight: 900;
  max-width: 980px;
}

.module-head p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.count-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #000;
  color: var(--text);
  font-size: 13px;
}

.count-pill {
  border-color: var(--line);
  background: #000;
  color: var(--text);
  white-space: nowrap;
}

.sensitivity-grid {
  display: grid;
  grid-template-columns: 300px minmax(680px, 1.45fr) 320px;
  gap: 14px;
  align-items: start;
  padding: 28px;
}

.crosshair-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 350px;
  gap: 14px;
  align-items: start;
  padding: 28px;
}

.surface {
  position: relative;
  background: rgba(10, 10, 10, .82);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255,255,255,.09), transparent 26%, transparent 74%, rgba(53,215,198,.08));
  opacity: 0;
  transition: opacity .2s ease;
}

.surface:hover {
  border-color: rgba(255, 255, 255, .86);
  background: rgba(18, 18, 18, .86);
}

.surface:hover::after {
  opacity: .55;
}

.surface-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .86);
}

.surface-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.surface-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.surface-body {
  padding: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.small,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  color: var(--text);
  background: rgba(5, 5, 5, .9);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 10px;
  outline: none;
  transition: border-color .16s ease, background .16s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--text);
  box-shadow: none;
  background: #0c0c0c;
}

input[type="range"] {
  min-height: 26px;
  padding: 0;
  accent-color: var(--red);
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--cyan);
}

.color-input {
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

.inline-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
  color: var(--text);
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 13px;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255,255,255,.42) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .38s ease;
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn:hover {
  border-color: var(--text);
  background: var(--text);
  color: #000;
}

.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 800;
}

.btn.cyan {
  background: rgba(0, 0, 0, .82);
  border-color: var(--cyan);
  color: #d6fffb;
}

.btn.ghost {
  background: transparent;
}

.btn.icon {
  width: 40px;
  padding: 0;
  font-weight: 900;
}

.crosshair-tuner {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
}

.tuner-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.tuner-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.crosshair-tuner .field {
  margin-bottom: 2px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 5, 5, .9);
  color: var(--text);
  font-size: 13px;
}

.test-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 14px 0;
}

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

.tab,
.seg-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.tab.active,
.seg-btn.active {
  color: #fff;
  background: rgba(255, 70, 85, .22);
  border-color: var(--red);
}

.arena-wrap {
  padding: 18px;
}

.arena-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  position: relative;
  min-height: 68px;
  padding: 12px;
  background: rgba(0, 0, 0, .82);
  border: 1px solid var(--line);
  border-radius: 0;
}

.stat::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--cyan));
  transform: scaleX(.18);
  transform-origin: left;
  transition: transform .25s ease;
}

.stat:hover::after {
  transform: scaleX(1);
}

.stat b {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  animation: numberGlow 3.2s ease-in-out infinite;
}

@keyframes numberGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { text-shadow: 0 0 18px rgba(255,255,255,.16); }
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px),
    rgba(5, 5, 5, .88);
  background-size: 40px 40px, 40px 40px, auto;
  cursor: none;
  user-select: none;
  touch-action: none;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 44px rgba(53, 215, 198, .05);
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.12), transparent 20%),
    linear-gradient(90deg, transparent, rgba(53,215,198,.12), transparent);
  opacity: .48;
  animation: arenaBreath 4.6s ease-in-out infinite;
}

.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(255,255,255,.08) 50%, transparent 53%),
    linear-gradient(180deg, transparent 0 47%, rgba(255,255,255,.08) 50%, transparent 53%);
  opacity: .12;
  mix-blend-mode: screen;
}

@keyframes arenaBreath {
  0%, 100% { opacity: .26; }
  50% { opacity: .58; }
}

.arena.hit-flash {
  animation: arenaHit .11s ease;
}

@keyframes arenaHit {
  0% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42), 0 0 0 rgba(255, 70, 85, 0);
  }

  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0), 0 0 18px rgba(255, 70, 85, .16);
  }
}

canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.arena-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.arena-overlay.hidden {
  display: none;
}

.overlay-box {
  max-width: 520px;
}

.overlay-box h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.overlay-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.arena-actions {
  margin-top: 12px;
}

.progress-line {
  height: 12px;
  margin-top: 14px;
  border-radius: 0;
  background: rgba(5, 5, 5, .88);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--cyan));
  transition: width .18s ease;
  box-shadow: 0 0 18px rgba(53, 215, 198, .28);
}

.result-main {
  display: grid;
  gap: 12px;
}

.sens-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .84);
  overflow: hidden;
}

.sens-card::after {
  content: "";
  position: absolute;
  inset: auto -20% 0;
  height: 34%;
  background: linear-gradient(90deg, transparent, rgba(255,70,85,.18), rgba(53,215,198,.16), transparent);
  filter: blur(18px);
  animation: sensWash 5s ease-in-out infinite;
}

@keyframes sensWash {
  0%, 100% { transform: translateX(-12%); opacity: .38; }
  50% { transform: translateX(12%); opacity: .68; }
}

.sens-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.sens-value {
  position: relative;
  z-index: 1;
  margin: 8px 0 6px;
  font-size: clamp(54px, 9vw, 92px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sens-sub {
  color: var(--muted);
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric {
  min-height: 76px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
}

.metric strong {
  display: block;
  margin-bottom: 5px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.log {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.log-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
  line-height: 1.45;
}

.log-item strong {
  color: var(--cyan);
}

.notice,
.formula {
  line-height: 1.52;
  font-size: 13px;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 0;
  background: rgba(0, 0, 0, .84);
  color: var(--text);
}

.formula {
  color: var(--muted);
}

.filter-panel,
.detail-panel {
  position: sticky;
  top: 118px;
}

.search-row {
  position: relative;
}

.search-row input {
  padding-left: 34px;
}

.search-mark {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 900;
}

.team-list {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.team-chip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
  overflow: hidden;
}

.team-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(53,215,198,.18), transparent);
  transform: translateX(-100%);
  transition: transform .24s ease;
}

.team-chip:hover::before {
  transform: translateX(0);
}

.team-chip > * {
  position: relative;
}

.team-chip.active {
  color: #fff;
  border-color: var(--cyan);
  background: rgba(53, 215, 198, .12);
}

.team-chip span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.team-chip em {
  color: #cbd3de;
  font-style: normal;
  font-size: 12px;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
  margin-bottom: 12px;
}

.library-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.copy-feedback {
  min-height: 22px;
  color: var(--cyan);
  font-size: 13px;
}

.crosshair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.crosshair-card {
  position: relative;
  display: grid;
  grid-template-rows: 132px minmax(0, 1fr) auto;
  min-height: 236px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, .82);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.crosshair-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, transparent 0 36%, rgba(255,255,255,.1) 46%, transparent 58%);
  opacity: 0;
  transform: translateX(-24%);
  transition: opacity .18s ease, transform .28s ease;
}

.crosshair-card:hover,
.crosshair-card.active {
  transform: translateY(-3px);
  border-color: var(--red);
  background: rgba(8, 8, 8, .94);
}

.crosshair-library {
  max-height: min(1080px, calc(100vh - 136px));
  padding: 2px 8px 24px 2px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(65,227,209,.38) rgba(255,255,255,.04);
  scrollbar-width: thin;
}

.crosshair-library::-webkit-scrollbar {
  width: 8px;
}

.crosshair-library::-webkit-scrollbar-track {
  border-radius: 99px;
  background: rgba(255,255,255,.035);
}

.crosshair-library::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(65,227,209,.55), rgba(255,93,104,.4));
}

.crosshair-library .library-tools {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 2px 0 10px;
  background: linear-gradient(180deg, rgba(7,19,25,.98) 65%, transparent);
  backdrop-filter: blur(12px);
}

.crosshair-card:hover::after,
.crosshair-card.active::after {
  opacity: 1;
  transform: translateX(24%);
}

.preview-box {
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, .88);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.preview-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 24px 24px;
}

.preview-img {
  position: relative;
  width: 74px;
  height: 74px;
  object-fit: contain;
  transition: transform .22s ease, filter .22s ease;
}

.crosshair-card:hover .preview-img {
  transform: scale(1.12);
  filter: drop-shadow(0 0 12px rgba(255,255,255,.24));
}

.fallback-cross {
  position: absolute;
  width: 52px;
  height: 52px;
  display: none;
  color: var(--fallback);
}

.preview-box.image-failed .fallback-cross {
  display: block;
}

.preview-box.image-failed .preview-img {
  display: none;
}

.fallback-cross::before,
.fallback-cross::after {
  content: "";
  position: absolute;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.fallback-cross::before {
  width: 52px;
  height: 3px;
  left: 0;
  top: 24px;
}

.fallback-cross::after {
  width: 3px;
  height: 52px;
  left: 24px;
  top: 0;
}

.card-info {
  min-width: 0;
  padding: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 4px;
}

.swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: var(--swatch);
}

.card-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 0 12px 12px;
}

.mini-code {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 8px;
  background: rgba(5, 5, 5, .9);
}

.selected-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 5, 5, .9);
  margin-bottom: 12px;
  overflow: hidden;
}

.selected-preview img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.selected-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  font-size: 21px;
}

.selected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .sensitivity-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .crosshair-layout {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .result-panel,
  .detail-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .filter-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 0 12px 24px;
  }

  .topbar,
  .module-head,
  .sensitivity-grid,
  .crosshair-layout,
  .library-tools {
    grid-template-columns: 1fr;
  }

  .quick-nav {
    justify-self: stretch;
  }

  h1 {
    font-size: clamp(34px, 13vw, 56px);
  }

  h2 {
    font-size: clamp(36px, 14vw, 62px);
  }

  .subtitle,
  .module-head p {
    max-width: none;
  }

  .test-tabs,
  .arena-meta,
  .metric-grid,
  .inline-two {
    grid-template-columns: 1fr;
  }

  .arena {
    min-height: 390px;
    aspect-ratio: 4 / 5;
  }

  .module {
    padding: 0;
  }

  .module-head,
  .sensitivity-grid,
  .crosshair-layout {
    padding: 18px;
  }

  .crosshair-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .crosshair-card {
    min-height: 210px;
    grid-template-rows: 106px minmax(0, 1fr) auto;
  }

  .ambient-canvas {
    opacity: .42;
  }

  .scan-field {
    opacity: .18;
  }
}

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

  .ambient-canvas,
  .scan-field {
    display: none;
  }
}

/* Layered glass direction */
:root {
  --bg: #061015;
  --panel: rgba(9, 21, 28, .78);
  --surface: rgba(14, 29, 38, .72);
  --line: rgba(173, 220, 226, .18);
  --line-soft: rgba(173, 220, 226, .1);
  --text: #f3fbfb;
  --muted: #91a7ad;
  --red: #ff5d68;
  --cyan: #41e3d1;
  --yellow: #ffc96b;
  --shadow: 0 28px 70px rgba(0, 0, 0, .34), 0 2px 0 rgba(255, 255, 255, .025) inset;
  --scroll-y: 0;
}

body {
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(65, 227, 209, .12), transparent 25vw),
    radial-gradient(circle at 84% 34%, rgba(255, 93, 104, .09), transparent 32vw),
    linear-gradient(150deg, #07171d 0%, #081116 44%, #03080b 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(150, 225, 224, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 225, 224, .028) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: translateY(calc(var(--scroll-y) * -18px));
  opacity: .74;
}

.scan-field {
  background:
    linear-gradient(112deg, transparent 0 38%, rgba(65, 227, 209, .07) 47%, rgba(255,255,255,.045) 50%, transparent 59%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.012) 0 1px, transparent 1px 8px);
  opacity: .34;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 3px;
  background: rgba(255,255,255,.035);
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #a8fff4, var(--red));
  box-shadow: 0 0 16px rgba(65, 227, 209, .7);
  transition: width .08s linear;
}

.chapter-rail {
  position: fixed;
  z-index: 40;
  top: 50%;
  right: 20px;
  display: grid;
  gap: 14px;
  transform: translateY(-50%);
}

.chapter-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(173, 220, 226, .2);
  border-radius: 50%;
  background: rgba(6, 16, 21, .7);
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(14px);
  transition: transform .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.chapter-dot::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid transparent;
}

.chapter-dot.active {
  color: #fff;
  border-color: rgba(65, 227, 209, .7);
  box-shadow: 0 0 0 5px rgba(65, 227, 209, .08), 0 0 24px rgba(65, 227, 209, .22);
  transform: scale(1.08);
}

.chapter-dot.active::after {
  border-color: rgba(65, 227, 209, .28);
}

.app {
  width: min(1740px, 100%);
  padding: 0 56px 88px;
}

.topbar {
  min-height: 104px;
  margin-bottom: 56px;
  padding: 26px 4px 22px;
  background: linear-gradient(180deg, rgba(4, 12, 16, .94), rgba(4, 12, 16, .7));
  border-bottom: 1px solid rgba(173, 220, 226, .12);
  backdrop-filter: blur(22px) saturate(130%);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

h1 {
  color: #f6ffff;
  text-shadow: 0 0 44px rgba(65, 227, 209, .1);
}

.brand-mark {
  color: var(--cyan);
}

.brand-mark::before {
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red), var(--cyan));
  box-shadow: none;
}

.quick-nav {
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(173, 220, 226, .16);
  border-radius: 14px;
  background: rgba(8, 22, 28, .62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.quick-nav a {
  min-height: 42px;
  border-radius: 9px;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.quick-nav a + a {
  border-left: 0;
}

.quick-nav a:hover {
  color: #fff;
  background: rgba(65, 227, 209, .12);
  box-shadow: 0 0 22px rgba(65,227,209,.1) inset;
}

.module {
  --section-accent: var(--cyan);
  margin-top: 0;
  margin-bottom: 88px;
  border: 1px solid rgba(173, 220, 226, .12);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(13, 31, 39, .82), rgba(5, 15, 20, .72));
  box-shadow: 0 45px 110px rgba(0,0,0,.38), 0 1px 0 rgba(255,255,255,.07) inset;
  overflow: visible;
  opacity: 0;
  transform: translateY(64px) scale(.985);
  transition: opacity .85s cubic-bezier(.2,.75,.2,1), transform .85s cubic-bezier(.2,.75,.2,1);
  animation: none;
}

.module:nth-of-type(2) {
  --section-accent: var(--red);
}

.module.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.module::before {
  inset: -18px 24px 18px -18px;
  z-index: -1;
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--section-accent) 23%, transparent), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 42%);
  border: 1px solid color-mix(in srgb, var(--section-accent) 22%, transparent);
  opacity: .72;
  transform: translate3d(var(--shift-x, 0), var(--shift-y, 0), 0);
  transition: opacity .35s ease, transform .35s ease;
}

.module::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--section-accent), transparent);
  box-shadow: 0 0 26px var(--section-accent);
  opacity: .75;
}

.module:hover::before {
  opacity: 1;
}

.module-head {
  min-height: 220px;
  padding: 42px 48px 38px;
  border-bottom: 1px solid rgba(173, 220, 226, .1);
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 35%, color-mix(in srgb, var(--section-accent) 19%, transparent), transparent 31%),
    linear-gradient(105deg, rgba(255,255,255,.035), transparent 42%);
}

.module-head::before {
  content: attr(data-section);
  position: absolute;
  right: 34px;
  bottom: -24px;
  color: rgba(255,255,255,.025);
  font-size: 150px;
  line-height: 1;
  font-weight: 900;
  pointer-events: none;
}

.module-head > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--section-accent);
  letter-spacing: .12em;
}

h2 {
  font-size: clamp(48px, 5vw, 82px);
  text-shadow: 0 10px 42px rgba(0,0,0,.32);
}

.count-pill,
.tag {
  border-color: rgba(173, 220, 226, .16);
  border-radius: 999px;
  background: rgba(8, 22, 28, .7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.count-pill {
  border-color: color-mix(in srgb, var(--section-accent) 45%, transparent);
  color: var(--section-accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--section-accent) 10%, transparent);
}

.sensitivity-grid,
.crosshair-layout {
  gap: 20px;
  padding: 32px;
  background: rgba(2, 10, 14, .18);
  border-radius: 0 0 26px 26px;
}

.surface {
  --glow-x: 50%;
  --glow-y: 20%;
  border: 1px solid rgba(173, 220, 226, .12);
  border-radius: 17px;
  background:
    radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(100, 238, 224, .1), transparent 32%),
    linear-gradient(145deg, rgba(18, 38, 48, .82), rgba(8, 21, 28, .78));
  box-shadow: 0 24px 54px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.045);
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.surface::after {
  background: radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(255,255,255,.13), transparent 25%);
  opacity: .55;
}

.surface:hover {
  border-color: rgba(65, 227, 209, .28);
  background-color: transparent;
  box-shadow: 0 30px 72px rgba(0,0,0,.3), 0 0 35px rgba(65,227,209,.055), inset 0 1px 0 rgba(255,255,255,.07);
  transform: translateY(-3px);
}

.surface:hover::after {
  opacity: .78;
}

.surface-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(173, 220, 226, .1);
  background: linear-gradient(100deg, rgba(255,255,255,.035), transparent);
}

.surface-head h3 {
  text-transform: none;
}

label {
  text-transform: none;
}

input,
select,
textarea {
  border-color: rgba(173, 220, 226, .17);
  border-radius: 9px;
  background: rgba(3, 12, 17, .72);
}

.btn,
.tab,
.seg-btn,
.team-chip {
  border-color: rgba(173, 220, 226, .16);
  border-radius: 9px;
  background: rgba(5, 16, 22, .72);
}

.btn.primary,
.tab.active,
.seg-btn.active {
  border-color: rgba(255, 93, 104, .65);
  background: linear-gradient(135deg, rgba(255,93,104,.94), rgba(220,54,72,.88));
  box-shadow: 0 10px 26px rgba(255,93,104,.18), inset 0 1px 0 rgba(255,255,255,.18);
}

.tab,
.seg-btn {
  text-transform: none;
}

.stat {
  border-color: rgba(173,220,226,.12);
  border-radius: 11px;
  background: rgba(4, 15, 21, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.stat::after {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.arena {
  border-color: rgba(65, 227, 209, .2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 46%, rgba(33, 111, 119, .12), transparent 45%),
    linear-gradient(rgba(104, 188, 193, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 188, 193, .045) 1px, transparent 1px),
    rgba(2, 10, 14, .88);
  background-size: auto, 40px 40px, 40px 40px, auto;
  box-shadow: inset 0 0 80px rgba(0,0,0,.32), 0 20px 50px rgba(0,0,0,.24), 0 0 46px rgba(65, 227, 209, .06);
}

.arena-overlay {
  background: rgba(2, 10, 14, .56);
  backdrop-filter: blur(8px);
}

.overlay-box {
  padding: 25px 30px;
  border: 1px solid rgba(173,220,226,.12);
  border-radius: 16px;
  background: rgba(7, 19, 25, .7);
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
}

.progress-line {
  height: 8px;
  border: 0;
  border-radius: 99px;
  background: rgba(255,255,255,.06);
}

.sens-card,
.notice {
  border-color: rgba(173,220,226,.14);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(12,32,40,.88), rgba(5,17,23,.76));
}

.sens-card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 16px 40px rgba(0,0,0,.2);
}

.notice {
  border-left-color: var(--yellow);
}

.team-chip.active {
  background: rgba(65, 227, 209, .12);
  box-shadow: 0 0 20px rgba(65,227,209,.06) inset;
}

.crosshair-card {
  --glow-x: 50%;
  --glow-y: 25%;
  border-color: rgba(173,220,226,.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(65,227,209,.09), transparent 34%),
    linear-gradient(145deg, rgba(15,34,43,.84), rgba(7,19,26,.82));
  box-shadow: 0 16px 34px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}

.crosshair-card:hover,
.crosshair-card.active {
  transform: translateY(-6px) perspective(700px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  border-color: rgba(65,227,209,.38);
  background-color: transparent;
  box-shadow: 0 26px 50px rgba(0,0,0,.3), 0 0 28px rgba(65,227,209,.07);
}

.crosshair-card.active {
  border-color: rgba(255,93,104,.55);
  box-shadow: 0 26px 50px rgba(0,0,0,.3), 0 0 30px rgba(255,93,104,.08);
}

.preview-box {
  border-bottom-color: rgba(173,220,226,.1);
  background: linear-gradient(145deg, rgba(4,16,22,.76), rgba(8,25,31,.64));
}

@media (max-width: 1500px) {
  .chapter-rail { display: none; }
  .sensitivity-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .crosshair-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .result-panel, .detail-panel { grid-column: 1 / -1; position: static; }
  .result-panel .result-main { grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); align-items: start; }
  .result-panel .sens-card { grid-row: span 3; }
  .detail-panel .surface-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
  .detail-panel .selected-preview { grid-row: span 4; margin: 0; }
}

@media (max-width: 820px) {
  .app { padding: 0 14px 48px; }
  .topbar { margin-bottom: 34px; }
  .module { margin-bottom: 48px; border-radius: 19px; }
  .module::before { inset: -9px 9px 10px -8px; border-radius: 22px; }
  .module-head { min-height: 180px; padding: 30px 22px 26px; border-radius: 19px 19px 0 0; }
  .sensitivity-grid, .crosshair-layout { padding: 16px; border-radius: 0 0 19px 19px; }
  .surface { border-radius: 14px; }
  .result-panel .result-main,
  .detail-panel .surface-body { display: grid; grid-template-columns: 1fr; }
  .crosshair-library { max-height: none; overflow: visible; padding-right: 2px; }
  .crosshair-library .library-tools { position: static; background: transparent; backdrop-filter: none; }
}

/* Secure local AI coach */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.agent-toggle {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 16px 8px 9px;
  border: 1px solid rgba(65, 227, 209, .34);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(16, 43, 50, .96), rgba(5, 19, 25, .96));
  color: #f6ffff;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .42), 0 0 35px rgba(65, 227, 209, .12), inset 0 1px 0 rgba(255,255,255,.08);
  cursor: pointer;
  backdrop-filter: blur(18px);
  font-weight: 800;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.agent-toggle:hover {
  transform: translateY(-3px);
  border-color: rgba(65, 227, 209, .65);
  box-shadow: 0 25px 65px rgba(0, 0, 0, .48), 0 0 42px rgba(65, 227, 209, .2);
}

.agent-toggle-mark,
.agent-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), #1ba99e);
  color: #031012;
  box-shadow: 0 0 22px rgba(65, 227, 209, .28);
  font-size: 11px;
  font-weight: 950;
}

.agent-toggle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(65, 227, 209, .1), 0 0 16px var(--cyan);
}

.agent-toggle i.busy {
  background: var(--yellow);
  animation: agentPulse 1s ease-in-out infinite;
}

@keyframes agentPulse {
  0%, 100% { opacity: .45; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.agent-panel {
  position: fixed;
  right: 28px;
  bottom: 94px;
  z-index: 69;
  display: grid;
  grid-template-rows: auto auto auto minmax(170px, 1fr) auto auto auto;
  width: min(440px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 122px));
  border: 1px solid rgba(173, 220, 226, .18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 4%, rgba(65, 227, 209, .13), transparent 28%),
    linear-gradient(155deg, rgba(12, 33, 41, .98), rgba(4, 15, 21, .98));
  box-shadow: 0 38px 100px rgba(0,0,0,.58), 0 0 55px rgba(65,227,209,.08), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(24px) saturate(130%);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .25s ease, visibility .25s ease, transform .25s cubic-bezier(.2,.8,.2,1);
}

.agent-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.agent-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(173, 220, 226, .1);
}

.agent-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.agent-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
}

.agent-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.agent-auth {
  border-bottom: 1px solid rgba(173, 220, 226, .09);
  background: rgba(2, 12, 17, .28);
}

.agent-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
}

.agent-account[hidden],
.agent-auth-gate[hidden],
.agent-auth-form[hidden] {
  display: none;
}

.agent-account div {
  display: grid;
  gap: 3px;
}

.agent-account strong {
  color: #eafffc;
  font-size: 12px;
}

.agent-account span {
  color: var(--muted);
  font-size: 10px;
}

.agent-account button,
.agent-auth-tabs button {
  border: 1px solid rgba(173,220,226,.13);
  border-radius: 8px;
  background: rgba(4,16,22,.65);
  color: #9fb3b6;
  cursor: pointer;
  font-size: 10px;
}

.agent-account button {
  padding: 7px 10px;
}

.agent-account-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 6px !important;
}

.agent-settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 18px 15px;
  border-top: 1px solid rgba(173,220,226,.08);
}

.agent-settings-form[hidden] { display: none; }

.agent-settings-form > strong,
.agent-settings-form > label,
.agent-settings-form > div {
  grid-column: 1 / -1;
}

.agent-settings-form input[type="password"] {
  min-width: 0;
  min-height: 36px;
  font-size: 10px;
  text-transform: none;
}

.agent-settings-form > label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.agent-settings-form > label input { width: auto; }

.agent-settings-form > div {
  display: flex;
  gap: 7px;
}

.agent-settings-form button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(65,227,209,.25);
  border-radius: 8px;
  background: rgba(65,227,209,.1);
  color: #dffffb;
  cursor: pointer;
  font-size: 10px;
}

.agent-auth-gate {
  padding: 14px 18px 16px;
}

.agent-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.agent-auth-tabs button {
  min-height: 32px;
}

.agent-auth-tabs button.active {
  border-color: rgba(65,227,209,.42);
  background: rgba(65,227,209,.12);
  color: #eafffc;
}

.agent-auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.agent-auth-form input {
  min-width: 0;
  min-height: 38px;
  margin: 0;
  font-size: 11px;
  text-transform: none;
}

.agent-auth-form button {
  min-height: 38px;
  border: 1px solid rgba(65,227,209,.38);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(65,227,209,.9), rgba(26,163,152,.9));
  color: #031113;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.agent-auth-gate > p {
  margin: 9px 0 0;
  color: #7d9498;
  font-size: 10px;
  line-height: 1.4;
}

.agent-panel.auth-required .agent-context,
.agent-panel.auth-required .agent-messages,
.agent-panel.auth-required .agent-suggestions,
.agent-panel.auth-required .agent-form {
  opacity: .25;
  pointer-events: none;
  user-select: none;
}

.agent-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(173, 220, 226, .14);
  border-radius: 10px;
  background: rgba(2, 11, 16, .55);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.agent-context {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 49px;
  max-height: 49px;
  padding: 12px 18px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(173, 220, 226, .08);
  scrollbar-width: none;
}

.agent-context::-webkit-scrollbar { display: none; }

.agent-context span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(65,227,209,.16);
  border-radius: 999px;
  background: rgba(65,227,209,.06);
  color: #bbd6d7;
  font-size: 10px;
}

.agent-messages {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(65,227,209,.3) transparent;
  scrollbar-width: thin;
}

.agent-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.agent-message.user {
  justify-content: flex-end;
}

.agent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 9px;
}

.agent-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border: 1px solid rgba(173,220,226,.1);
  border-radius: 5px 14px 14px 14px;
  background: rgba(17, 40, 49, .72);
  color: #dce9e9;
  font-size: 13px;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-message.user .agent-bubble {
  border-color: rgba(255,93,104,.2);
  border-radius: 14px 5px 14px 14px;
  background: rgba(255,93,104,.12);
  color: #fff;
}

.agent-message.loading .agent-bubble::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 4px;
  margin-left: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  animation: agentThinking .85s ease-in-out infinite alternate;
}

@keyframes agentThinking {
  from { opacity: .3; transform: scaleX(.5); }
  to { opacity: 1; transform: scaleX(1); }
}

.agent-suggestions {
  display: flex;
  gap: 7px;
  padding: 0 18px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.agent-suggestions::-webkit-scrollbar { display: none; }

.agent-suggestions button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(173,220,226,.13);
  border-radius: 9px;
  background: rgba(4, 16, 22, .72);
  color: #aec1c4;
  cursor: pointer;
  font-size: 11px;
}

.agent-suggestions button:hover {
  border-color: rgba(65,227,209,.34);
  color: #fff;
}

.agent-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px 18px 8px;
  border-top: 1px solid rgba(173, 220, 226, .09);
}

.agent-form textarea {
  min-height: 48px;
  max-height: 120px;
  margin: 0;
  resize: none;
  text-transform: none;
}

.agent-send {
  align-self: stretch;
  min-width: 64px;
  border: 1px solid rgba(65,227,209,.46);
  border-radius: 10px;
  background: linear-gradient(135deg, #42e2d1, #1aa398);
  color: #031113;
  cursor: pointer;
  font-weight: 900;
}

.agent-send:disabled {
  cursor: wait;
  opacity: .55;
}

.agent-status {
  min-height: 25px;
  margin: 0;
  padding: 0 18px 11px;
  color: #789196;
  font-size: 10px;
  line-height: 1.4;
}

.agent-status.error { color: #ff8c95; }

@media (max-width: 620px) {
  .agent-toggle { right: 14px; bottom: 14px; }
  .agent-panel { right: 8px; bottom: 78px; width: calc(100vw - 16px); height: calc(100vh - 92px); border-radius: 18px; }
  .agent-head { padding: 18px 17px 15px; }
  .agent-messages { padding: 15px; }
  .agent-form { padding-inline: 15px; }
  .agent-status { padding-inline: 15px; }
  .agent-auth-form { grid-template-columns: 1fr; }
}
