/* The public homepage owns its dark palette; it never changes editor theme storage. */
@font-face { font-family: Chivo; src: url('/fonts/chivo-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }
.home-page {
  --home-bg: #090a0d;
  --home-surface: #16171d;
  --home-border: #36373f;
  --home-text: #f6f6f7;
  --home-muted: #c3c3ca;
  --home-accent: #7750ff;
  margin: 0;
  min-width: 280px;
  background: var(--home-bg);
  color: var(--home-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
.home-page *, .home-page *::before, .home-page *::after { box-sizing: border-box; }
.home-page :where(button, select, textarea) { font: inherit; }
.home-page button, .home-page a, .home-page select { -webkit-tap-highlight-color: transparent; }
.home-page button, .home-page a { touch-action: manipulation; }
.home-page button { cursor: pointer; }
.home-page a { color: inherit; text-decoration: none; }
.home-page button:focus-visible, .home-page a:focus-visible, .home-page select:focus-visible, .home-page textarea:focus-visible { outline: 3px solid #ad95ff; outline-offset: 4px; }
.home-page button:disabled { cursor: wait; opacity: .65; }
.home-page img { display: block; }
.home-header { min-height: 73px; display: flex; align-items: center; gap: 36px; padding: 8px max(44px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid #27282e; }
.home-brand { display: flex; align-items: center; flex: 0 0 auto; min-height: 44px; font-family: Chivo, -apple-system, BlinkMacSystemFont, sans-serif; font-size: 33px; font-weight: 900; letter-spacing: .4px; line-height: 1.2; white-space: nowrap; }
.home-nav { display: flex; align-items: center; gap: 48px; padding-left: 36px; border-left: 1px solid #46464d; }
.home-nav a, .home-nav button { display: flex; align-items: center; min-height: 44px; padding: 0; background: transparent; color: var(--home-text); border: 0; font-size: 21px; white-space: nowrap; }
.home-nav a:hover, .home-nav button:hover, .home-locale:hover { color: #c0acff; }
.home-account { margin-left: auto; display: flex; align-items: center; gap: 36px; }
.home-locale { min-width: 67px; min-height: 44px; padding: 5px 0; color: var(--home-text); background: none; border: 0; font-size: 20px; }
.home-login { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 23px; border: 1px solid #64656d; border-radius: 12px; font-size: 20px; white-space: nowrap; }
.home-login:hover { background: #202128; border-color: #96929f; }
.home-main { width: min(100%, 1488px); margin: 0 auto; padding: 51px 44px 44px; }
.home-hero { display: grid; grid-template-columns: minmax(0, .593fr) minmax(0, 1fr); gap: 35px; align-items: start; }
.home-intro h1 { margin: -9px 0 13px; font-size: clamp(42px, 4vw, 58px); line-height: 1.13; letter-spacing: -1.5px; font-weight: 760; }
.home-subtitle { margin: 0; font-size: 22px; line-height: 1.65; color: #d6d6d9; letter-spacing: .1px; }
.home-scenes { margin-top: 20px; }
.home-scene { position: relative; width: 100%; min-height: 103px; display: flex; align-items: center; gap: 29px; padding: 18px 0 18px 38px; border: 0; border-bottom: 1px solid #2b2c33; background: transparent; color: var(--home-text); text-align: left; }
.home-scene:last-child { border-bottom: 0; }
.home-scene.is-selected::before { position: absolute; content: ""; left: 0; top: 16px; bottom: 24px; width: 5px; border-radius: 3px; background: #9a55ff; }
.home-scene:hover { background: #111217; }
.home-scene-icon { flex: 0 0 45px; width: 45px; height: 45px; opacity: .7; filter: invert(1); }
.home-scene.is-selected .home-scene-icon { opacity: 1; filter: invert(76%) sepia(26%) saturate(1557%) hue-rotate(209deg) brightness(102%) contrast(103%); }
.home-scene-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.home-scene-copy strong { font-size: 26px; font-weight: 650; line-height: 1.3; }
.home-scene-copy > span { font-size: 15px; line-height: 1.6; color: #d1d1d6; overflow-wrap: anywhere; }
.home-composer { min-width: 0; margin: 0; padding: 27px 30px 20px; border: 1px solid var(--home-border); border-radius: 19px; background: var(--home-surface); }
.home-composer h2 { margin: 0 0 18px; font-size: 32px; line-height: 1.35; font-weight: 690; letter-spacing: -.5px; }
.home-composer textarea { display: block; width: 100%; min-height: 200px; margin: 0; resize: vertical; border: 1px solid #51525e; border-radius: 16px; padding: 15px 22px; background: #202127; color: var(--home-text); font-size: 21px; line-height: 1.55; }
.home-composer textarea::placeholder { color: #aaaab5; opacity: 1; }
.home-composer textarea:hover { border-color: #777381; }
.home-options { display: flex; align-items: center; gap: 17px; margin-top: 30px; }
.home-select-wrap { position: relative; flex: 1 1 155px; min-width: 110px; max-width: 200px; }
.home-select-wrap::after { position: absolute; top: 50%; right: 15px; width: 18px; height: 18px; content: ""; pointer-events: none; transform: translateY(-50%); background: url('/icons/chevron-down.svg') center / contain no-repeat; filter: invert(1); }
.home-count-wrap { flex-basis: 140px; max-width: 192px; }
.home-select-wrap select { appearance: none; display: block; min-height: 51px; width: 100%; margin: 0; padding: 10px 42px 10px 23px; border: 1px solid #494a55; border-radius: 13px; background: #202127; color: var(--home-text); font-size: 21px; line-height: 1.4; text-overflow: ellipsis; }
.home-select-wrap select:hover { border-color: #807b92; }
.home-select-wrap option { background: #202127; color: var(--home-text); }
.home-attachment-actions { flex: 0 1 auto; display: flex; align-items: center; gap: 21px; margin-left: 10px; padding-left: 24px; border-left: 1px solid #6a6971; }
.home-tool { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--home-text); font-size: 20px; white-space: nowrap; }
.home-tool:hover { color: #c5b4ff; }
.home-tool img, .home-draft-hint img, .home-help-header img { filter: invert(1); }
.home-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 45px; }
.home-draft-hint { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; color: var(--home-muted); font-size: 17px; line-height: 1.5; }
.home-draft-hint img { opacity: .75; flex: 0 0 23px; }
.home-generate { flex: 0 0 auto; min-width: 216px; min-height: 62px; padding: 12px 28px; border: 1px solid #8360ff; border-radius: 13px; background: #7047f5; color: #fff; font-size: 25px; font-weight: 600; letter-spacing: 1px; box-shadow: inset 0 1px 0 #9c7aff4d; }
.home-generate:hover { background: #8059ff; }
.home-generate:active { background: #6037df; }
.home-attachment-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.home-error { margin: 15px 0 -18px; color: #ffb9be; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.home-page [hidden] { display: none !important; }
.home-examples { margin-top: 50px; padding-top: 24px; border-top: 1px solid #46464e; scroll-margin-top: 24px; }
.home-examples h2 { margin: 0 0 24px 3px; font-size: 30px; line-height: 1.4; font-weight: 660; letter-spacing: .2px; }
.home-example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-example-grid figure { overflow: hidden; margin: 0; border: 1px solid #62606b; border-radius: 11px; background: #eeeaf5; }
.home-example-grid img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.home-sr-only, .home-skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.home-skip:focus { position: fixed; top: 10px; left: 10px; z-index: 10; width: auto; height: auto; clip: auto; padding: 12px; border-radius: 8px; background: #7047f5; }
.home-help-dialog { max-width: 560px; width: calc(100% - 32px); padding: 25px; border: 1px solid #575260; border-radius: 18px; color: var(--home-text); background: #19191f; font-size: 16px; line-height: 1.7; }
.home-help-dialog::backdrop { background: #030306bb; }
.home-help-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.home-help-header h2 { margin: 0; font-size: 24px; }
.home-help-header button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #514e5b; border-radius: 10px; background: #25242c; }
.home-help-dialog ol { padding-left: 24px; }
.home-help-dialog li { margin: 10px 0; }
.home-help-dialog p { margin-bottom: 0; color: var(--home-muted); }
html:lang(en) .home-intro h1 { font-size: clamp(38px, 3.5vw, 52px); letter-spacing: -1.2px; }
html:lang(en) .home-scene-copy > span { font-size: 15px; }
html:lang(en) .home-tool { font-size: 17px; gap: 7px; }
html:lang(en) .home-select-wrap select { font-size: 17px; }
html:lang(en) .home-draft-hint { font-size: 15px; }
@media (min-width: 1600px) { .home-header { padding-right: max(44px, calc((100vw - 1400px) / 2)); padding-left: max(44px, calc((100vw - 1400px) / 2)); } }
@media (max-width: 1320px) {
  .home-header { gap: 28px; padding-right: 32px; padding-left: 32px; }
  .home-nav { gap: 32px; padding-left: 28px; }
  .home-main { padding-right: 32px; padding-left: 32px; }
  .home-hero { gap: 28px; grid-template-columns: minmax(0, .57fr) minmax(0, 1fr); }
  .home-intro h1 { font-size: 48px; }
  .home-subtitle { font-size: 19px; }
  .home-scene { gap: 20px; padding-left: 22px; }
  .home-scene-copy strong { font-size: 24px; }
  .home-scene-copy > span { font-size: 15px; }
  .home-composer { padding-right: 24px; padding-left: 24px; }
  .home-options { gap: 12px; }
  .home-select-wrap select { padding-left: 16px; font-size: 18px; }
  .home-attachment-actions { gap: 16px; margin-left: 3px; padding-left: 18px; }
  .home-tool { font-size: 17px; gap: 7px; }
  .home-generate { min-width: 180px; }
  .home-draft-hint { font-size: 15px; }
}
@media (max-width: 1100px) {
  .home-hero { grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); gap: 24px; }
  .home-composer h2 { font-size: 28px; }
  .home-composer textarea { min-height: 180px; font-size: 18px; }
  .home-options { flex-wrap: wrap; margin-top: 20px; }
  .home-select-wrap, .home-count-wrap { flex: 1 1 40%; max-width: none; }
  .home-attachment-actions { width: 100%; justify-content: flex-start; margin: 0; padding: 0; gap: 24px; border-left: 0; }
  .home-composer-bottom { margin-top: 22px; flex-wrap: wrap; gap: 16px; }
  .home-generate { margin-left: auto; }
  .home-intro h1 { font-size: 44px; }
  .home-scene { gap: 16px; padding-left: 17px; }
  .home-scene-icon { flex-basis: 37px; width: 37px; height: 37px; }
  .home-scene-copy strong { font-size: 22px; }
  .home-example-grid { gap: 12px; }
  .home-examples h2 { font-size: 26px; }
}
@media (max-width: 760px) {
  .home-header { min-height: 112px; flex-wrap: wrap; column-gap: 16px; row-gap: 0; padding: 10px 20px 5px; }
  .home-brand { font-size: 25px; }
  .home-account { gap: 14px; }
  .home-locale { min-width: 48px; min-height: 44px; font-size: 15px; }
  .home-login { min-height: 44px; padding: 7px 12px; border-radius: 10px; font-size: 15px; }
  .home-nav { order: 3; width: 100%; padding-left: 0; border-left: 0; gap: 28px; }
  .home-nav a, .home-nav button { min-height: 44px; font-size: 15px; }
  .home-main { padding: 28px 20px 28px; }
  .home-hero { display: flex; flex-direction: column; gap: 22px; }
  .home-intro { width: 100%; }
  .home-intro h1 { margin: 0 0 10px; font-size: 38px; letter-spacing: -1px; line-height: 1.16; }
  .home-intro h1 br { display: block; }
  .home-subtitle { font-size: 15px; line-height: 1.6; }
  .home-scenes { display: flex; align-items: stretch; gap: 8px; margin-top: 20px; }
  .home-scene { justify-content: center; min-height: 48px; padding: 10px 8px; border: 1px solid #35343e; border-radius: 9px; gap: 7px; }
  .home-scene:last-child { border-bottom: 1px solid #35343e; }
  .home-scene.is-selected { border-color: #936dff; background: #241c3d; }
  .home-scene.is-selected::before { display: none; }
  .home-scene-icon { flex-basis: 23px; width: 23px; height: 23px; }
  .home-scene-copy strong { font-size: 15px; line-height: 1.4; white-space: nowrap; }
  .home-scene-copy > span { display: none; }
  .home-composer { width: 100%; padding: 22px 20px 16px; border-radius: 16px; }
  .home-composer h2 { margin-bottom: 15px; font-size: 25px; }
  .home-composer textarea { min-height: 160px; padding: 13px 15px; border-radius: 12px; font-size: 16px; }
  .home-options { gap: 12px; margin-top: 17px; }
  .home-select-wrap, .home-count-wrap { min-width: 0; }
  .home-select-wrap select { min-height: 48px; padding-left: 15px; font-size: 16px; border-radius: 10px; }
  .home-attachment-actions { gap: 22px; }
  .home-tool { min-height: 44px; font-size: 16px; }
  .home-tool img { width: 22px; height: 22px; }
  .home-composer-bottom { flex-direction: column-reverse; align-items: stretch; gap: 14px; margin-top: 15px; }
  .home-generate { width: 100%; min-height: 54px; min-width: 0; margin: 0; font-size: 21px; border-radius: 10px; }
  .home-draft-hint { font-size: 13px; gap: 8px; }
  .home-draft-hint img { width: 19px; height: 19px; flex-basis: 19px; }
  .home-attachment-hint { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin: 8px 0 0; font-size: 11px; line-height: 1.4; color: #9e9eaa; }
  .home-error { margin: 13px 0 0; }
  .home-examples { margin-top: 30px; padding-top: 23px; }
  .home-examples h2 { margin: 0 0 18px; font-size: 21px; line-height: 1.5; }
  .home-example-grid { grid-template-columns: 1fr; gap: 14px; }
  html:lang(en) .home-intro h1 { font-size: 35px; }
  html:lang(en) .home-intro h1 br { display: block; }
  html:lang(en) .home-scenes { gap: 6px; }
  html:lang(en) .home-scene { gap: 5px; padding: 8px 5px; }
  html:lang(en) .home-scene-copy strong { font-size: 13px; white-space: normal; }
  html:lang(en) .home-draft-hint { font-size: 13px; }
  html:lang(en) .home-tool { font-size: 14px; }
  html:lang(en) .home-select-wrap select { padding-left: 12px; padding-right: 30px; font-size: 16px; }
  html:lang(en) .home-select-wrap::after { right: 10px; width: 14px; height: 14px; }
}
@media (max-width: 360px) {
  .home-header { column-gap: 8px; padding-right: 14px; padding-left: 14px; }
  .home-brand { font-size: 22px; }
  .home-account { gap: 9px; }
  .home-login { padding: 6px 9px; font-size: 13px; }
  .home-locale { min-width: 43px; font-size: 14px; }
  .home-main { padding-right: 14px; padding-left: 14px; }
  .home-intro h1 { font-size: 33px; }
  .home-subtitle { font-size: 14px; }
  .home-scenes { gap: 6px; }
  .home-scene { padding: 10px 5px; gap: 5px; }
  .home-scene-icon { flex-basis: 20px; width: 20px; height: 20px; }
  .home-scene-copy strong { font-size: 13px; }
  .home-composer { padding: 19px 16px 15px; }
  .home-composer h2 { font-size: 23px; }
  .home-tool { gap: 7px; font-size: 15px; }
  .home-attachment-actions { gap: 17px; }
}
@media (prefers-reduced-motion: no-preference) { .home-page a, .home-page button, .home-page select, .home-page textarea { transition: background-color .15s, border-color .15s, color .15s; } }

/* Daylight keeps the same composition and follows the shared theme preference. */
html[data-theme="light"] .home-page {
  --home-bg: #f6f7fb;
  --home-surface: #ffffff;
  --home-border: #d9dce6;
  --home-text: #1c2030;
  --home-muted: #5c6172;
  --home-accent: #6740df;
  color-scheme: light;
}
html[data-theme="light"] .home-header { border-bottom-color: #dfe1ea; }
html[data-theme="light"] .home-nav { border-left-color: #d3d6e1; }
html[data-theme="light"] .home-subtitle,
html[data-theme="light"] .home-scene-copy > span { color: var(--home-muted); }
html[data-theme="light"] .home-scene { border-color: #d9dce6; }
html[data-theme="light"] .home-scene:hover { background: #eeedf7; }
html[data-theme="light"] .home-scene-icon { filter: none; }
html[data-theme="light"] .home-scene.is-selected .home-scene-icon { filter: invert(28%) sepia(53%) saturate(2862%) hue-rotate(245deg) brightness(89%) contrast(94%); }
html[data-theme="light"] .home-scene.is-selected { border-color: #8b6ce5; }
html[data-theme="light"] .home-login { border-color: #c5c8d4; }
html[data-theme="light"] .home-login:hover { background: #eeedf7; border-color: #8f85b6; }
html[data-theme="light"] .home-composer textarea,
html[data-theme="light"] .home-select-wrap select,
html[data-theme="light"] .home-select-wrap option { background: #f5f6fa; border-color: #c6cad7; color: var(--home-text); }
html[data-theme="light"] .home-composer textarea::placeholder { color: #656b7b; }
html[data-theme="light"] .home-examples { border-top-color: #d3d6e1; }
html[data-theme="light"] .home-example-grid figure { border-color: #d3d6e1; }
html[data-theme="light"] .home-tool img,
html[data-theme="light"] .home-draft-hint img,
html[data-theme="light"] .home-help-header img,
html[data-theme="light"] .home-select-wrap::after { filter: none; }
html[data-theme="light"] .home-help-dialog { background: #fff; border-color: #c6cad7; }
html[data-theme="light"] .home-help-header button { background: #f2f3f8; border-color: #c6cad7; }
html[data-theme="light"] .home-nav :is(a,button):hover,
html[data-theme="light"] .home-locale:hover,
html[data-theme="light"] .home-tool:hover { color: #6740df; }
@media (max-width: 760px) {
  html[data-theme="light"] .home-scene.is-selected { background: #eee8ff; }
}
