/* Shared Stark-Industries HUD theme across the JARVIS pages. */

:root {
  --cyan: #3fd0ff;
  --cyan-dim: #6fa8c0;
  --bg-0: #021018;
  --bg-1: #062236;
  --glow: 0 0 8px rgba(63, 208, 255, 0.6);
  --line: rgba(63, 208, 255, 0.35);
  --drawer-motion-ms: 520ms;
  --drawer-motion-ease: cubic-bezier(0, 0, 0.4, 1);
}

* {
  box-sizing: border-box;
}

body.hud {
  margin: 0;
  min-height: 100vh;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.5px;
  color: var(--cyan);
  background: radial-gradient(circle at 50% 30%, var(--bg-1), var(--bg-0) 70%);
}

.title {
  letter-spacing: 6px;
  text-shadow: var(--glow);
  margin: 0 0 4px;
  white-space: nowrap;
}

.title.small {
  font-size: 1.1rem;
  letter-spacing: 4px;
}

.muted {
  color: var(--cyan-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* AURA tagline with subtly emphasized initials. */
.tagline {
  margin: 24px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--cyan-dim);
}

.tagline .cap {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: rgba(2, 16, 24, 0.8);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cyan);
  font-family: inherit;
  font-size: 0.9rem;
}

.field:focus {
  outline: none;
  box-shadow: var(--glow);
}

.side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.arc-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(63, 208, 255, 0.7));
}

/* Each ring spins around the centre. `transform-box: fill-box` + centre origin
   keeps the rotation perfectly centred (no wobble) even when the SVG is scaled. */
.ring {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.ring-outer {
  animation: spin-cw 26s linear infinite;
}

.ring-mid {
  animation: spin-ccw 18s linear infinite;
}

.ring-inner {
  animation: spin-cw 12s linear infinite;
}

.ring-base {
  fill: none;
  stroke: rgba(63, 208, 255, 0.25);
  stroke-width: 2;
}

.ring-dash {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
}

.ring-seg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 6;
  opacity: 0.85;
}

/* Glowing core that pulses. */
.core-glow {
  fill: rgba(63, 208, 255, 0.18);
  animation: core-pulse 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.core-tri {
  fill: none;
  stroke: #bff0ff;
  stroke-width: 4;
  stroke-linejoin: round;
  animation: core-pulse 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes spin-cw {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-ccw {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* Animated POWER LEVEL bar (under the reactor). */
.power-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 210px;
  max-width: 18vw;
  margin-top: 18px;
}

.power-label,
.power-value {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-shadow: var(--glow);
  white-space: nowrap;
}

.power-track {
  flex: 1;
  height: 10px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(2, 16, 24, 0.8);
}

.power-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(63, 208, 255, 0.3),
    var(--cyan),
    rgba(191, 240, 255, 0.95),
    var(--cyan),
    rgba(63, 208, 255, 0.3)
  );
  background-size: 200% 100%;
  box-shadow: var(--glow);
  animation: power-shimmer 2.5s linear infinite;
}

@keyframes power-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Right: three labelled live clocks. */
.clocks-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: var(--glow);
  text-align: center;
}

.clock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 34, 54, 0.55);
  box-shadow: var(--glow);
}

.clock-label {
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--cyan-dim);
}

.clock {
  font-size: 1.35rem;
  letter-spacing: 3px;
  color: var(--cyan);
  text-shadow: var(--glow);
}

.clock-date {
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

/* Flickering glow on the JARVIS landing title. */
@keyframes title-flicker {
  0%,
  100% {
    text-shadow: 0 0 8px rgba(63, 208, 255, 0.6);
  }
  47% {
    text-shadow: 0 0 8px rgba(63, 208, 255, 0.6);
  }
  48% {
    text-shadow: 0 0 2px rgba(63, 208, 255, 0.25);
  }
  49% {
    text-shadow: 0 0 18px rgba(63, 208, 255, 0.95);
  }
  50% {
    text-shadow: 0 0 3px rgba(63, 208, 255, 0.3);
  }
  52% {
    text-shadow: 0 0 14px rgba(63, 208, 255, 0.85);
  }
}

/* Live status dot, shared by the SPEAKING indicator and landing panes. */
@keyframes dot-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ---------- Page 2 chat ---------- */

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.drawer-toggle {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(63, 208, 255, 0.15);
  border: 1.5px solid var(--cyan);
  border-radius: 999px;
  color: var(--cyan);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(63, 208, 255, 0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.drawer-toggle:hover {
  background: rgba(63, 208, 255, 0.32);
  box-shadow: 0 0 28px rgba(63, 208, 255, 0.75), 0 0 10px rgba(63, 208, 255, 0.45);
}

body:has(.request-drawer.open) .drawer-toggle {
  opacity: 0;
  pointer-events: none;
}

.drawer-toggle-prefix {
  font-weight: 700;
  opacity: 0.7;
}

.drawer-toggle-text {
  font-weight: 700;
}

.request-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 26;
  background: rgba(1, 8, 14, 0.36);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--drawer-motion-ms) var(--drawer-motion-ease);
}

.request-drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.request-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 27;
  height: 100vh;
  width: min(46vw, 560px);
  min-width: 360px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 24, 38, 0.95), rgba(2, 16, 24, 0.96));
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.38), var(--glow);
  transform: translateX(100%);
  opacity: 0;
  will-change: transform, opacity;
  transition:
    transform var(--drawer-motion-ms) var(--drawer-motion-ease),
    opacity var(--drawer-motion-ms) var(--drawer-motion-ease);
  display: flex;
  flex-direction: column;
}

.request-drawer.open {
  transform: translateX(0);
  opacity: 1;
}

.request-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.request-drawer-title {
  font-size: 0.95rem;
  letter-spacing: 1px;
  font-weight: 700;
}

.request-drawer-updated {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--cyan-dim);
  letter-spacing: 1px;
}

.request-drawer-fetch-state {
  margin-top: 3px;
  font-size: 0.68rem;
  letter-spacing: 0.8px;
  color: var(--cyan-dim);
}

.request-drawer-fetch-state.is-active {
  color: #9feeff;
}

.request-drawer-fetch-state.is-error {
  color: #ff9e9e;
}

.request-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.request-drawer-header-actions .btn-action {
  padding: 6px 12px;
  border-radius: 999px;
}

.request-drawer-header-actions .btn-action.is-loading {
  position: relative;
  color: var(--cyan-bright, #9feeff);
  border-color: rgba(63, 208, 255, 0.75);
  background: rgba(63, 208, 255, 0.16);
  text-shadow: 0 0 8px rgba(63, 208, 255, 0.35);
}

.request-drawer-header-actions .btn-action.is-loading::after {
  content: "";
  display: inline-block;
  width: 1.3em;
  margin-left: 0.2em;
  text-align: left;
  color: var(--cyan-dim);
  animation: refresh-trailing-dots 1.2s steps(4, end) infinite;
}

@keyframes refresh-trailing-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

.request-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.request-drawer-empty {
  margin: 6px;
  color: var(--cyan-dim);
  font-size: 0.85rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.status-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
}

.speaking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.speaking.active {
  opacity: 1;
  text-shadow: var(--glow);
}

.speaking .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #39ff7a;
}

.speaking.active .dot {
  box-shadow: 0 0 8px #39ff7a;
}

.status-line {
  padding: 8px 20px;
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--cyan-dim);
}

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
}

.bubble {
  max-width: 70%;
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--cyan);
  border-radius: 14px;
  background: rgba(63, 208, 255, 0.08);
  white-space: pre-wrap;
  line-height: 1.5;
  box-shadow: var(--glow);
}

.bubble.aura {
  border-top-left-radius: 2px;
}

.bubble.typing::after {
  content: "▋";
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Selectable open-requests list (single-select radios). */
.request-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 85%;
}

.request-drawer .request-list {
  max-width: 100%;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Search box that filters the request items as you type. */
.request-search {
  width: 100%;
  padding: 8px 12px;
  background: rgba(2, 16, 24, 0.8);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: var(--text, #cfeffd);
  font: inherit;
  outline: none;
}

.request-search::placeholder {
  color: rgba(63, 208, 255, 0.55);
}

.request-search:focus {
  box-shadow: var(--glow);
}

.request-search:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Container holding the individual request items. */
.request-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hidden items (filtered out by search) and the empty-state message. */
.request-item.hidden,
.request-empty.hidden {
  display: none;
}

.request-empty {
  padding: 6px 10px;
  font-style: italic;
  opacity: 0.7;
}

.request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.request-item:hover {
  background: rgba(63, 208, 255, 0.1);
  border-color: rgba(63, 208, 255, 0.5);
}

.request-item:has(input:checked) {
  background: rgba(63, 208, 255, 0.16);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(63, 208, 255, 0.28), inset 0 0 6px rgba(63, 208, 255, 0.06);
}

.request-item input[type="radio"] {
  accent-color: var(--cyan);
  cursor: pointer;
}

/* Locked (older) lists are dimmed and no longer selectable. */
.request-item:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}

.request-item input[type="radio"]:disabled {
  cursor: default;
}

/* An actionized request: clearly marked as done and no longer selectable. */
.request-item.actionized {
  opacity: 0.5;
  cursor: default;
}

.request-item.actionized span {
  text-decoration: line-through;
}

.request-item.actionized[data-outcome="ANALYZING"] {
  opacity: 0.78;
}

.request-item[data-outcome] span::after {
  content: "  [" attr(data-outcome) "]";
  color: var(--cyan-dim);
  font-size: 0.8em;
  letter-spacing: 1px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
}

.btn-action {
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(63, 208, 255, 0.22), rgba(63, 208, 255, 0.08));
  border: 1px solid var(--cyan);
  border-radius: 20px;
  color: #eaf9ff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(63, 208, 255, 0.25), inset 0 0 6px rgba(63, 208, 255, 0.12);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-action:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(63, 208, 255, 0.4), rgba(63, 208, 255, 0.18));
  box-shadow: 0 0 16px rgba(63, 208, 255, 0.5), inset 0 0 8px rgba(63, 208, 255, 0.2);
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: default;
}

.chat-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.input-bar {
  flex: 1;
  margin-top: 0;
}

.btn-send {
  padding: 12px 22px;
  background: rgba(63, 208, 255, 0.12);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--cyan);
  font-family: inherit;
  cursor: not-allowed;
}

.engine {
  font-size: 0.75rem;
  color: var(--cyan-dim);
}

.hidden {
  display: none;
}

/* ===========================================================================
   Landing page (new index.html): big centered reactor in the background,
   glass panes in the middle, clocks on the right, power bar at bottom.
   =========================================================================== */

.landing-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Ambient cinematic backdrop: faint perspective grid + radial vignette.
   Static (no animation) so it stays light on the GPU. */
.landing-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(
      rgba(63, 208, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(63, 208, 255, 0.05) 1px, transparent 1px),
    radial-gradient(
      ellipse at 50% 45%,
      transparent 40%,
      rgba(1, 8, 14, 0.85) 100%
    );
  background-size: 46px 46px, 46px 46px, 100% 100%;
  background-position: center;
}

/* Faint static scanlines for a HUD/CRT feel. */
.landing-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(63, 208, 255, 0.04) 0px,
    rgba(63, 208, 255, 0.04) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.5;
  z-index: 1;
}

/* Big arc reactor sitting behind everything, dead centre.
   Scales with the smaller viewport edge so it fits any screen. */
.landing-reactor {
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(200px, 62vmin, 720px);
  height: clamp(200px, 62vmin, 720px);
  transform: translate(-50%, -50%);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
  animation: reactor-breathe 6s ease-in-out infinite;
}

/* Soft cyan aura radiating from the reactor centre. */
.landing-reactor::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(63, 208, 255, 0.18),
    transparent 62%
  );
  pointer-events: none;
}

@keyframes reactor-breathe {
  0%,
  100% {
    opacity: 0.24;
  }
  50% {
    opacity: 0.34;
  }
}

.landing-reactor .arc-svg {
  width: 100%;
  height: 100%;
}

/* Title pinned to the top, above the reactor. */
.landing-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(16px, 4vh, 32px) 16px 0;
}

/* Glowing accent line beneath the subtitle. */
.landing-header::after {
  content: "";
  display: block;
  width: clamp(120px, 22vw, 220px);
  height: 1px;
  margin: clamp(10px, 1.6vh, 16px) auto 0;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: var(--glow);
}

/* Fluid, wrap-friendly title so it never overflows narrow screens. */
.landing-header .title {
  animation: title-flicker 4.5s ease-in-out infinite;
  white-space: normal;
  font-size: clamp(1.3rem, 5vw, 2.4rem);
  letter-spacing: clamp(2px, 1.4vw, 6px);
}

/* Acronym tagline ("Just A Rather Very Intelligent System") under the title. */
.landing-header .tagline {
  margin: clamp(8px, 1.4vh, 14px) 0 0;
  font-size: clamp(0.62rem, 1.8vw, 0.82rem);
}

/* Typed + spoken welcome message — a neat panel pinned to the LEFT side,
   vertically centred and styled to mirror the clocks column on the right. */
.landing-welcome-wrap {
  position: fixed;
  top: 50%;
  left: clamp(12px, 2.5vw, 32px);
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(180px, 19vw, 240px);
  min-height: clamp(300px, 46vh, 400px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(14px, 1.8vw, 20px) clamp(16px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 34, 54, 0.55);
  box-shadow: var(--glow);
}

/* Heading above the typed message — mirrors ".clocks-title" on the right. */
.welcome-tag {
  display: block;
  margin: 0 0 4px;
  font-size: 0.95rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: var(--glow);
  text-align: center;
}

.landing-welcome {
  display: block;
  margin: 0;
  min-height: 1.4em;
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  line-height: 1.65;
  letter-spacing: 0.4px;
  text-align: center;
  color: var(--cyan);
  text-shadow: var(--glow);
}

/* Blinking caret while the welcome text is being typed. */
.landing-welcome.typing::after {
  content: "▋";
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

/* Clocks kept on the right, vertically centred on roomy screens.
   Same width + edge inset as the left welcome panel so the centred panes
   sit symmetrically between the two side columns. */
.landing-clocks {
  position: fixed;
  top: 50%;
  right: clamp(12px, 2.5vw, 32px);
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(180px, 19vw, 240px);
  min-height: clamp(300px, 46vh, 400px);
  align-items: stretch;
}

.landing-clocks .clock-card {
  width: 100%;
}

/* Glass panes, centred, laid out in a responsive grid. */
.pane-grid {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
  align-content: center;
  justify-items: stretch;
  gap: clamp(16px, 2vw, 24px);
  width: min(620px, 92vw);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 24px);
}

/* With 3 panes in a 2-column grid, center the third pane for symmetry. */
#pane-a2 {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(300px, 100%);
}

/* Glassmorphism pane — crisp, uniform card. */
.pane {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(200px, 34vh, 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(18px, 2.2vw, 28px) clamp(14px, 1.6vw, 20px);
  border: 1px solid rgba(63, 208, 255, 0.45);
  border-radius: 14px;
  /* Near-opaque so the reactor behind never clutters the card. */
  background: linear-gradient(
    160deg,
    rgba(8, 38, 60, 0.9),
    rgba(4, 20, 32, 0.92)
  );
  box-shadow: 0 6px 22px rgba(2, 12, 20, 0.5),
    inset 0 1px 0 rgba(191, 240, 255, 0.12);
  color: var(--cyan);
  font-family: inherit;
  cursor: pointer;
  /* Settle opacity differs for active vs placeholder panes. */
  --settle-opacity: 1;
  /* Start hidden, then fly in (direction set per pane below). */
  opacity: 0;
  animation: pane-fly-left 1.5s cubic-bezier(0.16, 1.2, 0.3, 1) forwards;
  animation-delay: calc(0.5s + var(--pane-index) * 0.6s);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease, border-color 0.25s ease;
}

/* Second pane flies in from the right (first stays flying from the left). */
.pane:nth-child(even) {
  animation-name: pane-fly-right;
}

/* Thin accent line along the top edge of each card. */
.pane::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan),
    transparent
  );
  box-shadow: var(--glow);
}

/* Sweeping sheen across the glass. */
.pane-glow {
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(191, 240, 255, 0.25),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.pane:hover:not(.pane-disabled) {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--cyan);
  background: linear-gradient(
    160deg,
    rgba(14, 52, 78, 0.94),
    rgba(6, 26, 40, 0.94)
  );
  box-shadow: 0 10px 30px rgba(2, 12, 20, 0.6),
    0 0 22px rgba(63, 208, 255, 0.45);
}

.pane:hover:not(.pane-disabled) .pane-glow {
  left: 120%;
}

.pane:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.pane-label {
  font-size: clamp(0.62rem, 1.4vw, 0.72rem);
  letter-spacing: 3px;
  color: var(--cyan-dim);
}

.pane-name {
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  letter-spacing: 2px;
  text-shadow: var(--glow);
}

/* Short description line under the pane name. */
.pane-desc {
  margin-top: 2px;
  max-width: 90%;
  font-size: clamp(0.6rem, 1.3vw, 0.7rem);
  letter-spacing: 0.5px;
  line-height: 1.35;
  color: var(--cyan-dim);
}

/* Icon at the top of each card. */
.pane-icon {
  display: grid;
  place-items: center;
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
  margin-bottom: 2px;
  border-radius: 50%;
  border: 1px solid rgba(63, 208, 255, 0.35);
  background: radial-gradient(
    circle at 50% 40%,
    rgba(63, 208, 255, 0.22),
    rgba(63, 208, 255, 0.04) 70%
  );
  box-shadow: inset 0 0 14px rgba(63, 208, 255, 0.18);
}

.pane-icon svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(63, 208, 255, 0.7));
}

/* The active (AURA) icon slowly rotates. */
.pane-active .pane-icon svg {
  animation: spin-cw 9s linear infinite;
  transform-origin: 50% 50%;
}

/* Status row with a live dot. */
.pane-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: clamp(0.56rem, 1.2vw, 0.64rem);
  letter-spacing: 2px;
  color: var(--cyan-dim);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-dim);
}

.pane-active .pane-status {
  color: #39ff7a;
}

.pane-active .stat-dot {
  background: #39ff7a;
  box-shadow: 0 0 8px #39ff7a;
  animation: dot-blink 1.6s ease-in-out infinite;
}

/* Animated corner brackets for a targeting-reticle feel. */
.pane-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--cyan);
  opacity: 0.5;
  transition: opacity 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}

.pane-corner.tl {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.pane-corner.tr {
  top: 8px;
  right: 8px;
  border-left: none;
  border-bottom: none;
}

.pane-corner.bl {
  bottom: 8px;
  left: 8px;
  border-right: none;
  border-top: none;
}

.pane-corner.br {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}

.pane:hover:not(.pane-disabled) .pane-corner {
  opacity: 1;
  width: 22px;
  height: 22px;
}

/* Placeholder pane (REACTOR A2) — visibly inert, settles dimmed not full. */
.pane-disabled {
  cursor: default;
  opacity: 0;
  border-style: dashed;
  border-color: rgba(63, 208, 255, 0.28);
  --settle-opacity: 0.55;
}

.pane-disabled .pane-name {
  color: var(--cyan-dim);
  text-shadow: none;
}

.pane-disabled .pane-icon {
  border-color: rgba(63, 208, 255, 0.2);
  background: radial-gradient(
    circle at 50% 40%,
    rgba(63, 208, 255, 0.08),
    rgba(63, 208, 255, 0.02) 70%
  );
}

.pane-disabled .pane-icon svg {
  stroke: var(--cyan-dim);
  filter: none;
}

.pane-disabled .pane-corner {
  opacity: 0.25;
}

/* Power bar sits in normal flow at the bottom so it never overlaps panes. */
.landing-power {
  position: relative;
  z-index: 2;
  width: min(520px, 86vw);
  max-width: none;
  margin: 0 auto;
  padding: 0 16px clamp(56px, 8vh, 72px);
}

/* Fly in from the left with a slight rotation + overshoot bounce. */
@keyframes pane-fly-left {
  0% {
    opacity: 0;
    transform: translateX(-120vw) translateY(40px) scale(0.6) rotate(-12deg);
    filter: blur(4px);
  }
  60% {
    opacity: var(--settle-opacity);
  }
  100% {
    opacity: var(--settle-opacity);
    transform: none;
    filter: blur(0);
  }
}

/* Fly in from the right with a slight rotation + overshoot bounce. */
@keyframes pane-fly-right {
  0% {
    opacity: 0;
    transform: translateX(120vw) translateY(40px) scale(0.6) rotate(12deg);
    filter: blur(4px);
  }
  60% {
    opacity: var(--settle-opacity);
  }
  100% {
    opacity: var(--settle-opacity);
    transform: none;
    filter: blur(0);
  }
}

/* Respect reduced-motion preferences: skip the big fly-in, but still let the
   panes appear "magically" with a gentle fade + scale so they're never static. */
@media (prefers-reduced-motion: reduce) {
  .pane,
  .pane:nth-child(even) {
    animation: pane-materialise 0.9s ease forwards;
    animation-delay: calc(0.3s + var(--pane-index) * 0.45s);
  }

  .request-drawer,
  .request-drawer-backdrop {
    transition: none;
  }
}

@keyframes pane-materialise {
  0% {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(6px);
  }
  100% {
    opacity: var(--settle-opacity);
    transform: none;
    filter: blur(0);
  }
}

/* "Secure interface" + dev-credit tags pinned to the bottom corners as
   matching pills, so both bottom corners feel balanced. */
.landing-footer {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.secure-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid rgba(63, 208, 255, 0.35);
  border-radius: 999px;
  background: rgba(4, 22, 36, 0.6);
  font-size: 0.66rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

.secure-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: var(--glow);
}

/* Below ~1024px the fixed side panels would crowd the panes, so let the
   welcome message and clocks flow naturally below the title instead. */
@media (max-width: 1024px) {
  .landing-welcome-wrap {
    position: static;
    transform: none;
    width: min(640px, 92vw);
    margin: 16px auto 0;
  }

  .landing-clocks {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 14px auto 0;
    padding: 0 12px;
  }

  .landing-clocks .clocks-title {
    flex-basis: 100%;
    text-align: center;
  }

  .clock-card {
    min-width: clamp(110px, 28vw, 150px);
  }

  .request-drawer {
    width: min(68vw, 520px);
    min-width: 300px;
  }
}

/* Very narrow phones: tighten clock cards further. */
@media (max-width: 420px) {
  .clock-card {
    min-width: 0;
    flex: 1 1 30%;
    padding: 7px 8px;
  }

  .clock {
    font-size: 1.05rem;
  }

  .drawer-toggle {
    top: 48px;
    right: 12px;
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .request-drawer {
    width: 100vw;
    min-width: 0;
  }
}

/* ===========================================================================
   ANALYSIS FEATURE — Analysis Results Panel, AI Verdict, Action Buttons
   =========================================================================== */

.analysis-line {
  padding: 4px 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  border-radius: 4px;
  background: rgba(2, 16, 24, 0.4);
  white-space: pre-wrap;
  word-break: break-word;
}

.analysis-line.analysis-success {
  color: #39ff7a;
}

.analysis-line.analysis-failed {
  color: #ff6b6b;
}

.analysis-cert-tag {
  color: #ffd166;
  font-weight: 600;
}

.analysis-cert-status.expired {
  color: #ff6b6b;
  font-weight: 700;
}

.analysis-cert-status.active {
  color: #39ff7a;
  font-weight: 600;
}

/* AI verdict card: visually distinct from step-by-step pass/fail lines. */
.ai-verdict {
  max-width: 78%;
  border-width: 2px;
  background: linear-gradient(
    140deg,
    rgba(10, 32, 49, 0.92),
    rgba(5, 21, 33, 0.92)
  );
}

.ai-verdict-header {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9dddf2;
}

.ai-verdict-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  line-height: 1.45;
}

.ai-verdict-label {
  min-width: 82px;
  color: var(--cyan-dim);
}

.ai-verdict-value {
  color: #d7f5ff;
  word-break: break-word;
}

.ai-verdict-approve {
  border-color: #39ff7a;
  box-shadow: 0 0 10px rgba(57, 255, 122, 0.35);
}

.ai-verdict-deny,
.ai-verdict-deny_request_dcv {
  border-color: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.35);
}

.ai-verdict-manual_review,
.ai-verdict-unknown {
  border-color: #ffd166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.35);
}

/* Abort Button Container */
.abort-button-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  margin-bottom: 10px;
}

.btn-abort {
  padding: 8px 16px;
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid #ff6b6b;
  border-radius: 20px;
  color: #ff6b6b;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-abort:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.25);
}

.btn-abort:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Action Buttons Container (approve, deny, deny & request DCV, request DCV, cancel) */
.action-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  justify-content: center;
}

.btn-action-approve,
.btn-action-deny,
.btn-action-deny-dcv,
.btn-action-request-dcv,
.btn-action-cancel {
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--cyan);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid;
}

.btn-action-approve {
  background: rgba(57, 255, 122, 0.12);
  border-color: #39ff7a;
  color: #39ff7a;
}

.btn-action-approve:hover:not(:disabled) {
  background: rgba(57, 255, 122, 0.25);
}

.btn-action-deny {
  background: rgba(255, 107, 107, 0.12);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-action-deny:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.25);
}

.btn-action-deny-dcv {
  background: rgba(255, 159, 67, 0.12);
  border-color: #ff9f43;
  color: #ff9f43;
}

.btn-action-deny-dcv:hover:not(:disabled) {
  background: rgba(255, 159, 67, 0.25);
}

.btn-action-request-dcv {
  background: rgba(255, 214, 102, 0.12);
  border-color: #ffd666;
  color: #ffd666;
}

.btn-action-request-dcv:hover:not(:disabled) {
  background: rgba(255, 214, 102, 0.25);
}

.btn-action-cancel {
  background: rgba(63, 208, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-action-cancel:hover:not(:disabled) {
  background: rgba(63, 208, 255, 0.25);
}

.btn-action-approve:disabled,
.btn-action-deny:disabled,
.btn-action-deny-dcv:disabled,
.btn-action-request-dcv:disabled,
.btn-action-cancel:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Keep analysis UI blocks truly hidden until JS removes the class. */
.abort-button-container.hidden,
.action-buttons-container.hidden {
  display: none;
}
