/* Tía Corazoncito Learning Center | design preview */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
  /* Palette from the authenticated MAPI dashboard. */
  --bg: #170d19;
  --surface: #281527;
  --panel: #372233;
  --ink: #fff2e6;
  --muted: #d1b5c7;
  --line: #70445e;
  --brand: #ff8bc0;
  --accent: #ff8bc0;
  --button: #ffe3a4;
  --on-button: #351022;
  --focus: #ffd77b;
  --backdrop: radial-gradient(ellipse at 87% 0, #461630 0, transparent 42rem);
  --hero-surface: radial-gradient(ellipse at 87% 85%, #ce2f7b7a 0%, transparent 53%), linear-gradient(116deg, #511634 0%, #571934 38%, #722044 72%, #64234a 100%);
  --hero-sub: #f3d2df;
  --hero-detail: #ffdda0;
  --hero-button: linear-gradient(110deg, #ffe3a4, #ffc76e);
  --card-surface: linear-gradient(145deg, #452337 -45%, #281826 82%);
  --shadow: 0 16px 50px rgb(9 3 8 / 23%);
  color-scheme: dark;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--backdrop), var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button:disabled { cursor: default; opacity: .55; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
.shell {
  width: min(100%, 1216px);
  margin-inline: auto;
  padding: 0 clamp(20px, 4.8vw, 64px);
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 50px; height: 50px; flex: 0 0 auto; object-fit: contain; }
.brand-text { display: grid; gap: 2px; line-height: 1.12; }
.brand-text strong { font: 700 22px/1.15 var(--serif); letter-spacing: -.045em; }
.brand-text small { font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.locale, .locale button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: .83rem;
  font-weight: 700;
}
.locale:has(button) { min-width: 0; padding: 0; border: 0; }
.locale svg { width: 16px; height: 16px; }
main { min-width: 0; }
.design-picker {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  margin: 24px 0 26px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.design-picker button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .45em;
  min-height: 43px;
  padding: 6px clamp(12px, 2.1vw, 24px);
  border: 1px solid transparent;
  border-radius: inherit;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 650;
  line-height: 1.2;
}
.design-picker svg { width: 16px; height: 16px; flex: 0 0 auto; }
.design-picker button[aria-pressed="true"] {
  background: var(--button);
  color: var(--on-button);
  box-shadow: 0 2px 4px rgb(54 20 32 / 12%);
}
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--hero-surface);
  box-shadow: var(--shadow);
}
.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(26px, 4.3vw, 67px);
}
.eyebrow, .flow-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: .69rem;
  font-weight: 760;
  line-height: 1.5;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hero-copy > .eyebrow::before { content: ""; width: 23px; height: 1px; background: currentColor; }
h1 {
  margin-top: 15px;
  max-width: 14ch;
  color: var(--ink);
  font: 500 clamp(2.45rem, 5.3vw, 4.8rem)/.98 var(--serif);
  letter-spacing: -.064em;
  text-wrap: balance;
}
.intro { max-width: 44ch; margin-top: 19px; color: var(--muted); font-size: clamp(.96rem, 1.6vw, 1.08rem); }
.hero-cta, .flow-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 47px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--button);
  color: var(--on-button);
  font-size: .92rem;
  font-weight: 720;
  line-height: 1.32;
}
.hero-cta { margin-top: 24px; }
.hero-cta svg { width: 18px; height: 18px; }
.hero-art { position: relative; min-width: 0; display: grid; place-items: center; overflow: hidden; }
.journal-art, .orbit-art { position: relative; width: 100%; height: 100%; }
.journal-art { display: grid; place-items: center; }
.orbit-art, [data-design="orbit"] .journal-art { display: none; }
.journal-art > svg, .orbit-art > svg { width: 100%; max-height: 450px; height: auto; }
[data-design="journal"] .hero-art {
  border-left: 1px solid #e5c3c5;
  background-color: #f1d8d7;
  background-image: radial-gradient(rgb(140 72 84 / 15%) .65px, transparent .95px);
  background-size: 7px 7px;
}
.workspace { margin-top: clamp(30px, 4vw, 52px); }
.section-heading { margin-bottom: 19px; }
.section-heading h2 {
  margin-top: 3px;
  color: var(--ink);
  font: 500 clamp(1.8rem, 3.2vw, 2.65rem)/1.12 var(--serif);
  letter-spacing: -.047em;
  text-wrap: balance;
}
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 95px;
  padding: 17px 21px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}
.tool-icon {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border-radius: 15px;
  background: #f4dce0;
  color: #8c3457;
}
[data-flow="observation"] .tool-icon { background: #f1dfcc; color: #805128; }
[data-flow="staffing"] .tool-icon { background: #e5e3d5; color: #52634b; }
[data-flow="word"] .tool-icon { background: #ebdfee; color: #794971; }
.tool-icon svg { width: 23px; height: 23px; }
.tool-copy { display: grid; gap: 3px; min-width: 0; }
.tool-copy strong { font-size: 1.025rem; line-height: 1.3; font-weight: 740; letter-spacing: -.022em; }
.tool-copy small { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.tool-arrow { align-self: center; color: var(--accent); font-size: 1.1rem; }
.tool-arrow svg { width: 18px; height: 18px; }
.preview-note { margin-top: 32px; padding: 18px 0 max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; }
.preview-note a { color: inherit; text-underline-offset: .15em; }

/* The alternate layout and the palette are independent choices. */
body[data-theme="light"] {
  --bg: #fff2e6;
  --surface: #fffbf5;
  --panel: #f2e4e3;
  --ink: #351526;
  --muted: #69515f;
  --line: #cfaebd;
  --brand: #872152;
  --accent: #872152;
  --button: #742342;
  --on-button: #fff8ed;
  --focus: #8e4a00;
  --backdrop: radial-gradient(ellipse at 87% 0, #ffdfdf 0, transparent 42rem);
  --hero-surface: linear-gradient(116deg, #fff8e8, #ffe8e8);
  --hero-sub: #69515f;
  --hero-detail: #84214b;
  --hero-button: linear-gradient(110deg, #81234a, #62162f);
  --card-surface: linear-gradient(145deg, #fffaf5, #fff6ee);
  --shadow: 0 15px 46px rgb(77 41 49 / 7%);
  color-scheme: light;
}
[data-design="orbit"] .brand-text strong { font-family: var(--sans); font-size: 19px; }
[data-design="orbit"] .design-picker { margin-inline: auto; }
[data-design="orbit"] .hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  border-radius: 30px;
  background: var(--hero-surface);
}
[data-design="orbit"] .hero-copy { grid-column: 2; grid-row: 1; padding-left: clamp(20px, 3vw, 47px); }
[data-design="orbit"] .hero-art {
  grid-column: 1; grid-row: 1;
  background: radial-gradient(ellipse at center, #722044, #35162c 66%, #281527);
}
[data-design="orbit"] .orbit-art { display: grid; place-items: center; }
[data-design="orbit"] h1 { font: 680 clamp(2.25rem, 4.65vw, 4.35rem)/1.02 var(--sans); letter-spacing: -.065em; }
[data-design="orbit"] .hero-cta { border-radius: 999px; }
[data-design="orbit"] .section-heading h2 { font: 660 clamp(1.6rem, 2.5vw, 2.15rem)/1.16 var(--sans); letter-spacing: -.045em; }
[data-design="orbit"] .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-design="orbit"] .tool-card { display: flex; flex-direction: column; align-items: start; justify-content: start; gap: 17px; min-height: 150px; padding: 18px; background: var(--card-surface); }
[data-design="orbit"] .tool-icon { width: 40px; height: 40px; border: 1px solid #8a5265; border-radius: 50%; background: #583344; color: #f4bbc9; }
[data-design="orbit"] [data-flow="observation"] .tool-icon { border-color: #846043; background: #503a2f; color: #f0c696; }
[data-design="orbit"] [data-flow="staffing"] .tool-icon { border-color: #65715b; background: #364538; color: #c2d5b5; }
[data-design="orbit"] [data-flow="word"] .tool-icon { border-color: #77567e; background: #49344f; color: #e5c1e7; }
[data-design="orbit"] .tool-arrow { position: absolute; top: 23px; right: 17px; }

/* Native dialog: dialog and form colors follow the selected visual system. */
body:has(dialog[open]) { overflow: hidden; }
#flow-dialog, #preferences-dialog {
  width: min(600px, calc(100% - 36px));
  max-width: none;
  max-height: min(88vh, 880px);
  max-height: min(88dvh, 880px);
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 35px 100px rgb(34 10 24 / 35%);
  scrollbar-width: thin;
}
#flow-dialog::backdrop, #preferences-dialog::backdrop { background: rgb(37 17 29 / 56%); }
#close-dialog {
  position: sticky;
  top: 14px;
  z-index: 2;
  float: right;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 14px 16px 0 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}
#close-dialog svg { width: 20px; height: 20px; }
#flow-content { padding: 30px clamp(21px, 4vw, 35px) 35px; overflow-wrap: break-word; }
#flow-content .flow-eyebrow { padding-right: 8px; }
#flow-title { margin: 10px 40px 0 0; font: 550 clamp(1.95rem,4vw,2.65rem)/1.07 var(--serif); letter-spacing: -.045em; text-wrap: balance; }
[data-design="orbit"] #flow-title { font: 670 clamp(1.75rem, 3.2vw, 2.2rem)/1.12 var(--sans); }
.flow-intro { clear: both; margin: 12px 0 20px; color: var(--muted); font-size: .97rem; }
.flow-panel { margin-block: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.flow-stack { display: grid; gap: 13px; }
.flow-row, .flow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.flow-actions { margin-block: 16px 3px; }
.flow-label { display: block; margin-block: 6px; color: var(--ink); font-weight: 690; font-size: .93rem; }
.flow-note, .flow-status { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.flow-status:not(:empty) { margin-top: 10px; }
.flow-time { color: var(--accent); font: 720 .82rem/1.4 var(--sans); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.flow-meter { color: var(--accent); font-weight: 720; }
.flow-output { display: block; margin-top: 8px; color: var(--ink); }
.flow-story { margin-top: 7px; line-height: 1.55; }
.flow-word { display: block; color: var(--accent); font: 580 clamp(1.55rem, 4vw, 2.2rem)/1.18 var(--serif); letter-spacing: -.025em; }
#flow-content h3 { margin-block: 4px 7px; font-size: 1.13rem; line-height: 1.35; letter-spacing: -.02em; }
#flow-content :is(label, legend) { font-weight: 650; }
#flow-content fieldset { min-width: 0; margin: 12px 0; padding: 0; border: 0; }
#flow-content legend { margin-bottom: 7px; }
#flow-content :is(input, select, textarea) { max-width: 100%; accent-color: var(--button); }
#flow-content :is(select, textarea, input[type=number], input[type=text]) {
  padding: 10px 12px;
  min-height: 45px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
#flow-content select, #flow-content textarea { display: block; width: 100%; }
#flow-content textarea { resize: vertical; line-height: 1.45; min-height: 110px; }
#flow-content input[type=number] { width: 6em; }
#flow-content input[type=range] { display: block; width: 100%; min-height: 42px; margin: 0; cursor: pointer; }
#flow-content button:not(.flow-primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 44px;
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.3;
}
#flow-content .flow-chip[aria-pressed=true] { background: var(--button); color: var(--on-button); border-color: var(--button); }
#flow-content .flow-chip { border-radius: 999px; }
#flow-content button svg { width: 18px; height: 18px; }

@media (hover: hover) {
  .tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
  .tool-card:hover .tool-arrow { transform: translateX(2px); }
  .hero-cta:hover, .flow-primary:hover { filter: brightness(1.07); }
  .design-picker button:not([aria-pressed=true]):hover, .locale:hover, #flow-content .flow-secondary:hover { border-color: var(--accent); }
}
@media (max-width: 820px) {
  [data-design="orbit"] .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { padding-inline: max(17px, env(safe-area-inset-left)) max(17px, env(safe-area-inset-right)); }
  .masthead { min-height: 75px; }
  .brand { gap: 9px; }
  .brand-logo { width: 42px; height: 42px; }
  .brand-text strong { font-size: 20px; }
  .brand-text small { font-size: 9px; }
  .locale, .locale button { padding-inline: 10px; }
  .design-picker { margin: 17px auto 18px; }
  .hero, [data-design="orbit"] .hero { grid-template-columns: minmax(0, 1fr); border-radius: 21px; }
  .hero-copy, [data-design="orbit"] .hero-copy { display: block; padding: 25px 23px; grid-column: 1; grid-row: 1; }
  h1, [data-design="orbit"] h1 { max-width: 16ch; margin-top: 9px; font-size: clamp(2.2rem, 8vw, 3.15rem); }
  .intro { max-width: 45ch; margin-top: 10px; }
  .hero-cta { margin-top: 17px; min-height: 45px; padding: 9px 15px; }
  .hero-art, [data-design="orbit"] .hero-art { grid-column: 1; grid-row: 2; max-height: 235px; }
  .journal-art, .orbit-art { min-height: 0; }
  .journal-art > svg, .orbit-art > svg { width: 100%; height: 100%; max-height: 221px; }
  [data-design="journal"] .hero-art { border-left: 0; border-top: 1px solid #e5c3c5; }
  [data-design="orbit"] .hero-copy { padding-bottom: 10px; }
  [data-design="orbit"] .hero-art { margin: 0 11px 12px; border-radius: 14px; }
  .workspace { margin-top: 27px; }
  .section-heading { margin-bottom: 13px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .tool-card { gap: 11px; min-height: 80px; padding: 13px; border-radius: 14px; }
  .tool-icon { width: 42px; height: 42px; border-radius: 12px; }
  .tool-copy small { font-size: .82rem; }
  [data-design="orbit"] .tool-card { min-height: 147px; padding: 14px; gap: 12px; }
  [data-design="orbit"] .tool-arrow { top: 18px; right: 13px; }
  .preview-note { margin-top: 24px; }
  #flow-dialog, #preferences-dialog {
    width: min(100%, 560px);
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto auto 0;
    border-radius: 22px 22px 0 0;
  }
  #flow-content { padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); }
  #close-dialog { top: 10px; margin: 10px 12px 0 2px; }
}
@media (max-width: 365px) {
  .shell { padding-inline: 12px; }
  .hero-copy, [data-design="orbit"] .hero-copy { padding-inline: 18px; }
  .design-picker button { padding-inline: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  [data-design="orbit"] .tool-card { padding: 11px; }
  .flow-panel { padding: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tool-card, .tool-arrow, .hero-cta, .design-picker button, .locale { transition: color .18s, border-color .18s, background-color .18s, box-shadow .18s, transform .18s; }
  button:active:enabled { transform: translateY(1px); }
  .journal-art { animation: appear-art .5s cubic-bezier(.2,.7,.3,1) both; }
  [data-design="orbit"] .orbit-art { animation: appear-art .65s cubic-bezier(.18,.75,.18,1) both; }
  #flow-dialog[open] { animation: open-panel .23s cubic-bezier(.2,.7,.25,1) both; }
  #flow-dialog[open]::backdrop { animation: open-backdrop .18s ease-out; }
  @keyframes appear-art { from { opacity: .25; transform: translateY(7px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes open-panel { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes open-backdrop { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .design-picker [aria-pressed=true], #flow-content .flow-chip[aria-pressed=true] { outline: 2px solid Highlight; outline-offset: -4px; }
}

.journal-art:has(.journal-cover) { min-height: 305px; overflow: hidden; }
.journal-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.art-caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 6px 10px;
  color: #502b37;
  background: #fff7ed;
  border: 1px solid #dfc4c5;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgb(60 24 40 / 9%);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.3;
}
.art-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 100%; background: #9f4464; }
@media (max-width: 650px) {
  .journal-art:has(.journal-cover) { min-height: 178px; height: clamp(178px, 47vw, 235px); }
  .art-caption { left: 11px; bottom: 11px; }
}

.flow-row > .flow-label { display: grid; flex: 1 1 125px; gap: 4px; }
.flow-row > .flow-label input[type=number] { width: 100%; }
.flow-label > :is(select, textarea) { margin-top: 4px; }
#flow-content .flow-word { flex: 1 1 110px; min-width: 0; margin: 13px 0 0; font-family: var(--sans); line-height: 1.25; }
#flow-content .flow-word h3 { color: var(--ink); font: 600 clamp(1.45rem, 3.7vw, 2.05rem)/1.2 var(--serif); }
#flow-content .flow-word .flow-secondary { margin-top: 9px; }
#flow-content .flow-word .flow-note { letter-spacing: .03em; }
.flow-panel > .flow-eyebrow:not(:first-child) { margin-top: 13px; }
.flow-panel .flow-output { margin-top: 5px; }
.flow-panel h3 + p { line-height: 1.55; }
.flow-panel p + .flow-note, #flow-content > button + .flow-note { margin-top: 10px; }
.flow-stack > .flow-status { margin: 0; }
.flow-panel audio { max-width: 100%; }

[data-design="orbit"] .orbit-art { display: flex; flex-direction: column; justify-content: center; }
[data-design="orbit"] .room-node:active:enabled { transform: translate(-50%, -50%); }
@media (max-width: 650px) {
  [data-design="orbit"] .hero-art { max-height: none; }
}

.hero .eyebrow { color: var(--hero-detail); }
.hero .intro { color: var(--hero-sub); }
.hero-cta { background: var(--hero-button); }
body[data-theme="dark"] .tool-card { background: var(--card-surface); }
body[data-theme="dark"] .tool-icon { color: #ffa2ce; background: #452337; }
body[data-theme="dark"] [data-flow="observation"] .tool-icon { color: #ffdc98; background: #463125; }
body[data-theme="dark"] [data-flow="staffing"] .tool-icon { color: #aadfc2; background: #26392f; }
body[data-theme="dark"] [data-flow="word"] .tool-icon { color: #d2b5fc; background: #392e49; }
.masthead-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.view-settings, #preferences-close, #add-space {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; min-width: 44px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .83rem/1.3 var(--sans);
}
.view-settings .icon { width: 17px; height: 17px; }
#preferences-dialog { padding: clamp(21px, 4vw, 32px); width: min(100% - 32px, 510px); }
.preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.preferences-heading h2 { font: 620 1.8rem/1.15 var(--serif); letter-spacing: -.035em; }
#preferences-close { padding: 6px; }
#preferences-hint, #preference-status { color: var(--muted); font-size: .9rem; }
.preferences-fields { display: grid; gap: 14px; margin: 18px 0 12px; }
.preferences-fields label { display: grid; gap: 4px; font-weight: 650; font-size: .91rem; min-width: 0; }
.preferences-fields select {
  display: block; min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 500 1rem/1.4 var(--sans);
}
.space-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.space-controls label { flex: 1 1 140px; }
#add-space { background: var(--button); color: var(--on-button); border-color: var(--button); }
#preference-status { min-height: 1.5em; }
html[data-text="large"] { font-size: 120%; }
html[data-text="large"] .tool-copy small, html[data-text="large"] .room-detail { font-size: 1rem; }
html[data-text="large"] .room-node { font-size: .84rem; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after,
html[data-motion="reduce"] dialog::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media(max-width:650px) {
  #preferences-dialog { width: min(100%, 560px); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .masthead { gap: 6px; }
  .masthead-actions { gap: 5px; }
  .view-settings { padding: 7px; }
  .view-settings span { display: none; }
}
@media(max-width:380px) {
  .brand-text strong { font-size: 17px; }
  .brand { gap: 5px; }
  .locale svg { display: none; }
}
/* Journal echoes the original MAPI sign-in screen, including its plum card and magenta primary action. */
body[data-design="journal"][data-theme="dark"] {
  --bg: #1b1022;
  --surface: #2c1431;
  --hero-surface: linear-gradient(145deg, #4a0b39, #190d20);
  --card-surface: linear-gradient(160deg, #341638, #1f1026);
}
body[data-design="journal"][data-theme="dark"] .hero { border-color: #b03a7b; }
body[data-design="journal"][data-theme="dark"] .hero-cta {
  background: linear-gradient(110deg, #be176d, #96124f);
  color: #fff5f8;
  border-color: #ff83bf;
}
@media(max-width:650px) {
  .masthead { padding-block: 8px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 8px; letter-spacing: .12em; }
}

/* Keep the language menu touch-friendly without widening the masthead. */
.locale:has(select) { position: relative; padding: 0; gap: 0; }
.locale select { color: var(--ink); background: transparent; font: inherit; min-height: 44px; padding: 0.4rem 0.35rem 0.4rem 1.65rem; border: 0; border-radius: inherit; max-width: 8.2rem; }
.locale select option { background: var(--bg); color: var(--ink); }
.locale:has(select) svg { position: absolute; left: .48rem; pointer-events: none; }
.locale select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media(max-width:380px) { .locale select { padding-left: .48rem; } }
