:root {
  color-scheme: dark;
  --bg: #1f1d2b;
  --bg-deep: #171521;
  --surface: #252332;
  --text: #f4f4f9;
  --muted: #a5a8bc;
  --control: #d5d7e4;
  --accent: #ff7551;
  --accent-hover: #ff967b;
  --on-accent: #20191e;
  --accent-soft: rgb(255 117 81 / 12%);
  --border: rgb(255 255 255 / 10%);
  --border-soft: rgb(255 255 255 / 7%);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 100px; scrollbar-gutter: stable; }
body { margin: 0; color: var(--text); font: 14px/1.6 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, textarea, summary):focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 4px; }
button:disabled { opacity: .4; cursor: default; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rotate { transform: rotate(180deg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.skip-link:focus { top: 12px; }
.js-only { display: none !important; }
.js-ready .js-only { display: flex !important; }
.js-ready .prompt-fallback { display: none; }
.top { min-height: 84px; padding: 0 32px; display: flex; gap: 24px; align-items: center; border-bottom: 1px solid var(--border-soft); background: var(--bg); }
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { display: block; height: 58px; width: auto; }
.logo-separator { width: 1px; height: 28px; background: var(--border); }
.page-nav { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.page-nav a { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.page-nav a:hover { color: var(--text); }
.page-nav a[aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.community-link { margin-left: auto; display: inline-flex; gap: 12px; align-items: center; min-height: 42px; padding: 8px 14px; border: 1px solid rgb(255 117 81 / 35%); border-radius: 10px; font-size: 12px; text-decoration: none; }
.community-link .icon { color: var(--accent); }
.community-link:hover { background: var(--accent-soft); }
.shell { width: min(100%, 1360px); margin: 0 auto; padding: 32px 32px 0; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 50px; margin-bottom: 28px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--accent-hover); font-size: 10px; font-weight: 600; letter-spacing: .13em; }
.eyebrow .icon { width: 15px; height: 15px; }
h1 { margin: 0; font-size: clamp(28px, 3.4vw, 42px); font-weight: 600; line-height: 1.2; letter-spacing: -.045em; }
h1 span { color: var(--accent-hover); }
.intro-copy { max-width: 665px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; text-wrap: pretty; }
.intro-note { position: relative; flex-shrink: 0; padding: 3px 0 3px 24px; border-left: 1px solid var(--border); }
.intro-note p { margin: 0 0 9px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.intro-note strong { font-weight: 500; color: var(--control); }
.intro-note > span:last-child { font-size: 11px; color: var(--muted); }
.note-mark { position: absolute; top: -10px; right: 0; color: var(--accent); font-size: 25px; }
.how-to { padding: 18px 22px 14px; border: 1px solid var(--border); background: rgb(255 255 255 / 2%); border-radius: 16px; }
.how-heading { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; cursor: pointer; list-style: none; }
.how-heading::-webkit-details-marker { display: none; }
.how-title { font-size: 14px; font-weight: 600; letter-spacing: -.015em; }
.model-intro { color: var(--muted); font-size: 12px; }
.how-chevron { margin-left: auto; width: 15px; height: 15px; color: var(--muted); transform: rotate(90deg); }
.how-to[open] .how-chevron { transform: rotate(-90deg); }
.how-heading a { color: var(--accent-hover); text-underline-offset: 3px; text-decoration-color: rgb(255 150 123 / 35%); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 0; margin: 18px 0 14px; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 11px; }
.step-number { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; color: var(--accent-hover); background: var(--accent-soft); font: 500 12px var(--mono); }
.steps strong { font-size: 13px; font-weight: 500; }
.steps p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.steps b { font-weight: 500; color: var(--control); }
.how-tip { margin: 0; padding-top: 11px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 11px; line-height: 1.6; }
.gallery { margin-top: 34px; scroll-margin-top: 20px; }
.gallery-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gallery-heading h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.gallery-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
#result-count { color: var(--muted); white-space: nowrap; font: 11px var(--mono); }
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 0; margin: -6px 0 8px; background: var(--bg); }
.filters { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: thin; min-width: 0; padding: 4px 3px; }
.filter { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--control); font-size: 12px; white-space: nowrap; }
.filter span { font-size: 10px; opacity: .7; }
.filter:hover { background: rgb(255 255 255 / 5%); }
.filter[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.search { position: relative; flex: 0 1 240px; min-width: 160px; }
.search > .icon { position: absolute; left: 13px; top: 13px; color: var(--muted); width: 17px; height: 17px; }
.search input { min-height: 44px; width: 100%; padding: 10px 42px 10px 40px; color: var(--text); border: 1px solid var(--border); background: var(--surface); border-radius: 10px; font-size: 12px; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.search .icon-button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: none; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.effect-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: rgb(255 255 255 / 2.5%); overflow: hidden; }
.effect-card:hover { border-color: rgb(255 255 255 / 22%); }
.preview { display: block; position: relative; padding: 0; border: 0; width: 100%; aspect-ratio: 3 / 4; background: var(--bg-deep); overflow: hidden; }
.preview:focus-visible { outline-offset: -5px; }
.preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.effect-number, .expand-icon { position: absolute; top: 12px; display: flex; align-items: center; justify-content: center; background: rgb(23 21 33 / 75%); border: 1px solid rgb(255 255 255 / 15%); border-radius: 8px; width: 30px; height: 30px; color: #fff; }
.effect-number { left: 12px; font: 11px var(--mono); }
.expand-icon { right: 12px; }
.expand-icon .icon { width: 14px; height: 14px; }
.preview-caption { position: absolute; bottom: 0; left: 0; right: 0; align-items: center; justify-content: center; height: 46px; padding-top: 10px; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); color: #fff; font-size: 11px; }
.card-content { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.card-category { color: var(--muted); font-size: 10px; line-height: 1; margin-bottom: 8px; }
.card-content h3 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; font-weight: 600; overflow-wrap: anywhere; }
.card-content > p { margin: 6px 0 16px; min-height: 3.2em; color: var(--muted); font-size: 12px; line-height: 1.6; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid rgb(255 117 81 / 35%); border-radius: 9px; background: var(--accent-soft); color: #ffad95; font-size: 12px; font-weight: 600; }
.card-content .copy-button { margin-top: auto; }
.copy-button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.copy-button .icon { width: 15px; height: 15px; }
.check-icon { display: none; }
.copy-button.is-copied { color: #92e8b0; background: rgb(74 222 128 / 9%); border-color: rgb(74 222 128 / 35%); }
.copy-button.is-copied .copy-icon { display: none; }
.copy-button.is-copied .check-icon { display: block; }
.prompt-fallback summary { padding: 8px 0; cursor: pointer; }
.prompt-fallback p { overflow-wrap: anywhere; font: 12px/1.8 var(--mono); user-select: all; }
.no-script { color: var(--muted); }
.empty { padding: 48px 20px; border: 1px dashed var(--border); border-radius: 16px; text-align: center; }
.empty > .icon { color: var(--accent); width: 26px; height: 26px; }
.empty h3 { font-size: 18px; margin: 12px 0 4px; font-weight: 500; }
.empty p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.secondary-button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); background: var(--surface); color: var(--control); border-radius: 10px; font-size: 13px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 36px; padding: 25px 0 32px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--accent-hover); }
.footer .icon { width: 15px; height: 15px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 10px; color: var(--control); background: var(--surface); }
.icon-button:hover { background: #353244; color: #fff; }
.dialog-open { overflow: hidden; }
.effect-dialog { width: min(980px, calc(100% - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid rgb(255 255 255 / 16%); border-radius: 18px; background: var(--bg); color: var(--text); overflow: auto; overscroll-behavior: contain; box-shadow: 0 32px 120px #0008; }
.effect-dialog::backdrop { background: rgb(9 8 15 / 85%); backdrop-filter: blur(5px); }
.dialog-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 18px; min-height: 60px; padding: 8px 12px 8px 22px; background: var(--bg); border-bottom: 1px solid var(--border); }
#dialog-position { color: var(--muted); font-size: 11px; }
.keyboard-tip { margin-left: auto; font-size: 10px; color: var(--muted); }
.dialog-top .icon-button { margin-left: auto; border: 0; }
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dialog-visual { position: relative; min-width: 0; display: flex; justify-content: center; align-items: center; background: #111019; }
.dialog-visual img { display: block; width: 100%; height: min(700px, calc(100dvh - 110px)); object-fit: contain; }
.image-navigation { position: absolute; inset: auto 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-navigation .icon-button { background: rgb(23 21 33 / 85%); border-color: rgb(255 255 255 / 20%); }
.image-navigation span { color: #e5e1ee; font-size: 10px; background: rgb(23 21 33 / 80%); padding: 6px 10px; border-radius: 20px; }
.dialog-content { min-width: 0; display: flex; flex-direction: column; padding: 26px; }
.dialog-content .eyebrow { font-size: 10px; margin-bottom: 9px; }
.dialog-content h2 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; overflow-wrap: anywhere; }
#dialog-description { margin: 9px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.prompt-label { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 12px; }
.prompt-label label { font-weight: 500; }
.prompt-label span { font-size: 10px; color: var(--muted); font-weight: 400; }
#dialog-prompt { display: block; width: 100%; min-height: 200px; height: 290px; flex: 1; resize: vertical; padding: 16px; border: 1px solid var(--border); background: var(--bg-deep); border-radius: 10px; color: #d8d6e3; font: 11px/1.85 var(--mono); }
#prompt-help { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 10px 0 18px; }
#dialog-copy { background: var(--accent); color: var(--on-accent); min-height: 48px; font-size: 13px; }
#dialog-copy:hover { background: var(--accent-hover); }
#dialog-copy.is-copied { background: #92e8b0; }
.manual-copy { color: #ffc7b5; font-size: 12px; margin: 12px 0 0; }
.dialog-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); }
.dialog-hint .icon { width: 16px; height: 16px; margin-top: 3px; }
.dialog-hint p { margin: 0; font-size: 11px; line-height: 1.7; }
.dialog-hint strong { font-weight: 500; color: var(--control); }
.toast { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 32px); width: max-content; border-radius: 10px; background: #dcfce7; color: #143321; box-shadow: 0 6px 24px #0004; font-size: 12px; font-weight: 500; padding: 12px 18px; pointer-events: none; }
.toast:empty { display: none; }
@media (hover: hover) and (pointer: fine) {
  .preview-caption { opacity: 0; }
  .preview:hover .preview-caption, .preview:focus-visible .preview-caption { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .effect-card, .copy-button, .filter, .icon-button { transition: border-color 160ms, background 160ms, color 160ms; }
  .preview-caption { transition: opacity 160ms; }
}
@media (max-width: 1099px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .shell { padding: 32px 24px 0; }
  .intro-note { display: none; }
  .toolbar { gap: 10px; }
  .filter { padding-inline: 11px; }
  .steps { gap: 20px; }
}
@media (max-width: 759px) {
  .top { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .logo img { height: 44px; }
  .logo-separator { display: none; }
  .page-nav { order: 3; width: 100%; }
  .page-nav a { flex: 1; min-height: 40px; }
  .community-link { min-height: 44px; font-size: 11px; padding: 8px 10px; gap: 7px; }
  .shell { padding: 28px 16px 0; }
  .intro { margin-bottom: 24px; }
  h1 { font-size: clamp(27px, 6.8vw, 38px); }
  .intro-copy { font-size: 13px; line-height: 1.75; }
  .how-to { padding: 16px; }
  .how-heading { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding-right: 22px; gap: 3px; }
  .how-chevron { position: absolute; top: 4px; right: 0; }
  .steps { grid-template-columns: 1fr; gap: 14px; margin: 17px 0; }
  .steps li { gap: 10px; }
  .steps p { margin-top: 2px; }
  .how-tip { font-size: 11px; }
  .gallery { margin-top: 28px; }
  .gallery-heading { gap: 10px; }
  .gallery-heading h2 { font-size: 18px; }
  .gallery-heading p { font-size: 11px; }
  #result-count { font-size: 10px; }
  .toolbar { flex-direction: column; align-items: stretch; padding-top: 8px; gap: 8px; }
  .search { flex: auto; }
  .filters { order: 2; padding-block: 4px; margin-inline: -3px; }
  .filter { min-height: 44px; padding: 6px 12px; }
  .search input { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .effect-card { border-radius: 12px; }
  .card-content { padding: 12px 10px; }
  .card-content h3 { font-size: 14px; }
  .card-content > p { font-size: 11px; margin-bottom: 13px; min-height: 4.8em; }
  .card-category { font-size: 9px; }
  .copy-button { padding-inline: 7px; font-size: 11px; gap: 6px; }
  .effect-number, .expand-icon { width: 25px; height: 25px; top: 8px; }
  .effect-number { left: 8px; font-size: 9px; }
  .expand-icon { right: 8px; }
  .preview-caption { height: 32px; font-size: 9px; padding-top: 5px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 28px; padding: 22px 0; font-size: 11px; }
  .effect-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  .dialog-top { padding-left: 16px; min-height: 58px; }
  .keyboard-tip { display: none; }
  .dialog-layout { display: flex; flex-direction: column; }
  .dialog-visual img { height: 300px; width: 100%; }
  .dialog-content { padding: 20px; }
  .dialog-content h2 { font-size: 24px; }
  #dialog-description { margin-bottom: 20px; }
  #dialog-prompt { flex: none; height: 230px; font-size: 12px; }
  #dialog-copy { position: sticky; bottom: 0; box-shadow: 0 6px 16px rgb(0 0 0 / 30%); }
}
@media (max-width: 359px) {
  .shell { padding-inline: 12px; }
  .grid { gap: 8px; }
  .card-content { padding-inline: 8px; }
  .card-content h3 { font-size: 13px; }
  .copy-button { font-size: 10px; gap: 5px; }
  .copy-button .icon { width: 13px; }
  .gallery-heading h2 { font-size: 16px; }
}
