/*


 */

:root {
  --bg-deep:   #090913;
  --bg-dark:   #0d0d22;
  --bg-card:   #111129;
  --bg-card2:  #141435;
  --border:    rgba(94, 230, 255, 0.18);
  --border-hi: rgba(94, 230, 255, 0.45);
  --purple:    #9b44ff;
  --purple-lo: rgba(155, 68, 255, 0.15);
  --pink:      #ff49c8;
  --pink-lo:   rgba(255, 73, 200, 0.15);
  --cyan:      #5ee6ff;
  --green:     #44ffaa;
  --red:       #ff4466;
  --orange:    #ff8844;
  --yellow:    #ffcc44;
  --text:      #dfe8ff;
  --text-dim:  rgba(210, 220, 255, 0.55);
  --text-mute: rgba(160, 170, 210, 0.38);
  --glow-p:    0 0 18px rgba(155,68,255,0.45), 0 0 40px rgba(155,68,255,0.12);
  --glow-pk:   0 0 18px rgba(255,73,200,0.4);
  --glow-r:    0 0 12px rgba(255,68,102,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: #090913;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(ellipse 130% 55% at 50% 0%, #2a1050 0%, #100a28 40%, transparent 70%),
    linear-gradient(180deg, #1c0d38 0%, #0e0d22 40%, #090913 100%);
  background-size: 100% 3px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', 'Zen Kaku Gothic New', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── App Layout ── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,32,0.9);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}

.header-brand { display: flex; flex-direction: column; gap: 1px; }
.app-tagline { font-size: 10px; color: var(--text-dim); letter-spacing: 0.35em; text-transform: uppercase; }

.app-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.25rem; font-weight: 400;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  text-decoration: none; letter-spacing: 0.04em;
  filter: drop-shadow(0 0 8px rgba(255,73,200,0.6)) drop-shadow(0 0 22px rgba(94,230,255,0.35));
  animation: glitch 10s infinite;
}
.app-logo .cat-icon,
.app-logo .logo-bug { -webkit-text-fill-color: initial; margin-right: 6px; font-size: 1.1rem; }
.logo-cat {
  height: 36px; width: 36px; object-fit: contain;
  margin-right: 8px; vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(255,73,200,0.8)) drop-shadow(0 0 14px rgba(94,230,255,0.5));
}

.app-nav { display: flex; gap: 20px; align-items: center; }
.app-nav a {
  color: var(--text-dim); font-size: 0.75rem; text-decoration: none;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 0.2s;
}
.app-nav a:hover { color: var(--purple); }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.7rem; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 10px;
}

.status-pill--error {
  color: var(--red);
  border-color: rgba(255, 74, 106, 0.45);
  background: rgba(255, 74, 106, 0.1);
}

.status-pill--error .status-dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ── 3-Column Grid ── */
.app-grid {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 12px;
  padding: 12px;
  flex: 1;
  align-items: start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.app-grid > *,
.panel,
.panel-center,
.panel-right {
  min-width: 0;
}

.input-privacy-note {
  margin-top: 10px;
  color: var(--text-mute);
  font-size: 0.64rem;
  line-height: 1.65;
}

/* ── Panel Base ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em;
  color: var(--text-dim); text-transform: uppercase;
}
.panel-header .dots { display: flex; gap: 5px; }
.panel-header .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

/* ── Panel color theming ── */
.panel-left   { gap: 0; border-color: rgba(255,68,204,0.3); }
.panel-center { border-color: rgba(68,221,255,0.3); }
.panel-right  { border-color: rgba(155,68,255,0.35); }

.panel-left .panel-header {
  border-bottom-color: rgba(255,68,204,0.35);
  background: linear-gradient(90deg, rgba(255,68,204,0.06), var(--bg-dark));
}
.panel-left .panel-header > span:first-child { color: var(--pink); text-shadow: 0 0 8px rgba(255,68,204,0.6); }

.panel-center .panel-header {
  border-bottom-color: rgba(68,221,255,0.35);
  background: linear-gradient(90deg, rgba(68,221,255,0.06), var(--bg-dark));
}
.panel-center .panel-header > span:first-child { color: var(--cyan); text-shadow: 0 0 8px rgba(68,221,255,0.5); }

.panel-right .panel-header {
  border-bottom-color: rgba(155,68,255,0.4);
  background: linear-gradient(90deg, rgba(155,68,255,0.08), var(--bg-dark));
}
.panel-right .panel-header > span:first-child { color: var(--text); }

.input-section { padding: 18px; }

.input-label {
  font-size: 0.65rem; letter-spacing: 0.12em; color: var(--text);
  margin-bottom: 8px;
}

.input-field {
  width: 100%; background: var(--bg-deep);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; color: var(--text);
  font-family: inherit; font-size: 0.82rem; line-height: 1.5;
  resize: none; outline: none; transition: border-color 0.2s;
  min-height: 80px;
}
.input-field::placeholder { color: var(--text-mute); }
.input-field:focus { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(155,68,255,0.12); }

.char-count { text-align: right; font-size: 0.65rem; color: var(--text-mute); margin-top: 4px; }

.btn-generate {
  display: block; width: 100%; margin-top: 10px;
  padding: 16px 12px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(155,68,255,0.5), rgba(255,68,204,0.5));
  border: 1px solid var(--pink);
  color: #fff; font-family: inherit;
  font-size: 0.92rem; font-weight: 900; letter-spacing: 0.14em;
  cursor: pointer; transition: all 0.25s;
  text-decoration: none; text-align: center;
  box-shadow: 0 0 20px rgba(255,68,204,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 12px rgba(255,68,204,0.8);
}
.btn-generate:hover {
  background: linear-gradient(135deg, rgba(155,68,255,0.75), rgba(255,68,204,0.75));
  box-shadow: 0 0 36px rgba(255,68,204,0.6), 0 0 60px rgba(155,68,255,0.25);
  transform: translateY(-2px);
}

.sample-section { padding: 0 18px 16px; }
.sample-label { font-size: 0.6rem; color: var(--cyan); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 8px; }
.sample-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sample-chip {
  font-size: 0.68rem; padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(180, 100, 255, 0.4); color: var(--text); background: rgba(155,68,255,0.08);
  cursor: pointer; transition: all 0.2s;
}
.sample-chip:hover { border-color: var(--pink); color: var(--pink); background: rgba(255,68,204,0.1); }

/* Cat mascot image */
.cat-img-section { position: relative; overflow: hidden; display: flex; justify-content: center; padding: 8px 0 0; }
.cat-img {
  width: 84%; display: block;
  transition: filter 0.6s ease;
  filter: drop-shadow(0 0 18px rgba(155,68,255,0.5));
  animation: catGlow 3s ease-in-out infinite, catBlink 5s ease-in-out infinite;
}
.cat-img.analyzing {
  animation: catGlow 2s ease-in-out infinite, catBlink 5s ease-in-out 1.5s infinite;
}
.cat-img.alert {
  filter: drop-shadow(0 0 24px rgba(255,68,102,0.9)) !important;
  animation: catShakeImg 0.4s ease;
}
.cat-img.fix {
  filter: drop-shadow(0 0 24px rgba(68,255,170,0.85)) !important;
  animation: catGlow 3s ease-in-out infinite, catBlink 5s ease-in-out 2s infinite;
}
@keyframes catGlow {
  0%,100% { filter: drop-shadow(0 0 18px rgba(155,68,255,0.5)); }
  50%     { filter: drop-shadow(0 0 36px rgba(155,68,255,1.0)); }
}
@keyframes catBlink {
  0%, 88%, 100% { transform: none; }
  92%           { transform: scaleY(0.80); }
  96%           { transform: none; }
}
@keyframes catShakeImg {
  0%,100% { transform: rotate(0deg) scale(1); }
  25%     { transform: rotate(-3deg) scale(1.04); }
  75%     { transform: rotate(3deg) scale(1.04); }
}

/* Cat speech bubble */
.cat-section {
  margin: 0 18px 16px;
  background: var(--bg-dark); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.cat-body { flex: 1; }
.cat-name { font-size: 0.6rem; color: var(--purple); letter-spacing: 0.15em; margin-bottom: 4px; }
.cat-bubble-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text);
  margin-bottom: 6px; letter-spacing: 0.05em;
}
.cat-bubble {
  font-size: 0.73rem; color: var(--text-dim); line-height: 1.6;
  transition: all 0.3s; white-space: pre-line;
}
.cat-bubble.alert { color: var(--red); }
.cat-bubble.fix { color: var(--green); }

/* Pixel cat — in divider header row, right side */
.error-log-box { min-height: 80px; }
.error-pixel-cat {
  position: absolute; right: 10px; bottom: 66px;
  width: 105px; height: 105px; object-fit: contain;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, filter 0.5s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none; z-index: 3;
  filter: drop-shadow(0 0 12px rgba(255,73,200,0.8));
}
.error-pixel-cat.visible { opacity: 1; transform: translateX(0); }
/* severity-linked filter — simulates expression change */
.error-pixel-cat.sev-low      { filter: drop-shadow(0 0 8px rgba(68,255,170,0.5)) brightness(1.15) hue-rotate(45deg); }
.error-pixel-cat.sev-mid      { filter: drop-shadow(0 0 10px rgba(255,204,68,0.5)) brightness(1.05); }
.error-pixel-cat.sev-high     { filter: drop-shadow(0 0 12px rgba(255,136,68,0.6)); }
.error-pixel-cat.sev-critical { filter: drop-shadow(0 0 14px rgba(255,73,200,0.9)) saturate(1.2); }

/* Logo */
.logo-img-wrap {
  display: flex; align-items: center;
  text-decoration: none; border-radius: 8px;
  overflow: hidden;
}
.logo-img { height: 48px; display: block; border-radius: 8px; }

.cat-features { padding: 0 18px 18px; }
.cat-features-title { font-size: 0.65rem; color: var(--text-dim); margin-bottom: 8px; letter-spacing: 0.1em; }
.cat-features ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.cat-features li { font-size: 0.72rem; color: var(--text-mute); }
.cat-features li::before { content: '✓ '; color: var(--green); }

/* ── CENTER PANEL ── */
.panel-center { min-height: 500px; }

.console-body {
  flex: 1; padding: 16px; overflow-y: auto;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  line-height: 1.7; color: var(--green);
  max-height: calc(100vh - 160px);
}

.console-line {
  display: flex; gap: 8px; opacity: 0;
  animation: fadeInLine 0.3s ease forwards;
  margin-bottom: 2px;
}
@keyframes fadeInLine {
  to { opacity: 1; }
}
.console-ts { color: var(--text-mute); flex-shrink: 0; }
.console-txt { }
.console-txt.ok  { color: var(--green); }
.console-txt.err { color: var(--red); }
.console-txt.warn { color: var(--yellow); }
.console-txt.info { color: var(--cyan); }
.console-txt.purple { color: var(--purple); }
.console-txt.dim { color: var(--text-mute); opacity: 0.6; }

.console-progress {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px; padding-right: 10px; opacity: 0;
  animation: fadeInLine 0.3s ease forwards;
}
.progress-label { color: var(--text-dim); min-width: 160px; font-size: 0.78rem; }
.progress-track { flex: 1; height: 8px; border-radius: 2px; overflow: hidden;
  background: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.07) 0px, rgba(255,255,255,0.07) 7px,
    transparent 7px, transparent 10px);
}
.progress-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg,
    var(--purple) 0px, var(--pink) 7px,
    transparent 7px, transparent 10px);
  transition: width 1.2s ease;
  box-shadow: 0 0 8px rgba(155,68,255,0.6);
}
.progress-pct { font-size: 0.72rem; color: var(--cyan); min-width: 36px; text-align: right; font-weight: 700; }

.error-log-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 10px; opacity: 0;
  animation: fadeInLine 0.4s ease forwards;
}
.divider-line { flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--red) 10%, var(--red) 90%, transparent); opacity: 0.85; }
.divider-label { color: var(--red); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-shadow: 0 0 10px rgba(255,68,102,0.8); white-space: nowrap; font-family: 'JetBrains Mono', monospace; }

.error-log-box {
  position: relative;
  background: #0f1018;
  border: 1px solid rgba(255,68,102,0.25);
  border-radius: 6px;
  color: var(--text); font-size: 0.78rem; line-height: 1.65;
  font-family: 'JetBrains Mono', monospace;
  min-height: 190px;
  opacity: 0;
  overflow: hidden;
  animation: fadeInLine 0.5s ease 0.1s forwards;
}
/* Error Box だけスクロール（コンソールは固定・猫は常に見える） */
.error-log-scroll {
  max-height: 360px; overflow-y: auto;
  padding: 12px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,68,102,0.4) transparent;
}
.error-log-scroll::-webkit-scrollbar { width: 6px; }
.error-log-scroll::-webkit-scrollbar-thumb { background: rgba(255,68,102,0.4); border-radius: 3px; }
.error-log-text {
  white-space: pre-wrap; word-break: break-word;
}

/* Error log metadata (Caused by / Hint / Time / ID) */
.error-log-meta {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,68,102,0.2);
  font-size: 0.75rem; line-height: 1.7;
  display: block;
}
.meta-line { display: block; }
.meta-line + .meta-line { margin-top: 3px; }
/* Time と ID は横並びで高さを詰める */
.meta-inline { display: flex; gap: 22px; flex-wrap: wrap; }
.meta-row { display: inline-block; }
.meta-key  { color: var(--pink);     font-weight: 700; }
.meta-val  { color: var(--text-dim); }
.meta-hint { color: var(--cyan);     }
.meta-dim  { color: var(--text-mute); }

.console-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-mute);
  display: flex; align-items: center; gap: 4px;
}
.cursor-blink { animation: blink 1s step-end infinite; color: var(--green); }
@keyframes blink { 50% { opacity: 0; } }

.live-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.65rem; color: var(--red); letter-spacing: 0.1em;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red);
  animation: livePulse 1.2s ease-in-out infinite;
}
@keyframes livePulse { 50% { opacity: 0.4; } }

/* ── RIGHT PANEL ── */
.panel-right { }

.sys-status {
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 7px;
  border-bottom: 1px solid var(--border);
}

.sys-val--error { color: var(--red) !important; }

.stream-error-message {
  color: var(--red);
  line-height: 1.6;
}

.stream-retry-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 74, 106, 0.55);
  border-radius: 6px;
  background: rgba(255, 74, 106, 0.12);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.stream-retry-btn:hover {
  background: rgba(255, 74, 106, 0.22);
}
.sys-status-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.65rem;
}
.sys-key { color: var(--text-mute); letter-spacing: 0.1em; text-transform: uppercase; }
.sys-val { color: var(--green); font-weight: 700; }
.sys-val.purple { color: var(--purple); }

/* Severity gauge */
.severity-section {
  padding: 18px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.severity-label { font-size: 0.65rem; color: var(--text-mute); letter-spacing: 0.15em; text-transform: uppercase; }

.gauge-wrap { position: relative; width: 140px; height: 140px; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 10; }
.gauge-fill {
  fill: none; stroke-width: 10;
  stroke: var(--purple);
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 1.5s ease, stroke 0.5s;
  filter: drop-shadow(0 0 6px rgba(155,68,255,0.6));
}
.gauge-fill.critical { stroke: var(--pink);   filter: drop-shadow(0 0 8px rgba(255,73,200,0.9)); }
.gauge-fill.high  { stroke: var(--red);    filter: drop-shadow(0 0 6px rgba(255,68,102,0.7)); }
.gauge-fill.warn  { stroke: var(--orange); filter: drop-shadow(0 0 6px rgba(255,136,68,0.6)); }
.gauge-fill.mid   { stroke: var(--yellow); filter: drop-shadow(0 0 6px rgba(255,204,68,0.5)); }
.gauge-fill.low   { stroke: var(--green);  filter: drop-shadow(0 0 6px rgba(68,255,170,0.5)); }

.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-pct { font-family: 'VT323', monospace; font-size: 2rem; font-weight: 400; color: var(--text); }
.gauge-risk { font-size: 0.6rem; letter-spacing: 0.12em; margin-top: 2px; }
.gauge-risk.critical { color: var(--pink); }
.gauge-risk.high   { color: var(--red); }
.gauge-risk.warn   { color: var(--orange); }
.gauge-risk.mid    { color: var(--yellow); }
.gauge-risk.low    { color: var(--green); }

/* Metric bars */
.metrics-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.metrics-title { font-size: 0.62rem; color: var(--text-mute); letter-spacing: 0.15em; margin-bottom: 12px; text-transform: uppercase; }
.metric-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.metric-name { font-size: 0.68rem; color: var(--text-dim); min-width: 50px; }
.metric-track { flex: 1; height: 7px; border-radius: 2px; overflow: hidden;
  background: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.07) 0px, rgba(255,255,255,0.07) 6px,
    transparent 6px, transparent 9px);
}
.metric-bar-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg,
    var(--purple) 0px, var(--pink) 6px,
    transparent 6px, transparent 9px);
  transition: width 1.5s ease;
  box-shadow: 0 0 6px rgba(155,68,255,0.4);
}
.metric-val { font-size: 0.68rem; color: var(--cyan); min-width: 32px; text-align: right; font-weight: 700; }

/* Suggested Fix */
.fix-section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.fix-title {
  font-size: 0.62rem; color: var(--text-mute); letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 2px;
}
.fix-subtitle {
  font-size: 0.68rem; color: var(--pink); margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.fix-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.fix-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.76rem; color: var(--text); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fix-item.visible { opacity: 1; transform: translateX(0); }
.fix-check { color: var(--green); flex-shrink: 0; font-size: 0.9rem; }

/* Fix progress */
.fix-progress-wrap { }
.fix-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px;
}
.fix-progress-pct { font-size: 0.65rem; color: var(--green); font-weight: 700; }
.fix-progress-track {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
.fix-progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 1.8s ease;
  box-shadow: 0 0 8px rgba(68,255,170,0.5);
}

/* Share */
.share-section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.share-title { font-size: 0.62rem; color: var(--text-mute); letter-spacing: 0.15em; margin-bottom: 10px; }
.btn-share {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 12px; margin-bottom: 10px; border-radius: 8px;
  font-size: 0.82rem; font-weight: 700; text-decoration: none; font-family: 'JetBrains Mono', monospace;
  border: 1px solid; cursor: pointer; transition: all 0.2s; letter-spacing: 0.08em;
}
.btn-share-x { border-color: rgba(255,255,255,0.15); color: var(--text); background: rgba(255,255,255,0.04); }
.btn-share-x:hover { background: rgba(255,255,255,0.1); }
.btn-share-copy { border-color: var(--border); color: var(--purple); background: var(--purple-lo); }
.btn-share-copy:hover { box-shadow: var(--glow-p); }

/* Quote */
.quote-section {
  padding: 16px 18px;
  background: rgba(155,68,255,0.04);
  border-top: 1px solid var(--border);
}
.quote-label { font-size: 0.6rem; color: var(--text-mute); letter-spacing: 0.15em; margin-bottom: 6px; }
.quote-text { font-size: 0.73rem; color: var(--text-dim); line-height: 1.6; font-style: italic; }
.quote-cat { margin-right: 5px; font-style: normal; }

/* ── Idle terminal (new page center panel) ── */
.idle-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 12px;
}
.idle-div-line { flex: 1; height: 1px; background: var(--cyan); opacity: 0.35; }
.idle-div-label {
  color: var(--cyan); font-size: 0.68rem; letter-spacing: 0.18em;
  white-space: nowrap; font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 8px rgba(94,230,255,0.7);
}
.idle-prompt {
  margin-top: 16px;
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.idle-prompt-char { color: var(--cyan); font-size: 0.85rem; font-weight: 700; }

/* ── Waiting state (legacy, kept for fallback) ── */
.waiting-panel {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; text-align: center; gap: 12px;
  color: var(--text-mute);
}
.waiting-icon { font-size: 2rem; opacity: 0.3; }
.waiting-text { font-size: 0.75rem; letter-spacing: 0.1em; }

/* ── Ranking ── */
.ranking-wrap { max-width: 720px; margin: 40px auto; padding: 0 20px; }
.ranking-header { margin-bottom: 24px; }
.ranking-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ranking-subtitle { font-size: 0.78rem; color: var(--text-dim); }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; transition: all 0.2s;
}
.ranking-item:hover { border-color: var(--purple); box-shadow: var(--glow-p); }
.ranking-num { font-size: 1rem; font-weight: 700; min-width: 28px; color: var(--text-mute); }
.ranking-num.gold { color: var(--yellow); }
.ranking-num.silver { color: #c0c0c0; }
.ranking-num.bronze { color: #cd7f32; }
.ranking-input { font-size: 0.82rem; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-views { font-size: 0.72rem; color: var(--text-mute); flex-shrink: 0; }

/* Footer */
.app-footer {
  text-align: center; padding: 16px;
  font-size: 0.65rem; color: var(--text-mute);
  letter-spacing: 0.12em; border-top: 1px solid var(--border);
}

/* ── Utilities ── */
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }

/* ── Glitch animation on logo ── */
@keyframes glitch {
  0%,90%,100% { filter: drop-shadow(0 0 8px rgba(255,73,200,0.6)) drop-shadow(0 0 22px rgba(94,230,255,0.35)); }
  92% { filter: drop-shadow(-3px 0 rgba(255,73,200,0.9)) drop-shadow(3px 0 rgba(94,230,255,0.9)); }
  94% { filter: drop-shadow(3px 0 rgba(255,73,200,0.9)) drop-shadow(-3px 0 rgba(94,230,255,0.9)); }
  96% { filter: drop-shadow(0 0 8px rgba(255,73,200,0.6)) drop-shadow(0 0 22px rgba(94,230,255,0.35)); }
}

/* ── Scanlines overlay ── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px
  );
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: 230px minmax(0, 1fr) 230px; }
  .panel-header { padding-inline: 12px; letter-spacing: 0.1em; }
  .console-progress { flex-wrap: wrap; }
  .progress-label { min-width: 100%; }
}
@media (max-width: 768px) {
  .app-grid { grid-template-columns: 1fr; }
  .panel-right { order: -1; }
  .app-header { flex-wrap: wrap; gap: 10px; }
  .app-tagline { letter-spacing: 0.2em; }
}
/* Reference: the original ErrorLog AI mock, renamed DebugMe. */
:root { --bg-deep:#020207; --bg-dark:#05050c; --bg-card:#06060e; --text:#eceaf6; --text-dim:#b0acc9; --text-mute:#77728e; --border:rgba(135,111,174,.3); --pink:#ff5bbe; --red:#ff5bbe; }
body { background-color:#020207; background-image:radial-gradient(ellipse at 8% 86%,#21073566,transparent 30%),radial-gradient(ellipse at 65% 42%,#04172255,transparent 48%),repeating-linear-gradient(0deg,transparent 0 63px,#35134720 64px,transparent 65px); font-family:'JetBrains Mono',monospace; }
.app-layout { max-width:1600px; margin:auto; padding:26px 30px 0; }
.app-header { position:relative; padding:0 8px 24px 0; background:transparent; border:0; backdrop-filter:none; min-height:122px; gap:22px; }
.header-brand { gap:12px; }
.app-logo { display:flex; align-items:center; font-size:clamp(28px,3.4vw,54px); letter-spacing:-.055em; }
.logo-cat { width:96px; height:88px; margin-right:18px; }
.app-tagline { font-size:14px; letter-spacing:.06em; padding-left:116px; margin-top:-12px; }
.app-nav { margin-left:auto; gap:16px; }
.app-nav a { font-size:11px; }
.status-pill { border-radius:10px; min-width:220px; padding:18px; justify-content:space-between; color:var(--green); background:#08060e99; font-size:12px; box-shadow:inset 0 0 20px #a147ed0b; }
.app-grid { max-width:none; grid-template-columns:minmax(270px,1.13fr) minmax(480px,1.98fr) minmax(280px,1fr); padding:0; gap:16px; }
.panel { background:linear-gradient(125deg,#10081965,#04050a80 60%); border-radius:12px; }
.panel-header { padding:18px 20px 12px; border:0; background:transparent!important; font-size:21px; letter-spacing:-.035em; font-weight:500; line-height:1.2; }
.panel-header .dots { display:none; }
.panel-left { display:grid; grid-template-columns:1fr 1fr; border:0; background:none; overflow:visible; align-content:start; }
.panel-left > .panel-header { grid-column:1/-1; border:1px solid #79478366; border-bottom:0; border-radius:12px 12px 0 0; background:linear-gradient(110deg,#29102b55,transparent)!important; padding:20px 22px 10px; }
.input-section { grid-column:1/-1; padding:10px 22px 20px; border:1px solid #79478366; border-top:0; border-radius:0 0 12px 12px; background:#100a1666; }
.input-label { font-size:13px; margin-bottom:22px; }
.input-field { min-height:116px; padding:15px; border:1px solid #a150c4; background:linear-gradient(120deg,#120b20aa,#020308); font-size:18px; border-radius:10px; box-shadow:inset 0 0 20px #ab39d90c; }
.char-count { margin-top:-23px; position:relative; padding-right:9px; pointer-events:none; margin-bottom:30px; }
.btn-generate { background:linear-gradient(110deg,#cb2199bb,#8e146cbb); border-color:#ff9cde; box-shadow:0 0 14px #ff39c488,inset 0 0 15px #ff83d888; border-radius:10px; padding:17px 8px; font-size:19px; letter-spacing:.04em; }
.input-privacy-note { font-size:10px; line-height:1.55; margin-top:15px; }
.sample-section { grid-column:1/-1; margin-top:14px; padding:15px 21px; border:1px solid var(--border); border-radius:12px; background:#08091288; }
.sample-label { font-size:12px; letter-spacing:0; margin-bottom:12px; }
.sample-chip { border-radius:5px; padding:6px 9px; font-size:11px; background:linear-gradient(#121220,#05050c); border-color:#5a506477; }
.cat-img-section { grid-column:1; grid-row:4 / span 2; margin:26px -32px 0 -35px; padding:0; align-self:center; overflow:visible; }
.cat-img { width:150%; max-width:330px; object-fit:contain; animation:catGlow 4s ease-in-out infinite; }
.cat-section { grid-column:2; margin:55px 4px 0 0; padding:16px 12px 8px; border:1px solid #b446f2; border-bottom:0; border-radius:14px 14px 0 0; background:#14072366; box-shadow:0 -4px 20px #9b44ff25; }
.cat-name { color:#c579ff; font-size:13px; letter-spacing:0; }
.cat-bubble { color:#d18afa; font-size:12px; }
.cat-features { grid-column:2; margin-right:4px; padding:8px 12px 18px; border:1px solid #b446f2; border-top:0; border-radius:0 0 14px 14px; background:#14072366; }
.cat-features-title { display:none; }
.cat-features li { font-size:11px; line-height:1.8; color:#c5c7df; }
.panel-center { min-height:805px; border-color:#5ee6ff88; padding:0 9px 9px; box-shadow:0 0 15px #35bbef10,inset 0 0 16px #35bbef08; }
.panel-center .panel-header { padding:17px 11px 12px; font-size:20px; }
.panel-center .panel-header > span { max-width:85%; }
.live-badge { font-size:13px; letter-spacing:0; }
.console-body { margin:0; padding:16px 13px; border:1px solid #3fcbcd77; border-bottom:0; border-radius:10px 10px 0 0; background:#000b; font-size:14px; max-height:none; min-height:710px; }
.console-line { margin-bottom:7px; gap:12px; }
.console-ts { color:#56e7b5; text-decoration:underline; text-underline-offset:5px; text-decoration-color:#227a5a; }
.console-txt.ok,.console-txt.info { color:#e0e0e9; }
.console-footer { border:1px solid #3fcbcd77; border-top:0; border-radius:0 0 10px 10px; background:#000b; color:var(--green); }
.error-log-box { background:linear-gradient(120deg,#15071166,#000 70%); border:1px solid var(--pink); border-radius:11px; font-size:14px; box-shadow:0 0 14px #ff49c815,inset 0 0 14px #ff49c809; white-space:pre-wrap; }
.error-log-scroll { max-height:480px; padding:16px; }
.error-log-divider { margin:22px 0 18px; }
.divider-label { color:var(--pink); font-size:17px; letter-spacing:0; }
.divider-line { height:1px; background:#a65d82; }
.panel-right { border:0; background:none; overflow:visible; gap:16px; }
.summary-card,.fix-section,.share-section,.quote-section { border:1px solid #715b895e; border-radius:12px; background:linear-gradient(120deg,#170b1b66,#04060caa); overflow:hidden; }
.summary-card { display:grid; grid-template-columns:41% 59%; padding-bottom:10px; }
.summary-card > .panel-header { grid-column:1/-1; color:var(--pink); padding:16px 18px; }
.summary-card > .panel-header > span:first-child { color:var(--pink); }
.summary-card > .panel-header > span:last-child { display:none; }
.sys-status { grid-column:1/-1; padding:0 18px 10px; border:0; gap:5px; }
.sys-status-row { font-size:9px; }
.severity-section { border:0; padding:0 5px 0 12px; position:relative; justify-content:center; gap:0; }
.severity-label { position:absolute; top:23px; z-index:1; font-size:10px; letter-spacing:0; }
.gauge-wrap { width:125px; height:125px; max-width:100%; }
.gauge-bg { stroke:#58204788; stroke-width:8; }
.gauge-fill { stroke-width:8; }
.gauge-pct { font-family:'JetBrains Mono',monospace; font-size:30px; margin-top:12px; }
.gauge-risk { font-size:9px; letter-spacing:0; }
.metrics-section { border:0; padding:13px 15px 0 8px; }
.metrics-title { display:none; }
.metric-row { gap:6px; margin-bottom:14px; }
.metric-name { font-size:10px; min-width:64px; }
.metric-val { color:#d5a9cf; min-width:25px; font-size:10px; font-weight:400; }
.metric-track { height:11px; border-radius:5px; background:#1e1026; }
.metric-bar-fill { background:linear-gradient(90deg,#aa286a,#f04d9c); border-radius:5px; }
.fix-section,.share-section { padding:18px 20px; border-color:#6d93ab66; }
.fix-section { min-height:265px; }
.fix-title,.share-title { font-size:20px; color:var(--cyan); letter-spacing:-.04em; margin-bottom:12px; }
.fix-title::before { content:'⚒ '; }
.fix-subtitle { color:#99b7d6; font-size:12px; }
.fix-item { white-space:normal; font-size:13px; margin-top:5px; }
.fix-progress-track { background:#162431; }
.fix-progress-fill { border-radius:0; background:repeating-linear-gradient(90deg,#49daa4 0 6px,transparent 6px 9px); }
.share-title { color:#77ccff; }
.btn-share { padding:12px 8px; font-size:14px; font-weight:400; border-radius:6px; margin-bottom:9px; }
.btn-share-x { border-color:#8f94b0; background:linear-gradient(#0b0c15,#03040a); }
.btn-share-copy { color:#d2d9ef; background:linear-gradient(#161425,#080710); }
.quote-section { padding:14px; border-color:#c343ee; box-shadow:0 0 15px #b136e333,inset 0 0 16px #a227be22; }
.quote-label { color:#ff93e3; font-size:13px; letter-spacing:0; }
.quote-text { color:#f48ee6; font-size:13px; font-style:normal; }
.app-footer { border:0; padding:28px 0 20px; font-size:12px; letter-spacing:.03em; }
@media(min-width:1600px) { .app-layout { padding-top:30px; } }
@media(max-width:1200px) { .app-layout { padding:20px 18px 0; } .app-grid { grid-template-columns: minmax(230px,1fr) minmax(360px,1.65fr) minmax(245px,1fr); gap:12px; } .panel-header,.panel-center .panel-header { font-size:17px; } .btn-generate { font-size:15px; } .metric-name { min-width:52px; font-size:9px; } .metrics-section { padding-right:9px; } .console-body { font-size:12px; } .app-nav { gap:8px; } .status-pill { min-width:165px; } }
@media(max-width:960px) { .app-grid { grid-template-columns:minmax(240px,.8fr) minmax(0,1.5fr); } .panel-right { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; align-items:start; } .app-header { flex-wrap:wrap; } .app-logo { font-size:35px; } .logo-cat { width:70px;height:70px; } .app-tagline { padding-left:88px;font-size:11px; } .panel-center { min-height:750px; } .console-body { min-height:650px; } }
@media(max-width:640px) { .app-layout { padding:16px 12px 0; } .app-header { gap:16px; padding-bottom:20px; } .header-brand { width:100%; } .app-logo { font-size:35px; } .app-tagline { font-size:10px; letter-spacing:0; } .app-nav { margin-left:0; } .status-pill { margin-left:auto; padding:9px 12px; min-width:145px; font-size:10px; } .app-grid { display:flex; flex-direction:column; gap:20px; } .app-grid>.panel { width:100%; } .panel-left { grid-template-columns:1fr 1fr; } .cat-img-section { margin-top:10px; max-height:240px; } .cat-img { max-height:255px; } .cat-section { margin-top:25px; } .panel-right { order:initial; display:flex; } .panel-center { min-height:450px; } .console-body { min-height:350px; font-size:11px; padding:14px 9px; overflow-wrap:anywhere; } .console-line { gap:7px; } .panel-header,.panel-center .panel-header { font-size:17px; } .summary-card { min-height:210px; } .gauge-wrap { width:135px; height:135px; } .metrics-section { padding-top:25px; } .metric-name { font-size:12px; min-width:75px; } .fix-section { min-height:180px; } .error-log-box { font-size:11px; } .console-footer { font-size:10px; overflow-wrap:anywhere; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; animation-delay:0ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }
.btn-share:disabled { opacity:.45; cursor:default; }
.panel-center { position:relative; }
.panel-center::before,.panel-center::after { content:''; position:absolute; pointer-events:none; width:22px; height:16px; border-color:var(--cyan); opacity:.85; }
.panel-center::before { top:5px;left:5px;border-top:1px solid;border-left:1px solid; }
.panel-center::after { bottom:5px;right:5px;border-bottom:1px solid;border-right:1px solid; }
@media(max-width:640px) { .app-logo { font-size:clamp(23px,7.2vw,35px); } .logo-cat { width:60px;height:60px;margin-right:12px; } .app-tagline { padding-left:72px; font-size:9px; } }
/* Shared details approved in the comparison screen. */
.error-broken-heart { position:absolute; top:10px; right:12px; width:58px; height:54px; filter:drop-shadow(0 0 8px #ed398455); pointer-events:none; z-index:2; }
.error-log-text { padding-top:2px; }
.error-log-text::first-line { color:var(--pink); font-size:1.12em; line-height:2; }
.error-log-scroll { padding-top:12px; }
.error-log-text { padding-right:52px; }
.console-subtitle { font-size:12px; font-weight:400; margin-left:10px; letter-spacing:0; }
.error-log-divider { display:block; border-bottom:1px dashed #97818e; padding-bottom:10px; }
.error-log-divider .divider-line { display:none; }
.error-log-meta .meta-inline { display:block; }
.error-log-meta .meta-row { display:block; }
.error-log-meta { font-weight:400; }
@media(max-width:960px) { .console-subtitle { display:none; } .error-broken-heart { width:40px;height:40px;right:8px; } .error-log-text { padding-right:32px; } }
@media(max-width:960px) { .panel-right { align-items:stretch; } }
.error-log-box { white-space:normal; }
.panel-left:has(.input-section + .cat-img-section) .cat-img-section { grid-row:3 / span 2; }

/* Reserve a side column so the crying cat stays near the start of the log. */
.error-log-box { display:grid; grid-template-columns:minmax(0,1fr) 116px; align-items:start; }
.error-log-scroll { grid-column:1; grid-row:1; min-width:0; padding-right:8px; }
.error-log-text { padding-right:0; }
.error-pixel-cat { position:relative; grid-column:2; grid-row:1; right:auto; bottom:auto; align-self:center; width:105px; height:105px; margin:80px 10px 16px 0; }
@media(max-width:640px) {
  .error-log-box { grid-template-columns:minmax(0,1fr) 88px; }
  .error-log-scroll { padding-left:10px; padding-right:6px; }
  .error-pixel-cat { width:78px; height:78px; margin:60px 8px 12px 0; }
}

.sound-toggle { border:1px solid #655575; border-radius:5px; padding:7px 9px; background:#0a0712; color:var(--text-dim); font:inherit; font-size:10px; cursor:pointer; white-space:nowrap; }
.sound-toggle[aria-pressed="true"] { border-color:var(--cyan); color:var(--cyan); box-shadow:0 0 8px #5ee6ff22; }
.sound-toggle:focus-visible { outline:2px solid var(--cyan); outline-offset:3px; }
