:root {
  /* Typography compliance: IBM Plex Mono** from Google Fonts for tiny thread IDs. */
  --rice: #F6EEDC;
  --honey: #D8B66A;
  --beeswax: #F2D88F;
  --linen: #E7DDC9;
  --indigo: #262B45;
  --ink: #2D2A24;
  --sage: #8B9474;
  --pearl: #FFF8D6;
  --paper-shadow: 0 18px 50px rgba(45, 42, 36, 0.09), 0 2px 0 rgba(255, 248, 214, 0.68) inset;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--rice); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 248, 214, 0.74) 0 9%, transparent 28%),
    radial-gradient(circle at 12% 88%, rgba(139, 148, 116, 0.16) 0 12%, transparent 34%),
    linear-gradient(115deg, var(--rice), var(--linen));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.33;
  background-image:
    linear-gradient(rgba(45, 42, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 42, 36, 0.025) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  mix-blend-mode: multiply;
}

.worktable {
  min-height: 100vh;
  padding: clamp(16px, 2.2vw, 34px);
  transition: filter 900ms ease, background-color 900ms ease;
}

.worktable.night-idle {
  filter: saturate(0.8) brightness(0.82);
}

.console {
  min-height: calc(100vh - clamp(32px, 4.4vw, 68px));
  display: grid;
  grid-template-rows: minmax(86px, auto) 1fr minmax(118px, auto);
  gap: clamp(14px, 1.6vw, 22px);
}

.paper-panel {
  border: 1px solid rgba(45, 42, 36, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 248, 214, 0.58), rgba(246, 238, 220, 0.88)),
    var(--rice);
  box-shadow: var(--paper-shadow);
  position: relative;
  overflow: hidden;
}

.paper-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.5), transparent 24%);
}

.top-shelf {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

.tape-label, .panel-kicker {
  margin: 0 0 8px;
  color: rgba(45, 42, 36, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "Jost", "Poppins", "Futura", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-transform: lowercase;
}

h1 { font-size: clamp(1.45rem, 3vw, 3.4rem); line-height: 0.95; }
h2 { font-size: clamp(1.25rem, 2vw, 2.1rem); line-height: 1.04; }

.planet-dot {
  color: var(--honey);
  text-shadow: 0 0 20px rgba(216, 182, 106, 0.96);
  animation: planetPulse 4.8s ease-in-out infinite;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.night-meter { justify-self: center; display: grid; gap: 10px; color: rgba(45, 42, 36, 0.66); }
.moon-phases { display: flex; gap: 12px; align-items: center; }
.moon-phases i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(38, 43, 69, 0.22);
  background: linear-gradient(90deg, var(--indigo) 48%, var(--pearl) 50%);
  box-shadow: 0 0 16px rgba(255, 248, 214, 0.8);
}
.moon-phases i:nth-child(2) { opacity: 0.72; transform: scale(0.82); }
.moon-phases i:nth-child(3) { background: var(--pearl); }
.moon-phases i:nth-child(4) { opacity: 0.72; transform: scale(0.82); background: linear-gradient(90deg, var(--pearl) 48%, var(--indigo) 50%); }
.moon-phases i:nth-child(5) { background: var(--indigo); }

.queue-status { justify-self: end; display: flex; align-items: center; gap: 10px; }
.status-pulse {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 0 0 rgba(216, 182, 106, 0.34);
  animation: breatheRing 3.8s ease-in-out infinite;
}

.garden-console {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(390px, 1.45fr) minmax(220px, 0.78fr);
  gap: clamp(14px, 1.6vw, 22px);
  min-height: 0;
}

.lane-panel, .specimen-panel { padding: clamp(18px, 2vw, 26px); }
.lane-panel { display: grid; align-content: space-between; gap: 16px; }
.soft-note { margin: 0; color: rgba(45, 42, 36, 0.66); line-height: 1.55; }

.lanes { display: grid; gap: 18px; padding: 10px 0; }
.lane {
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(139, 148, 116, 0.28);
  background: linear-gradient(90deg, rgba(231, 221, 201, 0.46), rgba(255, 248, 214, 0.32));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: rgba(45, 42, 36, 0.55);
}
.lane::before {
  content: "";
  position: absolute;
  left: 92px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: rgba(139, 148, 116, 0.34);
}
.pollen {
  position: absolute;
  left: 110px;
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 16px rgba(216, 182, 106, 0.85);
  animation: pollenTravel 7.8s ease-in-out infinite;
}
.lane:nth-child(1) .pollen:nth-of-type(2) { animation-delay: 0.7s; }
.lane:nth-child(1) .pollen:nth-of-type(3) { animation-delay: 1.4s; }
.lane:nth-child(2) .pollen { animation-delay: 0.6s; }
.lane:nth-child(2) .pollen:nth-of-type(2) { animation-delay: 1.5s; }
.lane:nth-child(2) .pollen:nth-of-type(3) { animation-delay: 2.1s; }
.lane:nth-child(3) .pollen { animation-delay: 1.2s; }
.lane:nth-child(3) .pollen:nth-of-type(2) { animation-delay: 2s; }
.lane:nth-child(3) .pollen:nth-of-type(3) { animation-delay: 2.7s; }
.lane:nth-child(4) .pollen { animation-delay: 1.8s; }
.lane:nth-child(4) .pollen:nth-of-type(2) { animation-delay: 2.6s; }
.lane:nth-child(4) .pollen:nth-of-type(3) { animation-delay: 3.4s; }

.scheduler {
  min-height: 530px;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(255, 248, 214, 0.82), rgba(246, 238, 220, 0.68) 48%, rgba(38, 43, 69, 0.08)),
    var(--rice);
}
.scheduler-label {
  position: absolute;
  top: 20px;
  left: 22px;
  color: rgba(45, 42, 36, 0.56);
  z-index: 2;
}
.scheduler-svg { width: min(100%, 680px); height: min(72vh, 650px); overflow: visible; }
.orbit { fill: none; stroke: rgba(38, 43, 69, 0.18); stroke-width: 1.2; stroke-dasharray: 3 12; transform-origin: 320px 320px; animation: slowOrbit 46s linear infinite; }
.orbit-two { stroke: rgba(216, 182, 106, 0.34); animation-duration: 34s; animation-direction: reverse; }
.engine-core { fill: rgba(255, 248, 214, 0.92); stroke: rgba(216, 182, 106, 0.62); stroke-width: 1.5; animation: coreBreathe 5s ease-in-out infinite; }
.core-title { font: 500 28px "Jost", sans-serif; letter-spacing: 0.1em; fill: var(--ink); text-transform: lowercase; }
.core-sub { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: 0.08em; fill: rgba(45, 42, 36, 0.56); text-transform: uppercase; }
.stem { fill: none; stroke: var(--sage); stroke-width: 2.1; stroke-linecap: round; stroke-dasharray: 7 8; opacity: 0.74; }
.leaf { fill: rgba(139, 148, 116, 0.13); stroke: rgba(139, 148, 116, 0.72); stroke-width: 1.5; }
.moon-node { cursor: pointer; transition: transform 520ms ease, opacity 520ms ease; }
.moon-node circle { fill: var(--pearl); stroke: var(--honey); stroke-width: 1.4; filter: drop-shadow(0 0 10px rgba(216, 182, 106, 0.35)); }
.moon-node path { stroke: var(--indigo); stroke-width: 1.1; stroke-linecap: round; opacity: 0.72; }
.moon-node.active circle { animation: nodeWake 2.6s ease-in-out infinite; }
.moon-node:hover circle { fill: var(--beeswax); }
.pinhole-stars circle { fill: var(--indigo); opacity: 0.38; animation: starDrift 5.5s ease-in-out infinite; }
.pinhole-stars circle:nth-child(2n) { animation-delay: 1.2s; }
.thread-note {
  position: absolute;
  right: 24px;
  bottom: 22px;
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 42, 36, 0.11);
  border-radius: 16px;
  background: rgba(255, 248, 214, 0.76);
  color: rgba(45, 42, 36, 0.68);
  font-size: 0.9rem;
  line-height: 1.35;
  transition: transform 300ms ease, background 300ms ease;
}
.thread-note.is-lit { transform: translateY(-4px); background: rgba(242, 216, 143, 0.34); }

.specimen-panel { display: grid; grid-template-rows: auto auto 1fr; gap: 18px; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.queue-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 248, 214, 0.45);
  border: 1px solid rgba(45, 42, 36, 0.08);
  transition: transform 450ms ease, background 450ms ease;
}
.queue-list li.is-first { background: rgba(242, 216, 143, 0.28); transform: translateX(-6px); }
.queue-list span { font-family: "Jost", sans-serif; letter-spacing: 0.09em; text-transform: lowercase; }
.queue-list em { font-style: normal; color: rgba(45, 42, 36, 0.54); }
.pressed-leaf { align-self: end; width: 100%; max-height: 260px; opacity: 0.55; }
.pressed-leaf path { fill: none; stroke: var(--sage); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.ledger article { padding: 20px 22px; border-right: 1px solid rgba(45, 42, 36, 0.1); }
.ledger article:last-child { border-right: 0; }
.ledger span { color: var(--sage); }
.ledger p { margin: 8px 0 0; line-height: 1.45; color: rgba(45, 42, 36, 0.68); }

.drawer-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  padding-top: clamp(16px, 2.2vw, 34px);
}
.drawer {
  min-height: 260px;
  padding: 34px 28px 28px;
  transform: translateY(22px);
  opacity: 0;
  transition: transform 850ms ease, opacity 850ms ease;
}
.drawer.is-open { transform: translateY(0); opacity: 1; }
.drawer-tab {
  position: absolute;
  top: 0;
  left: 28px;
  padding: 8px 14px;
  border-radius: 0 0 12px 12px;
  background: rgba(216, 182, 106, 0.25);
  color: rgba(45, 42, 36, 0.64);
}
.drawer p { color: rgba(45, 42, 36, 0.67); line-height: 1.65; font-size: 1rem; }

@keyframes planetPulse { 0%, 100% { opacity: 0.68; } 50% { opacity: 1; } }
@keyframes breatheRing { 0%, 100% { box-shadow: 0 0 0 0 rgba(216, 182, 106, 0.34); } 50% { box-shadow: 0 0 0 13px rgba(216, 182, 106, 0); } }
@keyframes pollenTravel { 0% { transform: translateX(0) scale(0.72); opacity: 0; } 18% { opacity: 1; } 62% { transform: translateX(120px) scale(1); opacity: 1; } 75% { transform: translateX(162px) scale(1.55); opacity: 0.92; } 100% { transform: translateX(190px) scale(0.4); opacity: 0; } }
@keyframes slowOrbit { to { transform: rotate(360deg); } }
@keyframes coreBreathe { 0%, 100% { transform: scale(1); transform-origin: 320px 320px; } 50% { transform: scale(1.035); transform-origin: 320px 320px; } }
@keyframes nodeWake { 0%, 100% { filter: drop-shadow(0 0 6px rgba(216, 182, 106, 0.28)); } 50% { filter: drop-shadow(0 0 22px rgba(216, 182, 106, 0.85)); } }
@keyframes starDrift { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.7; } }

@media (max-width: 980px) {
  .console { grid-template-rows: auto auto auto; }
  .top-shelf, .garden-console, .ledger, .drawer-section { grid-template-columns: 1fr; }
  .queue-status, .night-meter { justify-self: start; }
  .scheduler { min-height: 460px; }
  .scheduler-svg { height: 460px; }
  .ledger article { border-right: 0; border-bottom: 1px solid rgba(45, 42, 36, 0.1); }
}

@media (max-width: 560px) {
  .worktable { padding: 10px; }
  .paper-panel { border-radius: 18px; }
  .thread-note { position: relative; right: auto; bottom: auto; margin-top: -34px; }
  .scheduler-svg { height: 380px; }
}
