/* ==========================================================================
   Antigravity Bazi Diff — Open-Disk Aperture, Li Chun Exhibit & Lot Flight
   ========================================================================== */

:root {
  --ag-ink: #f4e5cb;
  --ag-ink-muted: #c1ae92;
  --ag-ink-faint: rgba(229, 199, 154, 0.34);
  --ag-bronze: #d2a773;
  --ag-bronze-deep: #e4bc88;
  --ag-bronze-line: rgba(198, 156, 104, 0.36);
  --ag-bronze-wash: rgba(198, 156, 104, 0.09);
  --ag-vermilion: #eda88f;
  --ag-focus: #f2c993;
  --ag-splay-angle: 0deg;
}

/* 1. Open-Desk Bronze Disk & Aperture Cleanup
   No filled rectangular aperture; desk remains continuous through the gap. */
.chart-panel,
.instrument[data-state="open"] .chart-panel {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.instrument[data-state="open"] .chart-panel {
  clip-path: none !important;
  -webkit-clip-path: none !important;
  overflow: visible;
}

.chart-panel::before,
.chart-panel::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* The whole bronze disk separates into its two existing halves. */
.instrument[data-state="open"] { --ag-splay-angle: 2.25deg; }
.instrument[data-state="open"] .dial-half:first-child:has(+ .dial-half) {
  transform: translateX(calc(-1 * var(--spread))) rotate(calc(-1 * var(--ag-splay-angle)));
}
.instrument[data-state="open"] .dial-half + .dial-half {
  transform: translateX(var(--spread)) rotate(var(--ag-splay-angle));
}
@media (max-width: 720px) {
  .instrument[data-state="open"] { --ag-splay-angle: 1.5deg; }
}

/* Transparent, ink-on-desk city control — no opaque box */
.birth-place select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--ag-bronze-deep) 50%),
    linear-gradient(135deg, var(--ag-bronze-deep) 50%, transparent 50%);
  background-position: calc(100% - 11px) 54%, calc(100% - 6px) 54%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 0 !important;
  border-bottom: 1px solid var(--ag-bronze-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ag-ink);
  padding: 0.35rem 1.5rem 0.3rem 0.15rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease;
}

.birth-place select:hover {
  border-bottom-color: var(--ag-bronze) !important;
  color: var(--ag-bronze-deep);
}

.birth-place select:focus-visible {
  outline: 1.5px solid var(--ag-focus);
  outline-offset: 3px;
}

.birth-place select option {
  background-color: #221912;
  color: var(--ag-ink);
}

/* Keep surrounding instrument controls legible over the bare desk */
.chart-panel label,
.chart-panel legend,
.chart-panel input,
.chart-panel select,
.chart-panel button {
  text-shadow: 0 1px 3px #100a06;
}

/* 2. Li Chun Cultural Exhibit (#ag-spring-exhibit) */
.ag-spring {
  position: relative;
  margin: 0 0 2.5rem;
  padding: 1.5rem 0 1.75rem;
  border-top: 1px solid var(--ag-bronze-line);
  border-bottom: 1px solid var(--ag-bronze-line);
  color: var(--ag-ink);
  background: transparent;
}

.ag-spring-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}

.ag-spring-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ag-bronze-deep);
}

.ag-spring-meta {
  margin: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--ag-ink-muted);
}

.ag-spring-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.22rem, 2.2vw, 1.55rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--ag-ink);
}

.ag-spring-lead {
  margin: 0 0 1.35rem;
  max-width: 62ch;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ag-ink-muted);
}

/* Two-stop bronze timeline dial */
.ag-spring-dial {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.4rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(198, 156, 104, 0.2);
  border-bottom: 1px solid rgba(198, 156, 104, 0.2);
}

.ag-spring-stop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ag-ink-muted);
  text-align: left;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.ag-spring-stop[data-stop="after"] {
  align-items: flex-end;
  text-align: right;
}

.ag-spring-stop:hover {
  color: var(--ag-ink);
  border-color: var(--ag-bronze-line);
}

.ag-spring-stop:focus-visible {
  outline: 1.5px solid var(--ag-focus);
  outline-offset: 2px;
}

.ag-spring-stop[aria-checked="true"] {
  color: var(--ag-ink);
  border-color: var(--ag-bronze);
  background: var(--ag-bronze-wash);
}

.ag-spring-stop-time {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: inherit;
}

.ag-spring-stop-tag {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ag-bronze-deep);
}

.ag-spring-axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 3.25rem;
  pointer-events: none;
}

.ag-spring-axis-mark {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--ag-bronze-deep);
  transform: rotate(45deg);
  background: transparent;
  transition: background-color 260ms ease, transform 260ms ease;
}

.ag-spring[data-phase="after"] .ag-spring-axis-mark {
  background: var(--ag-vermilion);
  border-color: var(--ag-vermilion);
  transform: rotate(135deg);
}

.ag-spring-axis-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ag-bronze-deep);
  white-space: nowrap;
}

/* Four Pillars reading strip */
.ag-spring-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.ag-spring-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem 0.5rem 0.75rem;
  border-top: 2px solid var(--ag-ink-faint);
  transition: border-color 260ms ease, background-color 260ms ease;
}

.ag-spring-pillar[data-role="shift"] {
  border-top-color: var(--ag-bronze);
  background: linear-gradient(180deg, var(--ag-bronze-wash), transparent 72%);
}

.ag-spring-pillar[data-role="fixed"] {
  border-top-color: rgba(229, 199, 154, 0.21);
}

.ag-spring-pillar-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ag-ink-muted);
  margin-bottom: 0.4rem;
}

.ag-spring-pillar-value {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  white-space: nowrap;
  line-height: 1.15;
  color: var(--ag-ink);
}

.ag-spring-pillar[data-role="shift"] .ag-spring-pillar-value {
  color: var(--ag-bronze-deep);
}

.ag-spring-pillar-state {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ag-ink-muted);
}

.ag-spring-pillar[data-role="shift"] .ag-spring-pillar-state {
  color: var(--ag-vermilion);
}

.ag-spring-pillar.is-crossing .ag-spring-pillar-value {
  animation: ag-pillar-cross 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ag-pillar-cross {
  0% {
    opacity: 0.25;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ag-spring-footnote {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ag-ink-muted);
}

/* 3. Lot Flight Layer & Cradle Anchor */
.ag-lot-flight-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9990;
  overflow: visible;
}

.ag-lot-cradle-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* The bamboo settles across the two brass rests. */
.lot-cradle::before,
.lot-cradle::after {
  top: calc(50% + 8px);
  bottom: auto;
}
.lot-cradle::before { left: 35%; }
.lot-cradle::after { right: 35%; }

/* 4. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .dial-half,
  .ag-spring-stop,
  .ag-spring-axis-mark,
  .ag-spring-pillar {
    transition: none !important;
  }

  .ag-spring-pillar.is-crossing .ag-spring-pillar-value {
    animation: none !important;
  }
}

.ag-ritual-reader {
  box-sizing: border-box;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  color: #e6d4b5;
  font: 400 13px/1.4 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ag-ritual-reader *, .ag-ritual-pickup-btn { box-sizing: border-box; }
.ag-ritual-guide {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  color: #bfa57a;
  letter-spacing: .04em;
}
.ag-ritual-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.ag-ritual-stop {
  appearance: none;
  min-height: 36px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 158, 98, .34);
  background: rgba(34, 24, 17, .82);
  color: #d6c099;
  font: 500 12px/1.25 var(--sans);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s;
  word-break: break-word;
}
.ag-ritual-stop-0 { grid-column: 1; grid-row: 1; justify-self: start; text-align: left; }
.ag-ritual-stop-1 { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
.ag-ritual-stop-2 { grid-column: 2; grid-row: 3; justify-self: end; text-align: right; }
.ag-ritual-stop-3 { grid-column: 1; grid-row: 3; justify-self: start; text-align: left; }
.ag-ritual-stop.is-active {
  border-color: #e5be78;
  background: linear-gradient(180deg, #523820, #342213);
  color: #fff3da;
  box-shadow: 0 0 0 1px rgba(229, 190, 120, .35), inset 0 1px 0 rgba(255, 232, 185, .2);
}
.ag-ritual-stop:focus-visible, .ag-ritual-pickup-btn:focus-visible {
  outline: 2px solid #f0cb82;
  outline-offset: 2px;
}
.ag-ritual-dial {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  cursor: grab;
  background:
    radial-gradient(circle at 38% 32%, rgba(214, 171, 108, .22), transparent 55%),
    radial-gradient(circle, #3a2719 0%, #271910 62%, #1b110b 100%);
  border: 2px solid #7c5b37;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .75), inset 0 0 0 6px rgba(154, 114, 65, .2), 0 4px 14px rgba(0, 0, 0, .45);
}
.ag-ritual-dial.is-dragging { cursor: grabbing; }
.ag-ritual-dial::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, rgba(224, 186, 122, .48) 0 1.6deg, transparent 1.6deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 100%);
  mask: radial-gradient(circle, transparent 58%, #000 59%, #000 100%);
  pointer-events: none;
}
.ag-ritual-dial::after {
  content: "";
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  border: 1px solid rgba(206, 165, 102, .35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
  pointer-events: none;
}
.ag-ritual-trig {
  position: absolute;
  font-size: 11px;
  line-height: 1;
  color: rgba(214, 178, 118, .66);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .85);
  pointer-events: none;
}
.ag-ritual-trig-0 { top: 20px; left: 20px; }
.ag-ritual-trig-1 { top: 20px; right: 20px; }
.ag-ritual-trig-2 { bottom: 20px; right: 20px; }
.ag-ritual-trig-3 { bottom: 20px; left: 20px; }
.ag-ritual-needle {
  position: absolute;
  inset: 0;
  transform: rotate(var(--ag-angle, 135deg));
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.ag-ritual-dial.is-dragging .ag-ritual-needle { transition: none; }
.ag-ritual-needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 15px;
  width: 8px;
  height: 66px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f3d28e 0%, #c8964e 52%, #5b3e22 100%);
  clip-path: polygon(50% 0%, 100% 72%, 68% 100%, 32% 100%, 0% 72%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .75));
}
.ag-ritual-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5daa0, #8a6234 70%, #3a2614);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}
.ag-ritual-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f1e8d6, #e5d7be);
  color: #241b13;
  border: 1px solid #b89867;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 8px rgba(0, 0, 0, .28);
}
.ag-ritual-glyph {
  flex: 0 0 auto;
  min-width: 2.3em;
  padding-right: 10px;
  border-right: 1px solid rgba(90, 63, 35, .3);
  font: 700 22px/1.15 "Songti SC", "Noto Serif SC", Georgia, serif;
  letter-spacing: .06em;
  text-align: center;
}
.ag-ritual-meta { min-width: 0; }
.ag-ritual-tag { display: block; font-size: 11px; font-weight: 700; color: #6e4b26; }
.ag-ritual-note { margin: 2px 0 0; font-size: 12px; color: #37291c; }
.ag-ritual-pickup { position: relative; }
.ag-ritual-pickup-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 56px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}
.ag-ritual-pickup-btn[hidden] { display: none; }
.ag-ritual-pickup.is-armed .ag-ritual-pickup-btn {
  border-color: rgba(232, 194, 122, .55);
  box-shadow: inset 0 0 18px rgba(232, 194, 122, .16);
}
.ag-ritual-pickup-cue {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(24, 17, 12, .88);
  border: 1px solid rgba(226, 187, 118, .65);
  color: #f4dfb7;
  font: 500 12px/1.25 system-ui, sans-serif;
}
.ag-ritual-pickup.is-lifting { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
@keyframes ag-ritual-pulse { 50% { border-color: #f6d591; box-shadow: 0 0 10px rgba(240, 200, 120, .35); } }
@media (prefers-reduced-motion: reduce) {
  .ag-ritual-needle, .ag-ritual-stop { transition: none; }
  .ag-ritual-pickup-cue { animation: none; }
}

.pillar-reader { margin-block: 17px 13px; }
.ag-ritual-dial {
  background:
    radial-gradient(circle at 38% 32%, #b4894430, #170f09a8 60%),
    var(--bronze-plate) 49.18% 82.35% / 224.56% 149.71%;
  width: clamp(112px, 35vw, 148px);
  height: auto;
  aspect-ratio: 1;
}
.ag-ritual-stop { min-height: 38px; border-radius: 2px; background: #2d1e13; }
.ag-ritual-pickup-btn { border-radius: 0; }
.ag-ritual-pickup-cue { border: 0; border-radius: 0; background: #2a1c10; }
.ag-ritual-pickup.is-armed .ag-ritual-pickup-btn { box-shadow: none; }
.ag-ritual-pickup.is-armed .ag-ritual-pickup-btn:is(:hover,:focus-visible) { background: #c59a4b14; }
.ask-slips [data-reference], .result-slips [aria-pressed="true"] { box-shadow: inset 0 -2px #ddb77a; background: #8f5a2b32; }
.pillar-citation { margin-block: 14px 7px; border-block: 1px solid #bf925758; }
.pillar-citation .text-link { display: grid; gap: 5px; padding-block: 11px; text-align: start; }
.pillar-citation .reference-copy { color: var(--ink); }
.pillar-citation .reference-target { color: var(--metal-light); font-size: .78rem; }

.ag-ritual-stop, .ag-ritual-pickup-btn { -webkit-tap-highlight-color: transparent; }
.ag-ritual-pickup-btn:not(:disabled) { touch-action: none; }

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

.ag-desk {
  --ag-bronze-deep: #15110d;
  --ag-bronze-mid: #241c15;
  --ag-bronze-edge: #5d4628;
  --ag-brass-bright: #d9b46c;
  --ag-brass-mid: #a67e3d;
  --ag-brass-dark: #583f1c;
  --ag-lacquer-deep: #180c0b;
  --ag-lacquer-mid: #2c1311;
  --ag-lacquer-rim: #7f2b22;
  --ag-vermilion: #a83226;
  --ag-paper-white: #efe7d7;
  --ag-paper-white-edge: #d9ccb4;
  --ag-paper-brown: #dcc59f;
  --ag-paper-brown-edge: #b99b6d;
  --ag-bamboo-light: #cfb37f;
  --ag-bamboo-dark: #8e6f3d;
  --ag-ink: #241b13;
  --ag-ink-muted: #5a4633;
  --ag-cream: #f1e5cd;
  --ag-cream-muted: #bba888;
  --ag-atlas: url('/desk/assets/reading-objects.webp');
  --ag-grain: none;

  position: relative;
  width: 100%;
  min-width: 0;
  color: var(--ag-cream);
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  border-radius: 12px;
  padding: 18px 16px 16px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(217, 180, 108, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(241, 229, 205, 0.12),
    inset 0 -14px 28px rgba(0, 0, 0, 0.45),
    0 14px 32px rgba(0, 0, 0, 0.42);
}

.ag-desk::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--ag-grain);
  pointer-events: none;
  z-index: 0;
}

.ag-desk::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(217, 180, 108, 0.14);
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
}

.ag-desk[data-case="work"] {
  background:
    radial-gradient(120% 90% at 18% 0%, rgba(166, 126, 61, 0.16), transparent 55%),
    radial-gradient(90% 80% at 92% 100%, rgba(92, 66, 35, 0.2), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 232, 192, 0.018) 0 2px,
      transparent 2px 14px
    ),
    linear-gradient(160deg, #1d1610 0%, #14100c 52%, #1c150f 100%);
}

.ag-desk[data-case="love"] {
  border-color: rgba(168, 50, 38, 0.42);
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(168, 50, 38, 0.18), transparent 58%),
    radial-gradient(95% 85% at 50% 100%, rgba(217, 180, 108, 0.11), transparent 62%),
    linear-gradient(155deg, #271210 0%, #160a09 48%, #21100e 100%);
}

.ag-desk[data-case="love"]::after {
  border-color: rgba(196, 86, 67, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 226, 198, 0.08);
}

.ag-desk__header,
.ag-desk__stage,
.ag-desk__footer {
  position: relative;
  z-index: 1;
}

.ag-desk__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 180, 108, 0.18);
}

.ag-desk__plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ag-brass-bright);
  text-transform: uppercase;
}

.ag-desk__plate-dot {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--ag-brass-bright), var(--ag-brass-dark));
  box-shadow: 0 0 0 1px rgba(217, 180, 108, 0.4);
  flex: none;
}

.ag-desk__state-badge {
  font-size: 12px;
  color: var(--ag-cream-muted);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(217, 180, 108, 0.24);
  background: rgba(14, 10, 7, 0.55);
}

.ag-desk__btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

.ag-desk__btn:focus-visible {
  outline: 2px solid var(--ag-brass-bright);
  outline-offset: 3px;
}

/* =========================
   WORK: ROLLED HANDSCROLLS
   ========================= */

.ag-scroll-rack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.ag-scroll {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: stretch;
  border-radius: 6px;
  transition: transform 240ms ease, filter 240ms ease;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
}

.ag-scroll:hover {
  transform: translateY(-2px);
}

.ag-scroll[aria-expanded="true"] {
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.56));
}

.ag-scroll__roller {
  position: relative;
  border-radius: 4px;
  background:
    linear-gradient(
      90deg,
      #2b1a10 0%,
      #6a4526 28%,
      #9a6d3f 50%,
      #4c2f1a 78%,
      #22130b 100%
    );
  box-shadow:
    inset 0 2px 3px rgba(255, 224, 174, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.65);
}

.ag-scroll__roller::before,
.ag-scroll__roller::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #4c3618 0%,
    #d9b46c 38%,
    #f2d598 52%,
    #8d682f 78%,
    #3d2b13 100%
  );
  border: 1px solid rgba(255, 237, 198, 0.24);
}

.ag-scroll__roller::before {
  top: -4px;
}

.ag-scroll__roller::after {
  bottom: -4px;
}

.ag-scroll__body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 13px 12px;
  min-height: 126px;
  border-top: 2px solid #7f6038;
  border-bottom: 2px solid #7f6038;
  color: var(--ag-ink);
  overflow: hidden;
  transition: padding 240ms ease, box-shadow 240ms ease, background-color 240ms ease;
  background-color: var(--ag-paper-brown);
  background-image:
    var(--ag-grain),
    linear-gradient(
      90deg,
      rgba(56, 36, 16, 0.26) 0%,
      rgba(255, 248, 232, 0.16) 10%,
      transparent 24%,
      transparent 76%,
      rgba(56, 36, 16, 0.22) 100%
    ),
    linear-gradient(180deg, #e7d5b5 0%, #d8c098 55%, #ceb182 100%),
    var(--ag-atlas);
  background-size: auto, 100% 100%, 100% 100%, 240% auto;
  background-position: 0 0, 0 0, 0 0, 12% 18%;
  background-blend-mode: multiply, normal, normal, soft-light;
}

.ag-scroll--alt .ag-scroll__body {
  background-color: var(--ag-paper-white);
  background-image:
    var(--ag-grain),
    linear-gradient(
      90deg,
      rgba(56, 36, 16, 0.24) 0%,
      rgba(255, 252, 244, 0.22) 10%,
      transparent 24%,
      transparent 76%,
      rgba(56, 36, 16, 0.2) 100%
    ),
    linear-gradient(180deg, #f2ead9 0%, #e5d7be 60%, #d9c7a7 100%),
    var(--ag-atlas);
  background-position: 0 0, 0 0, 0 0, 82% 18%;
}

.ag-scroll__brocade {
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(217, 180, 108, 0.55) 0 4px,
      rgba(94, 67, 35, 0.7) 4px 8px
    );
  border-bottom: 1px solid rgba(72, 49, 24, 0.45);
}

.ag-scroll__tie {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #8b2e23, #b54234);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 240ms ease, opacity 240ms ease;
}

.ag-scroll[aria-expanded="true"] .ag-scroll__tie {
  transform: translateX(10px) scaleX(0.4);
  opacity: 0;
}

.ag-scroll__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.ag-scroll__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #462c17;
}

.ag-scroll__seal {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1;
  color: #f8ece4;
  background: var(--ag-vermilion);
  border: 1px solid rgba(74, 15, 11, 0.45);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 210, 0.28);
}

.ag-scroll__cue {
  font-size: 11px;
  color: var(--ag-ink-muted);
  border-bottom: 1px dashed rgba(90, 70, 51, 0.45);
}

.ag-scroll__fact {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ag-ink);
}

.ag-scroll__unfold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0.55;
  transition: grid-template-rows 240ms ease, opacity 240ms ease, margin-top 240ms ease;
}

.ag-scroll__unfold-inner {
  overflow: hidden;
}

.ag-scroll[aria-expanded="true"] .ag-scroll__body {
  box-shadow:
    inset 0 0 0 1px rgba(168, 50, 38, 0.42),
    inset 0 10px 22px rgba(255, 249, 235, 0.35);
}

.ag-scroll[aria-expanded="true"] .ag-scroll__unfold {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 2px;
}

.ag-scroll__note {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(88, 63, 28, 0.28);
  font-size: 12.5px;
  line-height: 1.55;
  color: #463423;
}

/* =========================
   WORK: BOUND BAMBOO SLIPS
   ========================= */

.ag-bamboo {
  position: relative;
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(207, 179, 127, 0.35);
  background:
    var(--ag-grain),
    repeating-linear-gradient(
      90deg,
      rgba(226, 198, 145, 0.94) 0 18px,
      rgba(146, 114, 64, 0.96) 18px 20px,
      rgba(208, 177, 123, 0.94) 20px 38px,
      rgba(128, 97, 50, 0.96) 38px 40px
    ),
    var(--ag-atlas);
  background-blend-mode: multiply, normal, soft-light;
  color: var(--ag-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.45),
    inset 0 -8px 16px rgba(68, 46, 18, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.38);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.ag-bamboo::before,
.ag-bamboo::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(
      90deg,
      #593f22 0 7px,
      #8b683b 7px 14px,
      #412c16 14px 18px
    );
  opacity: 0.9;
  pointer-events: none;
}

.ag-bamboo::before {
  top: 7px;
}

.ag-bamboo::after {
  bottom: 7px;
}

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

.ag-bamboo[aria-expanded="true"] {
  border-color: var(--ag-brass-bright);
  box-shadow:
    0 0 0 1px rgba(217, 180, 108, 0.55),
    inset 0 1px 0 rgba(255, 246, 224, 0.65),
    0 12px 24px rgba(0, 0, 0, 0.48);
}

.ag-bamboo__slip {
  position: relative;
  z-index: 1;
  margin: 4px 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(244, 232, 206, 0.94), rgba(226, 204, 165, 0.94));
  border: 1px solid rgba(92, 66, 33, 0.35);
  box-shadow: 0 2px 6px rgba(42, 27, 10, 0.18);
}

.ag-bamboo__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6a331f;
}

.ag-bamboo__quote {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
  color: var(--ag-ink);
}

.ag-bamboo__unfold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0.5;
  transition: grid-template-rows 220ms ease, opacity 220ms ease;
}

.ag-bamboo__unfold-inner {
  overflow: hidden;
}

.ag-bamboo[aria-expanded="true"] .ag-bamboo__unfold {
  grid-template-rows: 1fr;
  opacity: 1;
}

.ag-bamboo__hint {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(92, 66, 33, 0.35);
  font-size: 12px;
  line-height: 1.5;
  color: #4f3a25;
}

/* =========================
   LOVE: FOLDED FOLIO ON LACQUER TRAY
   ========================= */

.ag-lacquer-tray {
  position: relative;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid rgba(168, 50, 38, 0.55);
  background:
    linear-gradient(145deg, rgba(255, 224, 202, 0.08) 0%, transparent 28%),
    linear-gradient(170deg, #321411 0%, #1a0b0a 52%, #240e0c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 212, 186, 0.16),
    inset 0 0 0 2px rgba(20, 7, 6, 0.72),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.ag-lacquer-tray__moment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #e8c796;
}

.ag-lacquer-tray__moment::before,
.ag-lacquer-tray__moment::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(217, 180, 108, 0.45), transparent);
}

.ag-folio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.ag-folio__spine {
  position: relative;
  background: linear-gradient(
    90deg,
    rgba(35, 19, 10, 0.65) 0%,
    rgba(217, 180, 108, 0.45) 48%,
    rgba(35, 19, 10, 0.65) 100%
  );
  border-top: 2px solid #8a6432;
  border-bottom: 2px solid #8a6432;
}

.ag-folio__spine::before,
.ag-folio__spine::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  height: 8px;
  border-top: 1px solid rgba(255, 236, 200, 0.55);
  border-bottom: 1px solid rgba(255, 236, 200, 0.55);
}

.ag-folio__spine::before {
  top: 24%;
}

.ag-folio__spine::after {
  bottom: 24%;
}

.ag-leaf {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 13px 13px;
  min-height: 132px;
  color: var(--ag-ink);
  border-top: 2px solid #967242;
  border-bottom: 2px solid #967242;
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.ag-leaf--white {
  border-left: 2px solid #967242;
  border-radius: 4px 0 0 4px;
  background-color: var(--ag-paper-white);
  background-image:
    var(--ag-grain),
    linear-gradient(90deg, rgba(255, 252, 245, 0.25) 0%, transparent 72%, rgba(58, 36, 18, 0.18) 100%),
    linear-gradient(180deg, #f3ecdd 0%, #e7dac3 100%),
    var(--ag-atlas);
  background-position: 0 0, 0 0, 0 0, 18% 76%;
  background-blend-mode: multiply, normal, normal, soft-light;
}

.ag-leaf--brown {
  border-right: 2px solid #967242;
  border-radius: 0 4px 4px 0;
  background-color: var(--ag-paper-brown);
  background-image:
    var(--ag-grain),
    linear-gradient(90deg, rgba(58, 36, 18, 0.22) 0%, transparent 28%, rgba(255, 245, 224, 0.14) 100%),
    linear-gradient(180deg, #e4cfa9 0%, #d2b687 100%),
    var(--ag-atlas);
  background-position: 0 0, 0 0, 0 0, 78% 76%;
  background-blend-mode: multiply, normal, normal, soft-light;
}

.ag-leaf::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ag-brass-dark), var(--ag-brass-bright), var(--ag-brass-dark));
  opacity: 0.85;
}

.ag-leaf--white::before {
  left: 12px;
}

.ag-leaf--brown::before {
  right: 12px;
}

.ag-leaf:hover {
  transform: translateY(-2px);
}

.ag-leaf[aria-expanded="true"] {
  z-index: 2;
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(168, 50, 38, 0.45),
    0 10px 18px rgba(0, 0, 0, 0.32);
}

.ag-leaf__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
}

.ag-leaf__who {
  font-size: 12px;
  font-weight: 700;
  color: #6b291f;
  letter-spacing: 0.04em;
}

.ag-leaf__state {
  font-size: 11px;
  color: var(--ag-ink-muted);
}

.ag-leaf__quote {
  margin: 0;
  font-size: 15px;
  line-height: 1.48;
  font-weight: 700;
  color: var(--ag-ink);
}

.ag-leaf__unfold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0.55;
  transition: grid-template-rows 240ms ease, opacity 240ms ease;
}

.ag-leaf__unfold-inner {
  overflow: hidden;
}

.ag-leaf[aria-expanded="true"] .ag-leaf__unfold {
  grid-template-rows: 1fr;
  opacity: 1;
}

.ag-leaf__detail {
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(107, 41, 31, 0.24);
  font-size: 12.5px;
  line-height: 1.55;
  color: #4a3324;
}

/* =========================
   LOVE: COPPER CLEPSYDRA ARROW RULER
   ========================= */

.ag-clepsydra {
  position: relative;
  display: block;
  padding: 12px 14px 13px;
  border-radius: 8px;
  border: 1px solid rgba(217, 180, 108, 0.44);
  background:
    var(--ag-grain),
    linear-gradient(180deg, #3c2b18 0%, #261a0e 52%, #1d130a 100%),
    var(--ag-atlas);
  background-blend-mode: overlay, normal, soft-light;
  color: var(--ag-cream);
  box-shadow:
    inset 0 1px 0 rgba(247, 222, 168, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.6),
    0 8px 18px rgba(0, 0, 0, 0.42);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

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

.ag-clepsydra[aria-expanded="true"] {
  border-color: var(--ag-brass-bright);
  box-shadow:
    0 0 0 1px rgba(217, 180, 108, 0.45),
    inset 0 1px 0 rgba(247, 222, 168, 0.48),
    0 12px 24px rgba(0, 0, 0, 0.52);
}

.ag-clepsydra__scale {
  position: relative;
  height: 16px;
  margin-bottom: 10px;
  border-radius: 3px;
  border: 1px solid rgba(217, 180, 108, 0.35);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(217, 180, 108, 0.65) 0 1px,
      transparent 1px 10px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(247, 222, 168, 0.9) 0 2px,
      transparent 2px 50px
    ),
    linear-gradient(180deg, #2a1d10 0%, #191109 100%);
}

.ag-clepsydra__arrow {
  position: absolute;
  top: -3px;
  left: 22%;
  width: 12px;
  height: 20px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f3d697 0%, #b7873f 65%, #69491c 100%);
  clip-path: polygon(50% 100%, 100% 34%, 74% 34%, 74% 0, 26% 0, 26% 34%, 0 34%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  transition: left 280ms ease;
}

.ag-clepsydra[aria-expanded="true"] .ag-clepsydra__arrow {
  left: 50%;
}

.ag-clepsydra__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--ag-brass-bright);
  letter-spacing: 0.05em;
}

.ag-clepsydra__line {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--ag-cream);
}

.ag-clepsydra__unfold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0.55;
  transition: grid-template-rows 220ms ease, opacity 220ms ease;
}

.ag-clepsydra__unfold-inner {
  overflow: hidden;
}

.ag-clepsydra[aria-expanded="true"] .ag-clepsydra__unfold {
  grid-template-rows: 1fr;
  opacity: 1;
}

.ag-clepsydra__note {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(217, 180, 108, 0.32);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ag-cream-muted);
}

.ag-desk__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(217, 180, 108, 0.14);
  font-size: 11.5px;
  color: var(--ag-cream-muted);
}

.ag-desk__colophon {
  opacity: 0.9;
}

/* =========================
   OPTIONAL: .ag-spring-dial
   INLAID BRONZE CLEPSYDRA RULER
   ========================= */

.ag-spring-dial {
  --ag-dial-pos: 0;
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  color: #f1e5cd;
  border: 1px solid rgba(217, 180, 108, 0.42);
  background:
    linear-gradient(180deg, rgba(242, 213, 152, 0.08) 0%, transparent 26%),
    linear-gradient(165deg, #2d2114 0%, #1a130b 55%, #24190e 100%);
  box-shadow:
    inset 0 1px 0 rgba(248, 224, 173, 0.25),
    inset 0 -3px 10px rgba(0, 0, 0, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.38);
}

.ag-spring-dial[data-phase="after"],
.ag-spring-dial.is-after {
  --ag-dial-pos: 1;
}

.ag-spring-dial__track,
.ag-spring-dial .ag-dial-track {
  position: relative;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(217, 180, 108, 0.45);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(217, 180, 108, 0.52) 0 1px,
      transparent 1px 8px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(247, 223, 171, 0.9) 0 2px,
      transparent 2px 40px
    ),
    linear-gradient(180deg, #1b130b 0%, #2a1e12 52%, #150f08 100%);
  overflow: hidden;
}

.ag-spring-dial__scale,
.ag-spring-dial .ag-dial-scale {
  position: absolute;
  inset: 0;
  width: 140%;
  background:
    linear-gradient(
      90deg,
      rgba(166, 126, 61, 0.16) 0%,
      rgba(166, 126, 61, 0.16) 49.5%,
      rgba(217, 180, 108, 0.95) 49.5%,
      rgba(217, 180, 108, 0.95) 50.5%,
      rgba(168, 50, 38, 0.22) 50.5%,
      rgba(168, 50, 38, 0.22) 100%
    );
  transform: translateX(calc(var(--ag-dial-pos) * -28.5%));
  transition: transform 320ms ease;
}

.ag-spring-dial__pointer,
.ag-spring-dial .ag-dial-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #f5d89a;
  box-shadow: 0 0 8px rgba(245, 216, 154, 0.7);
  pointer-events: none;
}

.ag-spring-dial__pillars,
.ag-spring-dial .ag-dial-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ag-spring-dial [data-pillar="day"],
.ag-spring-dial [data-pillar="hour"],
.ag-spring-dial .ag-spring-dial__stable {
  position: relative;
  border: 1px solid rgba(217, 180, 108, 0.52);
  border-radius: 6px;
  padding: 6px 8px;
  background:
    linear-gradient(180deg, rgba(217, 180, 108, 0.14), rgba(34, 24, 14, 0.75));
  box-shadow: inset 0 0 0 1px rgba(255, 236, 198, 0.12);
}

.ag-spring-dial [data-pillar="day"]::after,
.ag-spring-dial [data-pillar="hour"]::after,
.ag-spring-dial .ag-spring-dial__stable::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d9b46c;
  box-shadow: 0 0 0 2px rgba(217, 180, 108, 0.24);
}

/* =========================
   RESPONSIVE 320px LAYOUT
   ========================= */

@media (max-width: 560px) {
  .ag-desk {
    padding: 14px 11px 13px;
    border-radius: 10px;
  }

  .ag-desk::after {
    inset: 4px;
  }

  .ag-scroll-rack {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ag-scroll {
    grid-template-columns: 14px minmax(0, 1fr) 14px;
  }

  .ag-scroll__body {
    min-height: 0;
    padding: 11px 10px 10px;
  }

  .ag-lacquer-tray {
    padding: 10px 8px;
  }

  .ag-folio {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .ag-folio__spine {
    height: 8px;
    border-top: 0;
    border-bottom: 0;
    border-left: 2px solid #8a6432;
    border-right: 2px solid #8a6432;
    background: linear-gradient(
      180deg,
      rgba(35, 19, 10, 0.65) 0%,
      rgba(217, 180, 108, 0.45) 50%,
      rgba(35, 19, 10, 0.65) 100%
    );
  }

  .ag-folio__spine::before,
  .ag-folio__spine::after {
    display: none;
  }

  .ag-leaf {
    min-height: 0;
    padding: 12px 11px 11px;
  }

  .ag-leaf--white {
    border-right: 2px solid #967242;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
  }

  .ag-leaf--brown {
    border-left: 2px solid #967242;
    border-top: 0;
    border-radius: 0 0 4px 4px;
  }

  .ag-bamboo,
  .ag-clepsydra {
    padding: 10px 10px 11px;
  }

  .ag-spring-dial__pillars,
  .ag-spring-dial .ag-dial-pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-desk *,
  .ag-desk *::before,
  .ag-desk *::after,
  .ag-spring-dial * {
    transition: none !important;
    animation: none !important;
  }

  .ag-scroll:hover,
  .ag-scroll[aria-expanded="true"],
  .ag-bamboo:hover,
  .ag-leaf:hover,
  .ag-leaf[aria-expanded="true"],
  .ag-clepsydra:hover {
    transform: none;
  }
}

#case-vignette { margin: 12px 0 18px; }
.ag-desk { padding: 12px; border-radius: 2px; }
.ag-desk::after { display: none; }
.ag-spring-dial { position: relative; isolation: isolate; padding-block: 26px 11px; }
.ag-spring-dial::before {
  content: ""; position: absolute; inset: 13px 2.5% auto; height: 9px;
  background: repeating-linear-gradient(90deg,#251a10 0 1px,transparent 1px 8%),linear-gradient(#745238,#bf945e,#684426);
  border: 1px solid #ad855b;
  box-shadow: 0 4px 6px #140e09b4;
}
.ag-spring-dial::after {
  content: ""; position: absolute; top: 6px; left: 18%; width: 12px; height: 22px;
  background: linear-gradient(90deg,#924331,#d9955d,#823521);
  clip-path: polygon(2% 0,98% 0,88% 68%,50% 100%,12% 68%);
  transition: left .54s cubic-bezier(.2,.85,.2,1);
  pointer-events: none;
}
.ag-spring[data-phase="after"] .ag-spring-dial::after { left: calc(82% - 12px); }
.ag-spring-pillars { position: relative; gap: 6px; }
.ag-spring-pillars::after {
  content: ""; position: absolute; inset: auto 0 7px; height: 3px; background: #896345; box-shadow: 0 2px 2px #362318; pointer-events: none;
}
.ag-spring-pillar[data-role] {
  min-height: 115px; padding: 14px 3px 16px; border: 1px solid #a47b4c; border-radius: 4px;
  background: linear-gradient(90deg,#80503075,transparent 18% 78%,#77492c70),
    repeating-linear-gradient(93deg,#a4754847 0 1px,transparent 1px 7px), linear-gradient(147deg,#deba81,#b38455);
  box-shadow: 0 7px 8px #140f0b9c;
}
.ag-spring-pillar-label, .ag-spring-pillar-value, .ag-spring-pillar-state { color: #341f13; }
.ag-spring-pillar[data-role="shift"] :is(.ag-spring-pillar-value,.ag-spring-pillar-state) { color: #6b271a; }
#answer, #question-history p { white-space: pre-wrap; }
#question-status:empty, #answer:empty { display:none; }
#continue-question[disabled] { cursor: progress; opacity: .6; }
@media(prefers-reduced-motion:reduce) { .ag-spring-dial::after { transition: none; } }

.answer-source {
  display: inline; padding: 0 2px; border: none; color: inherit;
  background: transparent; font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: .24em;
}
.answer-source:hover, .answer-source:focus-visible { background-color: #9d693d2e; }

/* Paper and bamboo retain photographed fibres where the leaves open. */
.ag-scroll__body, .ag-scroll--alt .ag-scroll__body {
  background-image: linear-gradient(90deg,#3d220b44,#f4dfaf38 24% 74%,#3d220b40), var(--ag-atlas);
  background-size: 100% 100%, 800% 310%;
  background-repeat: no-repeat;
  background-position: center, 17% 48%;
  background-blend-mode: normal;
}
.ag-scroll--alt .ag-scroll__body { background-position: center, 34% 49%; }
.ag-leaf--white, .ag-leaf--brown {
  border-radius: 1px;
  background-image: linear-gradient(100deg,#f5dfb18c,#b2814d19 79%,#5f351f48), var(--ag-atlas);
  background-size: 100% 100%, 800% 340%;
  background-repeat: no-repeat;
  background-position: center, 72% 79%;
  background-blend-mode: normal;
}
.ag-leaf--brown { background-position: center, 96% 58%; }
.ag-leaf__who, .ag-leaf__state, .ag-scroll__cue { color: #442819; }
.ag-lacquer-tray, .ag-clepsydra { border-radius: 2px; }
.ag-lacquer-tray { box-shadow: none; }
.ag-desk[data-case="love"] { border-color: #845147; }
@media (prefers-reduced-motion: no-preference) {
  .ag-spring-pillar.is-crossing { animation: ag-slip-seating .53s cubic-bezier(.22,.82,.28,1) both; }
  .ag-spring-pillar.is-crossing:nth-child(2) { animation-delay: .075s; }
}
@keyframes ag-slip-seating {
  from { transform: translateY(-15px) perspective(270px) rotateX(-24deg); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}

/* Gemini 4 Argon High: calendar slider and lacquer receiving tray. */
/* Task 1: Chinese calendrical brass rule & vernier thumb in #ag-spring-exhibit */
#ag-spring-exhibit .ag-spring-dial {
  position: relative;
}
#ag-spring-exhibit .ag-spring-axis {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 49.4%, rgba(235, 194, 118, .65) 49.5%, rgba(235, 194, 118, .65) 50.5%, transparent 50.6%),
    repeating-linear-gradient(90deg, rgba(212, 172, 104, .42) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(235, 198, 132, .68) 0 1px, transparent 1px 40px),
    linear-gradient(180deg, #16100b 0%, #241911 52%, #140e0a 100%);
  background-size: 100% 100%, 100% 7px, 100% 12px, 100% 100%;
  background-position: center, center 4px, center 3px, center;
  background-repeat: no-repeat;
  border: 1px solid rgba(182, 141, 78, .52);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, .82),
    inset 0 -1px 0 rgba(236, 198, 128, .22),
    0 1px 2px rgba(0, 0, 0, .5);
}
#ag-spring-exhibit .ag-spring-range {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0 2px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
#ag-spring-exhibit .ag-spring-range:focus-visible {
  outline: 2px solid #f0cb82;
  outline-offset: 3px;
  border-radius: 4px;
}
#ag-spring-exhibit .ag-spring-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(214, 170, 96, .22), rgba(238, 198, 126, .42)),
    linear-gradient(180deg, #0d0906, #21160e);
  border: 1px solid rgba(178, 138, 76, .45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .9);
}
#ag-spring-exhibit .ag-spring-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 20px;
  margin-top: -8px;
  border-radius: 3px;
  border: 1px solid #f3d493;
  background:
    linear-gradient(90deg, transparent 46%, #2a1b0e 47%, #fbe3ae 50%, #2a1b0e 53%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(62, 40, 18, .45) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #ebd097 0%, #b98946 48%, #775225 85%, #9e7339 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 220, .75),
    0 2px 5px rgba(0, 0, 0, .78),
    0 0 0 1px rgba(40, 26, 14, .85);
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease;
}
#ag-spring-exhibit .ag-spring-range:hover::-webkit-slider-thumb,
#ag-spring-exhibit .ag-spring-range:active::-webkit-slider-thumb {
  transform: scale(1.04);
  box-shadow:
    inset 0 1px 0 #fff7df,
    0 0 10px rgba(234, 194, 118, .42),
    0 2px 6px rgba(0, 0, 0, .85);
}
#ag-spring-exhibit .ag-spring-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #140d08;
  border: 1px solid rgba(178, 138, 76, .45);
}
#ag-spring-exhibit .ag-spring-range::-moz-range-thumb {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #f3d493;
  background:
    linear-gradient(90deg, transparent 46%, #2a1b0e 47%, #fbe3ae 50%, #2a1b0e 53%, transparent 54%),
    linear-gradient(180deg, #ebd097 0%, #b98946 50%, #775225 100%);
  box-shadow: inset 0 1px 0 rgba(255, 246, 220, .75), 0 2px 5px rgba(0, 0, 0, .78);
}

/* Reactive Year & Month slips only; Day & Hour remain strictly fixed */
#ag-spring-exhibit .is-ag-mutable {
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), box-shadow .26s ease, border-color .26s ease;
}
#ag-spring-exhibit .is-ag-mutable.is-ag-shifting {
  transform: translateY(-2px);
  border-color: rgba(238, 198, 124, .78);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .55), inset 0 0 10px rgba(232, 190, 114, .22);
}
#ag-spring-exhibit [data-pillar="day"],
#ag-spring-exhibit [data-pillar="hour"] {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

/* Task 2: Understated lacquer & engraved brass receiving detail on #lot-cradle */
#lot-cradle {
  background-image:
    linear-gradient(90deg, rgba(218, 177, 108, .38) 0 2px, transparent 2px calc(100% - 2px), rgba(218, 177, 108, .38) calc(100% - 2px)),
    repeating-linear-gradient(90deg, rgba(208, 168, 98, .22) 0 1px, transparent 1px 12px),
    radial-gradient(ellipse at 50% 50%, rgba(44, 29, 18, .92) 0%, rgba(18, 12, 8, .98) 100%);
  border-color: rgba(186, 145, 82, .62);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, .88),
    inset 0 0 0 1px rgba(236, 198, 126, .24),
    inset 0 -1px 3px rgba(224, 182, 108, .18),
    0 2px 10px rgba(0, 0, 0, .55);
}
#lot-cradle.is-armed,
#lot-cradle:has(.ag-ritual-pickup-btn:not([hidden])) {
  border-color: rgba(234, 195, 122, .82);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, .9),
    inset 0 0 0 1px rgba(244, 208, 138, .45),
    inset 0 0 16px rgba(226, 184, 108, .16),
    0 2px 12px rgba(0, 0, 0, .62);
}
#v-stick-chosen {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .72));
}

/* Question receipt lacquer & brass entry response */
#question-receipt:not([hidden]) {
  border-color: rgba(194, 152, 86, .58);
  box-shadow:
    inset 0 1px 0 rgba(244, 210, 144, .22),
    inset 0 0 0 1px rgba(186, 144, 78, .18),
    0 6px 18px rgba(0, 0, 0, .48);
  animation: ag-receipt-settle .32s cubic-bezier(.22, 1, .36, 1);
}
@keyframes ag-receipt-settle {
  0% {
    box-shadow: inset 0 1px 0 rgba(250, 220, 158, .55), 0 2px 6px rgba(0, 0, 0, .35);
  }
}

@media (max-width: 340px) {
  #ag-spring-exhibit .ag-spring-axis { padding: 3px 5px; }
  #ag-spring-exhibit .ag-spring-range::-webkit-slider-thumb { width: 24px; }
  #ag-spring-exhibit .ag-spring-range::-moz-range-thumb { width: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #ag-spring-exhibit .ag-spring-range::-webkit-slider-thumb,
  #ag-spring-exhibit .is-ag-mutable,
  #question-receipt:not([hidden]) {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Integration: a single visible ruler with a workable touch target. */
#ag-spring-exhibit .ag-spring-dial:has(.ag-spring-range) {
  grid-template-columns: minmax(0, 1fr) minmax(130px, .9fr) minmax(0, 1fr);
  padding: 12px;
}
#ag-spring-exhibit .ag-spring-dial:has(.ag-spring-range)::before,
#ag-spring-exhibit .ag-spring-dial:has(.ag-spring-range)::after,
#ag-spring-exhibit .ag-spring-axis:has(.ag-spring-range) .ag-spring-axis-mark {
  display: none;
}
#ag-spring-exhibit .ag-spring-range { pointer-events: auto; min-width: 0; order: -1; }
#ag-spring-exhibit .ag-spring-axis:has(.ag-spring-range) { min-width: 0; }
@media (max-width: 500px) {
  #ag-spring-exhibit .ag-spring-dial:has(.ag-spring-range) {
    grid-template-columns: minmax(0, 1fr) minmax(78px, .8fr) minmax(0, 1fr);
    gap: 4px;
    padding: 8px 5px;
  }
  #ag-spring-exhibit .ag-spring-range { height: 37px; }
}

/* Opus 5.5 · shared desk-object template for the two reading exhibits (additive) */
.ag-set {
  container-type: inline-size;
  padding: 14px 12px 16px;
}
.ag-set .ag-desk__stage {
  display: grid;
  gap: 16px;
}
.ag-set .ag-lacquer-tray,.ag-set .ag-scroll-rack {
  margin: 0;
}
.ag-set .ag-desk__btn[data-obj] {
  position: relative;
  background-blend-mode: normal;
  transform: rotate(var(--ag-tilt,0deg));
  transition: transform .5s cubic-bezier(.2,.8,.2,1),width .45s cubic-bezier(.2,.8,.2,1),padding .4s ease,box-shadow .4s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ag-set .ag-desk__btn[data-obj]:hover {
  transform: rotate(var(--ag-tilt,0deg)) translateY(-2px);
}
.ag-set .ag-desk__btn[data-obj][aria-expanded="true"] {
  transform: translateY(var(--ag-lift,-4px));
  z-index: 2;
}
.ag-set [data-obj]::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: var(--ag-atlas) var(--ag-mark-p)/var(--ag-mark-s) no-repeat;
  transition: transform .55s cubic-bezier(.2,.8,.2,1),opacity .4s,left .55s cubic-bezier(.2,.8,.2,1);
}
.ag-set [data-mark="none"]::after {
  content: none;
}

/* Relationship: two corded xuan letters on a lacquer tray + bronze rule */
.ag-set .ag-lacquer-tray {
  padding: 12px 12px 18px;
  border-radius: 5px;
  border: 0;
  background: radial-gradient(120% 70% at 30% 0,#5a1d16a0,transparent 60%),linear-gradient(170deg,#2e100d,#160807 60%,#230c0a);
  box-shadow: inset 0 0 0 1px #c9a06a45,inset 0 0 0 5px #120605,inset 0 2px 14px #000c,0 12px 26px #000a;
}
.ag-set .ag-lacquer-tray__moment {
  margin: 2px 0 12px;
  font-size: 13px;
  letter-spacing: .3em;
  color: #e3c08a;
}
.ag-set .ag-folio {
  grid-template-columns: 1fr;
  gap: 12px;
  filter: none;
}
.ag-set .ag-folio__spine {
  display: none;
}
.ag-set [data-obj="letter"] {
  min-height: 0;
  padding: 14px 60px 14px 14px;
  border: 0;
  border-radius: 2px;
  color: #2a1c12;
  background: linear-gradient(var(--ag-wash,#fff4dc1c),var(--ag-wash,#fff4dc1c)),linear-gradient(100deg,#fff6e020,#6a42201f),var(--ag-atlas) var(--ag-skin-p)/var(--ag-skin-s) no-repeat;
  box-shadow: inset 0 1px 0 #fff8,0 10px 18px -6px #000d,0 2px 3px #0008;
}
.ag-set .ag-leaf--brown[data-obj] {
  --ag-wash: #a0703a36;
}
.ag-set [data-obj="letter"][aria-expanded="true"] {
  padding-right: 18px;
  box-shadow: inset 0 1px 0 #fff9,0 16px 24px -8px #000e;
}
.ag-set [data-obj="letter"]::before {
  content: "";
  position: absolute;
  inset: 0 26px 0 auto;
  width: 4px;
  height: auto;
  border-radius: 0;
  opacity: 1;
  background: linear-gradient(90deg,#5d140f,#a8352a 45%,#6a1912);
  box-shadow: 1px 0 2px #0006;
  transform-origin: 50% 0;
  transition: transform .45s ease .1s,opacity .3s .1s;
}
.ag-set [data-obj="letter"]::after {
  top: 4px;
  right: 6px;
  width: 54px;
  aspect-ratio: 175/240;
  mix-blend-mode: multiply;
  -webkit-mask: radial-gradient(60% 72% at 55% 32%,#000 55%,transparent);
  mask: radial-gradient(60% 72% at 55% 32%,#000 55%,transparent);
}
.ag-set [data-pose="untie"][aria-expanded="true"]::before {
  transform: scaleY(0);
  opacity: 0;
}
.ag-set [data-pose="untie"][aria-expanded="true"]::after {
  transform: translate(22px,48px) rotate(38deg);
  opacity: 0;
}
.ag-set [data-obj="letter"] .ag-leaf__top {
  padding: 0;
  flex-wrap: wrap;
}
.ag-set [data-obj="letter"] .ag-leaf__who {
  color: #8a2a1e;
  letter-spacing: .12em;
}
.ag-set [data-obj="letter"] .ag-leaf__state {
  color: #593a25;
}
.ag-set [data-obj="letter"] .ag-leaf__quote {
  font-size: 17px;
  line-height: 1.5;
}
.ag-set .ag-leaf__detail,
.ag-set .ag-scroll__note,
.ag-set .ag-bamboo__hint {
  color: #3b2417;
}
.ag-set [data-obj="rule"] {
  padding: 32px 16px 14px;
  border: 1px solid #d9b46c66;
  border-radius: 3px;
  background: linear-gradient(180deg,#f7dea81f,transparent 30%),repeating-linear-gradient(90deg,#00000016 0 1px,transparent 1px 3px),linear-gradient(170deg,#4a321a,#2a1b0e 55%,#1d1209);
  box-shadow: inset 0 1px 0 #f7dea860,inset 0 -3px 8px #000a,0 10px 20px #000b;
}
.ag-set [data-obj="rule"]::before {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  top: -16px;
  height: 16px;
  border: solid #b98a46;
  border-width: 0 3px;
}
.ag-set [data-obj="rule"] .ag-clepsydra__scale {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 11px;
  height: 12px;
  margin: 0;
}
.ag-set [data-obj="rule"] .ag-clepsydra__arrow {
  display: none;
}
.ag-set [data-obj="rule"]::after {
  top: 2px;
  left: 10px;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 3px 5px #000c;
}
.ag-set [data-pose="slide"][aria-expanded="true"]::after {
  left: calc(50% - 15px);
}
.ag-set [data-obj="rule"] .ag-clepsydra__line {
  font-size: 16px;
  line-height: 1.6;
  color: #f6e7c8;
}

/* Work: two photographed handscrolls + spreading bamboo-slip bundle */
.ag-set .ag-scroll-rack {
  grid-template-columns: 1fr;
  gap: 14px;
}
.ag-set [data-obj="scroll"] {
  width: 90%;
  grid-template-columns: 20px minmax(0,1fr) 20px;
  filter: drop-shadow(0 9px 12px #000b);
}
.ag-set [data-obj="scroll"]:nth-child(2) {
  justify-self: end;
}
.ag-set [data-obj="scroll"][aria-expanded="true"] {
  width: 100%;
}
.ag-set [data-obj="scroll"] .ag-scroll__body {
  min-height: 0;
  border: 0;
  background: linear-gradient(90deg,#4a2a1038,transparent 12% 88%,#4a2a1040),var(--ag-atlas) var(--ag-skin-p)/var(--ag-skin-s) no-repeat;
  background-blend-mode: normal;
  box-shadow: none;
}
.ag-set [data-obj="scroll"] .ag-scroll__fact {
  font-size: 16px;
}
.ag-set [data-obj="scroll"] .ag-scroll__roller {
  border-radius: 6px;
  background: var(--ag-atlas) var(--ag-roller-p)/var(--ag-roller-s) no-repeat;
  box-shadow: inset 0 0 4px #000a;
}
.ag-set [data-obj="scroll"] .ag-scroll__roller::before,.ag-set [data-obj="scroll"] .ag-scroll__roller::after {
  left: -3px;
  right: -3px;
  height: 16px;
  border: 0;
  border-radius: 3px;
  background: var(--ag-atlas) var(--ag-cap-p)/var(--ag-cap-s) no-repeat;
}
.ag-set [data-obj="slips"] {
  --ag-lift: -10px;
  padding: 18px calc(4% + 12px);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #24160a;
  color: #24170c;
  box-shadow: 0 10px 18px #000b;
}
.ag-set [data-obj="slips"]::before {
  content: "";
  position: absolute;
  top: -26px;
  bottom: -26px;
  left: 4%;
  right: 4%;
  height: auto;
  opacity: 1;
  border-radius: 0;
  background: none;
  border: 0 solid transparent;
  border-image: var(--ag-atlas) 118 78 146 1305 fill/26px 0/0 round;
  transition: left .55s cubic-bezier(.2,.8,.2,1),right .55s cubic-bezier(.2,.8,.2,1);
}
.ag-set [data-pose="spread"][aria-expanded="true"]::before {
  left: 0;
  right: 0;
}
.ag-set [data-pose="spread"][aria-expanded="true"] {
  box-shadow: 0 18px 26px #000d;
}
.ag-set [data-obj="slips"] .ag-bamboo__slip {
  margin: 0;
  padding: 6px 8px;
  border: 0;
  box-shadow: none;
  background: radial-gradient(farthest-side,#f3e2bd8c,#f3e2bd33 75%,transparent);
  text-shadow: 0 0 5px #f3dfb0;
}
.ag-set [data-obj="slips"] .ag-bamboo__quote {
  font-size: 15.5px;
}

@container (min-width: 460px) {
  .ag-set .ag-folio,.ag-set .ag-scroll-rack {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
  }
  .ag-set [data-obj="scroll"] {
    width: 94%;
  }
}
@media (prefers-reduced-motion:reduce)  {
  .ag-set [data-obj],.ag-set [data-obj]::before,.ag-set [data-obj]::after {
    transition: none!important;
  }
}
