:root {
  --bg: #0d1110;
  --bg-soft: #151b17;
  --panel: rgba(15, 20, 17, 0.88);
  --panel-strong: rgba(22, 29, 25, 0.96);
  --line: rgba(190, 212, 173, 0.14);
  --ink: #deead6;
  --muted: #97a693;
  --accent: #ffd158;
  --accent-soft: #f4b447;
  --signal: #88d39d;
  --danger: #d96f58;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --aurora-opacity: 0.08;
  --aurora-blur: 42px;
  --aurora-speed: 26s;
  --aurora-scale: 1.02;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Consolas, "Courier New", monospace;
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 88, 0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(136, 211, 157, 0.08), transparent 28%),
    linear-gradient(180deg, #0a0e0c 0%, #101613 100%);
}

.aurora-video-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: none;
}

.aurora-video-preload {
  display: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.45;
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
  position: relative;
  z-index: 1;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.masthead {
  overflow: hidden;
}

.window-bar,
.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.window-leds {
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
}

.window-leds i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 209, 88, 0.35);
  box-shadow: 0 0 12px rgba(255, 209, 88, 0.2);
}

.window-title {
  flex: 1;
}

.window-state,
.console-header span:last-child {
  color: var(--muted);
  text-align: right;
}

.masthead-body {
  padding: 28px 28px 30px;
}

.eyebrow,
.card-label {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 0.94;
  max-width: 12ch;
}

.lede {
  margin: 18px 0 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.7;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.84rem;
}

.pill.warning {
  border-color: rgba(217, 111, 88, 0.24);
  color: #ffbaa8;
}

.pill.subtle {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100dvh - 36px);
  height: calc(100dvh - 36px);
  margin-top: 18px;
}

.side-panel {
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(0, auto) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.duck-card,
.progress-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.duck-avatar {
  position: relative;
  width: 210px;
  height: 180px;
  margin: 18px auto 12px;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.28));
  animation: bob 3.4s ease-in-out infinite;
}

.duck-shadow {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 126px;
  height: 20px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.28);
}

.duck-body {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 132px;
  height: 90px;
  transform: translateX(-50%);
  border-radius: 58% 52% 46% 48%;
  background: linear-gradient(180deg, #ffd95e 0%, #f4b447 100%);
}

.duck-body::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 16px;
  width: 42px;
  height: 30px;
  border-radius: 60% 50% 70% 40%;
  background: rgba(255, 241, 186, 0.24);
}

.duck-wing {
  position: absolute;
  left: 24px;
  top: 34px;
  width: 52px;
  height: 34px;
  border-radius: 58% 42% 60% 40%;
  background: rgba(255, 241, 186, 0.24);
}

.duck-head {
  position: absolute;
  right: 10px;
  top: -34px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe27e 0%, #f6c453 100%);
}

.duck-eye {
  position: absolute;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #141815;
}

.duck-eye.left {
  left: 22px;
}

.duck-eye.right {
  right: 22px;
}

.duck-beak {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 34px;
  height: 16px;
  border-radius: 12px 12px 14px 14px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ff944d 0%, #eb6a33 100%);
}

.duck-avatar[data-level="0"] {
  opacity: 0.84;
}

.duck-avatar[data-level="2"] .duck-eye,
.duck-avatar[data-level="3"] .duck-eye {
  height: 10px;
  border-radius: 12px;
}

.duck-avatar[data-level="3"] .duck-beak,
.duck-avatar[data-level="4"] .duck-beak {
  width: 38px;
  transform: translateX(-50%) rotate(-4deg);
}

.duck-avatar[data-level="4"] .duck-eye {
  top: 26px;
  box-shadow: 0 -2px 0 #141815 inset;
}

.duck-avatar[data-level="5"] .duck-head {
  box-shadow: 0 0 0 4px rgba(136, 211, 157, 0.08);
}

.duck-avatar[data-level="5"] .duck-eye,
.duck-avatar[data-level="6"] .duck-eye,
.duck-avatar[data-level="7"] .duck-eye {
  width: 10px;
  height: 10px;
  top: 30px;
}

.duck-avatar[data-level="6"] .duck-head,
.duck-avatar[data-level="7"] .duck-head {
  background: linear-gradient(180deg, #fff0a5 0%, #ffd158 100%);
}

.duck-avatar[data-level="6"] .duck-beak,
.duck-avatar[data-level="7"] .duck-beak {
  width: 42px;
  bottom: 16px;
}

.duck-mood {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.progress-header {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: flex-start;
}

.progress-header h2 {
  margin: 8px 0 0;
  font-size: 1.32rem;
}

.meter-track {
  width: 100%;
  height: 16px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--signal), var(--accent-soft), var(--danger));
  box-shadow: 0 0 20px rgba(255, 209, 88, 0.22);
  transition: width 220ms ease;
}

.ladder {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: block;
}

.ladder-item {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  opacity: 1;
  transform: none;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.ladder-item.active {
  border-color: rgba(255, 209, 88, 0.28);
  background: rgba(255, 209, 88, 0.08);
  opacity: 1;
  transform: scale(1);
}

.ladder-item.complete {
  border-color: rgba(136, 211, 157, 0.18);
  background: rgba(136, 211, 157, 0.07);
  opacity: 0.56;
}

.ladder-item.queued {
  border-style: dashed;
  opacity: 1;
  transform: none;
}

.ladder-item.current-only {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ladder-topline {
  display: block;
}

.ladder-subtitle,
.ladder-sample {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.ladder-sample {
  font-size: 0.92rem;
  margin-top: 10px;
}

.console-panel {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  height: 100%;
  overflow: hidden;
  background: var(--panel-strong);
}

.chat {
  padding: 22px;
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat::-webkit-scrollbar {
  display: none;
}

.message {
  max-width: min(760px, 94%);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.message.user {
  margin-left: auto;
  background: rgba(255, 209, 88, 0.07);
}

.message.assistant.system {
  background: rgba(136, 211, 157, 0.08);
}

.message.pending {
  opacity: 0.72;
}

.message-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.message-body {
  margin: 0;
  line-height: 1.7;
}

.summary {
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 209, 88, 0.06);
  border: 1px solid rgba(255, 209, 88, 0.14);
  max-width: min(760px, 94%);
}

.summary.in-chat {
  margin-top: 4px;
}

.summary h3 {
  margin: 8px 0 0;
  font-size: 1.18rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-key {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-stat strong {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.composer {
  padding: 22px;
  border-top: 1px solid var(--line);
}

.composer-label {
  display: block;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

textarea:disabled {
  opacity: 0.62;
}

.suggestions {
  margin-top: 14px;
}

.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggestions-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.suggestion-chip {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 88, 0.24);
  background: rgba(255, 209, 88, 0.08);
}

.suggestion-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.button.primary {
  color: #111512;
  background: linear-gradient(180deg, #ffe384 0%, #f4b447 100%);
  box-shadow: 0 12px 28px rgba(255, 209, 88, 0.18);
}

.button.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}


@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .console-panel {
    min-height: 760px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 1240px);
  }

  .window-bar,
  .console-header,
  .status-row,
  .composer-actions,
  .suggestions-header {
    flex-direction: column;
    align-items: stretch;
  }

  .window-state,
  .console-header span:last-child {
    text-align: left;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }
}
