/* ============================================================
   SECURE UPLINK // LT-01 PIP-COM
   Purple / blue / orange chassis · CRT UI in device screen hole
   ============================================================ */
.cl-body {
  min-height: 100dvh;
  min-height: 100svh;
  margin: 0;
  color: #d8f5e0;
  background: #0a0614;
  overflow-x: hidden;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  /* Notch / home-indicator safe areas */
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

/* Atmospheric field behind device */
.cl-field-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(90, 40, 180, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(255, 100, 30, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 20%, rgba(40, 100, 220, 0.18) 0%, transparent 40%),
    linear-gradient(180deg, #12081f 0%, #0a0614 50%, #080412 100%);
}

.cl-field-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 70%);
}

.cl-field-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(255, 140, 50, 0.08), transparent 40%);
  animation: cl-field-pulse 6s ease-in-out infinite;
}

@keyframes cl-field-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Compact top bar — leave room for the console */
.cl-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.65rem;
  padding: 0.35rem 0.75rem;
  background: rgba(8, 4, 18, 0.88);
  border-bottom: 1px solid rgba(255, 140, 60, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(80, 30, 160, 0.25);
}

.cl-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #ffb070;
  text-decoration: none;
  min-height: 44px;
}

.cl-brand img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 120, 40, 0.35);
}

.cl-brand-short {
  display: none;
}

/* Horizontal scroll nav — no cramped wrap on small widths */
.cl-topnav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  mask-image: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
}

.cl-topnav::-webkit-scrollbar {
  display: none;
}

.cl-topnav a {
  flex: 0 0 auto;
  color: #9ab4d0;
  text-decoration: none;
  padding: 0.55rem 0.55rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: rgba(125, 249, 160, 0.15);
}

.cl-topnav a:hover,
.cl-topnav a.is-active {
  color: #7df9a0;
  border-bottom-color: rgba(125, 249, 160, 0.55);
}

.cl-topnav a:focus-visible {
  outline: 2px solid #ff9a4a;
  outline-offset: 2px;
  border-radius: 2px;
}

.cl-nav-short {
  display: none;
}

/* Stage — console fills the viewport */
.cl-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.2rem 0.35rem 0.45rem;
  min-height: calc(100dvh - 48px);
  min-height: calc(100svh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/*
  Device chassis = face-on console crop (pip-case-console.jpg 1214×822).
  Sized to the larger of width/height that still fits the viewport — in-your-face.
*/
.cl-device {
  --cl-ar: 1.4767;
  position: relative;
  /* Prefer filling height first so CRT is huge; fall back to width */
  width: min(99.6vw, calc((100dvh - 78px) * var(--cl-ar)));
  aspect-ratio: 1214 / 822;
  max-height: calc(100dvh - 78px);
  flex-shrink: 0;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.7))
          drop-shadow(0 0 70px rgba(90, 40, 180, 0.3));
  animation: cl-device-in 0.65s ease-out;
}

@keyframes cl-device-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cl-case-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill; /* box matches image AR — fill flush */
  object-position: center;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/*
  CRT glass hole — measured flood-fill on console crop:
  L=12.65% T=11.87% W=72.07% H=73.35% (slight inset for bezel lip)
*/
.cl-screen {
  position: absolute;
  z-index: 3;
  left: 13.2%;
  top: 12.6%;
  width: 70.6%;
  height: 71.2%;
  display: flex;
  flex-direction: column;
  /* Match CRT glass corner radius of the console art */
  border-radius: 5.5% / 6.5%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(24, 70, 48, 0.5), transparent 58%),
    linear-gradient(180deg, #0c1f16 0%, #07140f 50%, #040e0a 100%);
  box-shadow:
    inset 0 0 50px rgba(0, 30, 15, 0.9),
    inset 0 0 0 2px rgba(12, 40, 28, 0.95),
    0 0 40px rgba(40, 255, 140, 0.14);
}

.cl-crt-glass {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.15) 100%);
  border-radius: inherit;
}

.cl-crt-scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
  border-radius: inherit;
}

.cl-crt-flicker {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(120, 255, 180, 0.045) 48%,
    transparent 52%
  );
  background-size: 100% 200%;
  animation: cl-scan 6.5s linear infinite;
  opacity: 0.85;
  border-radius: inherit;
}

.cl-crt-vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.55);
}

@keyframes cl-scan {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}

/* Boot sequence */
.cl-boot {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 8%;
  background: #020805;
  font-size: clamp(0.55rem, 1.4vw, 0.85rem);
  letter-spacing: 0.08em;
  color: #5cff9a;
  transition: opacity 0.45s ease, visibility 0.45s;
}

.cl-boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cl-boot-line {
  margin: 0;
  opacity: 0;
  transform: translateY(4px);
  animation: cl-boot-line 0.35s ease forwards;
}

.cl-boot-line:nth-child(1) { animation-delay: 0.15s; }
.cl-boot-line:nth-child(2) { animation-delay: 0.45s; }
.cl-boot-line:nth-child(3) { animation-delay: 0.75s; }
.cl-boot-line:nth-child(4) { animation-delay: 1.05s; }

.cl-boot-ready {
  color: #ffb070;
  margin-top: 0.4rem;
}

@keyframes cl-boot-line {
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.cl-tabs {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem 0.25rem;
  border-bottom: 1px solid rgba(100, 255, 160, 0.28);
  background: rgba(0, 18, 12, 0.72);
  overflow-x: auto;
  scrollbar-width: none;
}

.cl-tabs::-webkit-scrollbar { display: none; }

.cl-tab {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: clamp(0.68rem, 1.35vw, 0.9rem);
  letter-spacing: 0.1em;
  padding: 0.35rem 0.7rem;
  min-height: 38px;
  border: 1px solid rgba(100, 255, 160, 0.28);
  background: transparent;
  color: #4a8a60;
  cursor: pointer;
  border-radius: 2px 2px 0 0;
  transition: color 0.12s, background 0.12s, box-shadow 0.12s;
}

.cl-tab:hover {
  color: #9dffc0;
  border-color: rgba(255, 140, 60, 0.5);
}

.cl-tab.is-active {
  color: #0a120e;
  background: linear-gradient(180deg, #7dffb0, #3dcf7a);
  border-color: #7dffb0;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(80, 255, 160, 0.4);
}

.cl-tab:focus-visible {
  outline: 2px solid #ff9a4a;
  outline-offset: 1px;
}

.cl-screen-body {
  position: relative;
  z-index: 8;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.85rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 200, 120, 0.4) transparent;
}

.cl-panel[hidden] {
  display: none !important;
}

.cl-panel-grid {
  display: grid;
  grid-template-columns: minmax(120px, 30%) 1fr;
  gap: 0.75rem 1.1rem;
  align-items: start;
  min-height: 100%;
}

/* Mascot / holo */
.cl-mascot {
  text-align: center;
}

.cl-holo-frame {
  position: relative;
  margin: 0 auto 0.35rem;
  width: min(100%, 200px);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(80, 255, 180, 0.4);
  background: #000;
  box-shadow:
    0 0 28px rgba(40, 255, 140, 0.32),
    inset 0 0 20px rgba(0, 255, 120, 0.08);
  cursor: pointer;
}

.cl-holo-frame:focus-visible {
  outline: 2px solid #ff9a4a;
  outline-offset: 2px;
}

.cl-holo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: contrast(1.12) saturate(1.25) hue-rotate(-4deg);
  mix-blend-mode: screen;
  animation: cl-holo-breathe 4s ease-in-out infinite;
  transition: opacity 0.45s ease, filter 0.45s ease;
}

.cl-holo-img.is-swap {
  opacity: 0;
  filter: contrast(1.12) saturate(1.25) brightness(1.4) hue-rotate(-4deg);
}

.cl-holo-frame.is-glitch .cl-holo-img {
  animation: cl-holo-glitch 0.35s steps(2) 1;
}

@keyframes cl-holo-glitch {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); filter: contrast(1.3) hue-rotate(20deg); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 0); filter: contrast(1.2) hue-rotate(-10deg); }
  100% { transform: translate(0, 0); }
}

@keyframes cl-holo-breathe {
  0%, 100% { opacity: 0.88; filter: contrast(1.1) brightness(1) saturate(1.2); }
  50% { opacity: 1; filter: contrast(1.18) brightness(1.1) saturate(1.3); }
}

.cl-holo-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 255, 140, 0.07) 3px,
    rgba(0, 255, 140, 0.07) 6px
  );
  pointer-events: none;
}

.cl-holo-ring {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(100, 255, 180, 0.25);
  border-radius: 50%;
  pointer-events: none;
  animation: cl-ring 3.2s linear infinite;
}

.cl-holo-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  color: #ffb070;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.1rem 0.25rem;
  border: 1px solid rgba(255, 154, 74, 0.45);
}

@keyframes cl-ring {
  0% { transform: scale(0.9); opacity: 0.65; }
  100% { transform: scale(1.12); opacity: 0; }
}

.cl-mascot-id {
  font-size: clamp(0.58rem, 1.15vw, 0.75rem);
  letter-spacing: 0.12em;
  color: #ff9a4a;
  margin: 0 0 0.3rem;
}

.cl-mascot-line {
  font-size: clamp(0.68rem, 1.25vw, 0.9rem);
  line-height: 1.4;
  color: #8dffb8;
  margin: 0 0 0.55rem;
  min-height: 3em;
  text-align: left;
}

.cl-meters {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  text-align: left;
}

.cl-meter {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: 0.25rem;
  align-items: center;
  font-size: clamp(0.45rem, 0.95vw, 0.58rem);
  color: #6aab80;
}

.cl-meter-bar {
  height: 6px;
  background: rgba(0, 40, 20, 0.85);
  border: 1px solid rgba(80, 200, 120, 0.35);
  overflow: hidden;
}

.cl-meter-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1a8f4a, #7dffb0);
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(80, 255, 160, 0.4);
}

.cl-meter-ap i {
  background: linear-gradient(90deg, #1a4a8f, #60a5fa);
  box-shadow: 0 0 8px rgba(80, 140, 255, 0.4);
}

.cl-meter-sig i {
  background: linear-gradient(90deg, #a85a10, #ff9a4a);
  box-shadow: 0 0 8px rgba(255, 140, 40, 0.4);
}

/* Form */
.cl-form-head h1 {
  font-size: clamp(0.95rem, 2.1vw, 1.45rem);
  letter-spacing: 0.08em;
  color: #9dffc0;
  margin: 0 0 0.2rem;
  text-shadow: 0 0 14px rgba(80, 255, 160, 0.45);
  font-weight: 700;
}

.cl-form-sub {
  font-size: clamp(0.58rem, 1.15vw, 0.75rem);
  color: #5a8a6a;
  margin: 0 0 0.65rem;
  line-height: 1.35;
}

.cl-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cl-honey {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.cl-field label {
  display: block;
  font-size: clamp(0.62rem, 1.15vw, 0.78rem);
  letter-spacing: 0.1em;
  color: #ffb070;
  margin-bottom: 0.22rem;
}

.cl-req { color: #ff6b4a; }
.cl-opt { color: #5a7a68; font-size: 0.85em; letter-spacing: 0.06em; }

.cl-field input,
.cl-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  font-family: inherit;
  /* ≥16px prevents iOS Safari focus zoom */
  font-size: 16px;
  color: #d8f5e0;
  background: rgba(0, 22, 14, 0.9);
  border: 1px solid rgba(80, 200, 120, 0.4);
  border-radius: 2px;
  padding: 0.5rem 0.7rem;
  outline: none;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.15s, box-shadow 0.15s;
  /* Stop iOS from auto-zooming / awkward sizing */
  -webkit-text-size-adjust: 100%;
}

.cl-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

@media (min-width: 900px) {
  .cl-field input,
  .cl-field textarea {
    font-size: max(16px, clamp(1rem, 1.35vw, 1.1rem));
  }
}

.cl-field input:focus,
.cl-field textarea:focus {
  border-color: #ff9a4a;
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 154, 74, 0.4),
    0 0 16px rgba(255, 140, 40, 0.15);
  color: #fff;
}

.cl-field input.cl-invalid,
.cl-field textarea.cl-invalid {
  border-color: #f87171;
  animation: cl-shake 0.35s ease;
}

@keyframes cl-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.cl-field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.cl-field-err {
  font-size: clamp(0.48rem, 0.95vw, 0.6rem);
  color: #fca5a5;
  margin: 0.15rem 0 0;
}

.cl-count {
  font-size: clamp(0.45rem, 0.9vw, 0.58rem);
  color: #5a8a6a;
}

.cl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.cl-tx-btn {
  flex: 1 1 160px;
  min-height: 48px;
  font-family: inherit;
  font-size: clamp(0.72rem, 1.3vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #1a0a08;
  cursor: pointer;
  border: 2px solid #ffb070;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffc080 0%, #ff8c28 45%, #c45a10 100%);
  box-shadow:
    0 0 18px rgba(255, 120, 40, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: filter 0.12s, transform 0.12s;
}

.cl-tx-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.cl-tx-btn:active {
  transform: translateY(0);
}

.cl-tx-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.cl-tx-icon {
  margin-right: 0.3rem;
  color: #4a2008;
}

.cl-clear-btn {
  min-height: 48px;
  font-family: inherit;
  font-size: clamp(0.62rem, 1.1vw, 0.78rem);
  letter-spacing: 0.1em;
  color: #7dffb0;
  background: transparent;
  border: 1px solid rgba(100, 255, 160, 0.35);
  border-radius: 3px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.cl-clear-btn:hover {
  border-color: #ff9a4a;
  color: #ffb070;
}

.cl-result {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(100, 255, 160, 0.45);
  background: rgba(0, 40, 24, 0.8);
  animation: cl-result-in 0.35s ease;
}

@keyframes cl-result-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cl-result.hidden { display: none !important; }

.cl-result.is-error {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(40, 10, 12, 0.8);
}

.cl-result-stamp {
  font-size: clamp(0.55rem, 1.05vw, 0.7rem);
  letter-spacing: 0.12em;
  color: #7dffb0;
  margin: 0 0 0.3rem;
}

.cl-result.is-error .cl-result-stamp {
  color: #fca5a5;
}

.cl-result-body {
  font-size: clamp(0.6rem, 1.1vw, 0.78rem);
  color: #b8e8c8;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

.cl-result-ref {
  font-size: clamp(0.5rem, 0.95vw, 0.65rem);
  color: #ffb070;
  margin: 0;
}

/* Flavor tabs */
.cl-flavor {
  max-width: 100%;
  padding: 0.25rem 0.15rem 0.5rem;
}

.cl-flavor h2 {
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);
  letter-spacing: 0.1em;
  color: #9dffc0;
  margin: 0 0 0.55rem;
}

.cl-stat-list,
.cl-item-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
}

.cl-stat-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1.5rem;
  gap: 0.35rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(80, 160, 100, 0.22);
  color: #8dffb8;
  font-size: clamp(0.58rem, 1.1vw, 0.78rem);
}

.cl-stat-list li span { color: #ff9a4a; font-weight: 700; }
.cl-stat-list li b { font-weight: 400; color: #a8d8b8; }
.cl-stat-list li i { font-style: normal; color: #7dffb0; text-align: right; }

.cl-item-list li {
  padding: 0.28rem 0;
  color: #a8d8b8;
  font-size: clamp(0.6rem, 1.1vw, 0.8rem);
  border-bottom: 1px dashed rgba(80, 160, 100, 0.22);
}

.cl-flavor-note {
  font-size: clamp(0.5rem, 0.95vw, 0.65rem);
  color: #5a8a6a;
}

.cl-radio-tuner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.cl-radio-btn {
  font-family: inherit;
  font-size: clamp(0.5rem, 1vw, 0.65rem);
  letter-spacing: 0.06em;
  padding: 0.3rem 0.45rem;
  min-height: 32px;
  border: 1px solid rgba(100, 255, 160, 0.3);
  background: transparent;
  color: #6a9a78;
  cursor: pointer;
  border-radius: 2px;
}

.cl-radio-btn.is-live {
  color: #0a120e;
  background: linear-gradient(180deg, #7dffb0, #3dcf7a);
  border-color: #7dffb0;
  font-weight: 700;
}

.cl-radio-line {
  font-size: clamp(0.6rem, 1.15vw, 0.8rem);
  color: #7a9a88;
  margin: 0 0 0.4rem;
  min-height: 2.4em;
}

.cl-radio-line.is-live {
  color: #7dffb0;
}

.cl-map-coords {
  font-size: clamp(0.65rem, 1.2vw, 0.85rem);
  color: #ffb070;
  margin: 0.5rem 0;
}

.cl-map-blip {
  width: 80px;
  height: 80px;
  margin: 0.5rem 0 0.75rem;
  border: 1px solid rgba(100, 255, 160, 0.3);
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, rgba(40, 255, 140, 0.08), transparent 70%);
}

.cl-map-blip span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #7dffb0;
  box-shadow: 0 0 12px #7dffb0;
  animation: cl-blip 1.8s ease-out infinite;
}

@keyframes cl-blip {
  0% { box-shadow: 0 0 0 0 rgba(125, 255, 176, 0.6); }
  100% { box-shadow: 0 0 0 20px rgba(125, 255, 176, 0); }
}

.cl-inline-link {
  color: #60a5fa;
  font-size: clamp(0.58rem, 1.1vw, 0.78rem);
}

.cl-inline-link:hover {
  color: #ffb070;
}

/* Screen footer */
.cl-screen-foot {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding: 0.35rem 0.7rem;
  font-size: clamp(0.55rem, 1.1vw, 0.72rem);
  letter-spacing: 0.08em;
  color: #5a9a70;
  border-top: 1px solid rgba(100, 255, 160, 0.22);
  background: rgba(0, 12, 8, 0.8);
}

.cl-foot-sig { color: #ff9a4a; }

/* Physical knobs over right-side console chrome */
.cl-side-controls {
  position: absolute;
  z-index: 5;
  right: 1.8%;
  top: 42%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cl-knob {
  /* 44px minimum touch target (WCAG / iOS HIG) */
  width: max(44px, clamp(44px, 4.5vw, 58px));
  height: max(44px, clamp(44px, 4.5vw, 58px));
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  font-family: inherit;
  font-size: clamp(0.5rem, 0.9vw, 0.58rem);
  letter-spacing: 0.06em;
  color: #1a1008;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #3a2060;
  background: radial-gradient(circle at 35% 30%, #ffc080, #e07020 55%, #8a3a08);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(255, 120, 40, 0.25);
  transition: transform 0.1s, box-shadow 0.1s;
  -webkit-tap-highlight-color: rgba(255, 160, 60, 0.25);
  touch-action: manipulation;
}

.cl-knob-hot {
  background: radial-gradient(circle at 35% 30%, #ff8080, #c02020 55%, #600808);
  color: #fff;
  border-color: #601010;
}

.cl-knob:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(255, 140, 40, 0.45);
}

.cl-knob:active {
  transform: scale(0.92);
}

.cl-knob:focus-visible {
  outline: 2px solid #7dffb0;
  outline-offset: 2px;
}

.cl-device-label {
  position: absolute;
  z-index: 5;
  left: 3.5%;
  bottom: 4.5%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.5rem, 1vw, 0.68rem);
  letter-spacing: 0.14em;
  color: rgba(255, 180, 100, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.cl-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7dffb0;
  box-shadow: 0 0 8px #7dffb0;
  animation: cl-pulse-dot 1.6s ease-in-out infinite;
}

@keyframes cl-pulse-dot {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.cl-disclaimer {
  position: relative;
  z-index: 2;
  margin: 0.35rem 0.5rem 0;
  max-width: 56rem;
  font-size: 0.58rem;
  color: rgba(180, 160, 200, 0.65);
  line-height: 1.4;
  text-align: center;
  padding-bottom: 0.15rem;
}

.cl-disclaimer a {
  color: #ffb070;
}

/* Boot flash */
.cl-screen.is-booting .cl-screen-body {
  filter: brightness(2.2) contrast(1.25);
  transition: filter 0.12s;
}

.cl-screen.is-tx .cl-crt-flicker {
  animation-duration: 0.4s;
  opacity: 1;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 160, 60, 0.12) 48%,
    transparent 52%
  );
}

/* Tablet: keep console alignment, slightly taller stage */
@media (max-width: 900px) {
  .cl-device {
    width: min(99.8vw, calc((100dvh - 90px) * var(--cl-ar)));
    width: min(99.8vw, calc((100svh - 90px) * var(--cl-ar)));
    max-height: calc(100dvh - 90px);
    max-height: calc(100svh - 90px);
  }

  .cl-panel-grid {
    grid-template-columns: minmax(80px, 28%) 1fr;
    gap: 0.45rem 0.55rem;
  }

  .cl-holo-frame {
    width: min(100%, 120px);
  }

  .cl-side-controls {
    right: 1.2%;
    top: 40%;
    gap: 0.45rem;
  }

  .cl-knob {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.5rem;
  }

  .cl-brand-full {
    display: none;
  }

  .cl-brand-short {
    display: inline;
  }

  .cl-nav-full {
    display: none;
  }

  .cl-nav-short {
    display: inline;
  }

  .cl-topnav {
    font-size: 0.72rem;
  }
}

/* Phone: still face-on console if landscape; portrait uses big CRT with case frame */
@media (max-width: 640px) {
  .cl-topbar {
    gap: 0.3rem;
    padding: 0.25rem 0.4rem;
  }

  .cl-topnav a {
    padding: 0.5rem 0.45rem;
    font-size: 0.7rem;
  }

  .cl-stage {
    padding: 0.15rem 0.2rem 0.4rem;
    justify-content: flex-start;
  }

  .cl-device {
    width: 100%;
    max-height: none;
    height: auto;
    aspect-ratio: 1214 / 822;
    min-height: 0;
  }

  .cl-screen {
    /* Keep hole alignment on console crop */
    left: 12.8%;
    top: 12.2%;
    width: 71.2%;
    height: 71.8%;
  }

  .cl-panel-grid {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cl-mascot {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.5rem;
    text-align: left;
    align-items: center;
  }

  .cl-holo-frame {
    width: 72px;
    grid-row: 1 / 3;
  }

  .cl-meters {
    display: none;
  }

  .cl-mascot-line {
    min-height: 0;
  }

  .cl-side-controls {
    /* Prefer bottom row so knobs stay tappable over chrome */
    position: relative;
    right: auto;
    top: auto;
    flex-direction: row;
    justify-content: center;
    gap: 0.55rem;
    margin: 0.4rem 0 0.1rem;
    z-index: 6;
  }

  .cl-knob {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.52rem;
  }

  .cl-device-label {
    display: none;
  }

  .cl-field input,
  .cl-field textarea {
    min-height: 48px;
    font-size: 16px; /* hard floor — no iOS zoom */
    padding: 0.6rem 0.75rem;
  }

  .cl-field textarea {
    min-height: 112px;
  }

  .cl-tx-btn,
  .cl-clear-btn {
    min-height: 48px;
    touch-action: manipulation;
  }

  .cl-tab {
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
  }

  .cl-form-head h1 {
    font-size: 0.9rem;
  }

  .cl-disclaimer {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

/* Tall phones / portrait where console AR is too wide: grow height so form is usable */
@media (max-width: 640px) and (max-aspect-ratio: 3/4) {
  .cl-device {
    aspect-ratio: auto;
    min-height: min(92dvh, 900px);
    min-height: min(92svh, 900px);
    width: 100%;
  }

  .cl-case-img {
    object-fit: cover;
    object-position: center 38%;
  }

  .cl-screen {
    left: 4%;
    top: 3%;
    width: 92%;
    height: 86%;
    border-radius: 14px;
    border: 2px solid rgba(90, 40, 160, 0.5);
    box-shadow:
      inset 0 0 40px rgba(0, 30, 15, 0.85),
      0 0 0 4px rgba(40, 20, 80, 0.55),
      0 0 36px rgba(255, 120, 40, 0.18);
  }

  .cl-side-controls {
    position: relative;
    right: auto;
    top: auto;
    flex-direction: row;
    justify-content: center;
    margin: 0.45rem 0 0.15rem;
    gap: 0.65rem;
  }

  .cl-knob {
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cl-crt-flicker,
  .cl-holo-img,
  .cl-holo-ring,
  .cl-field-glow,
  .cl-pulse-dot,
  .cl-map-blip span,
  .cl-device {
    animation: none !important;
  }

  .cl-boot-line {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
