@font-face {
  font-family: "BareMarker";
  src: url("../../assets/fontsets/bare-marker-font/BareMarkerRegular-8OYVz.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BareMarker";
  src: url("../../assets/fontsets/bare-marker-font/BareMarkerBold-R92x3.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BareMarker";
  src: url("../../assets/fontsets/bare-marker-font/BareMarkerLight-BLPV5.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --hud-fg: rgba(255, 255, 255, 0.92);
  --hud-bg: rgba(0, 0, 0, 0.28);
  --hud-border: rgba(255, 255, 255, 0.18);
  --font-ui: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-marker: "BareMarker", ui-sans-serif, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: #cfb492;
  color: #fff;
  overflow: hidden;
}

.viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #cfb492;
}

/* Project windows: translucent tints keyed to the active desktop wallpaper */
.viewport--desktop.viewport--bg-landscape {
  --project-surface-a: rgba(210, 232, 248, 0.94);
  --project-surface-b: rgba(218, 238, 228, 0.92);
  --project-text: rgba(16, 32, 28, 0.97);
  --project-heading: rgba(18, 58, 48, 0.98);
  --project-link: rgba(12, 92, 128, 0.98);
  --project-link-hover: rgba(8, 64, 92, 1);
  --project-divider: rgba(72, 128, 108, 0.62);
  --project-header-bg: rgba(255, 255, 255, 0.9);
  --project-title-fg: rgba(18, 72, 58, 0.98);
  --project-display-bg: rgba(255, 255, 255, 0.86);
  --project-display-border: rgba(88, 155, 188, 0.72);
  --project-display-rule: rgba(95, 155, 175, 0.58);
  --project-display-muted: rgba(22, 68, 56, 0.94);
  --project-summary-fg: rgba(14, 102, 138, 0.98);
  --project-accent: rgba(22, 118, 152, 0.98);
  /* Dark saturated chrome derived from the same pastel / glass palette */
  --project-window-border: color-mix(in srgb, var(--project-heading) 68%, #040a10 32%);
  --project-window-border-soft: color-mix(in srgb, var(--project-accent) 42%, #0c1818 58%);
  --project-window-glow: color-mix(in srgb, var(--project-accent) 18%, transparent);
  --project-window-shadow-deep: color-mix(in srgb, var(--project-link) 18%, #000000 82%);
}

.viewport--desktop.viewport--bg-ombre {
  --project-surface-a: rgba(255, 236, 228, 0.94);
  --project-surface-b: rgba(252, 224, 238, 0.92);
  --project-text: rgba(38, 22, 32, 0.97);
  --project-heading: rgba(98, 28, 62, 0.98);
  --project-link: rgba(148, 40, 96, 0.98);
  --project-link-hover: rgba(118, 24, 72, 1);
  --project-divider: rgba(188, 102, 138, 0.65);
  --project-header-bg: rgba(255, 255, 255, 0.9);
  --project-title-fg: rgba(92, 32, 64, 0.98);
  --project-display-bg: rgba(255, 255, 255, 0.88);
  --project-display-border: rgba(210, 128, 165, 0.72);
  --project-display-rule: rgba(200, 118, 155, 0.6);
  --project-display-muted: rgba(72, 36, 52, 0.94);
  --project-summary-fg: rgba(148, 44, 102, 0.98);
  --project-accent: rgba(178, 58, 118, 0.98);
  --project-window-border: color-mix(in srgb, var(--project-heading) 70%, #14020c 30%);
  --project-window-border-soft: color-mix(in srgb, var(--project-accent) 48%, #1a0814 52%);
  --project-window-glow: color-mix(in srgb, var(--project-accent) 18%, transparent);
  --project-window-shadow-deep: color-mix(in srgb, var(--project-link) 18%, #000000 82%);
}

.material-base {
  position: absolute;
  inset: 0;
  background: #cfb492;
  background-size: cover;
  background-position: center;
  transform: translateZ(0);
}

/* Landscape: full-bleed cover so the high-res JPEG scales with the viewport (best use of pixel data). */
.material-base.material-base--landscape-bg {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  image-rendering: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Start menu: Display / wallpaper picker (inside project Start window) */
.project-start-display {
  margin: 10px 0 12px;
  padding: 8px 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--project-display-border, rgba(17, 0, 55, 0.45));
  background: var(--project-display-bg, rgba(255, 255, 255, 0.97));
  box-shadow: 0 4px 12px rgba(12, 40, 8, 0.08);
  font-size: 13px;
  line-height: 1.35;
  color: var(--project-display-muted, rgba(24, 68, 16, 0.96));
}

.project-start-display__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--project-display-rule, rgba(120, 255, 64, 0.35));
}

.project-start-display__title {
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--project-title-fg, rgba(30, 100, 22, 0.88));
}



.project-start-display__body {
  padding: 0;
}

.project-start-display__details {
  margin: 0;
}

.project-start-display__summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--project-summary-fg, rgba(45, 170, 30, 0.98));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-start-display__summary::-webkit-details-marker {
  display: none;
}

.project-start-display__fieldset {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
}

.project-start-display__option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--project-display-muted, rgba(24, 68, 16, 0.96));
}

.project-start-display__option input {
  accent-color: var(--project-accent, rgba(75, 0, 94, 0.95));
}

.project-start-display--in-menu {
  margin: 0 8px 10px;
  font-size: 12px;
}

/* Display panel shown in the essay body area when avatar is clicked */
.project-start-display__fieldset--standalone {
  margin: 0;
  padding: 12px 0;
  border: 0;
  display: grid;
  gap: 10px;
}

.project-start-display__fieldset-legend {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7aaee8;
  margin-bottom: 8px;
  float: left;
  width: 100%;
}

.desktop-window--spawn-start-os .project-start-display__fieldset-legend {
  color: var(--sm-muted);
}

.desktop-window--spawn-start-os .project-start-display__option {
  color: var(--sm-body-text);
}

/* In-app Start menu (Windows-style shell inside the Start project window) */
.material-start-menu {
  font-family: var(--font-ui);
  width: 100%;
  min-width: 0;
  border: 1.5px solid #4a7fc1;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  /* Flex column so header + body + footer stack, body fills remaining height */
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.material-start-menu *,
.material-start-menu *::before,
.material-start-menu *::after {
  box-sizing: border-box;
}

.material-sm-header {
  background: #2255a4;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}

.material-sm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #7aaee8;
  background: linear-gradient(145deg, #e8eef8, #c8daf0);
  flex-shrink: 0;
  /* When the avatar is a button (start menu), make it interactive */
  appearance: none;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  overflow: hidden;
}

button.material-sm-avatar:hover {
  border-color: #3c70c9;
  transform: scale(1.07);
}

button.material-sm-avatar:focus-visible {
  outline: 2px solid #7aaee8;
  outline-offset: 2px;
}

.material-sm-title {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.material-sm-body {
  display: flex;
  background: #fff;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.material-sm-col-left {
  width: 180px;
  border-right: 1px solid #c8d8ec;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.material-sm-col-left--collapsed {
  width: 28px;
}

.material-sm-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 6px;
  border-bottom: 1px solid #c8d8ec;
  background: #eef4fb;
}

.material-sm-col-label {
  font-size: 10px;
  color: #2255a4;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.material-sm-col-left--collapsed .material-sm-col-label {
  opacity: 0;
}

.material-sm-collapse-btn {
  width: 16px;
  height: 16px;
  border: 1px solid #7aaee8;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2255a4;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  font-family: var(--font-ui);
}

.material-sm-collapse-btn:hover {
  background: #3c70c9;
  color: #fff;
  border-color: #3c70c9;
}

.material-sm-section-label {
  font-size: 9px;
  color: #7aaee8;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.material-sm-section-label--spaced {
  padding-top: 14px;
}

.material-sm-col-left--collapsed .material-sm-section-label {
  opacity: 0;
  padding: 4px 0;
}

.material-sm-toc-item {
  display: flex;
  align-items: flex-start;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.1s;
  border: 0;
  border-bottom: 1px solid #f0f5fb;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
}

.material-sm-toc-item:hover {
  background: #3c70c9;
}

.material-sm-toc-item:hover .material-sm-toc-name,
.material-sm-toc-item:hover .material-sm-toc-sub {
  color: #fff;
}

.material-sm-toc-name {
  font-size: 11px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}

.material-sm-toc-sub {
  font-size: 10px;
  color: #666;
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
}

.material-sm-toc-active {
  background: #deeafb;
}

.material-sm-col-left--collapsed .material-sm-toc-item {
  padding: 7px 6px;
}

.material-sm-col-left--collapsed .material-sm-toc-name,
.material-sm-col-left--collapsed .material-sm-toc-sub {
  display: none;
}

.material-sm-see-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: #1a3a6c;
  font-size: 11px;
  font-weight: 500;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.material-sm-see-item:hover {
  background: #3c70c9;
  color: #fff;
}

.material-sm-see-ico {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Crect x='1' y='1' width='11' height='11' rx='2' fill='%232255a4'/%3E%3Crect x='3' y='4' width='7' height='1' rx='0.5' fill='%23fff'/%3E%3Crect x='3' y='6' width='7' height='1' rx='0.5' fill='%23fff'/%3E%3Crect x='3' y='8' width='4' height='1' rx='0.5' fill='%23fff'/%3E%3C/svg%3E");
}

.material-sm-see-ico--lock {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Crect x='1' y='3' width='11' height='8' rx='1.5' fill='%234a7fc1'/%3E%3Cpath d='M4 3V2.5a2.5 2.5 0 015 0V3' fill='none' stroke='%232255a4' stroke-width='1.1'/%3E%3C/svg%3E");
}

.material-sm-see-ico--sketch {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Crect x='1' y='1' width='11' height='11' rx='2' fill='%232255a4'/%3E%3Ccircle cx='6.5' cy='6.5' r='3' fill='%23a8c8f0'/%3E%3C/svg%3E");
}

.material-sm-col-left--collapsed .material-sm-see-item {
  padding: 6px;
  justify-content: center;
}

.material-sm-col-left--collapsed .material-sm-see-item span:last-child {
  display: none;
}

.material-sm-see-divider {
  height: 1px;
  background: #c8d8ec;
  margin: 4px 10px;
}

.material-sm-col-left--collapsed .material-sm-see-divider {
  margin: 4px 6px;
}

.material-sm-col-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.material-sm-preview-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #c8d8ec;
}

.material-sm-preview-essay-label {
  font-size: 9px;
  font-weight: 600;
  color: #7aaee8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.material-sm-preview-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.25;
}

.material-sm-preview-body {
  padding: 16px 20px;
  font-size: 12px;
  color: #555;
  line-height: 1.85;
  flex: 1;
}

.material-sm-preview-lead {
  margin: 0;
}

/* Scrollable essay / display content area — replaces preview+full dual-pane */
.material-sm-essay-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 12px;
  color: #555;
  line-height: 1.85;
  min-height: 0;
}

.material-sm-read-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  font-weight: 600;
  color: #2255a4;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: none;
  font-family: var(--font-ui);
  padding: 0;
}

.material-sm-read-more:hover {
  color: #3c70c9;
}

.material-sm-essay-full {
  display: none;
  padding: 16px 20px;
  font-size: 12px;
  color: #555;
  line-height: 1.85;
  flex: 1;
  flex-direction: column;
}

.material-sm-essay-full:not([hidden]) {
  display: flex;
}

.material-sm-essay-full-body {
  flex: 1;
}

.material-sm-essay-p {
  margin: 0 0 1em;
}

.material-sm-essay-meta {
  font-size: 0.78em;
  opacity: 0.6;
  font-style: italic;
  letter-spacing: 0.01em;
}

.material-sm-essay-p:last-child {
  margin-bottom: 0;
}

.material-sm-back-btn {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  font-weight: 600;
  color: #2255a4;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
  background: none;
  border: none;
  font-family: var(--font-ui);
  padding: 0;
}

.material-sm-back-btn:hover {
  color: #3c70c9;
}

.material-sm-footer {
  background: #2255a4;
  padding: 6px 12px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #1a4a8c;
  flex-shrink: 0;
}

.material-sm-footer-btn {
  background: transparent;
  border: 1px solid #7aaee8;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-ui);
  padding: 3px 12px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.material-sm-footer-btn:hover {
  background: #3c70c9;
}

.content-window__body--project:has(.material-start-menu) {
  padding: 0;
  border-top: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Desktop entry: glass panel (z-index 50) over #window-layer; folders spawn into .window-layer--folders (z-index 55), then reparent to #window-layer on dismiss */
.desktop-entry-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: clamp(10px, 2.5vmin, 24px);
  background: transparent;
  pointer-events: none;
  cursor: default;
  transition:
    opacity 0.38s ease,
    visibility 0.38s ease;
}

.desktop-entry-overlay--dismissed {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.desktop-entry-overlay__glass {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: calc(100vw - clamp(20px, 5vmin, 48px));
  height: min(calc(100vh - clamp(20px, 5vmin, 48px)), 100%);
  min-height: 240px;
  padding: clamp(28px, 5vh, 48px) clamp(20px, 4vw, 40px);
  border-radius: clamp(18px, 2.5vmin, 28px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 12px 40px rgba(15, 22, 32, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  isolation: isolate;
  pointer-events: auto;
}

.desktop-entry-overlay__avatar {
  width: clamp(88px, 18vmin, 120px);
  height: clamp(88px, 18vmin, 120px);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(230, 232, 236, 0.95), rgba(200, 204, 212, 0.88));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06) inset,
    0 4px 14px rgba(15, 18, 28, 0.08);
  flex-shrink: 0;
  overflow: hidden;
}

.desktop-entry-overlay__pill {
  appearance: none;
  margin: 0;
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid rgba(20, 22, 28, 0.88);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(18, 20, 24, 0.92);
  font: inherit;
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: text;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  width: clamp(180px, 28vw, 260px);
  outline: none;
}

.desktop-entry-overlay__pill::placeholder {
  color: rgba(18, 20, 24, 0.38);
  letter-spacing: 0.12em;
  font-size: clamp(11px, 1.3vw, 13px);
}

.desktop-entry-overlay__pill:hover {
  background: #fff;
  border-color: rgba(10, 12, 18, 0.95);
}

.desktop-entry-overlay__pill:focus {
  outline: 2px solid rgba(45, 100, 160, 0.55);
  outline-offset: 3px;
  background: #fff;
}

.desktop-entry-overlay__hint {
  margin: 0;
  max-width: 28em;
  text-align: center;
  font-size: clamp(11px, 1.2vw, 12px);
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: rgba(28, 32, 38, 0.62);
}



.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 14px 16px;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  display: none;
}

.hud__title {
  font-weight: 650;
  letter-spacing: 0.2px;
  color: var(--hud-fg);
}

.hud__sub {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
}

.material-base::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.material-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(50, 35, 20, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.window-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

/* Decorative folder icons: stacked above the glass entry panel, then reparented into #window-layer on dismiss */
.window-layer--folders {
  z-index: 55;
}

.start-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 8px;
  background: rgba(38, 40, 42, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.start-bar__start {
  appearance: none;
  border: 0px solid rgba(255, 255, 255, 0.12);
  background: rgba(43, 34, 34, 0.08);
  color: rgba(245, 245, 242, 0.94);
  border-radius: 5px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.start-bar__start:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.start-bar__spacer {
  flex: 1 1 auto;
}

.start-bar__clock {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(220, 222, 218, 0.88);
  padding: 0 4px 0 0;
}

.start-hint {
  position: absolute;
  bottom: 48px;
  left: 8px;
  z-index: 40;
  padding: 6px 13px 6px 11px;
  background: rgba(28, 30, 32, 0.90);
  color: rgba(245, 245, 242, 0.94);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s ease;
}
.start-hint--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.start-hint strong {
  font-weight: 600;
}

.desktop-app-icon {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  display: grid;
  gap: 6px;
  place-items: center;
  width: 74px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(24, 18, 14, 0.35);
  backdrop-filter: blur(6px);
  color: rgba(255, 245, 235, 0.9);
  cursor: pointer;
  pointer-events: auto;
}

.desktop-app-icon:hover {
  background: rgba(24, 18, 14, 0.45);
  border-color: rgba(255, 255, 255, 0.24);
}

.desktop-app-icon__glyph {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 18px;
}

.desktop-app-icon__label {
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
}

.desktop-window {
  container-type: size;
  position: absolute;
  pointer-events: auto;
  user-select: none;
  cursor: default;
  border-radius: 4px;
}

.desktop-window--content .desktop-window__frame--content {
  background: rgba(255, 251, 246, 0.96);
  border-radius: 10px;
  border: 1px solid rgba(20, 14, 10, 0.1);
  box-shadow:
    0 10px 26px rgba(15, 12, 8, 0.14),
    0 2px 8px rgba(15, 12, 8, 0.08);
  overflow: hidden;
}

/*
 * Project / “digital” page windows (narrative HTML inside a frame):
 * Default look = teal/green “landscape OS” knockoff.
 * When opened FROM an abstract PNG (menu / project link / user input parent), JS adds
 * .desktop-window--spawn-themed and sets --spawn-* variables sampled from that PNG — see
 * applySpawnThemeVars() in overlay.js. Only .desktop-window--spawn-start-os should keep the
 * default greens below (Start menu and anything not tied to an abstract parent).
 */
.desktop-window--project-page .desktop-window__frame--content {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--project-window-border, rgba(14, 52, 48, 0.85));
  box-shadow:
    0 0 0 1px var(--project-window-border-soft, rgba(46, 120, 108, 0.35)),
    0 10px 28px var(--project-window-shadow-deep, rgba(8, 14, 12, 0.2));
}

.content-window__header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(24, 18, 14, 0.06);
  border-bottom: 1px solid rgba(20, 14, 10, 0.09);
}

/* Start-menu header: a bare clickable close strip — no title, no buttons */
.content-window__header--close-bar {
  display: block;
  cursor: pointer;
  min-height: 22px;
  padding: 5px 8px;
  user-select: none;
}

.content-window__header--close-bar:hover {
  filter: brightness(1.25);
}

.desktop-window--project-page .content-window__header {
  background: var(--project-header-bg, rgba(255, 255, 255, 0.42));
  border-bottom: 1px solid var(--project-divider, rgba(120, 255, 64, 0.92));
}

.content-window__controls {
  display: flex;
  gap: 6px;
}

.content-window__control {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 14, 10, 0.18);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.desktop-window--project-page .content-window__control {
  border-color: var(--project-window-border-soft, rgba(40, 104, 88, 0.65));
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.content-window__title {
  font-size: 12px;
  color: rgba(20, 14, 10, 0.75);
  font-weight: 600;
}

.desktop-window--project-page .content-window__title {
  color: var(--project-title-fg, rgba(38, 128, 22, 0.96));
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

.content-window__body {
  padding: 8px 10px 10px;
  max-height: min(70vh, 620px);
  overflow: auto;
  color: rgba(20, 14, 10, 0.88);
  font-size: 12px;
  line-height: 1.5;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(255, 251, 246, 0.96);
  background-blend-mode: soft-light;
}

.content-window__body--project {
  font-family: var(--font-ui);
  color: var(--project-text, rgba(24, 68, 16, 0.96));
  background-image: none;
  background-blend-mode: normal;
  background-size: auto;
  background: linear-gradient(
    168deg,
    var(--project-surface-a, rgba(255, 255, 255, 0.92)),
    var(--project-surface-b, rgba(255, 255, 255, 0.88))
  );
  border-top: 1px solid var(--project-divider, rgba(120, 255, 64, 0.72));
}

.content-window__body--project h2 {
  color: var(--project-heading, rgba(30, 115, 20, 0.96));
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

.content-window__body--project p {
  line-height: 1.5;
}

.content-window__body--project a {
  color: var(--project-link, rgba(45, 170, 30, 0.98));
  text-decoration-color: var(--project-link, rgba(45, 170, 30, 0.95));
}

.content-window__body--project a:hover {
  color: var(--project-link-hover, rgba(24, 130, 12, 0.98));
}

/* Abstract-sampled theme: maps PNG-derived --spawn-* into the same slots project pages use */
.desktop-window--project-page.desktop-window--spawn-themed .desktop-window__frame--content {
  border-color: var(--spawn-border);
  box-shadow:
    0 0 0 1px var(--spawn-border-soft),
    0 10px 26px var(--spawn-shadow-deep);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__header {
  background: var(--spawn-header-bg);
  border-bottom-color: var(--spawn-divider);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__title {
  color: var(--spawn-title-fg);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__control {
  border-color: var(--spawn-border-soft);
  box-shadow: none;
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__body--project {
  color: var(--spawn-text);
  background: linear-gradient(168deg, var(--spawn-surface-a), var(--spawn-surface-b));
  border-top-color: var(--spawn-divider);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__body--project h2 {
  color: var(--spawn-heading);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__body--project a {
  color: var(--spawn-link);
  text-decoration-color: var(--spawn-link);
}

.desktop-window--project-page.desktop-window--spawn-themed .content-window__body--project a:hover {
  color: var(--spawn-link-hover);
}

.desktop-window--project-page.desktop-window--spawn-themed .project-window__quick-link {
  border-top-color: var(--spawn-divider);
}

/* ─── Start menu themes ──────────────────────────────────────────────────────────────────────
 * Two context overrides match the wallpaper palettes from color_scheme_v4:
 *   landscape → black/green Windows nod
 *   ombre     → dark plum/pink Mac nod
 * Shell element colors use --sm-* custom properties applied below.
 * ─────────────────────────────────────────────────────────────────────────── */

/* Start menu window: JS sets an explicit style.height so the flex chain has a
   definite anchor — header and footer are then pinned and sm-body fills the rest */
.desktop-window--project-page.desktop-window--spawn-start-os {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desktop-window--project-page.desktop-window--spawn-start-os > .desktop-window__frame--content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Use chrome color as frame background so rounded corners don't show white at the bottom */
  background: var(--sm-chrome, #111111);
}

/* Fallback palette (no wallpaper class) */
.desktop-window--project-page.desktop-window--spawn-start-os {
  --project-window-border: rgba(14, 52, 48, 0.85);
  --project-window-border-soft: rgba(46, 120, 108, 0.38);
  --project-window-glow: rgba(32, 140, 120, 0.12);
  --project-window-shadow-deep: rgba(8, 14, 12, 0.22);
  --project-header-bg: rgba(255, 255, 255, 0.88);
  --project-divider: rgba(120, 255, 64, 0.92);
  --project-title-fg: rgba(38, 128, 22, 0.96);
  --project-text: rgba(24, 68, 16, 0.96);
  --project-heading: rgba(30, 115, 20, 0.96);
  --project-link: rgba(45, 170, 30, 0.98);
  --project-link-hover: rgba(24, 130, 12, 0.98);
  --project-surface-a: rgba(252, 255, 252, 0.94);
  --project-surface-b: rgba(244, 252, 248, 0.92);
  --sm-chrome: #111111;
  --sm-accent: #4caf50;
  --sm-accent-hover: #2e7d32;
  --sm-body-bg: #f5f5f0;
  --sm-body-text: #1a1a1a;
  --sm-title-fg: #d4f5d4;
  --sm-border: #2e7d32;
  --sm-muted: #7aaee8;
  --sm-row-hover: #2e7d32;
}

/* Landscape wallpaper: black chrome + green accents (Windows nod) */
.viewport--bg-landscape .desktop-window--project-page.desktop-window--spawn-start-os {
  --project-window-border: rgba(46, 125, 50, 0.9);
  --project-window-border-soft: rgba(76, 175, 80, 0.35);
  --project-window-glow: rgba(76, 175, 80, 0.12);
  --project-window-shadow-deep: rgba(0, 0, 0, 0.38);
  --project-header-bg: #111111;
  --project-divider: rgba(76, 175, 80, 0.55);
  --project-title-fg: #d4f5d4;
  --project-text: #1a1a1a;
  --project-heading: #1a1a1a;
  --project-link: #4caf50;
  --project-link-hover: #2e7d32;
  --project-surface-a: #f5f5f0;
  --project-surface-b: #f0f0eb;
  --sm-chrome: #111111;
  --sm-accent: #4caf50;
  --sm-accent-hover: #2e7d32;
  --sm-body-bg: #f5f5f0;
  --sm-body-text: #1a1a1a;
  --sm-title-fg: #d4f5d4;
  --sm-border: #2e7d32;
  --sm-muted: #4caf50;
  --sm-row-hover: #2e7d32;
}

/* Ombre wallpaper: dark plum chrome + pink accents (Mac nod) */
.viewport--bg-ombre .desktop-window--project-page.desktop-window--spawn-start-os {
  --project-window-border: rgba(74, 21, 40, 0.92);
  --project-window-border-soft: rgba(212, 83, 126, 0.38);
  --project-window-glow: rgba(212, 83, 126, 0.12);
  --project-window-shadow-deep: rgba(26, 13, 20, 0.42);
  --project-header-bg: #2a1520;
  --project-divider: rgba(212, 83, 126, 0.45);
  --project-title-fg: #f0d8e8;
  --project-text: #1a0d14;
  --project-heading: #1a0d14;
  --project-link: #d4537e;
  --project-link-hover: #993556;
  --project-surface-a: #fdf6f9;
  --project-surface-b: #f9eff4;
  --sm-chrome: #2a1520;
  --sm-accent: #d4537e;
  --sm-accent-hover: #993556;
  --sm-body-bg: #fdf6f9;
  --sm-body-text: #1a0d14;
  --sm-title-fg: #f0d8e8;
  --sm-border: #4a1528;
  --sm-muted: #d4537e;
  --sm-row-hover: #993556;
}

/* Apply --sm-* tokens to start-menu shell elements */
.desktop-window--spawn-start-os .material-start-menu {
  border-color: var(--sm-border);
}
.desktop-window--spawn-start-os .material-sm-header,
.desktop-window--spawn-start-os .material-sm-footer {
  background: var(--sm-chrome);
}
.desktop-window--spawn-start-os .material-sm-footer {
  border-top-color: var(--sm-border);
}
.desktop-window--spawn-start-os .material-sm-col-left {
  background: var(--sm-chrome);
  border-right-color: var(--sm-border);
}
.desktop-window--spawn-start-os .material-sm-col-header {
  background: color-mix(in srgb, var(--sm-chrome) 85%, var(--sm-accent) 15%);
  border-bottom-color: var(--sm-border);
}
.desktop-window--spawn-start-os .material-sm-col-label {
  color: var(--sm-accent);
}
.desktop-window--spawn-start-os .material-sm-collapse-btn {
  border-color: var(--sm-accent);
  color: var(--sm-accent);
}
.desktop-window--spawn-start-os .material-sm-collapse-btn:hover {
  background: var(--sm-accent-hover);
  border-color: var(--sm-accent-hover);
  color: #fff;
}
.desktop-window--spawn-start-os .material-sm-section-label {
  color: var(--sm-muted);
}
.desktop-window--spawn-start-os .material-sm-avatar {
  border-color: var(--sm-accent);
}
.desktop-window--spawn-start-os button.material-sm-avatar:hover {
  border-color: var(--sm-accent-hover);
}
.desktop-window--spawn-start-os button.material-sm-avatar:focus-visible {
  outline-color: var(--sm-accent);
}
.desktop-window--spawn-start-os .material-sm-title {
  color: var(--sm-title-fg);
}
.desktop-window--spawn-start-os .material-sm-body {
  background: var(--sm-body-bg);
}
.desktop-window--spawn-start-os .material-sm-toc-item {
  border-bottom-color: color-mix(in srgb, var(--sm-border) 30%, transparent);
}
.desktop-window--spawn-start-os .material-sm-toc-item:hover {
  background: var(--sm-row-hover);
}
.desktop-window--spawn-start-os .material-sm-toc-item:hover .material-sm-toc-name,
.desktop-window--spawn-start-os .material-sm-toc-item:hover .material-sm-toc-sub {
  color: #fff;
}
.desktop-window--spawn-start-os .material-sm-toc-active {
  background: color-mix(in srgb, var(--sm-accent) 18%, transparent);
}
.desktop-window--spawn-start-os .material-sm-toc-name {
  color: var(--sm-title-fg);
}
.desktop-window--spawn-start-os .material-sm-toc-sub {
  color: var(--sm-muted);
}
.desktop-window--spawn-start-os .material-sm-see-item {
  color: var(--sm-accent);
}
.desktop-window--spawn-start-os .material-sm-see-item:hover {
  background: var(--sm-row-hover);
  color: #fff;
}
.desktop-window--spawn-start-os .material-sm-see-divider {
  background: var(--sm-border);
}
.desktop-window--spawn-start-os .material-sm-preview-header {
  border-bottom-color: color-mix(in srgb, var(--sm-border) 40%, transparent);
}
.desktop-window--spawn-start-os .material-sm-preview-essay-label {
  color: var(--sm-muted);
}
.desktop-window--spawn-start-os .material-sm-preview-title,
.desktop-window--spawn-start-os .material-sm-preview-body,
.desktop-window--spawn-start-os .material-sm-essay-full,
.desktop-window--spawn-start-os .material-sm-essay-body {
  color: var(--sm-body-text);
}
.desktop-window--spawn-start-os .material-sm-read-more,
.desktop-window--spawn-start-os .material-sm-back-btn {
  color: var(--sm-accent);
}
.desktop-window--spawn-start-os .material-sm-read-more:hover,
.desktop-window--spawn-start-os .material-sm-back-btn:hover {
  color: var(--sm-accent-hover);
}
.desktop-window--spawn-start-os .material-sm-footer-btn {
  border-color: var(--sm-accent);
  color: var(--sm-title-fg);
}
.desktop-window--spawn-start-os .material-sm-footer-btn:hover {
  background: var(--sm-accent-hover);
}

.project-window__quick-link {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--project-divider, rgba(120, 255, 64, 0.85));
  font-size: 12px;
}

/* "click more windows to learn more →" prompt at foot of essay text windows */
.essay-window__more-prompt {
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  text-align: center;
  color: var(--project-summary-fg, rgba(14, 102, 138, 0.82));
  background: color-mix(in srgb, var(--project-header-bg, rgba(255, 255, 255, 0.9)) 85%, transparent);
  border: 1px solid var(--project-divider, rgba(72, 128, 108, 0.38));
}


.content-window__body h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.content-window__body p {
  margin: 0 0 8px;
}

.content-window__body a {
  color: rgba(30, 60, 160, 0.9);
  text-decoration: underline;
}

.desktop-window--minimized .content-window__body {
  display: none;
}

.desktop-window__frame {
  position: relative;
  display: block;
  width: 100%;
}

.desktop-window__image {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: auto;
  filter: drop-shadow(0 14px 22px rgba(15, 12, 8, 0.3))
    drop-shadow(0 3px 6px rgba(15, 12, 8, 0.18));
}

.window-zones {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
  isolation: isolate;
}

.zone-click {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  appearance: none;
  background: transparent;
  min-width: 0;
  min-height: 0;
  line-height: 0;
  z-index: 20;
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    outline-color 0.16s ease;
}

.zone-click:hover {
  background: rgba(0, 255, 247, 0.07);
  outline: 1px solid rgba(0, 255, 247, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 255, 247, 0.2),
    0 0 14px rgba(0, 220, 255, 0.28),
    inset 0 0 24px rgba(0, 255, 247, 0.05);
}

.zone-click:focus {
  outline: none;
}

.zone-click:focus-visible {
  background: rgba(180, 140, 255, 0.09);
  outline: 1px solid rgba(200, 170, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(200, 170, 255, 0.25),
    0 0 12px rgba(180, 140, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .zone-click {
    transition: none;
  }
}

.zone-text {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  z-index: 20;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: clamp(10px, 1.6cqw, 14px);
  line-height: 1.35;
  color: rgba(35, 28, 22, 0.88);
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.zone-text::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.zone-text--traces-clickable {
  cursor: pointer;
}

.zone-text--traces-clickable:hover {
  opacity: 0.8;
}

.viewport--show-zones .zone-click,
.viewport--debug-zones .zone-click {
  outline: 3px dashed rgba(0, 38, 36, 0.98);
  background: rgba(0, 255, 247, 0.2);
}

.viewport--show-zones .zone-text,
.viewport--debug-zones .zone-text {
  outline: 3px dashed rgba(61, 30, 0, 0.98);
  background: rgba(255, 200, 120, 0.28);
}

.viewport--show-zones .zone-click:hover,
.viewport--debug-zones .zone-click:hover {
  background: rgba(0, 255, 247, 0.3);
  outline: 3px solid rgba(0, 74, 70, 1);
  box-shadow:
    0 0 0 1px rgba(0, 20, 20, 0.7),
    0 0 16px rgba(0, 110, 130, 0.7),
    inset 0 0 24px rgba(0, 255, 247, 0.26);
}

.zone-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(calc(-100% - 3px));
  /* Shrink to text only (do not stretch to zone size; inline zone sizing must not win). */
  width: fit-content !important;
  max-width: min(240px, 92%);
  height: auto !important;
  min-width: 0;
  box-sizing: border-box;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #f7f4f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 9999;
}

.zone-label--click {
  background: rgba(14, 12, 11, 0.94);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f2f0ee;
}

.zone-label--text {
  background: linear-gradient(
    180deg,
    rgba(118, 78, 48, 0.96) 0%,
    rgba(88, 54, 32, 0.98) 100%
  );
  border-color: rgba(255, 220, 180, 0.28);
  color: #fff8f0;
}

.zone-draft {
  position: absolute;
  border: 2px dashed rgba(244, 98, 10, 0.9);
  background: rgba(255, 206, 150, 0.22);
  box-sizing: border-box;
}

.zone-draft[data-shape="circle"] {
  border-radius: 999px;
}

.zone-debug-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(440px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 10px;
  background: rgba(23, 18, 14, 0.84);
  color: #f7f0e8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: grid;
  gap: 8px;
}

.zone-debug-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.zone-debug-panel select,
.zone-debug-panel button,
.zone-debug-panel textarea {
  font: inherit;
}

.zone-debug-panel textarea {
  width: 100%;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #f9f1e9;
  padding: 8px;
}

/* Browser history in PNG text zones: chronological titles, Eastern time-of-day */
.history-line {
  margin: 0 0 3px;
  padding: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

.zone-text .history-line:last-child {
  margin-bottom: 0;
}

.history-line__time {
  display: inline;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0.72;
  white-space: nowrap;
}

.history-line__title {
  display: inline;
}

.history-line__word--shopping { color: #7be0ad; }
.history-line__word--research { color: #e0b0d5; }
.history-line__word--admin    { color: #aee5d8; }
.history-line__word--location { color: #86a397; }

.history-line--font-default .history-line__title {
  font-family: "Lexend", sans-serif;
  font-weight: var(--history-weight, 300);
}

.history-line--font-search .history-line__title {
  font-family: "Work Sans", sans-serif;
  font-weight: var(--history-weight, 400);
  letter-spacing: 0.01em;
}

.history-line--font-code .history-line__title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.93em;
  font-weight: var(--history-weight, 400);
}

.history-line--font-commerce .history-line__title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: var(--history-weight, 400);
  font-style: italic;
}

.history-line--font-writing .history-line__title {
  font-family: "Marck Script", cursive;
  font-size: var(--history-size, 1.0em);
  line-height: 1.5;
}

/* Script letterforms are delicate — pull back the shadow intensity */
.history-line--font-writing.history-line--day {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.history-line--font-writing.history-line--night {
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.22);
}


/* 7:00 a.m.–6:59 p.m. ET: lighter text — overlay blends with the collage surface */
.history-line--day {
  color: rgba(245, 238, 220, 0.91);
  mix-blend-mode: overlay;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.55);
}

.history-line--day .history-line__time {
  color: rgba(238, 228, 206, 0.78);
}

/* 7:00 p.m.–6:59 a.m. ET: darker text */
.history-line--night {
  color: rgba(22, 18, 15, 0.92);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.38),
    0 1px 4px rgba(255, 255, 255, 0.15);
}

.history-line--night .history-line__time {
  color: rgba(30, 26, 22, 0.65);
}

/* ===== Mobile app shell ===== */

.viewport--mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background-color: #1a2838;
  background-image: url("../../assets/desktopbackgrounddigital.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.mobile-preview-chrome {
  display: none;
}

.mobile-app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 390px;
  max-height: 844px;
  overflow: hidden;
  background: #1a1a1a;
  border-radius: 0;
}

@media (min-width: 500px) {
  .viewport--mobile {
    position: relative;
    background-color: #1a2838;
    background-image: radial-gradient(
        circle at center,
        rgba(0, 220, 255, 0.5) 1.1px,
        transparent 1.2px
      ),
      url("../../assets/desktopbackgrounddigital.jpg");
    background-size: 16px 16px, cover;
    background-position: center, center;
    background-repeat: repeat, no-repeat;
  }

  .mobile-preview-chrome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    margin: 0;
    max-width: min(340px, calc(100vw - 36px));
    padding: 0;
    text-align: left;
    pointer-events: auto;
  }

  .mobile-preview-chrome__label {
    margin: 0;
    font-family: var(--font-ui);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88);
    text-shadow:
      0 0 10px rgba(0, 210, 255, 0.45),
      0 0 22px rgba(0, 200, 255, 0.2);
  }

  .mobile-preview-chrome__back {
    display: inline-block;
    appearance: none;
    border: 1px solid rgba(0, 180, 255, 0.45);
    border-radius: 8px;
    padding: 8px 14px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(0, 95, 160, 0.95);
    background: rgba(255, 255, 255, 0.42);
    text-decoration: none;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.22);
    cursor: pointer;
    transition:
      background 0.15s ease,
      border-color 0.15s ease,
      color 0.15s ease;
  }

  .mobile-preview-chrome__back:hover {
    background: rgba(255, 255, 255, 0.58);
    border-color: rgba(0, 200, 255, 0.65);
    color: rgba(0, 60, 130, 0.98);
  }

  /* Phone frame: 390×844 proportion. Scoped selector beats base .mobile-app { height:100% }
     which otherwise stretches the flex child and breaks aspect-ratio. */
  .viewport--mobile .mobile-app {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    align-self: center;
    box-sizing: border-box;
    width: min(280px, 86vw, calc((100dvh - 96px) * 390 / 844));
    height: auto;
    max-height: calc(100dvh - 96px);
    aspect-ratio: 390 / 844;
    overflow: hidden;
    border-radius: 36px;
    box-shadow:
      0 0 0 3px #222,
      0 16px 44px rgba(0, 0, 0, 0.38);
  }
}

.mobile-screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.mobile-screen.active {
  display: block;
  animation: screenFadeIn 0.28s ease-out;
}

@keyframes screenFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Home screen */

.mobile-screen--home {
  background: #e8ddd0;
}

.homescreen-entry-surface {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  overflow: hidden;
  cursor: pointer;
  text-align: inherit;
  color: inherit;
  background: #ddd2c4;
}

.homescreen-paper {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: rotate(var(--paper-rotation, 0deg)) scale(1.04);
}

.homescreen-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
}

.homescreen-entry-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(82%, 320px);
  padding: 20px 18px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  text-align: center;
}

.homescreen-entry-title,
.homescreen-entry-hint {
  margin: 0;
  font-family: var(--font-ui);
  color: rgba(20, 20, 20, 0.9);
}

.homescreen-entry-title {
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.homescreen-entry-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  opacity: 0.86;
}

/* Back button (desktop preview) */

.mobile-back-btn {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 0;
}

.mobile-back-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Feed */

.mobile-screen--feed {
  background: #f3efe3;
}

.feed-loading-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  margin: 0;
  max-width: 88%;
  text-align: center;
  font: 400 13px var(--font-ui);
  color: rgba(30, 22, 16, 0.52);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  pointer-events: none;
}

.feed-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.feed-export-btn {
  position: absolute;
  top: 76px;
  right: 14px;
  z-index: 25;
  border: 1px solid rgba(20, 20, 20, 0.22);
  background: rgba(255, 255, 255, 0.62);
  color: rgba(20, 20, 20, 0.85);
  font: 600 11px var(--font-ui);
  letter-spacing: 0.01em;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.feed-export-btn:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(20, 20, 20, 0.3);
}

.mobile-info-btn {
  position: absolute;
  bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
  right: max(16px, calc(16px + env(safe-area-inset-right)));
  z-index: 25;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.22);
  background: rgba(255, 255, 255, 0.62);
  color: rgba(20, 20, 20, 0.8);
  font: 700 16px var(--font-ui);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.mobile-info-btn:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(20, 20, 20, 0.3);
}

/* Stories */

.mobile-screen--stories {
  background: #111;
}

.stories-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
}

/* Project screen */

.mobile-screen--project {
  background: #f3efe3;
}

.project-screen {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 22px 18px 80px;
  box-sizing: border-box;
  color: rgba(25, 18, 12, 0.88);
}

.project-screen__inner {
  max-width: 34ch;
}

.project-screen__kicker {
  font: 700 11px var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.project-screen__title {
  margin: 8px 0 12px;
  font: 750 22px var(--font-ui);
  letter-spacing: 0.01em;
}

.project-screen__p {
  margin: 0 0 12px;
  font: 450 13px/1.5 var(--font-ui);
  opacity: 0.9;
}

.project-screen__p a,
.project-screen__attribution a {
  color: rgba(12, 92, 128, 0.96);
}

.project-screen__attribution {
  margin: 0 0 12px;
  font: 400 11px/1.45 var(--font-ui);
  opacity: 0.72;
}

.project-screen__hint {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font: 600 12px/1.45 var(--font-ui);
  opacity: 0.85;
}

/* Folder icon cluster (img_5510) */
.desktop-window--folder-icon .desktop-window__image {
  filter: drop-shadow(0 6px 10px rgba(15, 12, 8, 0.22)) drop-shadow(0 2px 4px rgba(15, 12, 8, 0.12));
}


/* Meta menu (actionId menu): uses same variables as project pages; themed from parent PNG when spawned from a zone */
.desktop-window--meta-menu {
  z-index: 120;
}

.desktop-window--meta-menu.desktop-window--spawn-themed .desktop-window__frame--meta-menu {
  border-color: var(--spawn-border);
  background: linear-gradient(168deg, var(--spawn-surface-a), var(--spawn-surface-b));
  box-shadow:
    0 0 0 1px var(--spawn-border-soft),
    0 10px 26px var(--spawn-shadow-deep);
}

.desktop-window--meta-menu.desktop-window--spawn-themed .meta-menu__header {
  background: var(--spawn-header-bg);
  border-bottom-color: var(--spawn-divider);
}

.desktop-window--meta-menu.desktop-window--spawn-themed .meta-menu__title {
  color: var(--spawn-title-fg);
}

.desktop-window--meta-menu.desktop-window--spawn-themed .meta-menu__close {
  border-color: var(--spawn-border-soft);
  color: var(--spawn-title-fg);
}

.desktop-window--meta-menu.desktop-window--spawn-themed .meta-menu__item {
  border-color: var(--spawn-divider);
  color: var(--spawn-text);
  background: color-mix(in srgb, var(--spawn-header-bg) 96%, white);
}

.desktop-window__frame--meta-menu {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--project-window-border, rgba(14, 52, 48, 0.85));
  background: linear-gradient(
    168deg,
    var(--project-surface-a, rgba(255, 255, 255, 0.92)),
    var(--project-surface-b, rgba(255, 255, 255, 0.88))
  );
  box-shadow:
    0 0 0 1px var(--project-window-border-soft, rgba(46, 120, 108, 0.35)),
    0 10px 28px var(--project-window-shadow-deep, rgba(8, 14, 12, 0.2));
}

.meta-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--project-header-bg, rgba(255, 255, 255, 0.9));
  border-bottom: 1px solid var(--project-divider, rgba(120, 255, 64, 0.92));
}

.meta-menu__title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  color: var(--project-title-fg, rgba(38, 128, 22, 0.96));
}

.meta-menu__close {
  margin: 0;
  padding: 0 6px;
  border: 1px solid var(--project-window-border-soft, rgba(40, 104, 88, 0.5));
  background: rgba(255, 255, 255, 0.55);
  color: var(--project-title-fg, rgba(38, 128, 22, 0.96));
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.meta-menu__close:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--project-accent, rgba(22, 118, 152, 0.98));
}

.meta-menu__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px 8px;
}

.meta-menu__item {
  margin: 0;
  padding: 7px 9px;
  text-align: left;
  border: 1px solid var(--project-divider, rgba(72, 128, 108, 0.62));
  border-radius: 8px;
  background: color-mix(in srgb, var(--project-header-bg, rgba(255, 255, 255, 0.78)) 92%, transparent);
  color: var(--project-text, rgba(24, 68, 16, 0.96));
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.meta-menu__item:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--project-accent, rgba(22, 118, 152, 0.98));
  box-shadow: 0 1px 6px var(--project-window-glow, rgba(32, 140, 120, 0.12));
}

/* Menu matrix (actionId menumatrix): icon grid; Flaticon UIcons via desktop/index.html */
.desktop-window--menu-matrix {
  z-index: 120;
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .desktop-window__frame--menu-matrix {
  border-color: var(--spawn-border);
  background: linear-gradient(168deg, var(--spawn-surface-a), var(--spawn-surface-b));
  box-shadow:
    0 0 0 1px var(--spawn-border-soft),
    0 10px 26px var(--spawn-shadow-deep);
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .menu-matrix__header {
  background: var(--spawn-header-bg);
  border-bottom-color: var(--spawn-divider);
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .menu-matrix__title {
  color: var(--spawn-title-fg);
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .menu-matrix__close {
  border-color: var(--spawn-border-soft);
  color: var(--spawn-title-fg);
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .menu-matrix__cell {
  border-color: var(--spawn-divider);
  color: var(--spawn-text);
  background: color-mix(in srgb, var(--spawn-header-bg) 88%, transparent);
}

.desktop-window--menu-matrix.desktop-window--spawn-themed .menu-matrix__cell:hover {
  border-color: var(--spawn-border);
  background: color-mix(in srgb, var(--spawn-surface-a) 70%, transparent);
}

.desktop-window__frame--menu-matrix {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--project-window-border, rgba(14, 52, 48, 0.85));
  background: linear-gradient(
    168deg,
    var(--project-surface-a, rgba(255, 255, 255, 0.92)),
    var(--project-surface-b, rgba(255, 255, 255, 0.88))
  );
  box-shadow:
    0 0 0 1px var(--project-window-border-soft, rgba(46, 120, 108, 0.35)),
    0 10px 28px var(--project-window-shadow-deep, rgba(8, 14, 12, 0.2));
}

.menu-matrix__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  flex-shrink: 0;
  background: var(--project-header-bg, rgba(255, 255, 255, 0.9));
  border-bottom: 1px solid var(--project-divider, rgba(120, 255, 64, 0.92));
}

.menu-matrix__title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  color: var(--project-title-fg, rgba(38, 128, 22, 0.96));
}

.menu-matrix__close {
  margin: 0;
  padding: 0 6px;
  border: 1px solid var(--project-window-border-soft, rgba(40, 104, 88, 0.5));
  background: rgba(255, 255, 255, 0.55);
  color: var(--project-title-fg, rgba(38, 128, 22, 0.96));
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.menu-matrix__close:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--project-accent, rgba(22, 118, 152, 0.98));
}

.menu-matrix__grid {
  --menu-matrix-cols: 3;
  --menu-matrix-rows: 4;
  display: grid;
  grid-template-columns: repeat(var(--menu-matrix-cols), minmax(0, 1fr));
  grid-auto-rows: minmax(40px, 1fr);
  gap: 6px;
  padding: 8px;
  min-height: min(42vh, calc(var(--menu-matrix-rows) * 44px + (var(--menu-matrix-rows) - 1) * 6px + 16px));
}

.menu-matrix__cell {
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--project-divider, rgba(72, 128, 108, 0.45));
  border-radius: 7px;
  background: color-mix(in srgb, var(--project-header-bg, rgba(255, 255, 255, 0.9)) 94%, transparent);
  color: var(--project-text, rgba(24, 68, 16, 0.96));
  cursor: default;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.menu-matrix__cell--actionable {
  cursor: pointer;
}

.menu-matrix__cell .fi {
  font-size: 1.35rem;
  line-height: 1;
  display: block;
}

.menu-matrix__cell-img {
  width: 70%;
  height: 70%;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.menu-matrix__cell-placeholder {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--project-divider, rgba(72, 128, 108, 0.62)) 55%, transparent);
  opacity: 0.5;
}

.menu-matrix__cell:hover {
  border-color: var(--project-accent, rgba(22, 118, 152, 0.98));
  box-shadow: 0 1px 5px var(--project-window-glow, rgba(32, 140, 120, 0.1));
}

/* Fortune text on digital paper */
.desktop-window__frame--paper-fortune {
  position: relative;
}

.desktop-paper-fortune {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  box-sizing: border-box;
  text-align: center;
  font: 700 14px/1.35 ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  color: rgba(18, 24, 32, 0.92);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.desktop-window--paper-fortune .desktop-window__image {
  position: relative;
  z-index: 0;
}

/* Build project pages use .content-window__body--project + .desktop-window--project-page (narrative parity) */

/* Code / title zone fills */
.zone-click--codebuild {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-click__codebuild-label {
  font: 700 11px ui-monospace, monospace;
  color: rgba(40, 200, 120, 0.95);
  pointer-events: none;
}

.zone-click--gray-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 6%;
}

.zone-click__gray-title-text {
  font: 600 10px var(--font-ui);
  color: rgba(55, 55, 62, 0.88);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.zone-click--poem-filled {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  line-height: 1.2;
  text-align: center;
}

.zone-click__poem-text {
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  font: 700 clamp(10px, 2.2cqw, 15px) / 1.18 var(--font-marker);
  color: rgba(18, 34, 52, 0.95);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

.zone-click--checkbox-checked {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-click__checkbox-mark {
  pointer-events: none;
  font-size: clamp(12px, 4.5cqw, 26px);
  line-height: 1;
  font-weight: 700;
  color: rgba(18, 92, 58, 0.96);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.15);
}

/* User color picker */
.desktop-color-palette {
  position: fixed;
  z-index: 99998;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.desktop-color-palette__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.desktop-color-palette__swatch:hover {
  transform: scale(1.08);
  border-color: #fff;
}

/*
 * User-input poem picker (userinput zones):
 * — Chips: .user-input-modal__choice; tint: .user-input-modal--themed (--spawn-* from parent PNG)
 * — Overlay is position:fixed and appended to document.body (overlay.js) so height is NOT capped by the
 *   abstract .desktop-window box. To change overall / grid height, edit .user-input-modal and
 *   .user-input-modal__grid-scroll below (min-height / max-height).
 */
.user-input-local-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  /* Prefer top alignment with padding so the header is never flush/cut off when the window sits high on the viewport */
  align-items: flex-start;
  justify-content: center;
  padding: clamp(14px, 4vmin, 28px) clamp(10px, 2.5vmin, 18px)
    clamp(12px, 3vmin, 22px);
  padding-top: max(clamp(14px, 4vmin, 28px), env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  background: rgba(14, 16, 20, 0.06);
  border-radius: 4px;
  pointer-events: auto;
  overflow: auto;
  overscroll-behavior: contain;
}

/* When there is extra vertical room, center the modal without risking overflow past the top (safe alignment) */
@supports (align-items: safe center) {
  .user-input-local-overlay {
    align-items: safe center;
    justify-content: safe center;
  }
}

/* Legacy full-screen backdrop (unused by current userinput flow) */
.user-input-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(12, 14, 18, 0.45);
  backdrop-filter: blur(5px);
}

.user-input-modal-backdrop--align-top {
  display: block;
  padding: 0;
}

.user-input-modal {
  display: flex;
  flex-direction: column;
  width: min(380px, 100%);
  flex-shrink: 0;
  margin-inline: auto;
  /* Avoid 100% here: inside a flex overlay it can resolve oddly and collapse the word grid */
  min-height: min(400px, 92vh);
  max-height: min(90vh, 640px);
  overflow: hidden;
  padding: 8px 9px 8px;
  border-radius: 12px;
  background: rgba(255, 251, 246, 0.98);
  border: 1px solid rgba(20, 14, 10, 0.11);
  box-shadow:
    0 12px 32px rgba(8, 10, 14, 0.18),
    0 2px 10px rgba(8, 10, 14, 0.08);
}

.user-input-modal--themed {
  border-color: var(--spawn-border, rgba(20, 14, 10, 0.14));
  background: linear-gradient(
    168deg,
    var(--spawn-surface-a, rgba(255, 252, 248, 0.96)),
    var(--spawn-surface-b, rgba(255, 250, 245, 0.94))
  );
  box-shadow:
    0 12px 30px var(--spawn-shadow-deep, rgba(8, 10, 14, 0.2)),
    0 0 0 1px var(--spawn-border-soft, transparent);
}

.user-input-modal--themed .user-input-modal__title {
  color: var(--spawn-title-fg, rgba(18, 28, 42, 0.95));
}

.user-input-modal--themed .user-input-modal__hint,
.user-input-modal--themed .user-input-modal__preview {
  color: var(--spawn-text, rgba(18, 28, 42, 0.88));
}

.user-input-modal__drag-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px 8px;
  margin: -4px -9px 2px;
  border-radius: 10px 10px 0 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
  color: rgba(18, 28, 42, 0.45);
}

.user-input-modal__drag-handle:active {
  cursor: grabbing;
}

.user-input-modal__drag-grip {
  font-size: 13px;
  line-height: 1;
  letter-spacing: -0.12em;
  opacity: 0.65;
  transform: translateY(1px);
}

.user-input-modal__drag-label {
  font: 600 10px/1.2 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.user-input-modal--themed .user-input-modal__drag-handle {
  color: var(--spawn-title-fg, rgba(18, 28, 42, 0.5));
}

.user-input-modal__title {
  margin: 0 0 4px;
  font: 600 13px/1.3 var(--font-ui);
  color: rgba(18, 28, 42, 0.95);
}

.user-input-modal__hint {
  margin: 0 0 6px;
  font: 400 11px/1.4 var(--font-ui);
  color: rgba(18, 28, 42, 0.62);
}

.user-input-modal__preview {
  margin: 0 0 6px;
  padding: 4px 7px;
  border-radius: 6px;
  font: 500 11px/1.35 var(--font-ui);
  color: rgba(24, 68, 16, 0.94);
  background: rgba(255, 255, 255, 0.92);
  border: 1px dashed rgba(46, 120, 108, 0.32);
  min-height: 2em;
  word-break: break-word;
}

.user-input-modal__grid-scroll {
  flex: 1 1 auto;
  /* Keep a floor so pills never collapse; allow a tall scroll area inside the ≥400px modal */
  min-height: clamp(200px, 32vh, 320px);
  max-height: min(62vh, 480px);
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 6px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.user-input-modal__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.user-input-modal__grid-label {
  flex: 1 1 100%;
  width: 100%;
  margin: 6px 0 3px;
  font: 600 9px/1.35 var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(18, 28, 42, 0.48);
}

.user-input-modal__grid-label:first-child {
  margin-top: 0;
}

.user-input-modal--themed .user-input-modal__grid-label {
  color: color-mix(in srgb, var(--spawn-text, rgba(18, 28, 42, 0.88)) 55%, transparent);
}

.user-input-modal__actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.user-input-modal__choice {
  margin: 0;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(46, 120, 108, 0.45);
  background: rgba(255, 255, 255, 0.88);
  color: rgba(24, 68, 16, 0.94);
  font: 500 10px/1.25 var(--font-ui);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  hyphens: auto;
  word-break: break-word;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.user-input-modal__choice--history {
  font-family: var(--font-marker);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.user-input-modal__choice--selected {
  border-color: rgba(22, 118, 152, 0.95);
  background: rgba(220, 245, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(22, 118, 152, 0.35);
}

.user-input-modal--themed .user-input-modal__choice {
  border-color: var(--spawn-border-soft, rgba(46, 120, 108, 0.45));
  color: var(--spawn-text, rgba(24, 68, 16, 0.94));
}

.user-input-modal--themed .user-input-modal__choice--selected {
  border-color: var(--spawn-border, rgba(22, 118, 152, 0.95));
  background: color-mix(in srgb, var(--spawn-header-bg, #fff) 88%, transparent);
}

.user-input-modal--themed .user-input-modal__choice--history {
  font-family: var(--font-marker);
  font-weight: 700;
  color: var(--spawn-heading, var(--spawn-text, rgba(24, 68, 16, 0.94)));
}

.user-input-modal__choice:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(22, 118, 152, 0.85);
  box-shadow: 0 0 12px rgba(32, 140, 120, 0.2);
}

.user-input-modal__secondary,
.user-input-modal__done {
  flex: 1;
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  font: 600 12px var(--font-ui);
  cursor: pointer;
  border: 1px solid rgba(20, 14, 10, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: rgba(20, 14, 10, 0.8);
}

.user-input-modal__done {
  background: rgba(46, 120, 108, 0.18);
  border-color: rgba(46, 120, 108, 0.55);
  color: rgba(18, 72, 52, 0.95);
}

.user-input-modal__done:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-input-modal__cancel {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(20, 14, 10, 0.12);
  background: rgba(24, 18, 14, 0.06);
  font: 600 12px var(--font-ui);
  color: rgba(20, 14, 10, 0.75);
  cursor: pointer;
  flex-shrink: 0;
}

.user-input-modal__cancel:hover {
  background: rgba(24, 18, 14, 0.1);
}

/* Poem line written into .zone-text areas after userinput “Done” */
.zone-text__poem-line {
  margin: 0;
  font: 700 clamp(10px, 1.5cqw, 13px) / 1.35 var(--font-marker);
  color: rgba(28, 32, 38, 0.92);
}

/* User-picked shape overlays */
.zone-user-shape {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, var(--user-pick-color, #333) 75%, #000);
  background: var(--user-pick-color, #888);
}

.zone-user-shape--circle {
  border-radius: 50%;
}

.zone-user-wordart {
  position: absolute;
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 4px;
  pointer-events: none;
  overflow: hidden;
}

.zone-user-wordart__text {
  font: 800 10px/1.2 var(--font-ui);
  text-align: center;
  background: linear-gradient(120deg, #0cf, #a0f, #fa0);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
  word-break: break-word;
}

.zone-erin-portrait {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
}

.zone-erin-portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Profile avatar: image inside the circle ─────────────────────────────── */

.desktop-entry-overlay__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}

.material-sm-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}

/* ─── Profile photo grid in the display panel ──────────────────────────────── */

.display-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7aaee8;
  margin: 0 0 10px;
}

.desktop-window--spawn-start-os .display-section-label {
  color: var(--sm-muted);
}

.profile-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.profile-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.profile-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Riso-ink duotone: grayscale image × white paper + colour overlay = single-ink print */
.profile-option__thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.profile-option__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1) contrast(1.1) brightness(1.05);
  mix-blend-mode: multiply;
}

/* Coloured ink overlay — uses the per-option custom property set inline */
.profile-option__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--riso-ink, #e05a5a);
  opacity: 0.52;
  mix-blend-mode: multiply;
  pointer-events: none;
  border-radius: 50%;
}

/* Hover */
.profile-option:hover .profile-option__thumb {
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Selected: full-colour, no ink overlay, accent ring */
.profile-option--selected .profile-option__thumb {
  border-color: #4a7fc1;
  box-shadow: 0 0 0 3px rgba(74, 127, 193, 0.32), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-option--selected .profile-option__thumb img {
  filter: none;
  mix-blend-mode: normal;
}

.profile-option--selected .profile-option__thumb::after {
  display: none;
}

/* Spawn-start-os theme overrides for selected ring */
.desktop-window--spawn-start-os .profile-option--selected .profile-option__thumb {
  border-color: var(--sm-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sm-accent) 30%, transparent), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Wallpaper section that follows the profile grid */
.display-wallpaper-fieldset {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid rgba(74, 127, 193, 0.22);
  display: grid;
  gap: 10px;
  width: 100%;
}

.desktop-window--spawn-start-os .display-wallpaper-fieldset {
  border-top-color: color-mix(in srgb, var(--sm-border) 30%, transparent);
}


