/* ============================================================================
   HOME EXTENSIONS: DESIGN DOSSIER · 24H CIRCADIAN DIAL · LIVE GUESTBOOK
   Cohesive Cream-Paper (#fcf8ef) + Olive (#535d35) + Amber (#c88353) Museum UI
   High specificity (.exhibit ...) prevents home-exhibit.css button resets!
   ============================================================================ */

.ext-section {
  position: relative;
  padding-top: clamp(68px, 8vw, 112px);
  padding-bottom: clamp(56px, 7vw, 96px);
  border-top: 1px solid rgba(83, 93, 53, .14);
}
.ext-section [hidden] {
  display: none !important;
}
.ext-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.15fr);
  gap: 20px 44px;
  align-items: end;
  margin-bottom: 30px;
}
.ext-head h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  color: #3d4528;
  letter-spacing: -.01em;
}
.ext-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  color: #676654;
}
.ext-lead strong {
  color: #3d4528;
}

/* Shared Museum Pill Buttons (scoped under .exhibit to win specificity!) */
.exhibit .ext-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.exhibit .ext-tab,
.exhibit .ext-btn,
.exhibit .gb-sticker-btn {
  border: 1px solid rgba(83, 93, 53, .24);
  background: #f5efe0;
  color: #4f5834;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .18s ease;
}
.exhibit .ext-tab:hover,
.exhibit .ext-btn:hover,
.exhibit .gb-sticker-btn:hover {
  background: #eae0c7;
  transform: translateY(-1px);
}
.exhibit .ext-tab.is-active,
.exhibit .ext-btn.is-primary,
.exhibit .ext-btn.is-active,
.exhibit .gb-sticker-btn.is-selected {
  background: #535d35;
  color: #fffdf7;
  border-color: #535d35;
}
.exhibit .ext-btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* ============================================================================
   MODULE 01: DESIGN DOSSIER & LIVE IP SPRITE INSPECTOR
   ============================================================================ */
.ip-inspector-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: stretch;
}
.sprite-bench {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 22px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .18);
  box-shadow: 0 14px 36px rgba(68, 58, 38, .08);
}
.bench-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  color: #6c724c;
}
.sprite-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(83, 93, 53, .05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(83, 93, 53, .05) 1px, transparent 1px) 0 0 / 24px 24px,
    #f8f2e4;
  border: 1px solid rgba(83, 93, 53, .16);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.sprite-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(200, 131, 83, .22) 50%, transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(86% - .5px), rgba(83, 93, 53, .25) 86%, transparent calc(86% + .5px));
}
.sprite-canvas {
  width: min(76%, 290px);
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
}
.sprite-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.exhibit .sprite-controls .ext-btn {
  padding: 7px 12px;
  font-size: 12px;
}
.fps-slider {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #535d35;
}
.fps-slider input {
  width: 84px;
  accent-color: #535d35;
}
.frame-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.exhibit .frame-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(83, 93, 53, .18);
  background: #f5efe0;
  color: #6b704e;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.frame-cell .frame-num {
  font: 700 11px/1 ui-monospace, monospace;
}
.frame-cell small {
  font-size: 10px;
  opacity: .8;
}
.exhibit .frame-cell.is-current {
  background: #535d35;
  color: #fffdf7;
  border-color: #535d35;
}

.ip-spec-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spec-card {
  padding: 20px 22px;
  border-radius: 20px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .16);
  box-shadow: 0 10px 28px rgba(68, 58, 38, .06);
}
.spec-kicker {
  display: block;
  font: 600 10.5px/1.2 ui-monospace, SFMono-Regular, monospace;
  letter-spacing: .14em;
  color: #82865f;
  margin-bottom: 8px;
}
.spec-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #3d4528;
}
.spec-card > p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #626052;
}
.spec-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
}
.spec-metrics div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f0e1;
}
.spec-metrics dt {
  font-size: 11px;
  color: #7d815f;
}
.spec-metrics dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #3d4528;
}
.palette-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.exhibit .palette-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(83, 93, 53, .15);
  background: #faf5e8;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.exhibit .palette-chip:hover {
  transform: translateY(-1px);
  border-color: #535d35;
}
.palette-chip i {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(60, 56, 40, .18);
  flex-shrink: 0;
}
.palette-chip span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.palette-chip strong {
  font-size: 12.5px;
  color: #3d4528;
}
.palette-chip small {
  font-size: 10.5px;
  color: #7c7a66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-toast {
  margin: 8px 0 0;
  min-height: 18px;
  font-size: 12px;
  color: #535d35;
  font-weight: 600;
}

/* Tab 2: 6 Miniature Scenes Wall */
.scenes-dossier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.scene-spec-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .16);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(68, 58, 38, .06);
}
.scene-spec-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3ecdb;
  padding: 12px;
  display: grid;
  place-items: center;
}
.scene-spec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.scene-spec-code {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 246, .9);
  font: 600 10px/1 ui-monospace, monospace;
  color: #3d4528;
}
.scene-spec-code::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, #909d66);
}
.scene-spec-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.scene-spec-body h4 {
  margin: 0;
  font-size: 16px;
  color: #3d4528;
}
.scene-spec-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #666454;
  flex: 1;
}
.ext-inline-link {
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 600;
  color: #535d35;
  text-decoration: none;
  border-bottom: 1px solid rgba(83, 93, 53, .38);
  padding-bottom: 2px;
}
.ext-inline-link:hover {
  color: #c88353;
  border-color: #c88353;
}

/* Tab 3: 5-Dimension Interaction Matrix */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.matrix-card {
  padding: 20px 22px;
  border-radius: 20px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .16);
  box-shadow: 0 10px 26px rgba(68, 58, 38, .06);
}
.matrix-tech {
  display: inline-block;
  font: 600 10.5px/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
  color: #9e6b43;
  margin-bottom: 8px;
}
.matrix-card h4 {
  margin: 0 0 8px;
  font-size: 17px;
  color: #3d4528;
}
.matrix-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: #626052;
}

/* ============================================================================
   MODULE 02: 24H CIRCADIAN RHYTHM DIAL & PHYSIOLOGICAL GROWTH CURVE
   ============================================================================ */
.rhythm-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 24px;
  align-items: stretch;
}
.dial-cabinet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 22px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .18);
  box-shadow: 0 14px 36px rgba(68, 58, 38, .08);
}
.dial-stage {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.dial-stage:active {
  cursor: grabbing;
}
.dial-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.dial-hour-label {
  font: 600 10px/1 ui-monospace, SFMono-Regular, monospace;
  fill: #6c724c;
}
.dial-knob {
  fill: #c88353;
  stroke: #fffdf8;
  stroke-width: 3;
  filter: drop-shadow(0 4px 10px rgba(80, 52, 24, .32));
}
.dial-center-time {
  font: 600 32px/1 "Avenir Next", ui-monospace, sans-serif;
  fill: #3d4528;
  font-variant-numeric: tabular-nums;
}
.dial-center-sub {
  font: 600 11px/1 "PingFang SC", sans-serif;
  fill: #82865f;
}
.dial-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  font-size: 11px;
  color: #6c724c;
}
.dial-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dial-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.moment-pills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.exhibit .moment-pills .ext-btn {
  padding: 6px 4px;
  font: 600 11px/1.2 ui-monospace, monospace;
  text-align: center;
}

.rhythm-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rhythm-readout-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.activity-meter {
  margin-top: 6px;
}
.activity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 11px/1.2 ui-monospace, monospace;
  color: #6c724c;
  margin-bottom: 7px;
}
.activity-head strong {
  font-size: 14px;
  color: #3d4528;
}
.activity-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(83, 93, 53, .12);
  overflow: hidden;
}
.activity-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #718466;
  transition: width .35s cubic-bezier(.22, 1, .36, 1), background .35s ease;
}

.growth-curve-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.curve-legend-inline {
  font-size: 10.5px;
  letter-spacing: .04em;
}
.growth-svg {
  display: block;
  width: 100%;
  height: auto;
}
.curve-node {
  cursor: pointer;
  outline: none;
}
.curve-ring {
  fill: rgba(200, 131, 83, .0);
  stroke: rgba(200, 131, 83, 0);
  stroke-width: 1.5;
  transition: fill .2s ease, stroke .2s ease;
}
.curve-dot {
  fill: #fffdf8;
  stroke: #c88353;
  stroke-width: 2.5;
  transition: fill .2s ease;
}
.curve-node.is-selected .curve-ring,
.curve-node:hover .curve-ring {
  fill: rgba(200, 131, 83, .16);
  stroke: rgba(200, 131, 83, .5);
}
.curve-node.is-selected .curve-dot {
  fill: #c88353;
}
.curve-xlabel {
  font: 600 10.5px/1 ui-monospace, monospace;
  fill: #6c724c;
}
.curve-telemetry-foot {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f6f0e1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  font-size: 13px;
  color: #5b594b;
}
.curve-telemetry-foot strong {
  color: #3d4528;
}
.curve-telemetry-foot b {
  color: #535d35;
}

/* ============================================================================
   MODULE 03: LIVE CLOUD EXHIBITION GUESTBOOK
   ============================================================================ */
.guestbook-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 28px;
  align-items: start;
}
.gb-composer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 22px;
  background: #fffdf8;
  border: 1px solid rgba(83, 93, 53, .18);
  box-shadow: 0 14px 36px rgba(68, 58, 38, .08);
}
.gb-composer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font: 600 11px/1.2 ui-monospace, monospace;
  letter-spacing: .1em;
  color: #82865f;
}
.gb-composer-head strong {
  color: #535d35;
}
.gb-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #535d35;
}
.gb-field > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gb-field small {
  font: 500 11px/1 ui-monospace, monospace;
  color: #8c8a72;
}
.gb-field input,
.gb-field select,
.gb-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(83, 93, 53, .24);
  background: #fcf8ef;
  color: #2f3522;
  font: 400 13.5px/1.5 inherit;
  resize: vertical;
}
.gb-field input:focus,
.gb-field select:focus,
.gb-field textarea:focus {
  outline: 2px solid #909d66;
  border-color: #535d35;
}
.gb-stickers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #535d35;
}
.gb-sticker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.exhibit .gb-sticker-btn {
  padding: 6px 12px;
  font-size: 12px;
}
.gb-submit-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.gb-status {
  font-size: 12px;
  color: #535d35;
  font-weight: 600;
}

.gb-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.gb-note-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(170deg, #fffdf8 0%, #f8f1df 100%);
  border: 1px solid rgba(138, 114, 72, .24);
  box-shadow: 0 10px 26px rgba(68, 58, 38, .08);
  transform: rotate(var(--note-rot, 0deg));
  transition: transform .25s ease, box-shadow .25s ease;
}
.gb-note-card:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 16px 34px rgba(68, 58, 38, .13);
}
.gb-note-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #82865f;
}
.gb-note-sticker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #efe4ca;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.gb-note-ch {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(83, 93, 53, .1);
  color: #4f5834;
  font-weight: 600;
}
.gb-note-top time {
  margin-left: auto;
  font: 500 10px/1 ui-monospace, monospace;
}
.gb-note-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #363c26;
  flex: 1;
}
.gb-note-author {
  font-size: 12px;
  font-weight: 600;
  color: #7c7a66;
  text-align: right;
}

/* ============================================================================
   RESPONSIVE TABLET & MOBILE ADAPTATION
   ============================================================================ */
@media (max-width: 980px) {
  .ext-head,
  .ip-inspector-grid,
  .rhythm-grid,
  .guestbook-layout {
    grid-template-columns: 1fr;
  }
  .scenes-dossier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ext-section {
    padding-top: 48px;
    padding-bottom: 44px;
  }
  .sprite-bench,
  .spec-card,
  .dial-cabinet,
  .gb-composer {
    padding: 16px 14px;
  }
  .frame-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .moment-pills {
    grid-template-columns: repeat(3, 1fr);
  }
  .palette-list,
  .spec-metrics,
  .gb-field-row,
  .scenes-dossier-grid {
    grid-template-columns: 1fr;
  }
  .fps-slider {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}
