:root {
  color-scheme: dark;
  /* MOOD speaks the bench's pigment atlas now (common.js PIG / MANIFESTO §02),
     so the room reads as the same instrument, not a separate app. */
  --ink: #e6e1d3;                  /* PIG.ivory */
  --muted: #a39e91;                /* PIG.ivory-dim */
  --faint: #6c675f;                /* PIG.ash */
  --line: rgba(43, 39, 51, 0.9);   /* the bench's structural rule (--rule) */
  --room-copper: #c4a06a;          /* PIG.amber — the carrier pigment, as on the bench */
  --room-copper-bright: #d4b079;
  --sea: #6fa08c;                  /* PIG.copper */
  --paper: #141218;                /* PIG.void — the observatory ground */
  --panel: rgba(28, 25, 34, 0.88); /* PIG.plate */
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent 49.94%, rgba(230,225,211,.02) 50%, transparent 50.06%),
    radial-gradient(circle at 36% 42%, rgba(196, 160, 106, .10), transparent 42%),
    #141218;
  letter-spacing: .035em;
}

button, a, input { font: inherit; }
button, .mood-back {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(13, 18, 20, .72);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
button:hover, button:focus-visible, .mood-back:hover, .mood-back:focus-visible {
  border-color: rgba(225, 160, 109, .58);
  color: var(--room-copper-bright);
  outline: none;
}
button:disabled { opacity: .32; cursor: not-allowed; }

.mood-header {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  font-size: 10px;
  position: relative;
  z-index: 4;
  background: rgba(8, 12, 14, .86);
}
.mood-back { width: max-content; padding: 8px 11px; }
.mood-wordmark { display: flex; align-items: baseline; gap: 12px; letter-spacing: .24em; }
.mood-wordmark span { color: var(--muted); }
.mood-wordmark strong { color: var(--room-copper-bright); font-weight: 500; font-size: 14px; }
.mood-truth { text-align: right; color: var(--muted); }

.mood-layout {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(350px, .72fr);
}
.mood-aperture {
  min-height: 650px;
  position: sticky;
  top: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  isolation: isolate;
}
.mood-aperture::before {
  content: '';
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(197, 133, 86, .12);
  border-radius: 48% 48% 3% 3% / 62% 62% 3% 3%;
  pointer-events: none;
  z-index: 1;
}
.mood-aperture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
  pointer-events: none;
  z-index: -1;
}
#mood-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.mood-coordinate { position: absolute; top: 26px; left: 30px; color: var(--faint); font-size: 9px; }
.mood-room-copy {
  position: absolute;
  left: 9%;
  top: 19%;
  width: min(650px, 80%);
}
.mood-kicker { font-size: 9px; color: var(--room-copper); letter-spacing: .2em; margin-bottom: 22px; }
h1 {
  /* MANIFESTO §03/§10.5: nothing above 28px — the phenomenon is the headline,
     not the title; §M4/§10.10: bloom is phosphor (signal-driven), never a
     static CSS glow on text. Engraved, wide-tracked, restrained. */
  margin: 0 0 22px;
  font-size: 28px;
  font-weight: 200;
  line-height: 1.05;
  letter-spacing: .04em;
  color: #ddd3c0;
}
.mood-image { max-width: 620px; font-size: clamp(12px, 1.15vw, 16px); line-height: 1.8; color: #bcb7aa; }
.mood-intention { max-width: 580px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.mood-chain {
  position: absolute;
  left: 9%;
  bottom: 11%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  color: var(--muted);
}
.mood-chain span { border: 1px solid var(--line); padding: 8px 10px; background: rgba(8,12,14,.55); }
.mood-chain i, .mood-chain b { color: var(--room-copper); font-style: normal; font-weight: 400; }
.mood-silence { position: absolute; right: 28px; bottom: 26px; color: var(--faint); font-size: 8px; }

.mood-bench { background: var(--panel); min-width: 0; }
.mood-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.mood-section header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mood-section header > span { color: var(--room-copper); font-size: 8px; }
.mood-section h2 { margin: 0; font-size: 10px; font-weight: 500; letter-spacing: .16em; }
.mood-section header em { margin-left: auto; color: var(--faint); font-size: 7px; font-style: normal; }
.mood-status-line { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 8px; margin-bottom: 14px; }
#mood-status[data-kind='ready'] { color: var(--sea); }
#mood-status[data-kind='working'] { color: var(--room-copper); }
#mood-status[data-kind='error'] { color: #c77e75; }
#room-fingerprint { color: var(--faint); }
.mood-primary {
  width: 100%;
  padding: 15px;
  border-color: rgba(198, 123, 75, .42);
  color: var(--room-copper-bright);
  letter-spacing: .16em;
  font-size: 10px;
}
.mood-primary[data-state='engaged'] { background: rgba(120, 152, 142, .12); border-color: rgba(120, 152, 142, .42); color: #a9c6bc; }
.mood-readout { display: block; color: var(--muted); font-size: 9px; margin: 0 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mood-actions { display: grid; gap: 7px; }
.mood-actions.two { grid-template-columns: repeat(2, 1fr); }
.mood-actions.three { grid-template-columns: repeat(3, 1fr); }
.mood-actions button, .mood-bed-row button { padding: 10px 7px; font-size: 8px; }
.mood-route { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mood-route button { padding: 13px 10px; text-align: left; }
.mood-route button.active { border-color: rgba(196, 160, 106, .55); background: rgba(196, 160, 106, .10); }
.mood-route strong { display: block; color: var(--ink); font-size: 9px; font-weight: 500; margin-bottom: 6px; }
.mood-route small { display: block; color: var(--muted); font-size: 7px; line-height: 1.4; }
.mood-handles { display: grid; gap: 18px; }
.mood-handle { display: block; }
.mood-handle-name { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; margin-bottom: 9px; }
.mood-handle output { color: var(--room-copper-bright); }
input[type='range'] {
  width: 100%; height: 14px; appearance: none; background: transparent; cursor: ew-resize;
}
input[type='range']::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, var(--room-copper), var(--line)); }
input[type='range']::-webkit-slider-thumb {
  appearance: none; width: 8px; height: 14px; margin-top: -6px; border: 1px solid var(--room-copper-bright); background: #0d1214;
}
.mood-bed-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.mood-bed-row header { grid-column: 1 / -1; margin-bottom: 3px; }
.mood-bed-row .mood-readout { margin: 0; }
.mood-note { color: var(--faint); font-size: 7px; line-height: 1.6; margin: 12px 0 0; }

.mood-footer {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 7px;
  background: #080c0e;
}
.feature-disabled .mood-aperture, .feature-disabled .mood-bench section:not(.mood-entry) { opacity: .28; }

@media (max-width: 920px) {
  .mood-layout { grid-template-columns: 1fr; }
  .mood-aperture { position: relative; min-height: 68vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .mood-header { grid-template-columns: auto 1fr; }
  .mood-wordmark { justify-self: center; }
  .mood-truth { display: none; }
}

@media (max-width: 560px) {
  .mood-header { padding: 0 12px; }
  .mood-room-copy { left: 7%; top: 16%; width: 86%; }
  .mood-chain { left: 7%; gap: 5px; flex-wrap: wrap; }
  .mood-actions.three { grid-template-columns: 1fr; }
  .mood-footer { flex-wrap: wrap; padding: 10px 14px; }
}
