@font-face {
  font-family: "Mother City Serif";
  src: url("https://mother-city.oss-cn-shanghai.aliyuncs.com/mc-public/897c36a4ac40b99c70c16c0f327114cd3d2ff0279dc8488063392c1d7190739a/Serif-Semibold.ttf") format("truetype"), url("../assets/scene-ui/v3/fonts/Serif-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mother City Sans";
  src: url("https://mother-city.oss-cn-shanghai.aliyuncs.com/mc-public/354aa0d0794c39e51080d4226bc08e13039fb4a479ec58129a4fede7795e8d71/Sans-Regular.ttf") format("truetype"), url("../assets/scene-ui/v3/fonts/Sans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #24352f;
  --ink-soft: #5f6d63;
  --paper: #fffaf0;
  --paper-deep: #f3ead7;
  --green: #325d4e;
  --green-pale: #dce9dd;
  --coral: #e7684a;
  --gold: #db9a38;
  --night: #17243b;
  --line: rgb(54 77 65 / 18%);
  --shadow: 0 18px 60px rgb(38 55 47 / 12%);
  /* Match the accepted room typography; never force handwriting on receipts. */
  --scene-hand: "HanziPen SC", "Kaiti SC", "STKaiti", "KaiTi", "Mother City Serif", serif;
  font-family: "Mother City Sans", system-ui, sans-serif;
  background: #e9e4d6;
  color: var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 8%, rgb(238 188 111 / 23%), transparent 28rem),
    linear-gradient(145deg, #ece8dc, #dfe8df 65%, #efe4d4);
}

button, input, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(231 104 74 / 42%);
  outline-offset: 3px;
}

.day-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 12px max(22px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid rgb(255 255 255 / 55%);
  background: rgb(248 244 233 / 88%);
  backdrop-filter: blur(22px);
}

.day-brand, .day-topbar a { color: inherit; text-decoration: none; }

.day-brand { display: flex; align-items: center; gap: 12px; }
.day-brand img { width: 44px; height: 44px; border-radius: 13px; }
.day-brand strong { display: block; font-family: "Mother City Serif", serif; font-size: 20px; }
.day-brand small { color: var(--ink-soft); }

.day-top-actions { display: flex; align-items: center; gap: 10px; }
.room-link, .account-scope summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 251 241 / 88%);
  cursor: pointer;
  list-style: none;
}
.account-scope { position: relative; }
.account-scope summary::-webkit-details-marker { display: none; }
.account-scope-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.account-scope-panel p { margin: 0 0 10px; line-height: 1.55; }
.account-scope-panel p:last-child { margin: 0; }
.account-scope-panel strong { color: var(--coral); }
.companion-capabilities { display: grid; gap: 8px; margin: 14px 0; }
.companion-capabilities div { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: #f1eadc; }
.companion-capabilities dt { font-weight: 700; }
.companion-capabilities dd { margin: 0; color: #806f5e; text-align: right; }
#last-verified-watch { padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }

.day-shell { width: min(1280px, calc(100% - 34px)); margin: 28px auto 80px; }

.day-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 32px;
  min-height: 460px;
  padding: clamp(28px, 5vw, 72px);
  border-radius: 38px;
  background:
    linear-gradient(90deg, rgb(255 249 236 / 95%), rgb(255 249 236 / 68%)),
    var(--mc-media-18e4f8c0ac013345, url("../assets/scene-ui/v3/art/room-day-desktop.png")) center / cover;
  box-shadow: var(--shadow);
}

.day-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -38% 46%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(234 158 71 / 25%), transparent 67%);
  pointer-events: none;
}

.day-eyebrow { margin: 0 0 10px; color: var(--coral); letter-spacing: .08em; font-weight: 700; }
.day-hero h1 { max-width: 720px; margin: 0; font-family: "Mother City Serif", serif; font-size: clamp(42px, 7vw, 88px); line-height: .98; }
.day-intro { max-width: 620px; margin: 28px 0 0; color: var(--ink-soft); font-size: clamp(17px, 2vw, 22px); line-height: 1.75; }

.day-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.day-nav a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 252 244 / 86%);
  color: var(--ink);
  text-decoration: none;
}
.day-nav a[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.day-nav .is-today { background: var(--green); color: white; }

.day-proof { margin: 18px 0 0; color: var(--ink-soft); font-size: 13px; }

.day-metrics {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.metric {
  min-height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 24px;
  background: rgb(255 252 244 / 78%);
  backdrop-filter: blur(12px);
}
.metric:first-child { grid-column: 1 / -1; background: rgb(35 57 49 / 90%); color: white; }
.metric strong { font-family: "Mother City Serif", serif; font-size: 40px; line-height: 1; }
.metric span { color: inherit; opacity: .76; }

.day-grid { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 24px; margin-top: 24px; align-items: start; }
.day-card { padding: clamp(24px, 4vw, 42px); border: 1px solid rgb(255 255 255 / 64%); border-radius: 30px; background: rgb(255 250 240 / 90%); box-shadow: var(--shadow); }
.day-card h2 { margin: 0; font-family: "Mother City Serif", serif; font-size: clamp(30px, 4vw, 48px); }
.day-card-copy { font-size: 19px; line-height: 1.8; }
.day-source, .day-status { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.day-card button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.day-card .primary-action { background: var(--green); color: white; border-color: transparent; }

.lit-stars { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.day-chip { padding: 8px 12px; border-radius: 999px; background: var(--green-pale); color: var(--green); }
.day-chip.is-muted { background: #eee9df; color: #777268; }
.day-chip.is-night { background: rgb(255 216 126 / 18%); color: #ffe4a4; border: 1px solid rgb(255 225 162 / 25%); }

.seeds-panel { grid-row: span 2; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading p { margin: 0; color: var(--ink-soft); }
.seed-list { display: grid; gap: 14px; }
.seed-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgb(255 254 249 / 84%); }
.seed-heading { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.seed-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #f5dba9; color: #754d1c; font-weight: 700; }
.seed-heading h3 { margin: 4px 0 0; font-size: 20px; }
.seed-heading small { color: var(--ink-soft); }
.seed-response-state { padding: 7px 10px; border-radius: 999px; font-size: 12px; }
.seed-response-state.is-ready { background: var(--green-pale); color: var(--green); }
.seed-response-state.is-waiting { background: #f2e9dc; color: #806f5e; }
.seed-card blockquote { margin: 18px 0 5px; padding-left: 16px; border-left: 3px solid var(--coral); font-family: "Mother City Serif", serif; font-size: 20px; line-height: 1.65; }
.seed-response-source, .seed-waiting-copy { color: var(--ink-soft); }
.seed-details { margin-top: 14px; border-top: 1px solid var(--line); }
.seed-details summary { padding: 14px 0 8px; cursor: pointer; color: var(--green); }
.seed-details p { white-space: pre-wrap; line-height: 1.75; }
.seed-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.correction-form { margin-top: 14px; padding: 16px; border-radius: 16px; background: #f1eadc; }
.correction-form label { display: grid; gap: 8px; }
.correction-form textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; resize: vertical; }
.correction-form div { display: flex; gap: 8px; margin-top: 10px; }
.correction-form p { color: #855537; }
.empty-seeds { padding: 30px; border: 1px dashed var(--line); border-radius: 20px; text-align: center; color: var(--ink-soft); }

.night-card { position: relative; overflow: hidden; background: var(--night); color: #f9f2df; }
.night-card::before { content: ""; position: absolute; inset: -30% -10% auto 44%; height: 70%; background: radial-gradient(circle, rgb(233 176 91 / 26%), transparent 65%); }
.night-card > * { position: relative; z-index: 1; }
.night-layout { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: center; margin-top: 28px; }
.day-orb { width: 130px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 36% 34%, #fff7c8, #f1b14e 26%, #ad5e3b 58%, transparent 70%); filter: drop-shadow(0 0 22px rgb(255 193 92 / 60%)); }
.day-orb[data-state="forming"] { opacity: .45; filter: grayscale(.35) drop-shadow(0 0 12px rgb(255 193 92 / 28%)); }
.day-orb[data-state="empty"] { opacity: .12; filter: grayscale(1); }
.night-copy h3 { margin: 0 0 6px; font-family: "Mother City Serif", serif; font-size: 24px; }
.night-copy p { line-height: 1.7; color: rgb(249 242 223 / 78%); }
.night-card button { color: #f9f2df; border-color: rgb(255 255 255 / 20%); background: rgb(255 255 255 / 8%); }
.night-card .primary-action { background: #f1c675; color: #2b342f; }

.day-footer { margin-top: 24px; padding: 18px; text-align: center; color: var(--ink-soft); }

/* Display and companion voice only. Inputs, dates, counts and proof stay legible. */
.day-hero h1,
.day-eyebrow,
.day-intro,
.day-card h2,
.day-card-copy,
.seed-heading h3,
.seed-card blockquote,
.night-copy h3,
.room-link,
.day-nav a,
.day-card button {
  font-family: var(--scene-hand);
}

.day-hero h1 { line-height: 1.2; }
.day-card h2, .night-copy h3 { line-height: 1.4; }

@media (max-width: 860px) {
  .day-topbar { padding-inline: 16px; }
  .room-link { display: none; }
  .day-shell { width: min(100% - 20px, 720px); margin-top: 10px; }
  .day-hero { grid-template-columns: 1fr; min-height: 620px; padding: 30px 24px; border-radius: 28px; background-image: linear-gradient(180deg, rgb(255 249 236 / 96%) 0 43%, rgb(255 249 236 / 44%)), var(--mc-media-c2567d005e8477fe, url("../assets/scene-ui/v3/art/room-day-mobile.png")); background-position: center 28%; }
  .day-metrics { align-self: end; }
  .day-grid { grid-template-columns: 1fr; }
  .seeds-panel { grid-row: auto; }
}

@media (max-width: 520px) {
  .day-brand small { display: none; }
  .day-brand strong { font-size: 18px; }
  .account-scope summary { padding-inline: 12px; }
  .companion-capabilities div { grid-template-columns: 1fr; gap: 3px; }
  .companion-capabilities dd { text-align: left; }
  .day-hero { min-height: 660px; }
  .day-hero h1 { font-size: 45px; }
  .day-intro { font-size: 16px; }
  .day-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 105px; padding: 14px; }
  .metric strong { font-size: 34px; }
  .day-card { padding: 24px 18px; border-radius: 24px; }
  .section-heading { align-items: start; flex-direction: column; }
  .seed-heading { grid-template-columns: auto 1fr; }
  .seed-response-state { grid-column: 2; justify-self: start; }
  .night-layout { grid-template-columns: 1fr; }
  .day-orb { width: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Account data is hidden before scripts run and cleared on lifecycle lock. */
[hidden] { display: none !important; }
html:not([data-account-state="ready"]) .day-shell { display: none !important; }
.day-lock { max-width: 580px; margin: 10vh auto; padding: 28px; line-height: 1.8; }
.day-lock button, .account-scope-panel button, #day-quality { font: inherit; padding: .5rem .8rem; }
.seed-raw p { white-space: pre-wrap; overflow-wrap: anywhere; }
#day-night-form { margin-top: 1rem; }
#day-night-form label { display: grid; gap: .5rem; margin-bottom: 1rem; }
#day-night-form textarea { width: 100%; box-sizing: border-box; }

/* Night form uses the existing paper/ink palette; geometry and behavior stay intact. */
#day-night-form label { color: var(--ink); }
#day-night-form button {
  color: var(--green);
  background-color: var(--paper);
  border-color: var(--green);
}
#day-night-form button:not(:disabled):hover {
  color: var(--ink);
  background-color: var(--green-pale);
}
#day-night-form button:not(:disabled):active {
  color: var(--paper);
  background-color: var(--green);
}
#day-night-form button:focus-visible { outline-color: var(--green); }
#day-night-form button:disabled {
  color: var(--ink-soft);
  background-color: var(--paper-deep);
  border-color: var(--ink-soft);
}
