body.ai-page { background-color: #0b0f19; color: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body.ai-page * { font-family: inherit; }
body.ai-page i.fas, body.ai-page i.far, body.ai-page i.fa-solid { font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; }
body.ai-page .container { max-width: 1000px; margin: 30px auto 50px; padding: 0 20px; text-align: center; }
body.ai-page .breadcrumb { color: #94a3b8; }
body.ai-page .breadcrumb a { color: #94a3b8; text-decoration: none; }
body.ai-page .breadcrumb a:hover { color: #fff; }
body.ai-page h1 { font-size: 2rem; margin-bottom: 16px; }
body.ai-page [hidden] { display: none !important; }

.ai-zone { max-width: 860px; margin: 0 auto 30px; padding: 28px 22px; text-align: left; }
.ai-zone-notice { text-align: center; padding: 50px 20px; }
.ai-zone h3 { color: #fff; }
.ai-muted, .ai-hint { color: rgba(255, 255, 255, .8); font-size: .85rem; }
.ai-hint { display: block; margin-top: 4px; }
.ai-opt { font-weight: 400; color: rgba(255, 255, 255, .75); font-size: .8rem; margin-left: 6px; }

.ai-zone .format-grid { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.ai-zone .btn-format input, .ai-zone .q-btn input, .ai-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-zone .btn-format span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ai-zone .q-btn span { pointer-events: none; }
.ai-zone .btn-format:focus-within, .ai-zone .q-btn:focus-within { outline: 2px solid #60a5fa; outline-offset: 2px; }
.ai-rbox { display: inline-block; border: 2px solid currentColor; border-radius: 3px; opacity: .85; flex: none; }


.ai-zone .btn-main { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #ffffff !important; color: #111827 !important; border: 2px solid #ffffff; border-radius: 6px; padding: 14px 34px; font-size: 16px; font-weight: 700; letter-spacing: .02em; text-decoration: none; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); transition: transform .15s, box-shadow .15s, filter .15s; }
.ai-zone .btn-main:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); filter: brightness(.96); }
.ai-zone .btn-main:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ai-zone .btn-main:focus-visible, .ai-zone .btn-outline:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.ai-zone #aiDownload { background: #10b981 !important; border-color: #10b981; color: #ffffff !important; }
.ai-zone .btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #111827 !important; color: #ffffff !important; border: 1px solid #6b7280; border-radius: 6px; padding: 11px 22px; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: background .15s, border-color .15s; }
.ai-zone .btn-outline:hover:not(:disabled) { background: #1f2937 !important; border-color: #93c5fd; }
.ai-zone .btn-outline:disabled { opacity: .55; cursor: not-allowed; }
.ai-zone .ai-sm { padding: 7px 14px; font-size: .82rem; }
.ai-zone .btn-format, .ai-zone .q-btn { position: relative; display: block; background: #111827; color: #f3f4f6; border: 1px solid #4b5563; border-radius: 8px; padding: 12px 10px; font-size: .9rem; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.ai-zone .q-btn { display: inline-block; padding: 10px 18px; margin: 0 4px 6px 0; }
.ai-zone .btn-format:hover:not(.is-disabled), .ai-zone .q-btn:hover { background: #1f2937; border-color: #93c5fd; }
.ai-zone .btn-format.active, .ai-zone .q-btn.active { background: #3b82f6; border-color: #bfdbfe; color: #ffffff; font-weight: 600; box-shadow: 0 2px 8px rgba(59, 130, 246, .5); }
.ai-zone .btn-format.is-disabled { opacity: .45; cursor: not-allowed; }
.ai-notes { background: rgba(17, 24, 39, .85); border: 1px solid #4b5563; border-radius: 10px; padding: 10px 14px 10px 32px; color: #f3f4f6; }

.ai-group { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.ai-group legend, .ai-label { font-weight: 700; font-size: 1rem; color: #fff; margin-bottom: 6px; padding: 0; }
.ai-row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0; }
.ai-count { font-size: .8rem; color: rgba(255, 255, 255, .8); }
.ai-count.is-over { color: #fecaca; font-weight: 700; }
.ai-input { width: 100%; background: #111827; border: 1px solid #374151; color: #f3f4f6; border-radius: 10px; padding: 11px 12px; font: inherit; font-size: .95rem; }
.ai-input:focus { outline: 2px solid #60a5fa; outline-offset: 1px; }
.ai-textarea { resize: vertical; min-height: 110px; }
.ai-field label { display: block; font-size: .85rem; margin-bottom: 4px; }
.ai-pair { display: flex; align-items: center; gap: 10px; }
.ai-pair .ai-num { max-width: 130px; }
.ai-range { flex: 1; min-width: 0; accent-color: #3b82f6; }
.ai-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 12px; }
.ai-adv { border: 1px solid #374151; border-radius: 12px; margin-bottom: 22px; background: rgba(17, 24, 39, .85); }
.ai-adv summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; }
.ai-adv summary::-webkit-details-marker { display: none; }
.ai-adv summary i { margin-right: 8px; color: #60a5fa; }
.ai-adv-body { padding: 4px 14px 14px; }
.ai-toggle { margin: 12px 0 6px; }
.ai-sub { border: 0; padding: 0 0 0 4px; margin: 0 0 10px; min-width: 0; }
.ai-sub:disabled { opacity: .4; }
.ai-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; position: relative; }
.ai-slider { width: 42px; height: 24px; background: #374151; border-radius: 24px; position: relative; transition: .2s; flex: none; }
.ai-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.ai-switch input:checked + .ai-slider { background: #3b82f6; }
.ai-switch input:checked + .ai-slider::after { transform: translateX(18px); }
.ai-switch input:focus-visible + .ai-slider { outline: 2px solid #60a5fa; outline-offset: 2px; }
.ai-pick { text-align: center; border: 2px dashed rgba(255, 255, 255, .35); border-radius: 14px; padding: 24px 14px; cursor: pointer; transition: .2s; }
.ai-pick:hover, .ai-pick.is-over { border-color: #fff; background: rgba(255, 255, 255, .06); }
.ai-thumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 12px 0 0; }
.ai-thumbs li { position: relative; width: 96px; }
.ai-thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid #374151; display: block; }
.ai-thumbs button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #dc2626; color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.ai-thumbs small { display: block; text-align: center; color: rgba(255, 255, 255, .8); font-size: .72rem; }
.ai-suggest { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ai-suggest button { width: 100%; text-align: left; background: #111827; border: 1px solid #374151; color: #f3f4f6; border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .88rem; }
.ai-suggest button:hover { border-color: #60a5fa; }
.ai-submit-row, .ai-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.ai-status .ai-actions, .ai-result .ai-actions { justify-content: center; margin-top: 18px; }
.ai-error { color: #fff; background: rgba(127, 29, 29, .85); border: 1px solid #fca5a5; border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: .9rem; }
.ai-error a { color: #fff; font-weight: 700; }
.ai-warn { color: #fff; background: rgba(120, 53, 15, .85); border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: .88rem; }

.ai-status, .ai-result { text-align: center; }
.ai-status h3 { font-size: 1.2rem; margin-bottom: 6px; }
.ai-elapsed { display: inline-block; background: #111827; border: 1px solid #374151; border-radius: 999px; padding: 3px 12px; font-variant-numeric: tabular-nums; font-size: .88rem; margin: 6px 0; }
.ai-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px auto; max-width: 620px; }
.ai-steps li { flex: 1; min-width: 0; }
.ai-seg { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .4); overflow: hidden; position: relative; }
.ai-steps li.is-done .ai-seg { background: #10b981; }
.ai-steps li.is-error .ai-seg { background: #111827; box-shadow: inset 0 0 0 2px #fca5a5; }
.ai-steps li.is-active .ai-seg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #fff, transparent); animation: ai-slide 1.3s ease-in-out infinite; }
.ai-steps li.is-active .ai-seg.is-determinate::after { animation: none; background: #fff; width: var(--p, 0%); right: auto; transition: width .2s; }
.ai-steps span { display: block; font-size: .72rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
.ai-steps li.is-active span, .ai-steps li.is-done span { opacity: 1; font-weight: 600; }
@keyframes ai-slide { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ai-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; text-align: left; }
.ai-meta > div { background: #111827; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 12px; min-width: 0; }
.ai-meta dt { font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.ai-meta dd { margin: 2px 0 0; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; color: #fff; }
.ai-notes { margin: 0 0 14px; padding-left: 20px; text-align: left; font-size: .88rem; }
.ai-skel { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: linear-gradient(100deg, #1a2133 30%, #263049 50%, #1a2133 70%); background-size: 200% 100%; animation: ai-shimmer 1.4s linear infinite; }
.ai-skel-static { aspect-ratio: 4 / 3; animation: none; }
@keyframes ai-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ai-status .ai-skel { max-width: 420px; margin: 16px auto 0; }

.ai-fig { margin: 14px auto; position: relative; border-radius: 14px; overflow: hidden; background: #111827; max-width: 640px; }
.ai-fig img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .5s ease; position: relative; }
.ai-fig img.is-loaded { opacity: 1; }
.ai-fig .ai-skel { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; transition: opacity .4s; }
.ai-fig.is-loaded .ai-skel { opacity: 0; pointer-events: none; }
.ai-final { text-align: left; margin: 10px 0; }
.ai-final summary { cursor: pointer; }
.ai-final p { font-size: .88rem; overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 6px; }

.ai-gallery { max-width: 860px; margin: 30px auto; text-align: left; }
.ai-gallery h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 14px; }
.ai-gallery { content-visibility: auto; contain-intrinsic-size: 1px 900px; }
.ai-gal-lead { margin: -6px 0 14px; }
.ai-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ai-gal-card { margin: 0; background: #161b28; border: 1px solid #1e293b; border-radius: 14px; overflow: hidden; }
.ai-gal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ai-gal-filter { background: #161b28; color: #cbd5e1; border: 1px solid #1e293b; border-radius: 999px; padding: 5px 14px; font-size: .82rem; cursor: pointer; }
.ai-gal-filter.is-active { background: #0984e3; border-color: #0984e3; color: #fff; }
.ai-gal-sets { display: grid; gap: 18px; }
.ai-gal-set { background: #11161f; border: 1px solid #1e293b; border-radius: 14px; padding: 14px; }
.ai-gal-set[hidden] { display: none; }
.ai-gal-head { margin: 0 0 12px; display: grid; gap: 4px; }
.ai-gal-title { margin: 0; font-size: 1rem; color: #e2e8f0; }
.ai-gal-prompt { margin: 0; font-size: .85rem; color: #94a3b8; overflow-wrap: anywhere; }
.ai-gal-note { margin: 0; font-size: .82rem; color: #7dd3fc; }
.ai-gal-note b { color: #38bdf8; }
.ai-gal-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ai-gal-tile { margin: 0; background: #161b28; border: 1px solid #1e293b; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ai-gal-tile img { width: 100%; height: auto; display: block; background: #0f1420; }
.ai-gal-tile figcaption { padding: 8px 10px 10px; display: grid; gap: 8px; margin-top: auto; }
.ai-gal-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-chip { background: #1e293b; color: #cbd5e1; border-radius: 999px; padding: 2px 8px; font-size: .72rem; }
.ai-gal-btns { display: grid; gap: 6px; }
.ai-gal-btns .ai-btn { width: 100%; }
.ai-gal-orig { border-style: dashed; }
.ai-gal-img { cursor: zoom-in; }
.ai-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(2, 6, 14, .92); display: none; align-items: center; justify-content: center; padding: 16px; }
.ai-lightbox.is-open { display: flex; }
.ai-lb-inner { max-width: 1400px; max-height: 100%; display: flex; gap: 12px; align-items: flex-start; justify-content: center; flex-wrap: wrap; overflow: auto; }
.ai-lb-inner figure { margin: 0; text-align: center; color: #cbd5e1; font-size: .8rem; }
.ai-lb-inner img { max-width: min(660px, 92vw); max-height: 86vh; width: auto; height: auto; border-radius: 10px; display: block; background: #0f1420; min-width: 120px; min-height: 120px; }
.ai-lb-inner:not(.is-pair) img { max-width: min(1200px, 96vw); }
.ai-lb-inner.is-pair img { max-width: min(900px, calc((100vw - 56px) / 2)); }
@media (max-width: 700px) { .ai-lb-inner.is-pair img { max-width: 92vw; } }
.ai-lb-close { position: absolute; top: 12px; right: 14px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 999px; width: 38px; height: 38px; font-size: 1.3rem; cursor: pointer; z-index: 1; }
.ai-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #0f1420; }
.ai-ba > div { position: relative; min-width: 0; }
.ai-ba span { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.ai-gal-set.is-edit .ai-gal-row { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.seo-content { max-width: 600px; margin: 40px auto 10px; text-align: left; line-height: 1.7; }
.seo-content h2 { font-size: 1.25rem; font-weight: 700; color: #ffffff; margin: 32px 0 12px; }
.seo-content h3 { font-size: 1rem; font-weight: 600; color: #e2e8f0; margin: 20px 0 6px; }
.seo-content p, .seo-content li { color: #94a3b8; font-size: 0.95rem; }
.seo-content p { margin: 0 0 10px; }
.seo-content ol, .seo-content ul { padding-left: 22px; margin: 0 0 8px; }
.seo-content li { margin-bottom: 6px; }
.seo-content strong { color: #e2e8f0; font-weight: 600; }

.ai-all-tools { margin-top: 50px; }
.ai-all-tools h2 { font-size: 1.5rem; margin-bottom: 24px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.tool-card { background-color: #1e293b; padding: 30px; border-radius: 12px; text-decoration: none; color: white; transition: transform .3s, background-color .3s; border: 1px solid transparent; }
.tool-card:hover { transform: translateY(-5px); background-color: #262f45; border-color: #3b82f6; }
.tool-icon { font-size: 40px; color: #3b82f6; margin-bottom: 15px; }
.tool-card h3 { font-size: 20px; margin-bottom: 10px; }
.tool-card p { color: #94a3b8; font-size: 14px; }

.ai-test-banner { background: rgba(245, 158, 11, .15); border: 1px solid rgba(245, 158, 11, .6); color: #fcd34d; border-radius: 10px; padding: 10px 14px; font-size: .85rem; margin: 0 auto 16px; max-width: 860px; overflow-wrap: anywhere; }
.ai-test-banner code { background: rgba(0, 0, 0, .35); padding: 1px 6px; border-radius: 6px; }
.ai-debug { max-width: 860px; margin: 0 auto 30px; text-align: left; background: #161b28; border: 1px solid #1e293b; border-radius: 14px; padding: 14px 18px; }
.ai-debug summary { cursor: pointer; font-weight: 600; }
.ai-debug pre { background: #0b0f19; border: 1px solid #374151; border-radius: 10px; padding: 12px; font-size: .78rem; color: #cbd5e1; overflow: auto; max-height: 340px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }
.ai-debug p { margin-top: 10px; }

@media (max-width: 520px) {
    .ai-zone { padding: 20px 14px; }
    .ai-steps span { font-size: .62rem; }
    body.ai-page h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ai-skel, .ai-steps li.is-active .ai-seg::after { animation: none; }
    .ai-fig img { transition: none; }
}

.ai-select { width: 100%; }
.ai-field-select .ai-label { display: block; margin-bottom: 6px; }
.ai-tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ai-tag-chip { background: #1e3a5f; color: #e0f2fe; border: 1px solid #3b82f6; border-radius: 999px; padding: 4px 12px; font-size: .82rem; cursor: pointer; }
.ai-tag-chip:hover { background: #274b7a; }
#aiUpscaleGroup .ai-sub { margin-top: 10px; display: grid; gap: 12px; }

.ai-sc { margin: 28px 0; content-visibility: auto; contain-intrinsic-size: 1px 800px; }
.ai-sc-lead { margin: -6px 0 14px; }
.ai-sc-bases { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ai-sc-prompt { margin: 0 0 12px; font-size: .88rem; color: #94a3b8; overflow-wrap: anywhere; }
.ai-sc-prompt b { color: #cbd5e1; }
.ai-sc-row { margin: 0 0 18px; }
.ai-sc-rowtitle { margin: 0 0 2px; font-size: 1rem; color: #e2e8f0; }
.ai-sc-hint { margin: 0 0 10px; font-size: .8rem; }
.ai-sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .ai-sc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ai-sc-tile { margin: 0; background: #161b28; border: 1px solid #1e293b; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ai-sc-tile[hidden] { display: none; }
.ai-sc-tile img { width: 100%; height: auto; display: block; background: #0f1420; }
.ai-sc-tile figcaption { padding: 8px 10px 10px; display: grid; gap: 8px; margin-top: auto; }
.ai-sc-name { color: #e2e8f0; font-size: .88rem; display: block; }
.ai-sc-name .ai-chip { margin-left: 4px; }
.ai-sc-clamp { color: #94a3b8; font-size: .8rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-sc-final summary { cursor: pointer; color: #7dd3fc; font-size: .78rem; }
.ai-sc-final p { margin: 6px 0 0; font-size: .78rem; color: #94a3b8; overflow-wrap: anywhere; }
.ai-sc .ai-gal-btns .ai-btn { width: 100%; }

.ai-enh-row { flex-wrap: wrap; }
.ai-enh-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-zone select.ai-enh-level { width: auto; padding: 6px 10px; font-size: .82rem; }
.ai-zone .btn-outline:disabled { opacity: .5; cursor: not-allowed; }
.ai-undo { background: none; border: 0; padding: 0; color: #60a5fa; text-decoration: underline; cursor: pointer; font-size: .85rem; }
.ai-undo:hover { color: #93c5fd; }
.ai-thumbs .ai-thumb-num { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(17, 24, 39, .85); color: #fff; font-size: .78rem; font-weight: 700; line-height: 22px; text-align: center; pointer-events: none; }
