@font-face {
  font-family: "TeleNeo Office";
  src: url("../assets/fonts/Tele Neo Office.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* Face editor mode colours stay consistent across tabs, groups and cards. */
body[data-page="face"][data-face-editor-mode="quick"] .simplified-face-groups .group-number {
  background: #17443c;
  color: #79f0da;
}

body[data-page="face"][data-face-editor-mode="quick"] .simplified-face-groups > .field-group[open] > summary {
  background: #263936;
  box-shadow: inset 3px 0 0 #59e0c7;
}

body[data-page="face"][data-face-editor-mode="quick"] .simplified-face-groups .face-image-button.selected,
body[data-page="face"][data-face-editor-mode="quick"] .simplified-face-groups .advanced-preset-card.selected {
  box-shadow: inset 0 0 0 2px #59e0c7;
}

body[data-page="face"][data-face-editor-mode="advanced"] .simplified-face-groups .group-number {
  background: #4b3914;
  color: #ffd77a;
}

body[data-page="face"][data-face-editor-mode="advanced"] .simplified-face-groups > .field-group[open] > summary {
  background: #342c1d;
  box-shadow: inset 3px 0 0 #f0b94a;
}

body[data-page="face"][data-face-editor-mode="advanced"] .simplified-face-groups .face-image-button.selected,
body[data-page="face"][data-face-editor-mode="advanced"] .simplified-face-groups .advanced-preset-card.selected {
  box-shadow: inset 0 0 0 2px #f0b94a;
}

body[data-page="face"][data-face-editor-mode="professional"] #faceGroups .group-number {
  background: #302e57;
  color: #c7c4ff;
}

body[data-page="face"][data-face-editor-mode="professional"] #faceGroups > .field-group[open] > summary {
  background: #302e46;
  box-shadow: inset 3px 0 0 #9d98ff;
}

body[data-page="face"][data-face-editor-mode="professional"] #faceGroups .face-image-button.selected,
body[data-page="face"][data-face-editor-mode="professional"] #faceGroups .advanced-preset-card.selected {
  box-shadow: inset 0 0 0 2px #9d98ff;
}

/* Shared Photo & Music navigation. The music module keeps its own orange accent. */
.topbar .step-tabs {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.topbar .step-tabs a.music-tab:hover,
.topbar .step-tabs a.music-tab.selected {
  color: #fff7ec;
  background: #5a3a0c;
  box-shadow: inset 3px 0 0 #ff9900, 0 10px 28px rgba(0, 0, 0, 0.16);
}

.topbar .step-tabs a.music-tab span,
.topbar .step-tabs a.music-tab.selected span {
  color: #ff9900;
  background: rgba(255, 153, 0, 0.14);
}

@font-face {
  font-family: "TeleNeo Office";
  src: url("../assets/fonts/Tele Neo Office Thin.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "TeleNeo Office";
  src: url("../assets/fonts/Tele Neo Office Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "TeleNeo Office";
  src: url("../assets/fonts/Tele Neo Office Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* 2026 workspace refresh: desktop-first, borderless and cinematic. */
:root {
  --bg: #171919;
  --surface: #202323;
  --surface-2: #252828;
  --surface-3: #1c1f1f;
  --line: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(79, 201, 183, 0.55);
  --text: #d0d1ce;
  --text-strong: #f0f1ed;
  --muted: #8d9290;
  --faint: #606563;
  --aqua: #4fc9b7;
  --aqua-soft: rgba(79, 201, 183, 0.13);
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  background:
    radial-gradient(circle at 72% -20%, rgba(79, 201, 183, 0.055), transparent 34%),
    var(--bg);
}

.topbar,
.app-shell {
  width: min(1920px, 100%);
  padding-left: clamp(28px, 3vw, 56px);
  padding-right: clamp(28px, 3vw, 56px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  min-height: 0;
  padding-top: 15px;
  padding-bottom: 17px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
}

.topbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(20, 22, 22, 0.92);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
}

.brand {
  width: fit-content;
  gap: 13px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 3px;
  background: #193a36;
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.1);
}

.brand-mark i {
  border-radius: 1px;
}

.brand strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.brand small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.025em;
}

.status {
  display: none;
}

.step-tabs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 201, 183, 0.28) transparent;
}

.step-tabs a {
  min-height: 52px;
  padding: 9px 13px;
  gap: 11px;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  color: #aeb1ae;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.step-tabs a:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.step-tabs a.selected {
  border: 0;
  color: #f4fbf8;
  background: #224c47;
  box-shadow: inset 3px 0 0 var(--aqua), 0 10px 28px rgba(0, 0, 0, 0.16);
}

.step-tabs span {
  width: 31px;
  height: 31px;
  border-radius: 3px;
  background: rgba(79, 201, 183, 0.12);
  color: var(--aqua);
  font-size: 11px;
}

.step-tabs a.selected span {
  background: rgba(79, 201, 183, 0.18);
  color: #83dfd1;
}

.app-shell {
  padding-top: clamp(30px, 3vw, 48px);
  padding-bottom: 72px;
}

.page-hero {
  margin-bottom: clamp(28px, 2.5vw, 42px);
}

.page-hero h1 {
  margin-bottom: 11px;
  color: var(--text-strong);
  font-size: clamp(36px, 2.65vw, 54px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.page-hero p:last-child {
  max-width: 880px;
  color: #9da19f;
  font-size: 15px;
  line-height: 1.65;
}

.kicker {
  color: var(--aqua);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-layout,
.workspace {
  gap: clamp(18px, 1.5vw, 28px);
}

.panel,
.summary-panel,
.character-save-panel,
.image-picker-panel,
.field-group,
.time-panel,
.prompt-box,
.special-shot-control {
  border: 0;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.panel {
  padding: clamp(18px, 1.5vw, 26px);
}

.image-picker-panel,
.field-group,
.time-panel,
.prompt-box,
.special-shot-control {
  background: var(--surface-3);
  box-shadow: none;
}

.summary-grid article,
.saved-character-card,
.format-button,
.month-card,
.readout article,
.weather-control-block {
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.032);
  box-shadow: none;
}

.terrain-card,
.element-card,
.face-image-group-button,
.face-image-button,
.weather-image-card {
  border: 0;
  border-radius: 3px;
  background: var(--surface-3);
}

.terrain-card.selected,
.element-card.selected,
.face-image-group-button.selected,
.face-image-button.selected,
.weather-image-card.selected,
.format-button.selected,
.month-card.selected {
  border: 0;
  background: var(--aqua-soft);
  box-shadow: inset 0 0 0 2px rgba(79, 201, 183, 0.78);
}

select,
input[type="text"],
textarea {
  border: 0;
  border-radius: 2px;
  background: #181b1b;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.72), 0 0 0 3px rgba(79, 201, 183, 0.08);
}

.button,
.prompt-box button {
  border: 0;
  border-radius: 2px;
  background: var(--aqua);
  color: #13201e;
  box-shadow: none;
}

.button.ghost,
.prompt-box button {
  background: rgba(79, 201, 183, 0.09);
  color: #75d7c8;
}

.button:hover,
.prompt-box button:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Unified action-button typography, sizing and icon language. */
body .button,
body .prompt-box button {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.action-button::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: var(--action-icon) center / contain no-repeat;
  mask: var(--action-icon) center / contain no-repeat;
}

.action-back {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 5l-7 7 7 7M8 12h11' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.action-next {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5l7 7-7 7M5 12h11' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.action-next::before {
  order: 2;
}

.action-save {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h12l2 2v16H5V3zm3 0v6h8V3M8 21v-7h8v7' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.action-undo {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7H4v-5M4 7c2.2-2.6 5.4-4 8.8-3.6 4.8.6 8.2 5 7.6 9.8-.6 4.8-5 8.2-9.8 7.6-2.5-.3-4.7-1.7-6.1-3.7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.action-redo {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 7h5v-5m0 5c-2.2-2.6-5.4-4-8.8-3.6-4.8.6-8.2 5-7.6 9.8.6 4.8 5 8.2 9.8 7.6 2.5-.3 4.7-1.7 6.1-3.7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.action-copy {
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8' y='8' width='11' height='11' rx='1' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M16 8V5H5v11h3' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (max-width: 1100px) {
  .topbar,
  .app-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .step-tabs {
    grid-template-columns: repeat(4, minmax(155px, 1fr));
  }

  .step-tabs a {
    min-height: 48px;
  }
}

/* Layer Studio: keep the four step descriptions on one shared column. */
.layer-workflow-accordion.field-groups > .layer-workflow-step > summary strong {
  display: grid;
  grid-template-columns: 50px 210px minmax(0, 1fr);
  column-gap: 12px;
}

.layer-workflow-accordion .layer-workflow-number {
  flex: none;
}

.layer-workflow-accordion .group-title,
.layer-workflow-accordion > .layer-workflow-step > summary em {
  min-width: 0;
}

.layer-workflow-accordion .layer-workflow-optional {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border: 1px solid rgba(91, 215, 196, 0.34);
  border-radius: 999px;
  color: #7fe2d3;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .layer-workflow-accordion.field-groups > .layer-workflow-step > summary strong {
    grid-template-columns: 50px minmax(0, 1fr);
    row-gap: 4px;
  }

  .layer-workflow-accordion > .layer-workflow-step > summary em {
    grid-column: 2;
  }
}

/* Contextual video help at the bottom of generator and guide pages. */
.page-tutorial-help {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  margin-top: clamp(42px, 7vw, 86px);
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid rgba(157, 116, 255, 0.2);
  border-radius: 4px;
  background:
    radial-gradient(circle at 90% 10%, rgba(157, 116, 255, 0.13), transparent 42%),
    rgba(255, 255, 255, 0.025);
}

.page-tutorial-copy h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.page-tutorial-copy p {
  max-width: 620px;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

.page-tutorial-eyebrow {
  color: #bca4ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-tutorial-media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background: #111314;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.26);
}

.page-tutorial-media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.page-tutorial-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  justify-items: center;
  gap: 13px;
  color: rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(135deg, rgba(79, 201, 183, 0.12), rgba(157, 116, 255, 0.16)),
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(255, 255, 255, 0.018) 18px 19px);
}

.page-tutorial-play {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding-left: 4px;
  border-radius: 50%;
  background: rgba(157, 116, 255, 0.88);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 12px 30px rgba(94, 57, 183, 0.35);
}

@media (max-width: 800px) {
  .page-tutorial-help {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .page-tutorial-media {
    min-width: 0;
  }
}

/* Tutorial navigation and bilingual video library. */
.step-tabs a.tutorial-tab {
  box-shadow: inset 0 0 0 1px rgba(151, 132, 255, 0.24);
}

.step-tabs a.tutorial-tab span {
  background: rgba(151, 132, 255, 0.16);
  color: #c9beff;
}

.step-tabs a.tutorial-tab:hover,
.step-tabs a.tutorial-tab.selected {
  color: #f3f0ff;
  background: #342b58;
  box-shadow: inset 3px 0 0 #9784ff, 0 10px 28px rgba(0, 0, 0, 0.16);
}

.step-tabs a.tutorial-tab.selected span {
  background: rgba(151, 132, 255, 0.24);
  color: #ded8ff;
}

.tutorial-shell {
  max-width: 1540px;
}

.tutorial-video-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 20px 0;
}
.tutorial-video-links a {
  display: flex;
  flex: 0 1 293px;
  max-width: 100%;
  align-items: center;
  gap: 11px;
  min-height: 57px;
  padding: 10px 13px;
  box-sizing: border-box;
  border-radius: 3px;
  background: #342b58;
  color: #f3f0ff;
  box-shadow: inset 3px 0 0 #9784ff;
  font-size: 16px;
  text-decoration: none;
}
.tutorial-video-links a span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  background: rgba(151, 132, 255, 0.24);
  color: #ded8ff;
  font-weight: 700;
}
.tutorial-video-links a:hover { background: #41366b; }
.tutorial-video-links a:focus-visible { outline: 2px solid #c9beff; outline-offset: 3px; }

.tutorial-intro {
  max-width: 880px;
  margin-bottom: 28px;
}

.tutorial-intro h2 {
  margin: 4px 0 12px;
  color: var(--text-strong);
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.tutorial-intro > p:last-child {
  color: #aeb2af;
  font-size: 16px;
  line-height: 1.65;
}

.tutorial-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.tutorial-video-card {
  min-width: 0;
  padding: 14px 14px 20px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.tutorial-video-placeholder {
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(151, 132, 255, 0.2);
  background:
    radial-gradient(circle at 50% 38%, rgba(151, 132, 255, 0.17), transparent 38%),
    linear-gradient(145deg, #17191d, #101212);
  color: #c9beff;
}

.tutorial-video-embed {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  border: 1px solid rgba(151, 132, 255, 0.2);
  background: #101212;
}

.tutorial-video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.tutorial-video-placeholder span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding-left: 3px;
  border-radius: 50%;
  background: #6f5cd6;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.tutorial-video-placeholder strong {
  color: #ded8ff;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tutorial-video-card .kicker {
  margin: 0 0 8px;
  color: #9f8cf2;
}

.tutorial-video-card h3 {
  margin: 0 0 9px;
  color: var(--text-strong);
  font-size: 19px;
  font-weight: 500;
}

.tutorial-video-card > p:last-child {
  margin: 0;
  color: #9da39f;
  line-height: 1.55;
}

.tutorial-video-card.music .tutorial-video-placeholder {
  border-color: rgba(255, 166, 0, 0.2);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 166, 0, 0.16), transparent 38%),
    linear-gradient(145deg, #1c1914, #101212);
}

.tutorial-video-card.music .tutorial-video-placeholder span {
  background: #a86700;
}

.tutorial-video-card.music .kicker {
  color: #ffa600;
}

.tutorial-workflow {
  margin-top: 18px;
}

.tutorial-pipeline {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  counter-reset: tutorial-step;
}

.tutorial-pipeline li {
  min-width: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 11px;
  align-content: start;
  background: rgba(79, 201, 183, 0.055);
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.12);
  counter-increment: tutorial-step;
}

.tutorial-pipeline li::before {
  content: counter(tutorial-step, decimal-leading-zero);
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #173d37;
  color: var(--aqua);
  font-size: 11px;
  font-weight: 700;
}

.tutorial-pipeline strong {
  color: #dce7e4;
  font-size: 14px;
}

.tutorial-pipeline span {
  margin-top: 5px;
  color: #969d99;
  font-size: 13px;
  line-height: 1.5;
}

.tutorial-workflow code {
  padding: 2px 5px;
  background: rgba(79, 201, 183, 0.09);
  color: #8fe1d5;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

@media (max-width: 1050px) {
  .tutorial-video-grid,
  .tutorial-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .tutorial-video-grid,
  .tutorial-pipeline {
    grid-template-columns: 1fr;
  }
}

.language-switcher {
  position: absolute;
  top: 16px;
  right: 22px;
  z-index: 20;
  display: inline-grid;
  grid-template-columns: repeat(2, 68px);
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(79, 201, 183, 0.28);
  background: rgba(13, 17, 16, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.language-switcher button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #8f9a98;
  font: 700 12px/1 var(--font-ui, Arial, sans-serif);
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.language-switcher button img {
  width: 22px;
  height: 15px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.language-switcher button:hover {
  color: #e9f4f1;
  background: rgba(79, 201, 183, 0.1);
}

.language-switcher button.selected {
  color: #10201d;
  background: #4fc9b7;
}

@media (max-width: 760px) {
  body:not([data-page="home"]) .topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .topbar .site-title,
  .topbar .header-page-intro,
  .topbar .step-tabs,
  .topbar .language-switcher {
    grid-column: 1;
  }

  .topbar .header-page-intro {
    width: 100%;
    justify-self: stretch;
  }

  .language-switcher {
    position: static;
    justify-self: end;
    margin-left: auto;
  }
}

/* Keep every standard action button identical across the complete legacy cascade. */
body .button,
body .prompt-box button {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

body[data-page="face"] .image-picker-panel summary::after {
  display: none !important;
  content: none;
}

body[data-page="face"] .image-picker-panel.is-disabled > summary {
  opacity: 0.58;
  cursor: not-allowed;
}
/* Bilingual user guide entry and page. */
.language-switcher .guide-link,
.language-switcher .contact-link {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  text-align: center;
  font: 600 9px/1.05 var(--font-ui, Arial, sans-serif);
  letter-spacing: 0.025em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.language-switcher .guide-link {
  border: 1px solid #00ff00;
  background: #00ff00;
  color: #071007;
}
.language-switcher .guide-link span,
.language-switcher .contact-link span { width: 22px; height: 22px; flex: 0 0 22px; display: inline-grid; place-items: center; font-weight: 700; }
.language-switcher .guide-link span { background: #003d00; color: #00ff00; }
.language-switcher .guide-link strong,
.language-switcher .contact-link strong { max-width: 66px; font-weight: 600; }
.language-switcher .guide-link:hover { color: #020802; background: #39ff39; border-color: #39ff39; }
.language-switcher .guide-link:hover span { background: #002b00; color: #39ff39; }
.language-switcher .contact-link { border: 1px solid #4fc9b7; background: #173d37; color: #d9f7f2; }
.language-switcher .contact-link span { background: #4fc9b7; color: #10201d; }
.language-switcher .contact-link:hover { border-color: #78e1d1; background: #245e56; color: #fff; }
.language-switcher .contact-link:hover span { background: #78e1d1; }
.guide-shell { max-width: 1320px; }
html { scroll-behavior: smooth; }
.guide-card[id] { scroll-margin-top: 210px; }
.guide-intro { max-width: 820px; margin-bottom: 30px; }
.guide-intro h1 { margin: 0 0 12px; color: var(--text-strong); font-size: clamp(36px, 4vw, 58px); font-weight: 400; }
.guide-intro p { color: #aeb2af; font-size: 16px; line-height: 1.65; }
.guide-language-section { display: none; }
html[lang="hu"] .guide-language-section[lang="hu"], html[lang="en"] .guide-language-section[lang="en"] { display: block; }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.guide-card { padding: clamp(20px, 2vw, 30px); background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.16); }
.guide-card.guide-wide { grid-column: 1 / -1; }
.guide-card h2 { margin: 0 0 14px; color: var(--text-strong); font-size: 22px; font-weight: 500; }
.guide-card h2.numbered-title { display: flex; align-items: center; gap: 12px; }
.guide-number { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; background: #173d37; color: #59d8c5; font-size: 13px; font-weight: 600; }
.guide-number.music { background: #4a3511; color: #ffa600; }
.guide-card h3 { margin: 22px 0 8px; color: #b9eae3; font-size: 16px; }
.guide-card p, .guide-card li { color: #afb3b0; line-height: 1.65; }
.guide-card ol, .guide-card ul { margin: 0; padding-left: 22px; }
.guide-card li + li { margin-top: 9px; }
.guide-footer { margin-top: 22px; padding: 20px 4px 8px; border-top: 1px solid rgba(79, 201, 183, 0.18); color: #858d89; font-size: 12px; text-align: center; }
.guide-footer p { margin: 0; }
.guide-footer a { color: #67d7c6; text-decoration: none; }
.guide-footer a:hover { color: #fff; text-decoration: underline; }
html[lang="hu"] .guide-footer [lang="en"], html[lang="en"] .guide-footer [lang="hu"] { display: none; }

/* Contact page. The form composes a mailto message and stores no visitor data. */
body[data-page="contact"] [lang="en"] { display: none; }
html[lang="en"] body[data-page="contact"] [lang="hu"] { display: none; }
html[lang="en"] body[data-page="contact"] [lang="en"] { display: initial; }
.contact-shell { max-width: 1320px; }
.contact-intro { max-width: 780px; margin-bottom: 28px; }
.contact-intro h2 { margin: 5px 0 12px; color: var(--text-strong); font-size: clamp(30px, 3vw, 46px); font-weight: 400; letter-spacing: -0.025em; }
.contact-intro > p:last-child { margin: 0; color: #aeb2af; font-size: 16px; line-height: 1.65; }
.contact-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: stretch; }
.contact-card { min-width: 0; padding: clamp(22px, 3vw, 34px); background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.16); }
.contact-card h2 { margin: 0 0 18px; color: var(--text-strong); font-size: 23px; font-weight: 500; }
.contact-details { display: flex; flex-direction: column; align-items: flex-start; }
.contact-details h2 { max-width: 100%; font-size: clamp(18px, 2vw, 24px); overflow-wrap: anywhere; }
.contact-details > p:not(.kicker) { color: #aeb2af; line-height: 1.65; }
.contact-card-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 26px; background: #173d37; color: #68ddcc; font-size: 25px; font-weight: 700; }
.contact-email-link { margin-top: 6px; }
.contact-privacy-note { margin: auto 0 0; padding-top: 28px; color: #7f8985 !important; font-size: 12px; }
.contact-form { display: grid; gap: 16px; }
.contact-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.contact-form label { min-width: 0; display: grid; gap: 7px; color: #b9c0bd; font-size: 13px; }
.contact-form label > span { display: block; }
.contact-form label small { color: #7f8985; font-size: 11px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 2px; background: #181b1b; color: var(--text); font: 400 14px/1.4 "TeleNeo Office", Arial, sans-serif; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.contact-form textarea { min-height: 176px; resize: vertical; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: 0; box-shadow: inset 0 0 0 1px rgba(79,201,183,.75), 0 0 0 3px rgba(79,201,183,.08); }
.contact-form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.contact-form-status { color: #78dccc; font-size: 12px; }
@media (max-width: 820px) {
  .contact-grid,
  .contact-form-grid { grid-template-columns: 1fr; }
  .contact-privacy-note { margin-top: 0; }
}
.guide-back-top { position: fixed; right: 22px; bottom: 22px; z-index: 30; min-height: 58px; padding: 9px; display: inline-flex; align-items: center; gap: 10px; border: 0; background: rgba(79,201,183,.08); color: #d9f7f2; font: 400 14px/1.2 var(--font-ui, Arial, sans-serif); letter-spacing: 0; text-decoration: none; text-transform: none; box-shadow: inset 0 0 0 1px rgba(79,201,183,.35), 0 10px 28px rgba(0,0,0,.32); }
.guide-back-top span { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; background: #173d37; color: #59d8c5; font-size: 19px; }
.guide-back-top strong { padding-right: 4px; font-weight: 400; }
.guide-back-top:hover { background: #245e56; color: #fff; }
html[lang="hu"] .guide-back-top [lang="en"], html[lang="en"] .guide-back-top [lang="hu"] { display: none; }
@media (max-width: 760px) { .guide-back-top { right: 12px; bottom: 12px; } }
.guide-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.guide-steps a { min-height: 58px; padding: 9px; display: flex; align-items: center; gap: 10px; background: rgba(79,201,183,.08); color: #d9f7f2; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(79,201,183,.15); }
.guide-steps a:hover { background: #245e56; }
.guide-steps strong { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; margin: 0; background: #173d37; color: var(--aqua); font-size: 13px; }
.guide-steps a:nth-child(5) { box-shadow: inset 0 0 0 1px rgba(255,166,0,.24); }
.guide-steps a:nth-child(5) strong { background: #4a3511; color: #ffa600; }
.guide-steps a:nth-child(5):hover { background: #5b4012; }
.guide-tip { border-left: 3px solid var(--aqua); padding-left: 16px; }
@media (max-width: 900px) { .guide-card[id] { scroll-margin-top: 270px; } .guide-card.guide-wide { grid-column: auto; } .guide-steps { grid-template-columns: 1fr; } }

/* Shared legal pages and site-wide legal navigation. */
:is(body[data-page="legal"], body[data-page="privacy"], body[data-page="responsible-use"]) [lang="en"] { display: none; }
html[lang="en"] :is(body[data-page="legal"], body[data-page="privacy"], body[data-page="responsible-use"]) [lang="hu"] { display: none; }
html[lang="en"] :is(body[data-page="legal"], body[data-page="privacy"], body[data-page="responsible-use"]) [lang="en"] { display: initial; }
.legal-shell { max-width: 1320px; }
.legal-intro { max-width: 900px; margin-bottom: 24px; }
.legal-intro h2 { margin: 5px 0 12px; color: var(--text-strong); font-size: clamp(31px, 3.2vw, 49px); font-weight: 400; letter-spacing: -0.025em; }
.legal-intro > p:last-child { margin: 0; color: #aeb2af; font-size: 16px; line-height: 1.68; }
.legal-toc { position: sticky; top: 210px; z-index: 12; margin: 0 0 18px; padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; background: rgba(23,25,25,.94); box-shadow: 0 12px 32px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.legal-toc a { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; background: #202524; color: #b6dcd6; font-size: 12px; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(79,201,183,.14); }
.legal-toc a:hover { background: #245e56; color: #fff; }
.legal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.legal-card { min-width: 0; padding: clamp(22px, 3vw, 34px); background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.16); scroll-margin-top: 280px; }
.legal-card.legal-wide { grid-column: 1 / -1; }
.legal-card h2 { margin: 5px 0 16px; color: var(--text-strong); font-size: clamp(21px, 2vw, 27px); font-weight: 500; }
.legal-card h3 { margin: 0 0 7px; color: #d7e9e5; font-size: 17px; font-weight: 500; }
.legal-card p, .legal-card li { color: #afb3b0; line-height: 1.68; }
.legal-card p:last-child { margin-bottom: 0; }
.legal-card ul { margin: 0; padding-left: 22px; }
.legal-card li + li { margin-top: 8px; }
.legal-card a { color: #67d7c6; overflow-wrap: anywhere; }
.legal-card code { padding: 2px 5px; background: #171a19; color: #9ee9de; font-size: .92em; }
.legal-details { margin: 0 0 20px; display: grid; gap: 1px; background: rgba(255,255,255,.035); }
.legal-details > div { min-width: 0; padding: 10px 12px; display: grid; grid-template-columns: minmax(105px, .36fr) minmax(0, 1fr); gap: 12px; background: #1b1e1e; }
.legal-details dt { color: #858f8c; font-size: 12px; }
.legal-details dd { min-width: 0; margin: 0; color: #d6d8d4; line-height: 1.45; overflow-wrap: anywhere; }
.legal-details-wide > div { grid-template-columns: minmax(125px, .25fr) minmax(0, 1fr); }
.storage-panel { margin-top: 24px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center; background: #171b1a; box-shadow: inset 3px 0 0 rgba(79,201,183,.64); }
.storage-panel p { margin: 0; }
.storage-panel .button { justify-self: end; }
.storage-status { grid-column: 1 / -1; min-height: 18px; color: #79ddce; font-size: 12px; }
.principle-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.principle-card { min-width: 0; padding: 24px; background: #202323; box-shadow: inset 0 0 0 1px rgba(79,201,183,.1), 0 16px 38px rgba(0,0,0,.14); }
.principle-card > span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 20px; background: #173d37; color: #6fdfcf; font-weight: 700; }
.principle-card h2 { margin: 0 0 10px; color: var(--text-strong); font-size: 20px; font-weight: 500; }
.principle-card p { margin: 0; color: #aeb3b0; line-height: 1.64; }
.legal-warning-section { margin-bottom: 18px; box-shadow: inset 3px 0 0 rgba(255,153,0,.72), 0 18px 48px rgba(0,0,0,.16); }
.legal-warning-section > .kicker { color: #ffad33; }
.prohibited-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.prohibited-grid > div { padding: 16px; background: #191c1c; }
.prohibited-grid strong { display: block; margin-bottom: 7px; color: #ead6b5; font-size: 14px; }
.prohibited-grid p { margin: 0; font-size: 13px; }
.site-legal-footer { width: min(1920px, 100%); margin: 0 auto; padding: 24px clamp(28px,3vw,56px) 30px; border-top: 1px solid rgba(79,201,183,.15); color: #7f8885; font-size: 12px; text-align: center; }
.site-legal-footer p { margin: 0; }
.site-legal-footer a, .site-legal-links a { color: #67d7c6; text-decoration: none; }
.site-legal-footer a:hover, .site-legal-links a:hover { color: #fff; text-decoration: underline; }
.site-legal-footer [lang="en"], .site-legal-links [lang="en"] { display: none; }
html[lang="en"] .site-legal-footer [lang="hu"], html[lang="en"] .site-legal-links [lang="hu"] { display: none; }
html[lang="en"] .site-legal-footer [lang="en"], html[lang="en"] .site-legal-links [lang="en"] { display: initial; }
.site-legal-links { margin-top: 10px !important; color: #7f8885; }
@media (max-width: 1050px) {
  .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prohibited-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .legal-grid, .principle-grid, .prohibited-grid { grid-template-columns: 1fr; }
  .legal-card.legal-wide { grid-column: auto; }
  .legal-toc { position: static; flex-wrap: nowrap; overflow-x: auto; }
  .legal-toc a { flex: 0 0 auto; }
  .legal-card { scroll-margin-top: 24px; }
  .legal-details > div, .legal-details-wide > div { grid-template-columns: 1fr; gap: 4px; }
  .storage-panel { grid-template-columns: 1fr; }
  .storage-panel .button { justify-self: start; }
  .storage-status { grid-column: 1; }
  .site-legal-footer { padding-left: 18px; padding-right: 18px; line-height: 1.8; }
}

html,
body {
  overflow-x: clip;
}

/* Biztonságos alkotási munkafolyamat: előzmények, zárolások, ellenőrzés. */
.workflow-tools {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: minmax(410px, 1.2fr) minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 10px;
  align-items: start;
}

.history-controls,
.workflow-details {
  min-height: 58px;
  border: 0;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--text);
}

.history-controls {
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto auto minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.workflow-button,
.lock-chip {
  border: 0;
  border-radius: 2px;
  background: #1a211f;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.workflow-button {
  min-height: 40px;
  padding: 0 13px;
}

.workflow-button:hover:not(:disabled),
.lock-chip:hover {
  background: #2b3331;
  color: var(--text-strong);
}

.workflow-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.history-select {
  width: 100%;
  min-height: 40px;
}

#historyStatus {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.workflow-details > summary {
  min-height: 58px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.workflow-details > summary::-webkit-details-marker {
  display: none;
}

.workflow-details > summary:hover,
.workflow-details[open] > summary {
  background: #2b3331;
}

.workflow-details > summary strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
}

.workflow-details > summary span {
  color: var(--aqua);
  font-size: 13px;
}

.lock-grid,
.consistency-list {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: #171b1a;
}

.workflow-help {
  margin: 0;
  padding: 10px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: #171b1a;
  color: #a9aeac;
  font-size: 12px;
  line-height: 1.45;
}

.workflow-help + .lock-grid,
.workflow-help + .consistency-list {
  border-top: 0;
}

.lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 340px;
  overflow: auto;
}

.lock-chip {
  min-height: 42px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.lock-chip span {
  color: var(--muted);
}

.lock-chip.locked {
  background: rgba(79, 201, 183, 0.14);
  color: #eaf8f5;
  box-shadow: inset 3px 0 0 var(--aqua);
}

.lock-chip.locked span {
  color: var(--aqua);
}

.consistency-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.consistency-item {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.consistency-item i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--muted);
}

.consistency-item.warning i { background: #e7a85c; }
.consistency-item.success i { background: var(--aqua); }
.consistency-item.fixed i { background: #7ea9db; }

.consistency-item strong {
  color: var(--text-strong);
  font-size: 13px;
}

.consistency-item p {
  margin: 3px 0 0;
  color: #a9aeac;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1250px) {
  .workflow-tools {
    grid-template-columns: 1fr 1fr;
  }

  .history-controls {
    grid-column: 1 / -1;
  }
}

/* Weather page: numbered, square sections and unambiguous selections. */
body[data-page="weather"] .page-panel {
  background: var(--surface);
}

body[data-page="weather"] .weather-visual-panel {
  margin-top: 12px;
  background: transparent;
  box-shadow: none;
}

body[data-page="weather"] .weather-visual-panel > summary {
  min-height: 62px;
  padding: 10px 12px;
  background: #252b2a;
  transition: background 160ms ease;
}

body[data-page="weather"] .weather-visual-panel:nth-of-type(even) > summary {
  background: #222827;
}

body[data-page="weather"] .weather-visual-panel > summary:hover {
  background: #2b3331;
}

body[data-page="weather"] .weather-visual-panel[open] > summary {
  background: #263936;
}

body[data-page="weather"] .weather-visual-panel .weather-panel-content {
  padding: 12px;
  background: #151818;
}

body[data-page="weather"] .temperature-control {
  background: #252b2a;
}

.weather-visual-panel > summary {
  justify-content: flex-start;
  gap: 12px;
}

.weather-visual-panel > summary::after {
  margin-left: auto;
}

.weather-section-number,
.time-control-block .weather-control-heading > span,
.temperature-control .weather-control-heading > span {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 0;
  background: #193a36;
  color: #60d8c6;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.weather-section-number {
  font-family: inherit;
}

.weather-control-heading {
  gap: 12px;
}

.weather-control-heading strong,
.weather-visual-panel > summary > span {
  color: #e7e9e5;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.weather-control-block.time-control-block,
.weather-control-block.temperature-control,
.time-control-block .time-panel,
.weather-visual-panel .weather-image-card,
.weather-visual-panel .weather-image-card img,
.weather-visual-panel .month-card,
.weather-visual-panel .weather-panel-content {
  border-radius: 0;
}

.weather-control-block.time-control-block,
.time-control-block .time-panel {
  background: #252b2a !important;
  box-shadow: none;
}

body[data-page="weather"] .time-control-block .weather-control-heading strong,
body[data-page="weather"] .temperature-control .weather-control-heading strong {
  color: #e7e9e5;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.time-control-block .time-panel {
  padding-right: 0;
  padding-left: 0;
  border: 0;
}

body .terrain-card.selected,
body .element-card.selected,
body .face-image-group-button.selected,
body .face-image-button.selected,
body .weather-image-card.selected,
body .format-button.selected,
body .month-card.selected,
body .terrain-card[aria-pressed="true"],
body .element-card[aria-pressed="true"],
body .face-image-group-button[aria-pressed="true"],
body .face-image-button[aria-pressed="true"],
body .weather-image-card[aria-pressed="true"],
body .format-button[aria-pressed="true"],
body .month-card[aria-pressed="true"] {
  position: relative;
  outline: 3px solid #4fc9b7;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 1px rgba(232, 255, 251, 0.72);
}

/* The weather selection sits above both the image and its caption. */
body[data-page="weather"] .weather-image-card.selected,
body[data-page="weather"] .weather-image-card[aria-pressed="true"],
body[data-page="weather"] .month-card.selected,
body[data-page="weather"] .month-card[aria-pressed="true"] {
  outline: 0;
}

body[data-page="weather"] .weather-image-card.selected::after,
body[data-page="weather"] .weather-image-card[aria-pressed="true"]::after,
body[data-page="weather"] .month-card.selected::after,
body[data-page="weather"] .month-card[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px #4fc9b7;
}

/* Square, borderless preview surfaces. */
body .scene-preview,
body .scene-image,
body .summary-panel,
body .summary-grid article,
body .film-preview,
body .film-preview-label {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body .film-preview {
  width: min(100%, 780px);
  filter: none;
}

body .film-cell {
  box-shadow: none;
}

body .film-preview .film-perforations {
  height: 64px;
}

body .film-preview .film-preview-label {
  bottom: 12px;
  padding: 8px 15px;
  font-size: clamp(13px, 1.6vw, 20px);
}

.prompt-tabs {
  display: grid;
  gap: 0;
  background: #151818;
}

.prompt-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  background: #111414;
}

.photo-prompt-tab-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.face-editor-modes {
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(91, 215, 196, 0.16);
  background: #111414;
}

.face-editor-mode-heading {
  padding: 14px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.face-editor-mode-heading .kicker,
.face-editor-mode-heading h3,
.face-editor-mode-description {
  margin: 0;
}

.face-editor-mode-heading h3 {
  margin-top: 3px;
  color: #e7e9e5;
  font-size: 17px;
}

.face-editor-mode-status {
  padding: 7px 10px;
  background: #193a36;
  color: #80e3d4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.face-editor-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.face-editor-mode-description {
  min-height: 42px;
  padding: 2px 16px 14px;
  color: #a8b0ad;
  font-size: 14px;
  line-height: 1.5;
}

.simplified-face-groups[hidden],
#faceGroups[hidden] {
  display: none;
}

.simplified-face-groups .simple-face-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.simplified-face-groups .simple-face-field > label {
  color: #cbd1ce;
  font-size: 13px;
  font-weight: 700;
}

.simplified-face-groups .simple-face-field select {
  width: 100%;
}

.simplified-face-groups .simple-face-help {
  margin: 0;
  color: #8f9995;
  font-size: 12px;
  line-height: 1.45;
}

.simplified-face-groups .simple-face-preset {
  padding: 12px;
  border-left: 3px solid #326b62;
  background: rgba(91, 215, 196, 0.055);
}

.simplified-face-groups .simple-face-preset select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.simplified-face-groups .simple-face-empty {
  padding: 15px;
  background: rgba(255, 255, 255, 0.035);
  color: #a8b0ad;
  line-height: 1.55;
}

.layer-pack-hint {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.layer-pack-prompt-box { overflow: hidden; }

.layer-studio-titlebar,
.layer-source-meta,
.layer-list-head,
.layer-background-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layer-studio-titlebar { justify-content: space-between; }

.layer-studio-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid rgba(79, 201, 183, 0.3);
  border-radius: 999px;
  background: rgba(79, 201, 183, 0.08);
  color: var(--aqua);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.layer-studio-intro {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.layer-studio {
  padding: 12px;
  background: #181b1a;
}

.layer-upload-zone {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed rgba(79, 201, 183, 0.55);
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(79, 201, 183, 0.08), rgba(13, 16, 15, 0.18));
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.layer-upload-zone:hover,
.layer-upload-zone.is-dragging {
  border-color: var(--aqua);
  background: rgba(79, 201, 183, 0.13);
}

.layer-upload-zone[hidden],
.layer-studio-workspace[hidden] { display: none; }

.layer-upload-zone small { color: var(--muted); }

.layer-upload-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(79, 201, 183, 0.46);
  border-radius: 50%;
  color: var(--aqua);
  font-size: 28px;
  font-weight: 300;
}

.layer-studio-workspace {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.layer-pack-prompt-box > .layer-studio {
  display: block;
  width: 100%;
}

body .layer-studio .button,
body .layer-studio button,
.layer-studio select {
  font-size: 14px;
}

.layer-source-meta {
  flex-wrap: wrap;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #202321;
}

.layer-source-meta strong {
  overflow: hidden;
  max-width: min(420px, 70vw);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-source-meta span,
.layer-list-head span,
.layer-background-panel > span {
  color: var(--muted);
  font-size: 10px;
}

.layer-source-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.layer-source-actions .layer-remove-source {
  border-color: rgba(255, 117, 111, 0.48);
  color: #efb3b3;
}

.layer-source-actions .layer-remove-source:hover {
  border-color: #ff756f;
  background: rgba(255, 117, 111, 0.1);
  color: #fff0ef;
}

.layer-mask-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 9px;
  border: 1px solid var(--line);
  background: #202321;
}

.layer-mask-toolbar .button.selected {
  border-color: var(--aqua);
  background: rgba(79, 201, 183, 0.18);
  color: var(--aqua);
}

.layer-mask-toolbar .layer-sign-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.layer-sign-button > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: transparent;
  color: var(--aqua);
  font-size: 22px;
  line-height: 1;
}

.layer-workflow-accordion {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.layer-workflow-step {
  overflow: hidden;
  border: 0;
  background: #151818;
}

.layer-workflow-step > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px 10px 12px;
  background: #252b2a;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  outline: none;
  transition: background-color 150ms ease;
}

.layer-workflow-step > summary::-webkit-details-marker { display: none; }

.layer-workflow-step:nth-child(even) > summary { background: #222827; }

.layer-workflow-step > summary:hover { background: #2b3331; }

.layer-workflow-step[open] > summary { background: #263936; }

.layer-workflow-step.is-disabled > summary,
.layer-workflow-step.is-disabled > summary:hover {
  background: #202423;
  color: #79817e;
  cursor: not-allowed;
  opacity: 0.62;
}

.layer-workflow-step.is-disabled .layer-workflow-number {
  background: #26302e;
  color: #73817e;
}

.layer-workflow-step > summary:focus-visible {
  box-shadow: inset 0 0 0 1px var(--aqua);
}

.layer-workflow-number {
  display: grid;
  width: 50px;
  height: 42px;
  flex: 0 0 50px;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.layer-workflow-label {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

.layer-workflow-label strong {
  color: #e7e9e5;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.layer-workflow-label small {
  color: #a8b0ad;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.layer-workflow-content {
  padding: 10px;
  border-top: 1px solid var(--line);
}

.layer-workflow-content .layer-mask-toolbar {
  padding: 0;
  border: 0;
  background: transparent;
}

.layer-workflow-content .layer-background-heading {
  min-height: 40px;
  padding: 0;
}

.layer-workflow-content .layer-background-transform {
  padding: 10px 0 0;
}

.layer-workflow-content .layer-color-match {
  padding: 0;
  border-top: 0;
}

.layer-ai-button {
  border-color: rgba(79, 201, 183, 0.55);
  color: var(--aqua);
}

.layer-brush-control {
  display: grid;
  grid-template-columns: auto minmax(80px, 125px) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 7px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.layer-brush-control input { width: 100%; }

.layer-brush-control output {
  min-width: 34px;
  color: var(--text);
  text-align: right;
}

.layer-backdrop-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 7px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.layer-backdrop-control select {
  min-width: 92px;
  min-height: 28px;
  border: 1px solid var(--line);
  background: #171a19;
  color: var(--text);
  font: inherit;
}

.layer-backdrop-warning {
  min-height: 28px;
  padding: 7px 9px;
  border-left: 3px solid #ffb14f;
  background: rgba(255, 177, 79, 0.1);
  color: #ffd29a;
  font-size: 10px;
}

.layer-mask-toolbar [hidden] {
  display: none !important;
}

.layer-canvas-dock {
  min-width: 0;
}

.layer-canvas-window {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #151818;
}

.layer-canvas-window-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 28px 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #222827;
  color: #e7e9e5;
  user-select: none;
  touch-action: none;
}

.layer-canvas-window-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.layer-canvas-window-title strong {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.layer-canvas-window-title small {
  overflow: hidden;
  color: #9da8a4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-canvas-window-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.layer-canvas-window-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(79, 201, 183, 0.22);
  border-radius: 0;
  background: #193a36;
  color: #75dfcf;
  cursor: pointer;
  font: 700 15px/1 "TeleNeo Office", Arial, sans-serif;
}

.layer-canvas-window-actions button:hover {
  border-color: rgba(79, 201, 183, 0.58);
  background: #25564f;
  color: #ffffff;
}

.layer-canvas-window-actions button:focus-visible {
  outline: 1px solid var(--aqua);
  outline-offset: 1px;
}

.layer-canvas-window.is-floating {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 240px;
  border-radius: 14px;
  border-color: rgba(79, 201, 183, 0.32);
  background: #0d1010;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.64), 0 0 0 1px rgba(0, 0, 0, 0.48);
}

.layer-canvas-window.is-floating .layer-canvas-window-header {
  flex: 0 0 44px;
  cursor: grab;
}

.layer-canvas-window.is-floating.is-dragging .layer-canvas-window-header {
  cursor: grabbing;
}

.layer-canvas-window.is-floating .layer-canvas-shell {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 16px;
  border: 0;
  background-color: #0b0d0d;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.045) 75%);
}

.layer-canvas-window.is-floating .layer-canvas-shell canvas {
  max-width: var(--floating-canvas-max-width, 100%);
  max-height: var(--floating-canvas-max-height, 100%);
}

.layer-canvas-window.is-floating #layerSourceCanvas,
.layer-canvas-window.is-floating #layerCompositeCanvas:not([hidden]) {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 34px rgba(0, 0, 0, 0.58);
}

.layer-canvas-window.is-floating.is-minimized {
  min-height: 44px;
  height: 44px !important;
}

.layer-canvas-window.is-minimized .layer-canvas-shell,
.layer-canvas-window.is-minimized .layer-canvas-resize-handle {
  display: none;
}

.layer-canvas-resize-handle {
  position: absolute;
  z-index: 7;
  display: none;
  width: 22px;
  height: 22px;
  touch-action: none;
}

.layer-canvas-window.is-floating:not(.is-minimized) .layer-canvas-resize-handle {
  display: block;
}

.layer-canvas-resize-handle::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(117, 223, 207, 0.88);
  border-style: solid;
}

.layer-canvas-resize-handle.is-nw { top: 0; left: 0; cursor: nwse-resize; }
.layer-canvas-resize-handle.is-ne { top: 0; right: 0; cursor: nesw-resize; }
.layer-canvas-resize-handle.is-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.layer-canvas-resize-handle.is-se { right: 0; bottom: 0; cursor: nwse-resize; }
.layer-canvas-resize-handle.is-nw::after { top: 3px; left: 3px; border-width: 2px 0 0 2px; }
.layer-canvas-resize-handle.is-ne::after { top: 3px; right: 3px; border-width: 2px 2px 0 0; }
.layer-canvas-resize-handle.is-sw::after { bottom: 3px; left: 3px; border-width: 0 0 2px 2px; }
.layer-canvas-resize-handle.is-se::after { right: 3px; bottom: 3px; border-width: 0 2px 2px 0; }

.layer-canvas-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  background-color: #141616;
  background-image:
    linear-gradient(45deg, #202423 25%, transparent 25%),
    linear-gradient(-45deg, #202423 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #202423 75%),
    linear-gradient(-45deg, transparent 75%, #202423 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.layer-canvas-shell canvas {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

#layerMaskCanvas {
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}

#layerMaskCanvas.is-brush-active { cursor: none; }

.layer-brush-cursor {
  --brush-hard-stop: 45%;
  position: absolute;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 201, 183, 0.2) 0 var(--brush-hard-stop), rgba(79, 201, 183, 0.08) var(--brush-hard-stop), rgba(79, 201, 183, 0) 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.92), inset 0 0 0 1px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.layer-brush-cursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%);
}

.layer-brush-cursor.is-erase {
  border-color: #ff756f;
  background: radial-gradient(circle, rgba(255, 117, 111, 0.2) 0 var(--brush-hard-stop), rgba(255, 117, 111, 0.08) var(--brush-hard-stop), rgba(255, 117, 111, 0) 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.92), inset 0 0 0 1px rgba(255, 117, 111, 0.4);
}

#layerCompositeCanvas {
  z-index: 1;
  pointer-events: none;
}

#layerCompositeCanvas[hidden] { display: none; }

#layerExportTransparent[hidden],
#layerExportComposite[hidden],
#layerExportChroma[hidden] { display: none; }

.layer-create-row[hidden],
.layer-list-panel[hidden],
.layer-export-actions[hidden],
.layer-export-note[hidden] { display: none; }

#layerMaskCanvas.is-background-moving { cursor: grab; }

#layerMaskCanvas.is-background-dragging { cursor: grabbing; }

.layer-canvas-help {
  position: sticky;
  z-index: 3;
  align-self: end;
  justify-self: center;
  bottom: 8px;
  grid-area: 1 / 1;
  margin: 8px;
  padding: 5px 9px;
  border-radius: 2px;
  background: rgba(5, 8, 7, 0.78);
  color: #d2d8d6;
  font-size: 12px;
  pointer-events: none;
}

.layer-mask-status {
  min-height: 34px;
  padding: 8px 10px;
  border-left: 3px solid var(--aqua);
  background: rgba(79, 201, 183, 0.07);
  color: #cbd4d1;
  font-size: 13px;
  line-height: 1.5;
}

.layer-mask-status.is-error {
  border-left-color: #d97676;
  background: rgba(217, 118, 118, 0.09);
  color: #efb3b3;
}

.layer-create-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(150px, 1fr) minmax(85px, 0.45fr) auto;
  gap: 9px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  background: #202321;
}

.layer-create-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.layer-create-row input,
.layer-create-row select {
  width: 100%;
  min-height: 34px;
}

.layer-list-panel,
.layer-background-panel {
  border: 1px solid var(--line);
  background: #202321;
}

.layer-list-head {
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.layer-list { display: grid; }

.layer-empty-state {
  margin: 0;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 11px;
}

.layer-list-item {
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) auto auto auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.layer-list-item:last-child { border-bottom: 0; }

.layer-list-thumb {
  width: 38px;
  height: 38px;
  border: 1px solid #3a403e;
  object-fit: contain;
  background-color: #151817;
  background-image: linear-gradient(45deg, #292d2c 25%, transparent 25%), linear-gradient(-45deg, #292d2c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #292d2c 75%), linear-gradient(-45deg, transparent 75%, #292d2c 75%);
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: 10px 10px;
}

.layer-list-meta { min-width: 0; }

.layer-list-meta strong,
.layer-list-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-list-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.layer-background-panel {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px;
}

.layer-background-panel-top {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #202321;
  box-shadow: none;
}

.layer-background-panel > div { flex: 1 1 300px; }

.layer-background-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 100% !important;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 10px;
}

.layer-background-heading > strong { min-width: 70px; }

.layer-background-heading > span {
  flex: 1 1 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-background-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.layer-background-upload { cursor: pointer; }

#layerBackgroundRemove[hidden] { display: none; }

.layer-background-transform,
.layer-background-transform label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-background-transform {
  flex: 1 1 100%;
  justify-content: flex-start;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.layer-background-transform[hidden] { display: none; }

.layer-background-transform input[type="range"] { width: min(220px, 34vw); }

.layer-background-transform output {
  min-width: 38px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.layer-color-match label,
.layer-color-actions,
.layer-color-sliders label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-color-details {
  flex: 1 1 100%;
  border-top: 1px solid var(--line);
}

.layer-color-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  outline: none;
}

.layer-color-details summary::-webkit-details-marker { display: none; }

.layer-color-details summary::after {
  margin-left: auto;
  color: var(--aqua);
  content: "+";
  font-size: 18px;
}

.layer-color-details[open] summary::after { content: "−"; }

.layer-color-details summary span {
  color: var(--muted);
  font-size: 10px;
}

.layer-color-details summary:hover { background: rgba(79, 201, 183, 0.05); }

.layer-color-details summary:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.45);
}

.layer-color-match {
  display: grid;
  flex: 1 1 100% !important;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.layer-color-match[hidden] { display: none; }

.layer-color-actions { flex-wrap: wrap; }

.layer-color-actions .button:last-child { margin-left: auto; }

.layer-color-sliders {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  justify-content: start;
  gap: 10px;
}

.layer-color-target select {
  min-width: 160px;
  min-height: 32px;
}

.layer-color-match label {
  color: var(--muted);
  font-size: 13px;
}

.layer-color-sliders label {
  display: grid;
  grid-template-columns: 110px 220px 52px;
  justify-content: start;
  width: 100%;
}

.layer-color-match input[type="range"] { width: 220px; }

.layer-color-match output {
  min-width: 34px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.layer-image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
}

.layer-image-actions .button { min-width: 116px; }

.layer-api-key-panel input { min-height: 34px; }

.layer-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.layer-export-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .layer-create-row { grid-template-columns: 1fr 1fr; }
  .layer-create-row .button { width: 100%; }
  .layer-list-item { grid-template-columns: 38px minmax(90px, 1fr) auto; }
  .layer-list-item .layer-order-button { display: none; }
  .layer-color-sliders { grid-template-columns: minmax(0, 100%); }
}

@media (max-width: 980px) {
  .layer-canvas-window.is-floating {
    position: relative;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    box-shadow: none;
  }

  .layer-canvas-window.is-floating .layer-canvas-window-header {
    cursor: default;
  }

  .layer-canvas-window .layer-canvas-resize-handle {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .layer-create-row { grid-template-columns: 1fr; }
  .layer-canvas-shell { min-height: 260px; }
  .layer-color-sliders { grid-template-columns: 1fr; }
  .layer-color-sliders label { grid-template-columns: 90px minmax(110px, 1fr) 44px; }
  .layer-color-match input[type="range"] { width: 100%; }
  .layer-color-actions .button { flex: 1 1 140px; }
  .layer-mask-toolbar > .button,
  .layer-export-actions .button { flex: 1 1 145px; }
}

@media (max-width: 760px) {
  .photo-prompt-tab-list,
  .face-editor-mode-tabs {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .face-editor-mode-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .face-editor-mode-status {
    white-space: normal;
  }
}

button.prompt-tab {
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #aeb5b2;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

button.prompt-tab > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 16px;
  font-weight: 700;
}

button.prompt-tab:hover {
  background: #2b3331;
  color: #e7e9e5;
}

button.prompt-tab.selected,
button.prompt-tab[aria-selected="true"] {
  background: #25564f;
  color: #f1f5f3;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

button.prompt-tab:focus-visible {
  outline: 2px solid #80e3d4;
  outline-offset: -2px;
}

body .prompt-tab-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.prompt-tab-panel[hidden] {
  display: none;
}

.environment-mode-tabs {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

button.environment-mode-tab {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #aeb5b2;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

button.environment-mode-tab > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 16px;
  font-weight: 700;
}

button.environment-mode-tab:hover {
  background: #2b3331;
  color: #e7e9e5;
}

button.environment-mode-tab.selected,
button.environment-mode-tab[aria-selected="true"] {
  background: #25564f;
  color: #f1f5f3;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

.environment-mode-options {
  margin-bottom: 12px;
  padding: 14px;
  background: #202625;
}

.built-category-tabs {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.landscape-category-tabs {
  margin-bottom: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .landscape-category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

button.built-category-tab {
  min-height: 56px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #aeb5b2;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

button.built-category-tab > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 16px;
  font-weight: 700;
}

button.built-category-tab:hover {
  background: #2b3331;
  color: #e7e9e5;
}

button.built-category-tab.selected,
button.built-category-tab[aria-selected="true"] {
  background: #25564f;
  color: #f1f5f3;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

.interior-lighting-options {
  margin-bottom: 12px;
}

.image-picker-panel.interior-lighting-options {
  padding: 12px;
  background: var(--surface-2);
}

body[data-page="environment"] .interior-lighting-options summary::after,
body[data-page="weather"] .weather-visual-panel > summary::after {
  display: none;
}

body[data-page="weather"] .weather-visual-panel > summary {
  justify-content: flex-start;
}

body[data-page="weather"] .weather-visual-panel > summary > span {
  margin: 0;
  text-align: left;
}

body[data-page="environment"] .interior-lighting-options > summary {
  min-height: 62px;
  padding: 10px 12px;
  background: var(--surface-2);
  transition: background 160ms ease;
}

body[data-page="environment"] .interior-lighting-options > summary:hover {
  background: #2b3331;
}

body[data-page="environment"] .interior-lighting-options[open] > summary {
  background: #263936;
}

.interior-lighting-options > summary {
  justify-content: flex-start;
}

.interior-lighting-options > summary > span {
  margin-right: auto;
  text-align: left;
}

section.interior-lighting-options {
  padding: 14px;
  background: #202625;
}

.environment-mode-options[hidden],
.interior-lighting-options[hidden] {
  display: none;
}

.environment-mode-options input {
  width: 100%;
}

.interior-lighting-content {
  padding: 14px;
  background: #151918;
}

.interior-lighting-content > p {
  margin: 0 0 12px;
  color: #9ca4a1;
  font-size: 12px;
}

.interior-light-picker-panel {
  margin-top: 10px;
  background: #222827;
}

.image-picker-panel .interior-light-picker-panel > summary {
  min-height: 56px;
  padding-inline: 16px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.interior-light-picker-panel > summary::-webkit-details-marker {
  display: none;
}

.interior-light-picker-panel > summary > span {
  min-width: 0;
  margin-right: auto;
  color: #f2f2f2;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}

.interior-light-picker-panel > summary::after {
  content: "+";
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #4fc9b7;
  color: #26302e;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.interior-light-picker-panel[open] > summary::after {
  content: "−";
}

.interior-light-visual-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  background: #151918;
}

.interior-light-card {
  position: relative;
  min-width: 0;
  padding: 0;
  aspect-ratio: 4 / 3;
  border: 0;
  background: #181c1b;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}

.interior-light-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.interior-light-card span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  min-height: 30px;
  padding: 6px 8px;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 9, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.interior-light-card.selected,
.interior-light-card[aria-pressed="true"] {
  outline: 3px solid #4fc9b7;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 1px rgba(232, 255, 251, 0.72);
}

.interior-light-card:hover img {
  transform: scale(1.035);
}

section.interior-lighting-options > header {
  margin-bottom: 12px;
  display: grid;
  gap: 4px;
}

section.interior-lighting-options > header strong {
  color: #e7e9e5;
  font-size: 16px;
  font-weight: 600;
}

section.interior-lighting-options > header small {
  color: #9ca4a1;
  font-size: 12px;
}

.interior-light-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.interior-light-grid label {
  display: grid;
  gap: 6px;
  color: #b5bbb8;
  font-size: 13px;
}

.terrain-grid[data-environment-mode="built"] .terrain-card,
.terrain-grid[data-environment-mode="interior"] .terrain-card {
  min-height: 176px;
  padding: 12px;
  align-content: space-between;
}

.scene-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(135deg, #182422, #31504b 55%, #171b1b);
}

.scene-placeholder[hidden] {
  display: none;
}

.scene-placeholder span {
  color: #5bd7c4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.scene-placeholder strong {
  margin-top: 5px;
  color: #f1f4f2;
  font-size: 26px;
  font-weight: 400;
}

.scene-preview[data-environment-mode="interior"] .scene-placeholder {
  background: linear-gradient(135deg, #202322, #46524f 55%, #181b1b);
}

#outdoorLightPanel[hidden],
#windPanel[hidden] {
  display: none;
}

.landing-hero {
  position: relative;
  min-height: clamp(560px, calc(100vh - 205px), 860px);
  overflow: hidden;
  border-radius: 3px;
  background: #111313;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

.landing-hero > img,
.landing-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landing-hero > img {
  display: block;
  object-fit: cover;
  object-position: 63% center;
  filter: saturate(0.88) contrast(1.04) brightness(0.82);
}

.landing-hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(10, 12, 12, 0.94) 0%, rgba(10, 12, 12, 0.78) 29%, rgba(10, 12, 12, 0.26) 58%, transparent 78%),
    linear-gradient(0deg, rgba(10, 12, 12, 0.52), transparent 36%);
}

.landing-hero-content {
  position: relative;
  z-index: 2;
  min-height: inherit;
  width: min(940px, 74%);
  margin-left: clamp(28px, 4vw, 76px);
  padding: clamp(48px, 4vw, 76px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.landing-hero-content h1 {
  max-width: 760px;
  margin: 12px 0 22px;
  color: #f5f3ed;
  font-size: clamp(38px, 3.6vw, 66px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.landing-hero-content h1 span {
  display: block;
  white-space: nowrap;
}

html[lang="en"] #landingTitle span:nth-child(3) {
  display: none;
}

.landing-hero-content > p:not(.kicker) {
  max-width: 590px;
  margin: 0;
  color: rgba(239, 240, 234, 0.74);
  font-size: clamp(15px, 1.05vw, 19px);
  line-height: 1.65;
}

.landing-hero-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.landing-hero-actions .button {
  min-height: 46px;
  padding-inline: 21px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.landing-text-link {
  color: rgba(242, 243, 237, 0.8);
  font-size: 13px;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.landing-text-link span {
  margin-left: 8px;
  color: var(--aqua);
  transition: margin-left 160ms ease;
}

.landing-text-link:hover {
  color: #fff;
}

.landing-text-link:hover span {
  margin-left: 13px;
}

.landing-hero-index {
  position: absolute;
  z-index: 2;
  right: clamp(24px, 3vw, 52px);
  bottom: clamp(22px, 2.4vw, 40px);
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-hero + .page-hero {
  margin-top: clamp(58px, 5vw, 92px);
  scroll-margin-top: 190px;
}

@media (max-width: 1100px) {
  .landing-hero {
    min-height: 600px;
  }

  .landing-hero > img {
    object-position: 68% center;
  }

  .landing-hero-content {
    width: 82%;
    padding: 54px 36px;
  }

  .landing-hero-content h1 {
    font-size: clamp(36px, 5vw, 52px);
  }
}

@media (max-width: 700px) {
  .landing-hero-content {
    width: calc(100% - 28px);
    margin-left: 14px;
    padding: 42px 22px;
  }

  .landing-hero-content h1 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .landing-hero-content h1 span {
    display: block;
    white-space: nowrap;
  }

  .landing-hero-content h1 span + span {
    font-size: clamp(16px, 4.7vw, 30px);
  }
}

:root {
  color-scheme: dark;
  --bg: #303030;
  --surface: #303030;
  --surface-2: #343434;
  --surface-3: #292929;
  --line: rgba(43, 196, 178, 0.28);
  --line-strong: rgba(43, 196, 178, 0.62);
  --text: #a9a9a9;
  --text-strong: #c2c2c2;
  --muted: #898989;
  --faint: #666666;
  --aqua: #2bc4b2;
  --aqua-soft: rgba(43, 196, 178, 0.16);
  --shadow: rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "TeleNeo Office", Arial, system-ui, sans-serif;
  line-height: 1.45;
}

button,
select,
input,
textarea {
  font: inherit;
}

button,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.topbar,
.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
}

.brand-mark i {
  display: block;
  align-self: end;
  background: var(--aqua);
  border-radius: 3px;
}

.brand-mark i:nth-child(1) { height: 48%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 66%; }

.brand strong,
.brand small {
  display: block;
  line-height: 1;
  letter-spacing: 0;
}

.brand strong {
  font-size: 15px;
  font-weight: 400;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.status {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.status span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--aqua);
}

.status.ready span {
  background: var(--aqua);
}

.app-shell {
  padding-bottom: 54px;
}

.step-tabs {
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.step-tabs a {
  min-height: 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-3);
  text-decoration: none;
}

.step-tabs a.selected {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: var(--text-strong);
}

.step-tabs span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--aqua-soft);
  color: var(--aqua);
  font-size: 11px;
}

.page-hero {
  margin: 0 0 26px;
}

.page-hero h1 {
  margin-bottom: 8px;
}

.page-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: start;
  gap: 18px;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.page-panel {
  min-height: 360px;
}

.single-field {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
}

.side-panel {
  position: sticky;
  top: 16px;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.summary-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-grid article {
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--aqua);
  font-size: 10px;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.face-actions > .button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.button.ghost.screen-button[aria-pressed="true"] {
  color: #171b1a;
  border-color: var(--aqua);
  background: var(--aqua);
}

.button.ghost.screen-button[data-face-background="green"] {
  color: #eaffed;
  border-color: #269c3b;
  background: #176f2a;
}

.button.ghost.screen-button[data-face-background="blue"] {
  color: #eef5ff;
  border-color: #317bdc;
  background: #2159a8;
}

.button.ghost.screen-button[data-face-background="green"][aria-pressed="true"] {
  border-color: #35d04f;
  background: #35d04f;
}

.button.ghost.screen-button[data-face-background="blue"][aria-pressed="true"] {
  color: #f4f8ff;
  border-color: #2878e8;
  background: #2878e8;
}

.button.ghost.screen-button.is-conflicting {
  opacity: 0.58;
  border-style: dashed;
  cursor: help;
}

.special-shot-control {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto minmax(260px, 1.4fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}

.special-shot-control > div,
.special-shot-control small {
  display: block;
}

.control-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.control-help.error {
  color: #ef8f82;
  font-weight: 700;
}

.special-shot-control small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.shot-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  white-space: nowrap;
}

.shot-check input {
  accent-color: var(--aqua);
}

.crowd-presence-control {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(560px, 2.6fr);
  align-items: center;
  gap: 14px;
  background: #181d1c;
}

.crowd-presence-heading {
  display: grid;
  gap: 5px;
}

.crowd-presence-heading > div {
  display: grid;
  gap: 5px;
}

.crowd-children-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin-top: 7px;
  color: #d8dcda;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.crowd-children-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--aqua);
}

.crowd-children-toggle:has(input:disabled) {
  opacity: 0.42;
  cursor: not-allowed;
}

.crowd-presence-control strong {
  color: #e7e9e5;
  font-size: 16px;
  font-weight: 600;
}

.crowd-presence-control small {
  color: #a8b0ad;
  font-size: 12px;
}

.crowd-presence-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

button.crowd-presence-button {
  min-height: 50px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #c2c7c4;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

button.crowd-presence-button > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-weight: 700;
}

button.crowd-presence-button:hover {
  background: #2b3331;
  color: #f0f2f0;
}

button.crowd-presence-button.selected,
button.crowd-presence-button[aria-checked="true"] {
  background: #25564f;
  color: #f3f6f4;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

.lens-effect-control {
  margin-top: 18px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.lens-effect-control > header {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.lens-effect-control > header > div {
  display: grid;
  gap: 5px;
}

.lens-effect-control strong {
  color: #e7e9e5;
  font-size: 14px;
  font-weight: 600;
}

.lens-effect-control small,
#lensEffectCount {
  color: #a8b0ad;
  font-size: 12px;
}

#lensEffectCount {
  flex: 0 0 auto;
  padding-top: 2px;
}

.lens-effect-grid {
  display: block;
  min-width: 0;
  width: auto;
}

.lens-effect-field {
  display: grid;
  gap: 6px;
}

.lens-effect-field > span {
  color: var(--muted);
  font-size: 11px;
}

.lens-effect-field select {
  min-height: 42px;
  width: 100%;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: "TeleNeo Office", Arial, sans-serif;
}

.lens-effect-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.lens-effect-info {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #193a36;
  color: #59d8c5;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.lens-effect-info:hover {
  background: #245e56;
  color: #fff;
}

.lens-effect-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(79, 201, 183, 0.42);
  border-radius: 0;
  background: #202525;
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.lens-effect-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.lens-effect-dialog form {
  padding: 20px;
}

.lens-effect-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lens-effect-dialog h3,
.lens-effect-dialog p {
  margin: 0;
}

.lens-effect-dialog h3 {
  color: var(--text-strong);
  font-size: 18px;
}

.lens-effect-dialog p {
  margin-top: 16px;
  color: #b8bfbb;
  line-height: 1.6;
}

.lens-effect-dialog header button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: #193a36;
  color: #59d8c5;
  font-size: 22px;
  cursor: pointer;
}

button.lens-effect-button {
  min-height: 58px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #c2c7c4;
  font-family: "TeleNeo Office", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

button.lens-effect-button > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 12px;
  font-weight: 700;
}

button.lens-effect-button > strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
}

button.lens-effect-button:hover {
  z-index: 2;
  background: #2b3331;
  color: #f0f2f0;
  transform: scale(1.035);
}

button.lens-effect-button.selected,
button.lens-effect-button[aria-pressed="true"] {
  background: #25564f;
  color: #f3f6f4;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

@media (max-width: 680px) {
  .lens-effect-control > header {
    display: grid;
  }

}

/* Guide navigation: the site header scrolls away; Quick start becomes the safe bookmark bar. */
body[data-page="guide"] .topbar {
  position: relative;
}

body[data-page="guide"] .guide-grid > .guide-card.guide-wide:first-child {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #202323;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38);
}

body[data-page="guide"] .guide-card[id] {
  scroll-margin-top: var(--guide-anchor-offset, 224px);
}

@media (max-width: 900px) {
  body[data-page="guide"] .guide-grid > .guide-card.guide-wide:first-child {
    position: relative;
  }

  body[data-page="guide"] .guide-card[id] {
    scroll-margin-top: 18px;
  }
}

@media (max-width: 1100px) {
  .crowd-presence-control {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .crowd-presence-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.intro {
  min-height: 112px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0 24px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--aqua);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.04;
  color: var(--text);
}

h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.18;
  color: var(--text-strong);
}

h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

.intro-actions,
.panel-head,
.prompt-box > div,
.character-save-row,
.saved-character-card header,
.time-copy,
.terrain-card header,
.element-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.button,
.prompt-box button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--aqua);
  color: #303030;
  font-weight: 400;
}

.button,
.prompt-box button,
.format-button,
.terrain-card,
.element-card,
.face-image-group-button,
.face-image-button {
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  transform-origin: center;
}

.button:active,
.prompt-box button:active,
.format-button:active,
.terrain-card:active,
.element-card:active,
.face-image-group-button:active,
.face-image-button:active {
  transform: scale(0.95);
}

.button.secondary {
  background: var(--aqua);
  color: #303030;
}

.button.ghost,
.prompt-box button {
  background: transparent;
  color: var(--aqua);
}

.button:hover,
.prompt-box button:hover {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(43, 196, 178, 0.1);
}

.compact-button {
  min-height: 32px;
}

.character-save-panel {
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.character-save-panel h2 {
  font-size: 15px;
}

.character-save-row {
  gap: 8px;
}

.character-save-row input {
  min-width: 0;
  flex: 1 1 auto;
}

.saved-character-list {
  max-height: min(34vh, 340px);
  padding-right: 4px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.saved-character-list::-webkit-scrollbar {
  width: 8px;
}

.saved-character-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.saved-character-list::-webkit-scrollbar-track {
  background: transparent;
}

.saved-character-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 11px;
}

.saved-character-card {
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.saved-character-card strong,
.saved-character-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.saved-character-card strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
}

.saved-character-card small,
.saved-character-card p {
  color: var(--muted);
  font-size: 10px;
}

.saved-character-card p {
  margin: 0;
  line-height: 1.35;
}

.saved-character-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.saved-character-manager {
  display: grid;
  gap: 10px;
}

.saved-character-manager select {
  width: 100%;
}

.hair-color-dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--text); background: var(--surface-2); }
.hair-color-dialog::backdrop { background: rgb(0 0 0 / 0.68); }
.hair-color-dialog form, .hair-color-pair { display: grid; gap: 14px; }
.hair-color-pair { grid-template-columns: 1fr 1fr; }
.hair-color-pair label { display: grid; gap: 7px; color: var(--muted); }
.hair-color-pair input { width: 100%; height: 54px; padding: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.prompt-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  align-items: start;
  gap: 18px;
}

.editor {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 48px var(--shadow);
}

.panel-head {
  margin-bottom: 15px;
  align-items: flex-start;
}

.format-row {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.format-button {
  min-height: 74px;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
}

.format-button i {
  width: 34px;
  height: 46px;
  display: block;
  justify-self: center;
  border: 2px solid currentColor;
  border-radius: 5px;
  color: var(--faint);
}

.format-button[data-orientation*="16:9"] i {
  width: 46px;
  height: 28px;
}

.format-button[data-orientation*="1:1"] i {
  width: 38px;
  height: 38px;
}

.format-button strong,
.format-button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.format-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.format-button.selected,
.terrain-card.selected,
.element-card.selected,
.face-image-group-button.selected,
.face-image-button.selected {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  box-shadow: inset 0 0 0 1px rgba(43, 196, 178, 0.18);
}

.model-third-control {
  margin-bottom: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 2.25fr);
  align-items: center;
  gap: 14px;
  background: #181d1c;
}

.model-third-control[hidden] {
  display: none;
}

.model-third-control > div:first-child {
  display: grid;
  gap: 5px;
}

.model-third-control strong {
  color: #e7e9e5;
  font-size: 16px;
  font-weight: 600;
}

.model-third-control small {
  color: #a8b0ad;
  font-size: 12px;
}

.model-third-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

button.model-third-button {
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: #252b2a;
  color: #c2c7c4;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.thirds-guide {
  width: 52px;
  height: 32px;
  flex: 0 0 52px;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border: 1px solid #64706d;
}

.thirds-guide > b {
  background: rgba(255, 255, 255, 0.045);
}

.thirds-guide-left > b:first-child,
.thirds-guide-center > b:nth-child(2),
.thirds-guide-right > b:last-child {
  background: #4fc9b7;
}

button.model-third-button:hover {
  background: #2b3331;
  color: #f0f2f0;
}

button.model-third-button.selected,
button.model-third-button[aria-checked="true"] {
  background: #25564f;
  color: #f3f6f4;
  box-shadow: inset 3px 0 0 #4fc9b7;
}

@media (max-width: 1100px) {
  .model-third-control {
    grid-template-columns: 1fr;
  }
}

.field-groups {
  display: grid;
  gap: 8px;
}

.field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
}

.field-group.has-required-missing {
  border-color: rgba(255, 52, 52, 0.85);
  background: rgba(255, 0, 0, 0.2);
}

.field-group summary {
  min-height: 46px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.field-group summary::marker {
  color: var(--aqua);
}

.field-group summary strong {
  color: #2bc4b2;
  font-size: 17px;
  font-weight: 700;
}

.field-group summary em {
  color: #2bc4b2;
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
}

.fields-grid,
.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fields-grid {
  padding: 0 13px 13px;
}

.control-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .photo-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .photo-control-grid {
    grid-template-columns: 1fr;
  }
}

.film-preview {
  --film-base: #b8aa7f;
  --film-light: #d8cfac;
  --film-dark: #8f815d;
  --film-texture:
    radial-gradient(circle at 14% 28%, rgba(75, 63, 39, 0.24) 0 0.7px, transparent 1.2px),
    radial-gradient(circle at 68% 72%, rgba(255, 250, 222, 0.42) 0 0.65px, transparent 1.1px),
    repeating-linear-gradient(101deg, transparent 0 43px, rgba(255, 248, 219, 0.14) 44px, transparent 45px 97px),
    linear-gradient(180deg, var(--film-light), var(--film-base) 48%, var(--film-dark));
  width: min(100%, 960px);
  margin: 18px auto 0;
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(43, 196, 178, 0.78);
  border-radius: 10px;
  background: transparent;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.28));
}

.film-preview::after {
  content: none;
}

.film-perforations {
  position: relative;
  height: 80px;
  display: block;
  background: var(--film-texture);
  background-size: 47px 41px, 61px 53px, 103px 100%, 100% 100%;
  -webkit-mask-image: url("../assets/film/perforation-mask.svg?v=6");
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-size: 6.6666667% 100%;
  mask-image: url("../assets/film/perforation-mask.svg?v=6");
  mask-repeat: repeat-x;
  mask-size: 6.6666667% 100%;
}

.film-perforations::before,
.film-perforations::after {
  content: none;
}

.film-perforations::before {
  top: 0;
}

.film-perforations::after {
  bottom: 0;
}

.film-perforations i {
  display: none;
}

.film-perforations i::before,
.film-perforations i::after {
  content: none;
}

.film-edge-code {
  position: absolute;
  z-index: 3;
  color: rgba(59, 48, 29, 0.82);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 247, 215, 0.34);
  pointer-events: none;
}

.film-edge-code-top {
  top: 3px;
  left: 64%;
  letter-spacing: 5px;
}

.film-edge-code-bottom {
  right: 0;
  bottom: 3px;
  left: 0;
  display: block;
  height: 10px;
}

.film-edge-code b {
  position: absolute;
  font: inherit;
}

.film-edge-code b:nth-child(1) {
  left: 6%;
}

.film-edge-code b:nth-child(2) {
  left: 37%;
}

.film-edge-code b:nth-child(3) {
  left: 78%;
}

.film-frame {
  position: relative;
  display: grid;
  grid-template-columns: 30% 40% 30%;
  gap: 5px;
  padding: 0;
  background: var(--film-base);
  overflow: hidden;
}

.film-cell {
  position: relative;
  min-width: 0;
  display: block;
  overflow: hidden;
  background: #1a1d1c;
  box-shadow: inset 0 0 0 1px rgba(69, 60, 40, 0.32);
}

.film-cell-main {
  aspect-ratio: 2 / 3;
}

.film-cell-main canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  display: block;
  background: #1a1d1c;
}

.film-cell-side canvas {
  position: absolute;
  top: 0;
  width: auto;
  max-width: none;
  height: 100%;
  display: block;
}

.film-cell-side {
  height: 100%;
}

.film-cell-left canvas {
  right: 0;
}

.film-cell-right canvas {
  left: 0;
}

.film-preview-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  max-width: calc(100% - 64px);
  padding: 9px 18px;
  border-radius: 9px;
  background: rgba(5, 5, 5, 0.94);
  color: #fff;
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.film-label-stock,
.film-label-lens,
.film-label-style {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Photo workflow: the photographic decisions follow the same numbered
   accordion pattern as the Layer Studio below. */
.photo-workflow {
  margin-top: 0;
}

.photo-workflow-step {
  overflow: hidden;
}

.photo-workflow-step > summary {
  list-style: none;
}

.photo-workflow-step > summary::-webkit-details-marker {
  display: none;
}

.photo-workflow-step.is-disabled > summary {
  cursor: not-allowed;
  opacity: 0.52;
}

.photo-workflow-content {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #151818;
}

.photo-workflow-control {
  max-width: 680px;
}

.photo-workflow-summary-value {
  color: inherit;
  font: inherit;
  white-space: normal;
}

.photo-style-reference-head {
  margin: 14px 0 10px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.photo-style-reference-head strong {
  color: #e7e9e5;
  font-size: 15px;
}

.photo-style-reference-head small {
  color: var(--muted);
  text-align: left;
}

.photo-reference-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.caricature-reference-index {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  min-width: 28px;
  padding: 5px 7px;
  border: 1px solid rgba(83, 215, 197, 0.46);
  background: rgba(7, 31, 28, 0.9);
  color: var(--aqua);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.caricature-performance-builder {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.caricature-auto-variation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--aqua);
  background: rgba(83, 215, 197, 0.07);
  color: #dfe7e3;
}

.caricature-auto-variation .secondary {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
}

.caricature-auto-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caricature-auto-copy > span {
  line-height: 1.45;
}

.caricature-auto-copy small {
  color: var(--muted);
  font-size: 11px;
}

.caricature-framing-rule {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(160, 174, 168, 0.22);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.photo-reference-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px dashed rgba(160, 174, 168, 0.34);
  color: var(--muted);
  line-height: 1.5;
}

.photo-reference-card {
  position: relative;
  aspect-ratio: 2 / 3;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #202423;
  color: #fff;
  font-family: "TeleNeo Office", Arial, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-origin: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.photo-reference-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(160, 174, 168, 0.42);
  transition: box-shadow 150ms ease;
}

.photo-reference-card.selected::after,
.photo-reference-card[aria-pressed="true"]::after {
  box-shadow: inset 0 0 0 4px #4fc9b7;
}

.photo-reference-card:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}

.photo-reference-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #202423;
  transform: scale(1.03);
  transform-origin: center;
  transition: transform 170ms ease;
}

.photo-reference-card[data-style-reference="modern-digital-portrait"] > .photo-reference-image {
  transform: scale(1.12);
  transform-origin: 50% 43%;
}

.photo-reference-card:hover:not(:active):not(:disabled) {
  z-index: 20;
  transform: scale(1.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.photo-reference-card > .visual-card-label {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  min-height: 22%;
  padding: 8px 7%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  white-space: normal;
  text-align: center;
}

.photo-reference-card > .visual-card-label strong {
  color: #fff;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.photo-reference-card[data-photo-style] > .visual-card-label {
  height: clamp(54px, 22%, 64px);
  min-height: 0;
  box-sizing: border-box;
}

.photo-reference-card:disabled {
  cursor: not-allowed;
  opacity: 0.32;
  filter: grayscale(0.7);
}

.photo-reference-help {
  display: block;
  margin-top: 10px;
}

.layer-style-transfer {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.layer-style-reference {
  width: 168px;
  aspect-ratio: 4 / 5;
  height: auto;
  display: block;
  background-color: #202423;
  background-repeat: no-repeat;
  background-position: center 30%;
  background-size: 135% auto;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.layer-style-transfer-copy {
  display: grid;
  gap: 8px;
}

.layer-style-transfer-copy p,
.layer-style-transfer-copy small {
  margin: 0;
  color: var(--muted);
}

.layer-style-transfer-copy > strong {
  color: var(--aqua);
  font-size: 18px;
}

.layer-style-actions {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layer-upscale-warning {
  margin: 8px 0 0;
  color: #ffcc73;
  font-weight: 700;
  line-height: 1.45;
}

.layer-print-export {
  display: block;
}

.layer-upscale-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.layer-upscale-card {
  position: relative;
  aspect-ratio: var(--upscale-card-aspect, 4 / 5);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(160, 174, 168, 0.34);
  background: #202524;
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.layer-upscale-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(160, 174, 168, 0.42);
  transition: box-shadow 150ms ease;
}

.layer-upscale-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(79, 201, 183, 0.68);
}

.layer-upscale-card.selected,
.layer-upscale-card[aria-pressed="true"] {
  border-color: var(--aqua);
}

.layer-upscale-card.selected::after,
.layer-upscale-card[aria-pressed="true"]::after {
  box-shadow: inset 0 0 0 4px var(--aqua);
}

.layer-upscale-picker.is-processing .layer-upscale-card.selected::before,
.layer-upscale-picker.is-processing .layer-upscale-card[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(255, 255, 255, 0.34);
  border-top-color: var(--aqua);
  border-radius: 50%;
  animation: layer-upscale-spin 750ms linear infinite;
}

@keyframes layer-upscale-spin {
  to { transform: rotate(360deg); }
}

.layer-upscale-card:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.layer-upscale-card canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #171a19;
}

.layer-upscale-card-label {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  min-height: 22%;
  padding: 13px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

.prompt-box .layer-upscale-card-label strong {
  flex: 0 0 auto;
  color: #fff;
  font-size: 19px;
  line-height: 1.15;
}

.layer-upscale-card-label small {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.layer-upscale-status {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.layer-upscale-status.is-error {
  color: #f1b0a9;
}

.layer-lut-picker {
  padding-right: 4px;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
  overscroll-behavior: contain;
  scrollbar-color: rgba(79, 201, 183, 0.55) #171a19;
}

.layer-lut-card.is-loading canvas {
  opacity: 0.54;
}

.layer-lut-card.is-error canvas {
  opacity: 0.24;
}

.layer-lut-card .layer-upscale-card-label {
  min-height: 26%;
  padding: 10px 8px;
  white-space: normal;
}

.prompt-box .layer-lut-card .layer-upscale-card-label strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-upscale-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 5px 7px;
  background: rgba(6, 28, 25, 0.88);
  color: var(--aqua);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .photo-reference-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .photo-reference-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .caricature-auto-variation {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-style-reference-head {
    align-items: start;
    flex-direction: column;
  }

  .photo-style-reference-head small {
    text-align: left;
  }

  .layer-style-transfer {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .layer-style-reference {
    width: 120px;
  }

  .layer-upscale-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .photo-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layer-style-transfer {
    grid-template-columns: 1fr;
  }

  .layer-style-reference {
    width: min(220px, 100%);
    justify-self: center;
  }
}

.film-label-lens {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68em;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.film-label-style {
  color: #54d7c8;
  font-size: 0.64em;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.film-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(circle at 18% 27%, rgba(255,255,255,0.55) 0 0.6px, transparent 0.9px),
    radial-gradient(circle at 72% 64%, rgba(0,0,0,0.65) 0 0.7px, transparent 1px);
  background-size: 5px 5px, 7px 7px;
}

.field,
.control-grid > div {
  min-width: 0;
}

.field label,
.field-label {
  margin: 0 0 6px;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

select:disabled,
input:disabled {
  opacity: 0.45;
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(43, 196, 178, 0.12);
}

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

.image-field {
  grid-column: 1 / -1;
}

.image-field select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-picker-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: visible;
  scroll-margin-top: 180px;
}

.image-picker-panel summary {
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.image-picker-panel summary::-webkit-details-marker {
  display: none;
}

.image-picker-panel summary::after {
  content: "+";
  width: 38px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--aqua);
  border-radius: 14px;
  background: var(--aqua);
  color: #303030;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.image-picker-panel[open] summary::after {
  content: "-";
}

.image-picker-panel summary span {
  min-width: 0;
  color: #f2f2f2;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.face-image-grid {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.face-image-grid[hidden] {
  display: none;
}

.face-image-grid[data-face-image-picker="identitas"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.face-image-grid[data-face-image-picker="altipus"] {
  grid-template-columns: 1fr;
}

.face-image-grid.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.face-image-group-tabs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.face-image-group-button {
  min-width: 0;
  aspect-ratio: 3 / 4;
  min-height: 0;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: #2bc4b2;
  display: grid;
  align-content: start;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.face-image-group-button:hover:not(:active) {
  z-index: 2;
  transform: scale(1.08);
  border-color: var(--aqua);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.face-image-group-button:hover img {
  transform: scale(1.04);
}

.face-image-group-maps {
  width: 100%;
  min-width: 0;
}

.face-image-group-maps img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border: 1px solid rgba(43, 196, 178, 0.22);
  border-radius: 6px;
  background: var(--surface);
}

.face-image-card-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.face-image-button {
  position: relative;
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.face-image-button:hover:not(:active) {
  z-index: 2;
  transform: scale(1.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.face-image-button.is-unavailable {
  opacity: 0.34;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.face-image-button img {
  width: 100%;
  display: block;
  aspect-ratio: 415 / 615;
  object-fit: contain;
  border: 1px solid rgba(43, 196, 178, 0.18);
  border-radius: 6px;
  background: var(--surface-3);
  transition: transform 180ms ease;
}

.face-image-button[data-face-image-ratio="landscape"] img {
  aspect-ratio: 304 / 268;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="iris"] img {
  aspect-ratio: 295 / 479;
}

.face-image-button[data-face-image-ratio="eye-detail"] img {
  aspect-ratio: 372 / 498;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="eye-shape"] img {
  aspect-ratio: 391 / 493;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="position"] img {
  aspect-ratio: 253 / 297;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="age"] img {
  aspect-ratio: 483 / 487;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="identity"] img {
  aspect-ratio: 812 / 732;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="character-type"] img {
  aspect-ratio: 189 / 220;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="body-type"] img {
  aspect-ratio: 311 / 315;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="skull"] img {
  aspect-ratio: 347 / 498;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="cheekbone"] img {
  aspect-ratio: 356 / 543;
  object-position: center top;
}

.face-image-button[data-face-image-ratio="jaw"] img {
  aspect-ratio: 291 / 539;
  object-position: center top;
}

.face-image-button:hover img {
  transform: scale(1.08);
}

.identity-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--aqua-soft);
  font-size: 12px;
}

.field-group.is-available .identity-note {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: var(--aqua);
}

.terrain-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.terrain-card {
  position: relative;
  min-height: 132px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  isolation: isolate;
}

.terrain-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 14, 13, 0.3) 0%, rgba(8, 14, 13, 0.58) 52%, rgba(8, 14, 13, 0.93) 100%);
  transition: background 160ms ease;
}

.terrain-card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.terrain-card:hover > img {
  transform: scale(1.04);
}

.terrain-card.selected::after {
  background: linear-gradient(180deg, rgba(3, 48, 43, 0.18) 0%, rgba(4, 41, 37, 0.5) 52%, rgba(4, 24, 22, 0.9) 100%);
}

.terrain-card header {
  align-items: flex-start;
}

.terrain-card strong,
.terrain-card span,
.terrain-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.terrain-card strong {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
}

.terrain-card span {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--aqua-soft);
  color: var(--aqua);
  font-weight: 400;
}

.terrain-card small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.96);
}

.element-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.element-card {
  min-height: 92px;
  padding: 11px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
}

.environment-elements-heading {
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: #181d1c;
}

.environment-elements-heading strong {
  color: #e7e9e5;
  font-size: 15px;
  font-weight: 600;
}

.environment-elements-heading small {
  color: #a8b0ad;
  font-size: 12px;
}

.element-card header {
  align-items: flex-start;
}

.element-card strong,
.element-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.element-card strong {
  font-size: 12px;
  font-weight: 400;
}

.element-card small {
  color: var(--muted);
  font-size: 10px;
}

.element-card[disabled] {
  opacity: 0.46;
  cursor: not-allowed;
}

.weather-control-block {
  position: relative;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(43, 196, 178, 0.34);
  border-radius: 10px;
  background: rgba(24, 33, 32, 0.42);
}

.weather-control-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-control-heading > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(43, 196, 178, 0.18);
  color: var(--aqua);
  font-size: 11px;
  font-weight: 700;
}

.weather-control-heading strong {
  font-size: 14px;
}

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

.season-visual-grid,
.weather-visual-grid,
.light-direction-grid,
.phase-calendar {
  display: grid;
  gap: 9px;
}

.season-visual-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.weather-visual-grid,
.light-direction-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wind-direction-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

button.wind-direction-button {
  min-height: 82px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #303836;
  border-radius: 0;
  background: #202625;
  color: #d5dad7;
  font-family: "TeleNeo Office", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

button.wind-direction-button:hover:not(:disabled) {
  border-color: #438d82;
  background: #27302e;
}

button.wind-direction-button.selected {
  border-color: #4fc9b7;
  background: #25564f;
  box-shadow: inset 3px 0 0 #62ddca;
  color: #f4f7f5;
}

.wind-direction-arrow {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  background: #173c37;
  color: #64ddcb;
  font-size: 31px;
  line-height: 1;
}

.wind-direction-button > span:last-child {
  display: grid;
  gap: 4px;
}

.wind-direction-button b {
  font-size: 14px;
  line-height: 1.2;
}

.wind-direction-button small {
  color: #9ca9a5;
  font-size: 11px;
}

.wind-direction-disabled .weather-panel-content {
  opacity: 0.48;
}

button.wind-direction-button:disabled {
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .wind-direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .wind-direction-grid {
    grid-template-columns: 1fr;
  }
}

.phase-calendar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weather-image-card {
  position: relative;
  min-width: 0;
  height: auto;
  aspect-ratio: 415 / 619;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-3);
  color: #fff;
  text-align: left;
  box-shadow: inset 0 0 0 1px transparent;
}

.weather-image-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.weather-image-card > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.weather-image-card strong {
  font-size: 13px;
}

.weather-image-card small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
}

/* Match the portrait reference cards: crop the old top caption from the
   artwork and provide one large, consistent caption at the bottom. */
.weather-state-card,
.season-image-card,
.light-image-card,
.wind-image-card {
  container-type: inline-size;
}

.weather-state-card img,
.season-image-card img,
.light-image-card img {
  transform: scale(1.13);
  transform-origin: center bottom;
}

.weather-state-card > span,
.season-image-card > span,
.light-image-card > span,
.wind-image-card > span {
  position: absolute;
  z-index: 1;
  left: 3.85%;
  right: 3.85%;
  bottom: 1.95%;
  width: auto;
  height: 11.65%;
  min-height: 0;
  padding: 0 5%;
  overflow: visible;
  clip: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4cqi;
  background: rgba(12, 12, 12, 0.94);
  color: #fff;
  white-space: normal;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.weather-state-card > span strong,
.season-image-card > span strong,
.light-image-card > span strong,
.wind-image-card > span strong {
  font-size: clamp(13px, 5.55cqi, 23px);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.weather-image-card.weather-state-card:hover img,
.weather-image-card.season-image-card:hover img,
.weather-image-card.light-image-card:hover img {
  transform: scale(1.16);
}

.weather-image-card:hover img {
  transform: scale(1.035);
}

.weather-image-card.selected {
  border-color: var(--aqua);
  box-shadow: inset 0 0 0 2px var(--aqua), 0 0 0 1px rgba(43, 196, 178, 0.2);
}

.weather-image-card:disabled {
  opacity: 0.34;
  filter: grayscale(0.72);
  cursor: not-allowed;
}

.weather-image-card:disabled:hover img {
  transform: scale(1.13);
}

.weather-visual-panel {
  margin-top: 10px;
}

.weather-panel-content {
  padding: 12px;
}

.month-card {
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(50, 63, 61, 0.8), rgba(31, 37, 36, 0.94));
  color: var(--text);
  text-align: left;
}

.month-card .month-number {
  grid-row: 1 / span 2;
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--aqua);
  font-size: 23px;
  font-weight: 700;
}

.month-card strong {
  font-size: 13px;
}

.month-card small {
  color: var(--muted);
  font-size: 10px;
}

.month-card.selected {
  border-color: var(--aqua);
  background: linear-gradient(145deg, rgba(43, 196, 178, 0.2), rgba(31, 48, 45, 0.96));
  box-shadow: inset 0 0 0 1px var(--aqua);
}

.time-panel {
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.time-copy {
  margin-bottom: 9px;
}

.time-copy strong {
  color: var(--aqua);
  font-size: 20px;
}

.time-copy span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--aqua);
}

#timeSlider,
#temperatureOffset {
  height: 24px;
  appearance: none;
  border: 0;
  background: transparent;
}

#timeSlider::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #071630 0%, #143c6d 18%, #f2c35f 49%, #e8ad4f 58%, #173e70 82%, #071630 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

#timeSlider::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #071630 0%, #143c6d 18%, #f2c35f 49%, #e8ad4f 58%, #173e70 82%, #071630 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

#temperatureOffset::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #397ca8, #68b7c5 35%, #71817d 50%, #e09e55 70%, #b94d39);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#temperatureOffset::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #397ca8, #68b7c5 35%, #71817d 50%, #e09e55 70%, #b94d39);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#timeSlider::-webkit-slider-thumb,
#temperatureOffset::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -5.5px;
  appearance: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

#timeSlider::-moz-range-thumb,
#temperatureOffset::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.time-scale {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
}

.temperature-readout {
  margin-bottom: 5px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3px 12px;
}

.temperature-readout > span {
  color: var(--muted);
  font-size: 11px;
}

.temperature-readout strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--aqua);
  font-size: 25px;
}

.temperature-scale {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
}

.outfit-control {
  margin-top: 14px;
}

.output {
  position: sticky;
  top: 16px;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.scene-preview {
  position: relative;
  height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  box-shadow: 0 16px 48px var(--shadow);
  isolation: isolate;
}

.scene-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 180ms ease;
}

.scene-preview[data-weather="rain"] .scene-image,
.scene-preview[data-weather="storm"] .scene-image,
.scene-preview[data-weather="cloud"] .scene-image,
.scene-preview[data-weather="fog"] .scene-image,
.scene-preview[data-weather="mist"] .scene-image,
.scene-preview[data-weather="hail"] .scene-image,
.scene-preview[data-weather="sleet"] .scene-image,
.scene-preview[data-weather="snow_shower"] .scene-image,
.scene-preview[data-weather="sandstorm"] .scene-image {
  filter: saturate(0.72) brightness(0.78);
}

.scene-preview[data-time="night"] .scene-image {
  filter: brightness(0.38) saturate(0.72) contrast(1.08);
}

.scene-preview[data-time="night"][data-weather="rain"] .scene-image,
.scene-preview[data-time="night"][data-weather="storm"] .scene-image,
.scene-preview[data-time="night"][data-weather="cloud"] .scene-image,
.scene-preview[data-time="night"][data-weather="fog"] .scene-image,
.scene-preview[data-time="night"][data-weather="mist"] .scene-image {
  filter: brightness(0.28) saturate(0.58) contrast(1.12);
}

.scene-sky,
.scene-sun,
.scene-land,
.scene-water {
  position: absolute;
  inset: 0;
}

.scene-sky {
  background: linear-gradient(180deg, #496d78 0%, #b8945c 64%, #2b2922 100%);
  opacity: 0.9;
}

.scene-sun {
  left: 68%;
  top: 18%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f3c673;
  box-shadow: 0 0 42px rgba(243, 198, 115, 0.52);
}

.scene-land.one {
  top: auto;
  height: 48%;
  background: linear-gradient(160deg, transparent 31%, rgba(32, 49, 34, 0.95) 32%, #283a2c 64%, #1c211b 100%);
}

.scene-land.two {
  top: auto;
  height: 35%;
  background: linear-gradient(20deg, #433322 0%, #615032 42%, #26231d 43%);
  opacity: 0.92;
}

.scene-water {
  top: auto;
  height: 16%;
  background: linear-gradient(90deg, rgba(43, 196, 178, 0.32), rgba(43, 196, 178, 0.12));
  opacity: 0;
}

.scene-preview[data-terrain="desert"] .scene-sky {
  background: linear-gradient(180deg, #7d9aa4 0%, #d0a85d 58%, #8e6941 100%);
}

.scene-preview[data-terrain="desert"] .scene-land.one {
  background: linear-gradient(160deg, transparent 35%, #c28a4a 36%, #a46f38 66%, #5a3d29 100%);
}

.scene-preview[data-terrain="desert"] .scene-land.two {
  background: linear-gradient(18deg, #d49b57 0%, #8b5f35 52%, #3d2f23 53%);
}

.scene-preview[data-terrain="coast"] .scene-water,
.scene-preview[data-terrain="river"] .scene-water,
.scene-preview[data-terrain="glacier"] .scene-water {
  opacity: 1;
}

.scene-preview[data-terrain="jungle"] .scene-sky {
  background: linear-gradient(180deg, #33534b 0%, #49653e 52%, #182016 100%);
}

.scene-preview[data-terrain="jungle"] .scene-land.one {
  background: linear-gradient(160deg, transparent 26%, #1f4b31 27%, #132414 100%);
}

.scene-preview[data-terrain="glacier"] .scene-sky {
  background: linear-gradient(180deg, #9db9c4 0%, #d5e3e4 60%, #50636c 100%);
}

.scene-preview[data-terrain="glacier"] .scene-land.one {
  background: linear-gradient(160deg, transparent 27%, #dce6e4 28%, #7d9aa0 67%, #33434a 100%);
}

.scene-preview[data-terrain="savanna"] .scene-sky {
  background: linear-gradient(180deg, #6f96a0 0%, #d19b56 60%, #6a5531 100%);
}

.scene-preview[data-weather="rain"] .scene-sky,
.scene-preview[data-weather="storm"] .scene-sky,
.scene-preview[data-weather="cloud"] .scene-sky {
  filter: saturate(0.68) brightness(0.72);
}

.scene-preview[data-weather="snow"] .scene-land.two,
.scene-preview[data-weather="snow_shower"] .scene-land.two,
.scene-preview[data-weather="rime"] .scene-land.two,
.scene-preview[data-weather="sleet"] .scene-land.two {
  background: linear-gradient(18deg, #d7e1dd 0%, #78847e 52%, #2c302d 53%);
}

.scene-preview[data-time="night"] .scene-sky {
  filter: brightness(0.35) saturate(0.75);
}

.scene-preview[data-time="night"] .scene-sun {
  background: #dce6e4;
  box-shadow: 0 0 26px rgba(220, 230, 228, 0.32);
}

.readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.readout article {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.readout span {
  display: block;
  margin-bottom: 5px;
  color: var(--aqua);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
}

.readout strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.prompt-stack {
  display: grid;
  gap: 8px;
}

.prompt-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.prompt-box > div {
  min-height: 42px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.prompt-box strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.prompt-box button {
  min-height: 30px;
  padding: 0 9px;
  flex: 0 0 auto;
  font-size: 11px;
}

textarea {
  width: 100%;
  display: block;
  padding: 12px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: #2b2b2b;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-box.final textarea {
  min-height: 190px;
}

/* Give the scene more room without making the Environment/Weather sidebar taller. */
@media (min-width: 441px) {
  body[data-page="environment"] .scene-preview,
  body[data-page="weather"] .scene-preview {
    height: 450px;
  }

  body[data-page="environment"] .prompt-box.final textarea,
  body[data-page="weather"] .prompt-box.final textarea {
    height: clamp(42px, calc(100vh - 895px), 137px);
    min-height: clamp(42px, calc(100vh - 895px), 137px);
  }
}

.full-prompt-box textarea,
.landscape-photo-prompt-box textarea,
.layer-pack-prompt-box textarea {
  min-height: 260px;
}

#promptStats,
#fullPromptStats,
#landscapePhotoPromptStats,
#layerPackPromptStats,
#aiPortraitPromptStats {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-portrait-button {
  border-color: rgba(79, 201, 183, 0.46);
  background: rgba(79, 201, 183, 0.13);
  color: var(--aqua);
}

.fantasy-portrait-button {
  border-color: rgba(222, 168, 74, 0.55);
  background: rgba(222, 168, 74, 0.14);
  color: #f0c875;
}

.fantasy-portrait-button:hover,
.fantasy-portrait-button:focus-visible {
  border-color: rgba(240, 200, 117, 0.82);
  background: rgba(222, 168, 74, 0.22);
}

.human-fantasy-portrait-button {
  border-color: rgba(105, 211, 183, 0.62);
  background: linear-gradient(135deg, rgba(79, 201, 183, 0.14), rgba(222, 168, 74, 0.16));
  color: #9ee2cd;
}

.human-fantasy-portrait-button:hover,
.human-fantasy-portrait-button:focus-visible {
  border-color: rgba(135, 229, 204, 0.86);
  background: linear-gradient(135deg, rgba(79, 201, 183, 0.22), rgba(222, 168, 74, 0.22));
}

.ai-portrait-prompt-box {
  border-left: 3px solid var(--aqua);
}

.ai-portrait-prompt-box textarea {
  min-height: 230px;
}

@media (max-width: 1180px) {
  .panel-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Egységes olvashatósági méretezés a négy generátoroldalon. */
.brand strong {
  font-size: 16px;
}

.brand small,
.status,
.step-tabs span {
  font-size: 12px;
}

.kicker,
.field label,
.field-label {
  font-size: 13px;
}

.summary-grid span,
.readout span {
  font-size: 11px;
}

.summary-grid strong,
.readout strong,
.terrain-card small,
.element-card strong,
.prompt-box strong {
  font-size: 13px;
}

.element-card small,
.time-copy span,
.identity-note,
.saved-character-card strong {
  font-size: 12px;
}

.saved-character-card small,
.saved-character-card p,
.saved-character-empty,
.time-scale,
.prompt-box button,
#promptStats,
#fullPromptStats,
#landscapePhotoPromptStats {
  font-size: 12px;
}

textarea {
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  padding: 10px 14px;
  border: 1px solid rgba(43, 196, 178, 0.34);
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.load-error {
  padding: 14px;
  border: 1px solid rgba(224, 112, 98, 0.45);
  border-radius: 8px;
  color: #ffbbb2;
  background: rgba(224, 112, 98, 0.08);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .output {
    position: static;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }

  .readout,
  .prompt-stack {
    grid-column: span 1;
  }

  .scene-preview {
    grid-column: 1;
  }

  .prompt-stack {
    grid-row: span 3;
  }

  .terrain-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar,
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar,
  .intro,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 30px;
  }

  .intro-actions {
    width: 100%;
  }

  .intro-actions .button,
  .panel-head .button {
    width: 100%;
  }

  .fields-grid,
  .control-grid,
  .control-grid.compact,
  .terrain-grid,
  .element-strip,
  .format-row,
  .readout,
  .summary-grid,
  .step-tabs,
  .output {
    grid-template-columns: 1fr;
  }

  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions .button {
    width: 100%;
  }

  .special-shot-control {
    grid-template-columns: 1fr;
  }

  .saved-character-list {
    max-height: 260px;
  }

  .face-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .face-image-grid[data-face-image-picker="altipus"],
  .face-image-grid[data-face-image-picker="identitas"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .face-image-group-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .face-image-group-button {
    min-height: 0;
  }

  .face-image-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .output,
  .prompt-stack,
  .scene-preview {
    grid-column: auto;
    grid-row: auto;
  }

  .time-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .time-copy span {
    text-align: left;
  }

  .season-visual-grid,
  .weather-visual-grid,
  .light-direction-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .panel {
    padding: 12px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 18px;
  }

  .season-visual-grid,
  .weather-visual-grid,
  .light-direction-grid,
  .phase-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-preview {
    height: 190px;
  }

  .film-perforations {
    height: 34px;
  }

  .film-perforations::before,
  .film-perforations::after {
    content: none;
  }

  .film-perforations i::before,
  .film-perforations i::after {
    content: none;
  }

  .film-preview-label {
    bottom: 10px;
    padding: 7px 12px;
  }

  .film-edge-code {
    font-size: 8px;
  }

  .film-edge-code-top {
    top: 2px;
    letter-spacing: 4px;
  }

  .film-edge-code-bottom {
    bottom: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Final desktop/tablet theme overrides. Keep this block last in the cascade. */
.site-title {
  width: fit-content;
  min-height: 42px;
  display: inline-grid;
  align-content: end;
  gap: 5px;
  color: var(--text-strong);
  text-decoration: none;
}

.site-title strong {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: clamp(28px, 2vw, 40px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.site-title .brand-photo { color: #4fc9b7; }
.site-title .brand-amp { color: #f2f3ef; font-weight: 300; }
.site-title .brand-music { color: #ff9900; }

.site-title small {
  margin: 0;
  color: #f2f3ef;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: clamp(13px, 1vw, 17px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.025em;
}

.site-title:hover .brand-photo { color: #71e0cf; }
.site-title:hover .brand-music { color: #ffad33; }

body:not([data-page="home"]) .topbar {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
}

.topbar .step-tabs {
  grid-column: 1 / -1;
}

.topbar .header-page-intro {
  width: min(760px, 62vw);
  margin: 0;
  padding: 11px 16px 12px;
  justify-self: end;
  align-self: end;
  display: block;
  background: #1c2120;
  box-shadow: inset 3px 0 0 rgba(79, 201, 183, 0.62);
  color: var(--text);
  font-family: "TeleNeo Office", Arial, sans-serif;
  text-align: left;
}

.topbar .header-page-intro .kicker {
  margin: 0 0 3px;
  color: #4fc9b7;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
}

.topbar .header-page-intro h1 {
  margin: 0;
  color: var(--text-strong);
  font-family: inherit;
  font-size: clamp(25px, 1.75vw, 34px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.topbar .header-page-intro > p:last-child {
  max-width: 820px;
  margin: 7px 0 0;
  color: #989d9a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
}

.topbar .step-tabs a {
  min-height: 57px;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.012em;
}

.topbar .step-tabs span {
  width: 38px;
  height: 38px;
  border-radius: 0;
  font-size: 18px;
  font-weight: 700;
}

.field-groups {
  gap: 12px;
}

.field-group {
  background: #151818;
}

.field-group > summary {
  min-height: 54px;
  background: #202524;
}

.field-group[open] > summary {
  background: #22302d;
}

.field-group > .fields-grid {
  padding: 12px;
  gap: 10px;
  background: #151818;
}

.field-group .image-picker-panel,
.image-field > .image-picker-panel {
  background: #272d2c;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.field-group .field:nth-child(even) > .image-picker-panel {
  background: #242a29;
}

.field-group .image-picker-panel:hover,
.image-field > .image-picker-panel:hover {
  background: #2d3432;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);
}

.field-group .image-picker-panel[open] {
  background: #293330;
}

.field-group .image-picker-panel summary,
.image-field > .image-picker-panel summary {
  min-height: 56px;
  padding-inline: 16px 12px;
}

.field-groups > .field-group {
  background: transparent;
  box-shadow: none;
}

.field-groups > .field-group > summary {
  min-height: 62px;
  padding: 10px 16px 10px 12px;
  background: #252b2a;
  transition: background 160ms ease;
}

.field-groups > .field-group:nth-child(even) > summary {
  background: #222827;
}

.field-groups > .field-group > summary:hover {
  background: #2b3331;
}

.field-groups > .field-group[open] > summary {
  background: #263936;
}

.field-groups > .field-group > summary strong {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e7e9e5;
  font-family: "TeleNeo Office", Arial, sans-serif;
}

.field-groups .group-number {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #193a36;
  color: #5bd7c4;
  font-size: 16px;
  font-weight: 700;
}

.field-groups .group-number.layer-workflow-number {
  width: 50px;
  flex-basis: 50px;
}

.field-groups .group-title {
  color: #e7e9e5;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.field-groups > .field-group > summary em {
  color: #a8b0ad;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.image-picker-panel summary::after {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: #25564f;
  color: #f4f7f6;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.panel,
.summary-panel,
.character-save-panel,
.image-picker-panel,
.field-group,
.time-panel,
.prompt-box,
.special-shot-control,
.summary-grid article,
.saved-character-card,
.format-button,
.month-card,
.readout article,
.weather-control-block,
.terrain-card,
.element-card,
.face-image-group-button,
.face-image-button,
.weather-image-card,
.step-tabs a,
.button,
.prompt-box button,
select,
input[type="text"],
textarea {
  border-radius: 0;
}

.face-image-button img,
.face-image-group-maps img,
.terrain-card img,
.element-card img,
.weather-image-card img,
.weather-state-card > span,
.season-image-card > span,
.light-image-card > span,
.wind-image-card > span {
  border-radius: 0;
}

.face-image-grid,
.face-image-card-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.terrain-grid,
.element-strip,
.season-visual-grid,
.weather-visual-grid,
.light-direction-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.face-image-grid[data-face-image-picker="identitas"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.face-image-grid[data-face-image-picker="identitas"] .face-image-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Shared, language-independent 2:3 visual cards for Face and Weather. */
body[data-page="face"] .face-image-button,
body[data-page="weather"] .weather-image-card {
  position: relative;
  aspect-ratio: 2 / 3;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

body[data-page="face"] .face-image-button img,
body[data-page="weather"] .weather-image-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  border: 0;
  object-fit: cover;
  object-position: center;
}

/* Keep the 45-degree lighting pair visually identical except for its direction. */
body[data-page="weather"] .light-image-card.light-direction-front_right img {
  transform: scaleX(-1) scale(1.13);
}

body[data-page="weather"] .light-image-card.light-direction-front_right:hover img {
  transform: scaleX(-1) scale(1.16);
}

body[data-page="face"] .face-image-button > .visual-card-label,
body[data-page="weather"] .weather-image-card > span {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  width: 100%;
  height: auto;
  min-height: 22%;
  padding: 8px 7%;
  overflow: visible;
  clip: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  white-space: normal;
  text-align: center;
}

body[data-page="face"] .face-image-button > .visual-card-label strong,
body[data-page="weather"] .weather-image-card > span strong {
  color: #fff;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* One inset selection frame across the Face and Weather visual pickers. */
body[data-page="face"] .face-image-button.selected::after,
body[data-page="face"] .face-image-button[aria-pressed="true"]::after,
body[data-page="weather"] .weather-image-card.selected::after,
body[data-page="weather"] .weather-image-card[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px #4fc9b7;
}

/* Consistent lift-and-scale feedback for every interactive card. */
body :is(
  .format-button,
  .model-third-button,
  .face-image-group-button,
  .face-image-button,
  .terrain-card,
  .interior-light-card,
  .element-card,
  .month-card,
  .weather-image-card,
  .wind-direction-button,
  .crowd-presence-button
) {
  position: relative;
  transform-origin: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

body :is(
  .format-button,
  .model-third-button,
  .face-image-group-button,
  .face-image-button,
  .terrain-card,
  .interior-light-card,
  .element-card,
  .month-card,
  .weather-image-card,
  .wind-direction-button,
  .crowd-presence-button
):hover:not(:active):not(:disabled):not(.is-unavailable) {
  z-index: 20;
  transform: scale(1.08) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1100px) {
  .face-image-grid,
  .face-image-card-grid,
  .terrain-grid,
  .element-strip,
  .season-visual-grid,
  .weather-visual-grid,
  .light-direction-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .face-image-grid[data-face-image-picker="identitas"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .face-image-grid[data-face-image-picker="identitas"] .face-image-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.brand .brand-logo {
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  background: #183b3a;
  box-shadow: 0 0 28px rgba(79, 201, 183, 0.18), inset 0 0 0 1px rgba(79, 201, 183, 0.18);
}

.brand .brand-logo img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 155%;
  height: 155%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: translate(-50%, -50%);
}

.brand .brand-wordmark {
  display: grid;
  gap: 0;
  line-height: 0.82;
}

.brand .brand-wordmark strong {
  color: #e8eae6;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.085em;
  line-height: 0.86;
  white-space: nowrap;
}

.brand .brand-wordmark strong b {
  color: #f4f6f2;
  font-weight: 500;
}

.brand .brand-wordmark small {
  margin: 0;
  color: #4fc9b7;
  font-family: "TeleNeo Office", Arial, sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 0.86;
}

:root {
  --bg: #171919;
  --surface: #202323;
  --surface-2: #252828;
  --surface-3: #1c1f1f;
  --line: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(79, 201, 183, 0.55);
  --text: #d0d1ce;
  --text-strong: #f0f1ed;
  --muted: #8d9290;
  --faint: #606563;
  --aqua: #4fc9b7;
  --aqua-soft: rgba(79, 201, 183, 0.13);
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  background: radial-gradient(circle at 72% -20%, rgba(79, 201, 183, 0.055), transparent 34%), var(--bg);
}

.topbar,
.app-shell {
  width: min(1920px, 100%);
  padding-left: clamp(28px, 3vw, 56px);
  padding-right: clamp(28px, 3vw, 56px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  min-height: 0;
  padding-top: 15px;
  padding-bottom: 17px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
}

.topbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(20, 22, 22, 0.92);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
}

.brand {
  width: fit-content;
  gap: 13px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 3px;
  background: #193a36;
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.1);
}

.brand-mark i {
  border-radius: 1px;
}

.brand strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.brand small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.025em;
}

.status {
  display: none;
}

.step-tabs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 201, 183, 0.28) transparent;
}

.step-tabs a {
  min-height: 52px;
  padding: 9px 13px;
  gap: 11px;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  color: #aeb1ae;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.step-tabs a:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.step-tabs a.selected {
  border: 0;
  color: #f4fbf8;
  background: #224c47;
  box-shadow: inset 3px 0 0 var(--aqua), 0 10px 28px rgba(0, 0, 0, 0.16);
}

.step-tabs span {
  width: 31px;
  height: 31px;
  border-radius: 3px;
  background: rgba(79, 201, 183, 0.12);
  color: var(--aqua);
  font-size: 11px;
}

.step-tabs a.selected span {
  background: rgba(79, 201, 183, 0.18);
  color: #83dfd1;
}

.app-shell {
  padding-top: clamp(30px, 3vw, 48px);
  padding-bottom: 72px;
}

.page-hero {
  margin-bottom: clamp(28px, 2.5vw, 42px);
}

.page-hero h1 {
  margin-bottom: 11px;
  color: var(--text-strong);
  font-size: clamp(36px, 2.65vw, 54px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.page-hero p:last-child {
  max-width: 880px;
  color: #9da19f;
  font-size: 15px;
  line-height: 1.65;
}

.kicker {
  color: var(--aqua);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-layout,
.workspace {
  gap: clamp(18px, 1.5vw, 28px);
}

.panel,
.summary-panel,
.character-save-panel,
.image-picker-panel,
.field-group,
.time-panel,
.prompt-box,
.special-shot-control {
  border: 0;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.panel {
  padding: clamp(18px, 1.5vw, 26px);
}

.image-picker-panel,
.field-group,
.time-panel,
.prompt-box,
.special-shot-control {
  background: var(--surface-3);
  box-shadow: none;
}

.summary-grid article,
.saved-character-card,
.format-button,
.month-card,
.readout article,
.weather-control-block {
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.032);
  box-shadow: none;
}

.terrain-card,
.element-card,
.face-image-group-button,
.face-image-button,
.weather-image-card {
  border: 0;
  border-radius: 3px;
  background: var(--surface-3);
}

.terrain-card.selected,
.element-card.selected,
.face-image-group-button.selected,
.face-image-button.selected,
.weather-image-card.selected,
.format-button.selected,
.month-card.selected {
  border: 0;
  background: var(--aqua-soft);
  box-shadow: inset 0 0 0 2px rgba(79, 201, 183, 0.78);
}

select,
input[type="text"],
textarea {
  border: 0;
  border-radius: 2px;
  background: #181b1b;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(79, 201, 183, 0.72), 0 0 0 3px rgba(79, 201, 183, 0.08);
}

.button,
.prompt-box button {
  border: 0;
  border-radius: 2px;
  background: var(--aqua);
  color: #13201e;
  box-shadow: none;
}

.button.ghost,
.prompt-box button {
  background: rgba(79, 201, 183, 0.09);
  color: #75d7c8;
}

.button:hover,
.prompt-box button:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1100px) {
  .topbar,
  .app-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .step-tabs {
    grid-template-columns: repeat(4, minmax(155px, 1fr));
  }

  .step-tabs a {
    min-height: 48px;
  }
}

/* User-supplied complete desktop wordmark. */
.site-title {
  display: block;
  width: 360px;
  max-width: 100%;
  min-height: 0;
}

.site-title::before {
  content: none;
}

.site-header-logo {
  display: block;
  width: 100%;
  height: auto;
}

/* Quick and Advanced reuse the Professional card sizing and responsive grid. */
body[data-page="face"] .simplified-face-groups .quick-face-fields-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-page="face"] .simplified-face-groups .quick-face-card-field {
  grid-column: 1 / -1;
}

body[data-page="face"] .simplified-face-groups .quick-face-card-grid {
  padding: 10px;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="face"] .simplified-face-groups .quick-face-card-grid[data-face-image-picker="identitas"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="face"] .simplified-face-groups .quick-face-card-grid[data-face-image-picker="altipus"] {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1100px) {
  body[data-page="face"] .simplified-face-groups .quick-face-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-page="face"] .simplified-face-groups .quick-face-card-grid,
  body[data-page="face"] .simplified-face-groups .quick-face-card-grid[data-face-image-picker="identitas"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body[data-page="face"] .simplified-face-groups .advanced-face-preset-field {
  grid-column: 1 / -1;
}

body[data-page="face"] .simplified-face-groups .advanced-face-preset-grid {
  display: grid;
  padding: 10px;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="face"] .simplified-face-groups .advanced-face-preset-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
}

body[data-page="face"] .simplified-face-groups .advanced-preset-image-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body[data-page="face"] .simplified-face-groups .advanced-preset-image-grid img {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
}

body[data-page="face"] .simplified-face-groups .advanced-face-preset-card:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  body[data-page="face"] .simplified-face-groups .advanced-face-preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-page="face"] .simplified-face-groups .advanced-face-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A restrained colour map makes the three Face workflows recognizable at a glance. */
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="quick"].selected,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="quick"][aria-selected="true"] {
  background: #235b50;
  box-shadow: inset 3px 0 0 #59e0c7;
}

body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="quick"].selected > span,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="quick"][aria-selected="true"] > span {
  background: #17443c;
  color: #79f0da;
}

body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="advanced"].selected,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="advanced"][aria-selected="true"] {
  background: #66501f;
  box-shadow: inset 3px 0 0 #f0b94a;
}

body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="advanced"].selected > span,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="advanced"][aria-selected="true"] > span {
  background: #4b3914;
  color: #ffd77a;
}

body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="professional"].selected,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="professional"][aria-selected="true"] {
  background: #45436f;
  box-shadow: inset 3px 0 0 #9d98ff;
}

body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="professional"].selected > span,
body[data-page="face"] .face-editor-mode-tabs [data-face-editor-mode="professional"][aria-selected="true"] > span {
  background: #302e57;
  color: #c7c4ff;
}

body[data-page="face"] .face-editor-mode-status[data-mode="quick"] {
  background: #17443c;
  color: #79f0da;
}

body[data-page="face"] .face-editor-mode-status[data-mode="advanced"] {
  background: #4b3914;
  color: #ffd77a;
}

body[data-page="face"] .face-editor-mode-status[data-mode="professional"] {
  background: #302e57;
  color: #c7c4ff;
}

body[data-page="face"][data-face-editor-mode="quick"] .face-prompt-tabs button.prompt-tab.selected,
body[data-page="face"][data-face-editor-mode="quick"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] {
  background: #235b50;
  box-shadow: inset 3px 0 0 #59e0c7;
}

body[data-page="face"][data-face-editor-mode="quick"] .face-prompt-tabs button.prompt-tab.selected > span,
body[data-page="face"][data-face-editor-mode="quick"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] > span {
  background: #17443c;
  color: #79f0da;
}

body[data-page="face"][data-face-editor-mode="advanced"] .face-prompt-tabs button.prompt-tab.selected,
body[data-page="face"][data-face-editor-mode="advanced"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] {
  background: #66501f;
  box-shadow: inset 3px 0 0 #f0b94a;
}

body[data-page="face"][data-face-editor-mode="advanced"] .face-prompt-tabs button.prompt-tab.selected > span,
body[data-page="face"][data-face-editor-mode="advanced"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] > span {
  background: #4b3914;
  color: #ffd77a;
}

body[data-page="face"][data-face-editor-mode="professional"] .face-prompt-tabs button.prompt-tab.selected,
body[data-page="face"][data-face-editor-mode="professional"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] {
  background: #45436f;
  box-shadow: inset 3px 0 0 #9d98ff;
}

body[data-page="face"][data-face-editor-mode="professional"] .face-prompt-tabs button.prompt-tab.selected > span,
body[data-page="face"][data-face-editor-mode="professional"] .face-prompt-tabs button.prompt-tab[aria-selected="true"] > span {
  background: #302e57;
  color: #c7c4ff;
}
