/* ==========================================================================
   古法编程非遗体验馆 · Artisanal Code Museum
   Aesthetic: Archival Museum Parchment × Tactile Print × Classic 2014 Web
   ========================================================================== */

:root {
  --bg-paper: #f4eee1;
  --bg-paper-deep: #eae1cf;
  --bg-card: #fcf8ef;
  --ink-primary: #1f1b16;
  --ink-secondary: #5a5248;
  --ink-muted: #847a6c;
  --seal-red: #c23b22;
  --seal-red-dark: #942814;
  --brass: #a87b32;
  --brass-soft: #e9d9b5;
  --jade: #236947;
  --jade-soft: #dceee3;
  --border-ink: #2a241e;
  --border-soft: #d5cab6;
  --shadow-hard: 4px 4px 0 rgba(31, 27, 22, 0.14);
  --shadow-card: 0 10px 28px rgba(31, 27, 22, 0.08);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-paper);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle organic archival paper dot/grain feel */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(rgba(80, 62, 38, 0.07) 1px, transparent 0),
    radial-gradient(rgba(168, 123, 50, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: rgba(244, 238, 225, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--border-ink);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.brand-seal {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}

.brand-seal svg {
  display: block;
  width: 34px;
  height: 34px;
  filter: drop-shadow(1px 2px 0 rgba(31, 27, 22, 0.16));
}

.brand-btn:hover .brand-seal {
  transform: rotate(2deg) scale(1.04);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand-text small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.exhibit-stepper {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--ink-secondary);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.step-pill:hover {
  border-color: var(--border-ink);
  color: var(--ink-primary);
}

.step-pill.active {
  background: var(--ink-primary);
  color: #fdf8ee;
  border-color: var(--ink-primary);
}

.step-pill.cleared {
  border-color: var(--jade);
  color: var(--jade);
  background: var(--jade-soft);
}

.step-pill.active.cleared {
  background: var(--jade);
  color: #fff;
}

.purity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #fff9ec;
  border: 1px solid var(--brass);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #7b5314;
}

.purity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(35, 105, 71, 0.2);
}

.ctrl-btn,
.ctrl-select {
  height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--border-ink);
  background: var(--bg-card);
  color: var(--ink-primary);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.1s ease, background 0.15s ease;
}

.ctrl-btn:hover,
.ctrl-select:hover {
  background: var(--bg-paper-deep);
}

.ctrl-btn:active {
  transform: translateY(1px);
}

.ctrl-btn[aria-pressed="false"] {
  opacity: 0.65;
}

.ctrl-btn-coffee {
  background: #fff3d6;
  border-color: #a87b32;
  color: #6c460c;
}

.ctrl-btn-coffee:hover {
  background: #fde6b1;
}

.btn-coffee-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  background: #f5ca5a;
  color: #24190c;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border-ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-coffee-cta:hover {
  background: #ffd66b;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--border-ink);
}

.btn-coffee-cta:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--border-ink);
}

/* ==========================================================================
   MAIN STAGE & LOBBY VIEW
   ========================================================================== */

.main-stage {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 104px;
}

.view[hidden] {
  display: none !important;
}

.lobby-hero {
  max-width: 820px;
  margin: 18px auto 44px;
  text-align: center;
}

.heritage-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--seal-red);
  font-weight: 700;
  margin-bottom: 14px;
}

.ribbon-line {
  display: inline-block;
  width: 32px;
  height: 1.5px;
  background: var(--seal-red);
  opacity: 0.55;
}

.hero-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--ink-primary);
}

.hero-subtitle {
  margin: 0 auto 22px;
  max-width: 680px;
  font-size: 15.5px;
  color: var(--ink-secondary);
}

.hero-stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.ink-stamp {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--seal-red);
  color: var(--seal-red);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  border-radius: 3px;
  transform: rotate(-2deg);
  background: rgba(194, 59, 34, 0.04);
}

.ink-stamp-gold {
  border-color: var(--brass);
  color: #8b601a;
  transform: rotate(1.5deg);
  background: rgba(168, 123, 50, 0.06);
}

.ink-stamp-ink {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
  transform: rotate(-1deg);
  background: rgba(31, 27, 22, 0.04);
}

/* Visitor Pass Card */
.pass-card {
  max-width: 660px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--border-ink);
  overflow: hidden;
  text-align: left;
}

.pass-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--ink-primary);
  color: #f9f2e4;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.pass-no {
  color: #f3c46b;
}

.pass-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  padding: 20px 18px 14px;
}

.pass-field {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pass-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.pass-field input,
.cert-name-edit input {
  height: 44px;
  padding: 0 13px;
  border: 1.5px solid var(--border-ink);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  outline: none;
  transition: box-shadow 0.15s ease;
}

.pass-field input:focus,
.cert-name-edit input:focus {
  box-shadow: 0 0 0 3px rgba(194, 59, 34, 0.18);
  border-color: var(--seal-red);
}

.pass-footnote {
  margin: 0;
  padding: 10px 18px 14px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: #f5eedf;
  border-top: 1px dashed var(--border-soft);
}

/* Primary & Secondary Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  background: var(--seal-red);
  color: #fff8ec;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border-ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: #d3442a;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--border-ink);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--border-ink);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--border-ink);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(31, 27, 22, 0.18);
}

.btn-secondary:hover {
  background: var(--bg-paper-deep);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px dashed var(--ink-muted);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--border-ink);
  color: var(--ink-primary);
}

/* Lobby 4 Exhibit Preview Cards */
.exhibit-preview-section {
  max-width: 1120px;
  margin: 0 auto;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border-ink);
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.exhibit-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}

.exhibit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exhibit-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(31, 27, 22, 0.22);
}

.exhibit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.exhibit-era-tag {
  padding: 2px 7px;
  background: var(--brass-soft);
  color: #6b4b12;
  border: 1px solid var(--brass);
  border-radius: 4px;
  font-weight: 700;
}

.exhibit-status {
  color: var(--ink-muted);
}

.exhibit-status.done {
  color: var(--jade);
  font-weight: 700;
}

.exhibit-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17.5px;
  line-height: 1.3;
}

.exhibit-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
  flex: 1;
}

.exhibit-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--seal-red);
  font-weight: 600;
}

.exhibit-card-vault {
  background: linear-gradient(145deg, #f8f1df, #f1e4c6);
  border-style: dashed;
  border-color: var(--brass);
}

.exhibit-card-vault.unlocked {
  background: linear-gradient(145deg, #ecf8f0, #f9f2dd);
  border-style: solid;
  border-color: var(--jade);
}

.exhibit-card-vault.locked {
  cursor: default;
  opacity: 0.88;
}

.exhibit-card-vault.locked:hover {
  transform: none;
  box-shadow: var(--shadow-hard);
}

/* Crawlable Museum FAQ Section */
.museum-faq-section {
  max-width: 1120px;
  margin: 42px auto 0;
}

.section-guide-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--seal-red);
  text-decoration: none;
}

.section-guide-link:hover {
  text-decoration: underline;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow-hard);
}

.faq-item summary {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--seal-red);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   WORKBENCH VIEW
   ========================================================================== */

.night-ops-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: #1b1724;
  color: #f4ece1;
  border: 2px solid #c23b22;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(194, 59, 34, 0.22);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.night-ops-bar.is-day-shift {
  background: #231e18;
  border-color: #7c5c34;
  box-shadow: 0 4px 14px rgba(45, 34, 18, 0.14);
}

.night-ops-bar.is-day-shift .red-blink {
  background: #f6c431;
  animation: amberPulse 2.2s infinite;
}

.night-ops-bar.is-day-shift .night-incident {
  color: #e2d4be;
}

@keyframes amberPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(246, 196, 49, 0.8); }
  50% { opacity: 0.45; box-shadow: none; }
}

.night-ops-left,
.night-ops-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.red-blink {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff453a;
  animation: blinkPulse 1.1s infinite;
}

@keyframes blinkPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #ff453a; }
  50% { opacity: 0.35; box-shadow: none; }
}

.night-clock {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: #ffcf5c;
  letter-spacing: 0.05em;
}

.night-incident {
  font-size: 13px;
  color: #ffb8b0;
  font-weight: 600;
}

.caffeine-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.caffeine-track {
  width: 108px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.caffeine-fill {
  height: 100%;
  background: linear-gradient(90deg, #e58e26, #f6c431);
  transition: width 0.4s ease;
}

.btn-coffee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid #f6c431;
  border-radius: 5px;
  background: #332418;
  color: #ffdfa0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-coffee:hover {
  background: #4b3421;
}

.btn-coffee.needs-coffee {
  background: #4f3314;
  border-color: #ffd65c;
  color: #fff3cf;
  animation: coffeeBeacon 1.25s ease-in-out infinite;
}

@keyframes coffeeBeacon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246, 196, 49, 0.55); transform: scale(1); }
  50% { box-shadow: 0 0 14px 3px rgba(246, 196, 49, 0.65); transform: scale(1.03); }
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel-brief {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brief-card,
.output-card,
.telemetry-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: var(--shadow-hard);
}

.brief-card {
  padding: 16px 18px;
}

.brief-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.era-badge {
  padding: 2px 7px;
  background: var(--seal-red);
  color: #fff6e6;
  border-radius: 3px;
  font-weight: 700;
}

.exhibit-num {
  color: var(--ink-muted);
  font-weight: 600;
}

.cleared-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--jade-soft);
  color: var(--jade);
  border: 1px solid var(--jade);
  border-radius: 999px;
  font-weight: 700;
}

.brief-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.3;
}

.brief-story {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.brief-objectives h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.brief-objectives ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-primary);
}

.brief-objectives li {
  margin-bottom: 4px;
}

/* Output Card: Visual Preview & Console */
.output-card {
  overflow: hidden;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: var(--bg-paper-deep);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.offset-readout {
  font-weight: 600;
  color: var(--seal-red);
  white-space: nowrap;
  flex-shrink: 0;
}

.offset-readout.aligned {
  color: var(--jade);
}

.visual-stage {
  position: relative;
  padding: 16px;
  background: #f8f3e8;
}

.crosshair-h,
.crosshair-v {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  opacity: 0.45;
}

.crosshair-h {
  left: 16px;
  right: 16px;
  top: 50%;
  border-top: 1px dashed var(--seal-red);
}

.crosshair-v {
  top: 16px;
  bottom: 16px;
  left: 50%;
  border-left: 1px dashed var(--seal-red);
}

.preview-sandbox-host {
  position: relative;
  z-index: 2;
}

/* IE6 Dual Browser Simulator */
.ie6-stage {
  padding: 12px;
  background: #ece9d8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ie6-win {
  border: 2px solid #0054e3;
  border-radius: 4px 4px 2px 2px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.16);
}

.ie6-win.ff-win {
  border-color: #6b7b8c;
}

.ie6-win-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: linear-gradient(180deg, #0b61e8, #003ca8);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.ff-win .ie6-win-bar {
  background: linear-gradient(180deg, #8b9eb0, #5b6e80);
}

.ie6-viewport {
  padding: 10px;
  background: #f8f5ec;
  font-family: var(--font-mono);
  font-size: 11px;
}

.ie6-canvas {
  width: 100%;
  background: #fffdf7;
  border: 2px solid #b0843b;
  padding: 8px 6px;
  min-height: 70px;
  position: relative;
}

.ie6-canvas.collapsed {
  min-height: 22px;
  height: 22px;
  border-style: dashed;
  border-color: #c23b22;
  background: #fff0ed;
  overflow: visible;
  margin-bottom: 94px;
}

.ie6-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.ie6-row.broken-wrap {
  flex-wrap: wrap;
}

.ie6-margin-ghost {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.ie6-margin-ghost.ok {
  width: 24px;
  background: rgba(35, 105, 71, 0.14);
  color: #1c5c3c;
  border: 1px dashed #236947;
}

.ie6-margin-ghost.doubled {
  width: 56px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(194, 59, 34, 0.2),
    rgba(194, 59, 34, 0.2) 5px,
    rgba(255, 255, 255, 0.6) 5px,
    rgba(255, 255, 255, 0.6) 10px
  );
  color: #9e1f0e;
  border: 1px solid #c23b22;
}

.ie6-sidebar-box {
  width: 34%;
  height: 46px;
  display: grid;
  place-items: center;
  background: #2f5e8f;
  color: #fff;
  font-weight: 700;
  border: 1.5px solid #183656;
  flex-shrink: 0;
}

.ie6-content-box {
  flex: 1;
  min-width: 52%;
  height: 46px;
  display: grid;
  place-items: center;
  background: #e6dcc6;
  color: #2a241e;
  font-weight: 700;
  border: 1.5px solid #8a785c;
  margin-left: 6px;
}

.ie6-row.broken-wrap .ie6-content-box {
  flex: 0 0 100%;
  margin-left: 0;
  margin-top: 6px;
  background: #fbe1db;
  border-color: #c23b22;
  color: #8f1d0e;
}

.ie6-diag-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.ie6-diag-item {
  padding: 5px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border-soft);
  background: #fff;
}

.ie6-diag-item.pass {
  background: #edf8f1;
  border-color: #8cc5a2;
  color: #164e32;
}

.ie6-diag-item.fail {
  background: #fdf0ed;
  border-color: #e4a194;
  color: #8f2213;
}

.mini-link-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  text-decoration: underline;
}

.console-log-area {
  min-height: 82px;
  max-height: 155px;
  overflow-y: auto;
  padding: 10px 12px;
  background: #1d1b18;
  color: #e6dfd2;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.console-placeholder {
  color: #847d70;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 3px;
}

.log-line.log-err {
  color: #ff7b72;
}

.log-line.log-sys {
  color: #f3c46b;
}

.log-line.log-ok {
  color: #7ee787;
}

.test-results-area {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #faf5ea;
  border-top: 1px solid var(--border-soft);
}

.test-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid var(--border-soft);
  background: #fffdf8;
}

.test-row.pass {
  border-color: #93c9a9;
  background: #edf8f1;
  color: #164e32;
}

.test-row.fail {
  border-color: #e6a89c;
  background: #fdf0ed;
  color: #8d2514;
}

.test-row-detail {
  opacity: 0.9;
  text-align: right;
}

/* Telemetry Strip */
.telemetry-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 8px;
  text-align: center;
}

.tele-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px dashed var(--border-soft);
  padding: 0 4px;
}

.tele-item:last-child {
  border-right: none;
}

.tele-label {
  font-size: 10.5px;
  color: var(--ink-muted);
}

.tele-val {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink-primary);
}

.tele-val.tele-warn {
  color: var(--seal-red);
}

/* ==========================================================================
   RETRO IDE PANEL (Base structure; skin variables in themes.css)
   ========================================================================== */

.panel-ide {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ide-window {
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(31, 27, 22, 0.22);
  background: var(--ide-bg);
  color: var(--ide-fg);
  position: relative;
}

.ide-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ide-title-bg);
  border-bottom: 1px solid var(--ide-border);
  flex-wrap: wrap;
}

.ide-dots {
  display: flex;
  gap: 6px;
}

.ide-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.ide-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--ide-tab-bg);
  color: var(--ide-tab-fg);
  border-radius: 4px 4px 0 0;
  border: 1px solid var(--ide-border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.tab-dirty {
  color: #f6c431;
  font-size: 10px;
}

.ide-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.ide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--ide-btn-border);
  background: var(--ide-btn-bg);
  color: var(--ide-btn-fg);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.ide-btn:hover {
  filter: brightness(1.12);
}

.ide-btn-browser {
  background: #2e5d8f;
  border-color: #4b85c2;
  color: #ffffff;
}

.ide-btn-git-force {
  background: #a82419;
  border-color: #ff7b72;
  color: #fff6e8;
  font-family: var(--font-mono);
}

.ide-btn-git-force.shattered {
  animation: shakeHard 0.35s ease;
}

.ide-btn-ai-decoy {
  background: linear-gradient(135deg, #6b38d4, #b338a8);
  border-color: #d084ff;
  color: #ffffff;
  position: relative;
}

.ide-btn-ai-decoy.shattered {
  animation: shakeHard 0.35s ease;
  text-decoration: line-through;
  opacity: 0.72;
}

@keyframes shakeHard {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-2deg); }
  40% { transform: translateX(5px) rotate(2deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.ide-editor-wrap {
  position: relative;
  display: flex;
  height: 410px;
  background: var(--ide-bg);
}

.ide-gutter {
  width: 48px;
  padding: 14px 10px 14px 4px;
  background: var(--ide-gutter-bg);
  color: var(--ide-gutter-fg);
  border-right: 1px solid var(--ide-border);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}

.ide-code-layer {
  position: relative;
  flex: 1;
  min-width: 0;
}

.ide-textarea {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--ide-fg);
  caret-color: var(--ide-caret);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.ghost-prank {
  position: absolute;
  right: 16px;
  top: 12px;
  padding: 6px 11px;
  border-radius: 4px;
  background: rgba(194, 59, 34, 0.92);
  color: #fff6e8;
  font-family: var(--font-mono);
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: fadePop 0.18s ease;
}

@keyframes fadePop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--ide-status-bg);
  color: var(--ide-status-fg);
  border-top: 1px solid var(--ide-border);
  flex-wrap: wrap;
}

.ide-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  flex-wrap: wrap;
}

.no-ai-tag {
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(194, 59, 34, 0.18);
  color: var(--ide-warn-fg);
  font-weight: 700;
}

.ide-run-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcut-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.72;
}

.btn-run {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1.5px solid #123e27;
  border-radius: 5px;
  background: #238654;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #123e27;
}

.btn-run:hover {
  background: #299b61;
}

.btn-run:active {
  transform: translateY(1px);
}

/* Level Clear Banner */
.level-clear-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: #eef7f0;
  border: 2px solid var(--jade);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(35, 105, 71, 0.22);
  animation: stampDrop 0.35s cubic-bezier(0.22, 1.3, 0.36, 1);
  flex-wrap: wrap;
}

@keyframes stampDrop {
  0% { opacity: 0; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

.clear-stamp {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
  border: 3px solid var(--seal-red);
  border-radius: 50%;
  color: var(--seal-red);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.15;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 0 2px rgba(194, 59, 34, 0.35);
}

.clear-info {
  flex: 1 1 220px;
}

.clear-info h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: #164930;
}

.clear-info p {
  margin: 0;
  font-size: 13.5px;
  color: #2d5c44;
}

/* ==========================================================================
   CERTIFICATE HALL VIEW
   ========================================================================== */

.cert-layout {
  max-width: 1020px;
  margin: 0 auto;
  text-align: center;
}

.cert-header {
  margin-bottom: 24px;
}

.cert-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 36px);
}

.cert-subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--ink-secondary);
  font-size: 15px;
}

.cert-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.cert-canvas-frame {
  width: 100%;
  max-width: 840px;
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: 8px 8px 0 rgba(31, 27, 22, 0.18);
}

#cert-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.cert-controls {
  width: 100%;
  max-width: 720px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cert-name-edit {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cert-name-edit label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.cert-name-row {
  display: flex;
  gap: 10px;
}

.cert-name-row input {
  flex: 1;
}

.cert-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   RUBBER DUCK DEBUGGER
   ========================================================================== */

.duck-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.duck-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px 6px;
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--border-ink);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.duck-btn:hover {
  transform: translateY(-3px) rotate(-2deg);
}

.duck-btn.quacking {
  animation: duckQuack 0.32s ease;
}

@keyframes duckQuack {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.12, 0.9) rotate(-8deg); }
  70% { transform: scale(0.95, 1.06) rotate(5deg); }
}

.duck-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-primary);
}

.duck-bubble {
  position: relative;
  width: 290px;
  padding: 14px 16px;
  background: #fffdf5;
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 rgba(31, 27, 22, 0.22);
  font-size: 13.5px;
}

.duck-bubble-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 17px;
  cursor: pointer;
  color: var(--ink-muted);
}

.duck-bubble-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brass);
  margin-bottom: 6px;
}

.duck-bubble p {
  margin: 0 0 10px;
  color: var(--ink-primary);
}

.duck-hint-btn {
  padding: 5px 10px;
  border: 1.5px solid var(--border-ink);
  border-radius: 5px;
  background: #f9e7a0;
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   RETRO 2014 BROWSER MODAL
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 17, 13, 0.62);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.retro-browser {
  width: min(920px, 100%);
  height: min(650px, 88vh);
  display: flex;
  flex-direction: column;
  background: #e4e4e4;
  border: 2px solid #2b2b2b;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: var(--font-sans);
}

.rb-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, #4b7bb8, #2b558a);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.rb-win-close {
  width: 26px;
  height: 22px;
  border: 1px solid #962519;
  border-radius: 3px;
  background: linear-gradient(180deg, #e56a5a, #c23b22);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.rb-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #f3f3f3, #dcdcdc);
  border-bottom: 1px solid #b5b5b5;
}

.rb-nav-btns {
  display: flex;
  gap: 4px;
}

.rb-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #a2a2a2;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff, #e5e5e5);
  cursor: pointer;
  font-weight: 700;
}

.rb-address-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #9b9b9b;
  border-radius: 3px;
  overflow: hidden;
}

.rb-proto {
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6b6b6b;
  background: #f2f2f2;
  border-right: 1px solid #dcdcdc;
  line-height: 28px;
}

.rb-address-input {
  flex: 1;
  height: 28px;
  border: none;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
}

.rb-go-btn {
  height: 28px;
  padding: 0 12px;
  border: none;
  border-left: 1px solid #9b9b9b;
  background: #e6eef8;
  color: #1f4d85;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.rb-bookmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: #ececec;
  border-bottom: 1px solid #bdbdbd;
}

.rb-bookmark-btn {
  padding: 3px 9px;
  border: 1px solid #bebebe;
  border-radius: 3px;
  background: #f9f9f9;
  color: #242424;
  font-size: 11.5px;
  cursor: pointer;
}

.rb-bookmark-btn:hover,
.rb-bookmark-btn.active {
  background: #dce8f7;
  border-color: #5b89c4;
  color: #173f70;
}

.rb-viewport {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  padding: 18px 22px;
  color: #222;
  user-select: none; /* Artisanal rule: no copy-paste from browser! */
}

.rb-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 12px;
  background: #dfdfdf;
  border-top: 1px solid #b5b5b5;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #525252;
}

/* Retro Page Flavors Inside Browser */
.rb-search-banner {
  text-align: center;
  padding: 12px 0 16px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 16px;
}

.rb-search-logo {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rb-result-item {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e2e2e2;
}

.rb-result-link {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: #1a0dab;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.rb-result-url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #006621;
  margin: 2px 0 4px;
}

.rb-result-snippet {
  margin: 0;
  font-size: 13px;
  color: #4a4a4a;
}

/* AskOverflow Style */
.so-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 3px solid #f48024;
}

.so-brand {
  font-weight: 800;
  font-size: 18px;
  color: #222;
}

.so-brand span {
  color: #f48024;
}

.so-dup-box {
  padding: 10px 14px;
  background: #fff4d6;
  border: 1px solid #e2be69;
  border-radius: 4px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.so-post {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #e4e6e8;
}

.so-votes {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #6a737c;
  flex-shrink: 0;
}

.so-votes .accepted {
  display: block;
  color: #2f6f44;
  font-size: 20px;
  margin-top: 4px;
}

.so-body {
  flex: 1;
  font-size: 13.5px;
}

.so-body pre,
.retro-code-block {
  margin: 10px 0;
  padding: 10px 12px;
  background: #f4f4f4;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.so-comment {
  margin-top: 8px;
  padding: 6px 10px;
  background: #fafafa;
  border-left: 2px solid #d0d4d8;
  font-size: 12px;
  color: #555;
}

/* 2009 Personal Blog Style */
.oldblog-wrap {
  border: 2px solid #567d9a;
  background: #f6fbff;
  padding: 16px;
}

.oldblog-banner {
  padding: 10px 14px;
  background: linear-gradient(90deg, #274d6e, #4f81aa);
  color: #fff;
  font-family: "SimSun", Georgia, serif;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.oldblog-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  background: #000;
  color: #39ff14;
  padding: 2px 7px;
  border: 1px inset #888;
}

/* CSDN Paywall Parody */
.paywall-box {
  position: relative;
  border: 1px solid #e0e0e0;
  padding: 14px;
  background: #fff;
}

.paywall-curtain {
  position: relative;
  margin-top: 8px;
}

.paywall-blur {
  filter: blur(5px);
  transition: filter 0.25s ease;
}

.paywall-blur.unlocked {
  filter: none;
}

.paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.86);
  border: 1.5px dashed #fc5531;
  padding: 12px;
  text-align: center;
}

.paywall-overlay.hidden {
  display: none;
}

.paywall-unlock-btn {
  padding: 6px 12px;
  background: #fc5531;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   VINTAGE AI BLOCKER DIALOG (Win98 / Classic System Alert)
   ========================================================================== */

.vintage-dialog {
  width: min(460px, 100%);
  background: #ece9d8;
  border: 2px solid #003c74;
  border-radius: 6px 6px 2px 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  color: #111;
}

.vd-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: linear-gradient(180deg, #0a58ca, #003d99);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.vd-close {
  background: #d84737;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 3px;
  width: 22px;
  height: 20px;
  cursor: pointer;
  font-size: 11px;
}

.vd-body {
  display: flex;
  gap: 14px;
  padding: 18px 18px 14px;
  align-items: flex-start;
}

.vd-icon {
  font-size: 36px;
  line-height: 1;
}

.vd-content h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.vd-content p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: #333;
}

.vd-error-code {
  display: inline-block;
  padding: 3px 8px;
  background: #dedad0;
  border: 1px inset #bbb;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8d1f14;
}

.vd-footer {
  padding: 10px 18px 14px;
  display: flex;
  justify-content: flex-end;
  background: #e2dfd0;
  border-top: 1px solid #ccc;
}

.vd-ok-btn {
  padding: 6px 18px;
  border: 1.5px solid #333;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff, #dcdcdc);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.vd-ok-btn:hover {
  background: linear-gradient(180deg, #fff, #cecece);
}

/* ==========================================================================
   TOASTS & LEVEL 4 PM POPUPS
   ========================================================================== */

.toast-stack {
  position: fixed;
  top: 68px;
  right: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  pointer-events: none;
}

.toast-item {
  padding: 10px 14px;
  background: var(--ink-primary);
  color: #fdf6e8;
  border: 1.5px solid var(--brass);
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  animation: slideInRight 0.2s ease;
}

.toast-item.toast-warn {
  background: #8f2213;
  border-color: #f6c431;
}

.toast-item.toast-ok {
  background: #1b593a;
  border-color: #8ee0b2;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

.pm-toast-stack {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 310px;
}

.pm-popup {
  background: #ffffff;
  border: 2px solid #2b6cb0;
  border-radius: 7px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: slideInLeft 0.25s ease;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.pm-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #2b6cb0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.pm-popup-body {
  padding: 10px 12px;
  font-size: 13px;
  color: #222;
}

.pm-popup-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
}

.pm-popup-actions button {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  background: #f7fafc;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pm-popup-actions button:first-child {
  background: #ebf8ff;
  border-color: #63b3ed;
  color: #1a4b82;
}

.sleepy-vignette {
  --drowsy: 0;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 45;
  opacity: var(--drowsy);
  background: radial-gradient(
    circle at 50% 48%,
    rgba(10, 8, 18, calc(0.18 * var(--drowsy))) 24%,
    rgba(8, 6, 16, calc(0.62 + 0.24 * var(--drowsy))) 78%,
    rgba(4, 3, 10, 0.92) 100%
  );
  backdrop-filter: brightness(calc(1 - 0.26 * var(--drowsy))) saturate(calc(1 - 0.35 * var(--drowsy)));
  -webkit-backdrop-filter: brightness(calc(1 - 0.26 * var(--drowsy))) saturate(calc(1 - 0.35 * var(--drowsy)));
  transition: opacity 0.65s ease, backdrop-filter 0.65s ease;
}

.sleepy-vignette.active {
  opacity: 1;
}

/* ==========================================================================
   MUSEUM FOOTER & BUY ME A COFFEE ($2.99 WAFFO) MODAL
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1.5px solid var(--border-ink);
  background: var(--bg-paper-deep);
  padding: 18px 22px;
  margin-top: 24px;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.patron-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: #fff3d1;
  border: 1px solid var(--brass);
  border-radius: 999px;
  color: #7c510d;
  font-weight: 700;
  font-size: 11.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--seal-red);
  text-decoration: underline;
}

.footer-coffee-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #fff4d8;
  border: 1px solid var(--brass);
  border-radius: 999px;
  color: #6b4408;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.footer-coffee-link:hover {
  background: #fce4a6;
}

.footer-sep {
  color: var(--ink-muted);
}

/* Buy Me a Coffee Dialog */
.coffee-dialog {
  width: min(490px, 100%);
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: 8px 8px 0 rgba(31, 27, 22, 0.34);
  overflow: hidden;
  animation: fadePop 0.2s ease;
}

.coffee-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #231c15;
  color: #fdf6e8;
}

.coffee-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coffee-cup-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f5ca5a;
  color: #231c15;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.coffee-head-left h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
}

.coffee-head-left small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #e6c684;
  letter-spacing: 0.05em;
}

.coffee-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: transparent;
  color: #fdf6e8;
  font-size: 14px;
  cursor: pointer;
}

.coffee-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.coffee-dialog-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.coffee-story {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.coffee-receipt {
  padding: 12px 14px;
  background: #f5eedf;
  border: 1.5px dashed var(--brass);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.receipt-row span {
  color: var(--ink-secondary);
}

.receipt-total {
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
  font-family: var(--font-mono);
  font-size: 15px;
}

.receipt-total strong {
  color: var(--seal-red);
  font-size: 18px;
}

.coffee-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-waffo-pay {
  width: 100%;
  height: 46px;
  font-size: 15px;
}

.btn-waffo-pay:disabled {
  opacity: 0.7;
  cursor: wait;
}

.coffee-status-box {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  background: #fff8e6;
  border: 1px solid #d4a648;
  color: #5d3f0c;
}

.coffee-status-box.err {
  background: #fdf0ed;
  border-color: #df9a8e;
  color: #8b2012;
}

.coffee-status-box.ok {
  background: #edf8f1;
  border-color: #82bf9a;
  color: #164f32;
}

.coffee-legal-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.5;
}

.coffee-legal-note a {
  color: var(--ink-secondary);
  text-decoration: underline;
}

/* ==========================================================================
   TRUST & E-E-A-T PROVENANCE SECTION
   ========================================================================== */

.eeat-section {
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: var(--shadow-hard);
}

.eeat-byline {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-soft);
}

.eeat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.eeat-card {
  padding: 14px 15px;
  background: #f9f4e8;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
}

.eeat-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: var(--ink-primary);
}

.eeat-card p {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.58;
  color: var(--ink-secondary);
}

.eeat-refs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12.2px;
  color: var(--ink-muted);
}

.eeat-refs strong {
  color: var(--ink-primary);
}

.eeat-refs a {
  color: var(--seal-red);
  text-decoration: none;
  font-weight: 600;
}

.eeat-refs a:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .eeat-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 980px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .ide-editor-wrap {
    height: 330px;
  }

  .site-header {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .exhibit-stepper {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px dashed var(--border-soft);
  }
}

@media (max-width: 600px) {
  .ctrl-label,
  .purity-pill {
    display: none;
  }

  .telemetry-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tele-item:nth-child(2) {
    border-right: none;
  }

  .duck-dock {
    right: 12px;
    bottom: 12px;
  }

  .duck-bubble {
    width: 250px;
  }
}
