/* PROVISIC_OS v5 FUI — tone-mapped, scoped presentation; no body/theme rewrite. */

@property --provisic-beam-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --provisic-fui-cyan: var(--cyan, #00f0ff);
  --provisic-fui-emerald: var(--emerald, #10b981);
  --provisic-fui-violet: var(--violet, #a855f7);
  --provisic-fui-rose: var(--rose, #f43f5e);
  --provisic-fui-panel: rgba(6, 14, 28, 0.74);
  --provisic-fui-line: rgba(0, 240, 255, 0.28);
  --provisic-fui-muted: #8fa3ba;
}

.hero-scrim {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: none;
}

.hero-dock {
  position: relative;
  isolation: isolate;
}

.hero-dock::before {
  content: '';
  position: absolute;
  inset: -1.25rem -2rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(3, 10, 22, 0.78) 0%,
    rgba(3, 10, 22, 0.52) 48%,
    transparent 78%
  );
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* True clipped corners, with a masked pseudo-border so the diagonal edges
   remain visible. Text and controls are never transformed. */
.hud-panel,
.founder-dossier,
.cmd-modal,
.spec-modal {
  --provisic-chamfer: 14px;
  --provisic-chamfer-shape: polygon(
    var(--provisic-chamfer) 0,
    calc(100% - var(--provisic-chamfer)) 0,
    100% var(--provisic-chamfer),
    100% calc(100% - var(--provisic-chamfer)),
    calc(100% - var(--provisic-chamfer)) 100%,
    var(--provisic-chamfer) 100%,
    0 calc(100% - var(--provisic-chamfer)),
    0 var(--provisic-chamfer)
  );
  position: relative;
  border: 0;
  border-radius: 0;
  clip-path: var(--provisic-chamfer-shape);
  background-color: var(--provisic-fui-panel);
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(0, 240, 255, 0.075), transparent 38%),
    linear-gradient(145deg, rgba(10, 22, 40, 0.18), rgba(4, 10, 20, 0.12));
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: none;
  isolation: isolate;
}

.founder-dossier { --provisic-chamfer: 20px; }
.cmd-modal,
.spec-modal { --provisic-chamfer: 16px; }

.hud-panel::before,
.founder-dossier::before,
.cmd-modal::before,
.spec-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 2px;
  clip-path: var(--provisic-chamfer-shape);
  background:
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) left top / 100% 2px no-repeat,
    conic-gradient(
      from var(--provisic-beam-angle),
      rgba(0, 240, 255, 0.78) 0deg,
      rgba(0, 240, 255, 0.78) 55deg,
      rgba(16, 185, 129, 0.45) 125deg,
      rgba(0, 240, 255, 0.78) 210deg,
      rgba(168, 85, 247, 0.65) 285deg,
      rgba(0, 240, 255, 0.78) 360deg
    );
  opacity: 0.92;
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* Four registration brackets, kept separate from the animated border. */
.hud-panel::after,
.founder-dossier::after,
.cmd-modal::after,
.spec-modal::after {
  content: '';
  position: absolute;
  inset: 7px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.9;
  background:
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) left top / 15px 1px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) left top / 1px 15px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) right top / 15px 1px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) right top / 1px 15px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) left bottom / 15px 1px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) left bottom / 1px 15px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) right bottom / 15px 1px no-repeat,
    linear-gradient(var(--provisic-fui-cyan), var(--provisic-fui-cyan)) right bottom / 1px 15px no-repeat;
  filter:
    drop-shadow(0 16px 38px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 18px rgba(0, 240, 255, 0.10));
}

/* The clipped brackets retain their registration glow; this unclipped wrapper
   exposes the soft panel shadow instead of losing it to the chamfer clip. */
.lab-layout {
  filter:
    drop-shadow(0 16px 38px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 18px rgba(0, 240, 255, 0.10));
}

@keyframes provisic-fui-beam {
  to { --provisic-beam-angle: 360deg; }
}

.hud-panel:hover::before,
.hud-panel:active::before,
.hud-panel:focus-within::before,
.founder-dossier:hover::before,
.founder-dossier:focus-within::before,
.cmd-modal:hover::before,
.cmd-modal:focus-within::before,
.spec-modal:hover::before,
.spec-modal:focus-within::before {
  opacity: 1;
  animation: provisic-fui-beam 3.6s linear infinite;
}

/* If @property is unsupported the conic border is static. If conic gradients
   are unsupported entirely, retain a useful linear registration border. */
@supports not (background: conic-gradient(#000, #fff)) {
  .hud-panel::before,
  .founder-dossier::before,
  .cmd-modal::before,
  .spec-modal::before {
    background: linear-gradient(115deg, var(--provisic-fui-cyan), rgba(16, 185, 129, 0.35), var(--provisic-fui-violet));
    animation: none !important;
  }
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--provisic-fui-cyan);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.12), 0 0 18px rgba(0, 240, 255, 0.2);
}

/* Inward descendant rings cannot be clipped by a panel's chamfer. */
.hud-panel :focus-visible,
.founder-dossier :focus-visible,
.cmd-modal :focus-visible,
.spec-modal :focus-visible,
#neural-drawer :focus-visible,
#ai-brief-panel :focus-visible,
#rag-console :focus-visible {
  outline-offset: -3px;
}

#provisic-telemetry,
#hardware-status,
#fps-status,
#ai-kernel-status,
#ai-brief-meta,
#neural-status,
#neural-model,
#neural-tokens,
#neural-cache,
#rag-results,
.ai-intent-row {
  font-family: 'JetBrains Mono', 'Noto Sans TC', monospace;
  font-variant-numeric: tabular-nums lining-nums;
}

#provisic-telemetry {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  min-width: 0;
  color: var(--provisic-fui-muted);
  font-size: var(--fs-label);
  line-height: 1.35;
  letter-spacing: 0.045em;
  pointer-events: auto;
}

#hardware-status,
#fps-status,
#ai-kernel-status {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.45rem;
  padding: 0.2rem 0.42rem;
  color: #b8c8d9;
  white-space: nowrap;
  background: rgba(5, 12, 24, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.18);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

#hardware-status::before,
#fps-status::before,
#ai-kernel-status::before,
#neural-status::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: var(--provisic-fui-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.72);
}

#fps-status { color: #a5f3fc; }
#ai-kernel-status[data-state='ready'],
#ai-kernel-status.ready,
#ai-kernel-status.is-ready { color: #6ee7b7; }
#ai-kernel-status[data-state='ready']::before,
#ai-kernel-status.ready::before,
#ai-kernel-status.is-ready::before { background: var(--provisic-fui-emerald); }
#hardware-status[data-state='warn'],
#fps-status[data-state='warn'],
#ai-kernel-status[data-state='busy'] { color: #fcd34d; }
#hardware-status[data-state='error'],
#fps-status[data-state='error'],
#ai-kernel-status[data-state='error'],
#ai-kernel-status.is-error { color: #fda4af; }

#neural-toggle,
#voice-toggle,
#ai-brief-synthesize,
#neural-boot,
#neural-close,
#rag-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 34px;
  padding: 0.46rem 0.72rem;
  color: #d7e6f2;
  background: rgba(7, 17, 31, 0.86);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 0;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  font: 600 var(--fs-label)/1.3 'JetBrains Mono', 'Noto Sans TC', monospace;
  letter-spacing: 0.045em;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#neural-toggle:hover,
#voice-toggle:hover,
#ai-brief-synthesize:hover,
#neural-boot:hover,
#neural-close:hover,
#rag-submit:hover {
  color: #fff;
  background: rgba(0, 240, 255, 0.13);
  border-color: var(--provisic-fui-cyan);
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.07), 0 0 14px rgba(0, 240, 255, 0.15);
}

#neural-toggle[aria-pressed='true'],
#neural-toggle.active,
#voice-toggle[aria-pressed='true'],
#voice-toggle.active,
#neural-boot[aria-pressed='true'] {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.62);
  background: rgba(16, 185, 129, 0.11);
}

#neural-toggle:disabled,
#voice-toggle:disabled,
#ai-brief-synthesize:disabled,
#neural-boot:disabled,
#rag-submit:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

#decision-lab {
  scroll-margin-top: 6.5rem;
}

#ai-brief-panel {
  position: relative;
  display: grid;
  min-height: 0;
  height: auto;
  align-self: start;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem 0.9rem;
  padding: 0.9rem;
  color: #d5e2ee;
  background:
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    rgba(5, 13, 25, 0.82);
  background-size: 18px 18px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

#ai-brief-text {
  grid-column: 1 / -1;
  min-width: 0;
  color: #d5e2ee;
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

#ai-brief-meta {
  align-self: center;
  min-width: 0;
  color: var(--provisic-fui-muted);
  font-size: var(--fs-label);
  line-height: 1.55;
  letter-spacing: 0.035em;
}

#ai-brief-synthesize { align-self: center; }

#neural-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(430px, 100vw);
  height: 100vh;
  height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) 1.2rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #dce8f2;
  background:
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    rgba(3, 9, 19, 0.975);
  background-size: 22px 22px;
  border-left: 1px solid rgba(0, 240, 255, 0.38);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.62);
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
  transition: transform 240ms ease, visibility 240ms;
}

#neural-drawer.is-closed,
#neural-drawer[aria-hidden='true'] {
  transform: translateX(calc(100% + 24px));
  visibility: hidden;
  pointer-events: none;
}

#neural-drawer.open,
#neural-drawer.is-open,
#neural-drawer[aria-hidden='false'] {
  transform: translateX(0);
  visibility: visible;
}

#neural-close {
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 44px;
}

#neural-boot {
  align-self: flex-start;
  color: #a5f3fc;
  border-color: rgba(0, 240, 255, 0.5);
}

#neural-status {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.5rem;
  color: #a5f3fc;
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

#neural-progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  appearance: none;
  color: var(--provisic-fui-cyan);
  background: rgba(148, 163, 184, 0.14);
  border: 0;
  border-radius: 0;
}

#neural-progress::-webkit-progress-bar { background: rgba(148, 163, 184, 0.14); }
#neural-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--provisic-fui-emerald), var(--provisic-fui-cyan));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.42);
}
#neural-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--provisic-fui-emerald), var(--provisic-fui-cyan));
}
#neural-progress > span,
#neural-progress > .progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--provisic-fui-emerald), var(--provisic-fui-cyan));
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
}

#neural-model,
#neural-tokens {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.58rem;
  color: #d9e8f3;
  background: rgba(8, 18, 32, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  font-size: var(--fs-label);
  line-height: 1.5;
}

select#neural-model,
input#neural-model,
input#neural-tokens { min-height: 40px; }
#neural-tokens { font-variant-numeric: tabular-nums; }

#neural-tier-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#neural-tier-list > * {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.52rem 0.6rem;
  color: #b9c9d8;
  background: rgba(9, 19, 34, 0.68);
  border-left: 2px solid rgba(0, 240, 255, 0.3);
  font: var(--fs-body)/1.5 'JetBrains Mono', 'Noto Sans TC', monospace;
}

#neural-tier-list > .active,
#neural-tier-list > [aria-current='true'] {
  color: #a5f3fc;
  border-left-color: var(--provisic-fui-cyan);
  background: rgba(0, 240, 255, 0.08);
}

#neural-cache,
#neural-privacy {
  color: var(--provisic-fui-muted);
  font-size: var(--fs-label);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#neural-privacy {font-size:var(--fs-body);
  padding-left: 0.65rem;
  border-left: 2px solid rgba(16, 185, 129, 0.42);
}

#rag-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  padding: 0.85rem;
  color: #d7e4ef;
  background: rgba(5, 13, 25, 0.76);
  border: 1px solid rgba(0, 240, 255, 0.18);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

#rag-query {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 74px;
  padding: 0.62rem 0.68rem;
  resize: vertical;
  color: #e5f0f7;
  caret-color: var(--provisic-fui-cyan);
  background: rgba(2, 8, 17, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 0;
  font: var(--fs-body)/1.55 'Inter', 'Noto Sans TC', system-ui, sans-serif;
}

#rag-query::placeholder { color: #71849a; }
#rag-query:focus { border-color: rgba(0, 240, 255, 0.65); }
#rag-submit { align-self: end; }

#rag-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  max-height: min(42vh, 380px);
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
  color: #c8d6e3;
  font-size: var(--fs-body);
  line-height: 1.6;
  scrollbar-color: rgba(0, 240, 255, 0.45) rgba(148, 163, 184, 0.08);
  scrollbar-width: thin;
}

#rag-results > * {
  min-width: 0;
  padding: 0.58rem 0.65rem;
  overflow-wrap: anywhere;
  background: rgba(10, 21, 37, 0.72);
  border-left: 2px solid rgba(0, 240, 255, 0.3);
}

.rag-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.3rem 0.55rem;
  color: #9fb4c7;
  background: rgba(7, 16, 29, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  font: var(--fs-label)/1.35 'JetBrains Mono', 'Noto Sans TC', monospace;
  cursor: pointer;
}

.rag-chip:hover,
.rag-chip.active,
.rag-chip[aria-pressed='true'] {
  color: #a5f3fc;
  border-color: rgba(0, 240, 255, 0.58);
  background: rgba(0, 240, 255, 0.1);
}

.ai-intent-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  color: #9db2c5;
  font-size: var(--fs-body);
  line-height: 1.45;
}

.ai-intent-row > [data-intent],
.ai-intent-row > .intent-label {
  color: #a5f3fc;
  letter-spacing: 0.04em;
}

.ai-streaming::after {
  content: '';
  display: inline-block;
  width: 0.48em;
  height: 1em;
  margin-left: 0.25em;
  vertical-align: -0.14em;
  background: var(--provisic-fui-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  animation: provisic-fui-caret 850ms steps(2, end) infinite;
}

@keyframes provisic-fui-caret {
  50% { opacity: 0; }
}

.spec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spec-tabs button {
  appearance: none;
  padding: 0.55rem 0.85rem;
  color: var(--provisic-fui-muted);
  background: rgba(7, 17, 31, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.26);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  font: 600 var(--fs-label)/1.3 'JetBrains Mono', 'Noto Sans TC', monospace;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.spec-tabs button[aria-selected="true"] {
  color: var(--provisic-fui-cyan);
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.62);
  box-shadow: inset 0 2px 0 rgba(0, 240, 255, 0.72);
}

.audio-eq {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 18px;
  height: 14px;
  pointer-events: none;
}

.audio-eq > i {
  display: block;
  flex: 0 0 2px;
  width: 2px;
  height: 35%;
  min-height: 2px;
  background: currentColor;
  opacity: 0.5;
  transform-origin: center bottom;
}

.audio-eq > span {
  display: block;
  flex: 0 0 2px;
  width: 2px;
  height: 35%;
  min-height: 2px;
  background: currentColor;
  opacity: 0.5;
  transform-origin: center bottom;
}

.audio-eq > i:nth-child(2),
.audio-eq > span:nth-child(2) { height: 85%; }
.audio-eq > i:nth-child(3),
.audio-eq > span:nth-child(3) { height: 58%; }
.audio-eq > i:nth-child(4),
.audio-eq > span:nth-child(4) { height: 100%; }

#voice-toggle.listening,
.listening #voice-toggle {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(244, 63, 94, 0.1);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.14);
}

.listening .audio-eq > i,
.audio-eq.listening > i,
.audio-eq.is-active > i,
.listening .audio-eq > span,
.audio-eq.listening > span,
.audio-eq.is-active > span {
  opacity: 1;
  animation: provisic-fui-eq 620ms ease-in-out infinite alternate;
}

.listening .audio-eq > i:nth-child(2),
.audio-eq.listening > i:nth-child(2),
.audio-eq.is-active > i:nth-child(2),
.listening .audio-eq > span:nth-child(2),
.audio-eq.listening > span:nth-child(2),
.audio-eq.is-active > span:nth-child(2) { animation-delay: -310ms; }
.listening .audio-eq > i:nth-child(3),
.audio-eq.listening > i:nth-child(3),
.audio-eq.is-active > i:nth-child(3),
.listening .audio-eq > span:nth-child(3),
.audio-eq.listening > span:nth-child(3),
.audio-eq.is-active > span:nth-child(3) { animation-delay: -150ms; }
.listening .audio-eq > i:nth-child(4),
.audio-eq.listening > i:nth-child(4),
.audio-eq.is-active > i:nth-child(4),
.listening .audio-eq > span:nth-child(4),
.audio-eq.listening > span:nth-child(4),
.audio-eq.is-active > span:nth-child(4) { animation-delay: -440ms; }

@keyframes provisic-fui-eq {
  from { transform: scaleY(0.28); }
  to { transform: scaleY(1); }
}

.top-hud { gap: 0.7rem; }
.top-hud #provisic-telemetry { flex: 0 1 auto; }

.stress-preset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
}

.preset-pill {
  appearance: none;
  min-width: 0;
  min-height: 32px;
  padding: 0.4rem 0.35rem;
  color: #b8c8d9;
  background: rgba(7, 17, 31, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.26);
  border-radius: 999px;
  font: 600 var(--fs-label)/1.3 'JetBrains Mono', 'Noto Sans TC', monospace;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.preset-pill:hover,
.preset-pill[aria-pressed='true'] {
  color: #a5f3fc;
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.68);
}

#pin-snapshot-btn[aria-pressed='true'] {
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.68);
  background: rgba(168, 85, 247, 0.12);
}

.snapshot-diff-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.7rem;
  padding: 0.48rem 0.58rem;
  color: #cbd5e1;
  background: rgba(168, 85, 247, 0.08);
  border-left: 2px solid var(--provisic-fui-violet);
  font: 500 var(--fs-label)/1.45 'JetBrains Mono', 'Noto Sans TC', monospace;
  font-variant-numeric: tabular-nums lining-nums;
}

.snapshot-diff-bar[hidden],
.copilot-dock-panel[hidden] { display: none; }
.snapshot-pin-state { color: #d8b4fe; }
.snapshot-delta-value.good { color: var(--provisic-fui-emerald); }
.snapshot-delta-value.warn { color: var(--amber, #f59e0b); }

.copilot-dock {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  margin-top: 0.75rem;
}

.copilot-dock-tabs {
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.copilot-dock-tabs button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.48rem 0.3rem;
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.copilot-dock-panel { min-width: 0; }

/* The single visible disclaimer remains in the telemetry footer. */
.hud-panel .copilot-dock .ai-disclaimer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.telemetry-footer { flex-wrap: wrap; }
.telemetry-footer .disclaimer-micro { flex: 1 1 10rem; }
#share-card-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
#share-card-btn[aria-disabled='true'] {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  #provisic-telemetry { font-size: var(--fs-label); gap: 0.3rem 0.45rem; }
  #hardware-status,
  #fps-status,
  #ai-kernel-status { padding-inline: 0.34rem; }
}

@media (max-width: 1060px) {
  .top-hud { flex-wrap: wrap; }
  .top-hud #provisic-telemetry {
    order: 4;
    flex: 1 0 100%;
    justify-content: flex-end;
  }
  #neural-drawer { width: min(400px, 100vw); }
}

@media (max-width: 640px) {
  .top-hud { position: absolute; width: 100%; }
  #decision-lab { scroll-margin-top: 2rem; }
  #provisic-telemetry {
    justify-content: flex-start;
    font-size: var(--fs-label);
  }
  #hardware-status { display: none; }
  #ai-brief-panel,
  #rag-console { grid-template-columns: minmax(0, 1fr); }
  #ai-brief-synthesize,
  #rag-submit { justify-self: start; }
  #neural-drawer {
    width: 100vw;
    padding-left: 0.9rem;
    clip-path: none;
    border-left: 0;
  }
  #neural-toggle,
  #voice-toggle { padding-inline: 0.55rem; }
  .hud-panel,
  .founder-dossier { --provisic-chamfer: 11px; }
  .cmd-modal,
  .spec-modal { --provisic-chamfer: 10px; }
}

@media (pointer: coarse) {
  #neural-toggle,
  #voice-toggle,
  #ai-brief-synthesize,
  #neural-boot,
  #neural-close,
  #rag-submit,
  .rag-chip,
  .preset-pill,
  .spec-tabs button {
    min-height: 44px;
  }
  .rag-chip { padding-inline: 0.72rem; }
  select#neural-model,
  input#neural-model,
  input#neural-tokens { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-panel::before,
  .founder-dossier::before,
  .cmd-modal::before,
  .spec-modal::before,
  .ai-streaming::after,
  .audio-eq > i,
  .audio-eq > span {
    animation: none !important;
  }
  .ai-streaming::after { opacity: 0.72; }
  #neural-drawer { transition: none; }
}

@media (prefers-contrast: more) {
  #hardware-status,
  #fps-status,
  #ai-kernel-status,
  #neural-model,
  #neural-tokens,
  #rag-query,
  .rag-chip {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.68);
  }
}
