/* ==========================================================
   PromptHub design system
   One stylesheet for the public site, user panel and admin.
   Themes: html[data-theme="dark" | "light"]
   ========================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    --container: 1200px;
    --gutter: 16px;
    --header-h: 68px;

    --ease: cubic-bezier(.2, .7, .2, 1);
    --speed: .18s;

    /* Dark (default): a softer "dim" navy instead of near-black, easier on the eyes */
    color-scheme: dark;
    --bg: #161b33;
    --bg-glow-1: rgba(124, 108, 255, .22);
    --bg-glow-2: rgba(74, 141, 255, .12);
    --surface: #1e2442;
    --surface-2: #252c4f;
    --surface-3: #2d355c;
    --surface-hover: #29305a;
    --border: rgba(170, 178, 255, .16);
    --border-strong: rgba(170, 178, 255, .30);
    --text: #f7f8ff;
    --text-muted: #d0d5f0;
    --text-subtle: #a6acd0;
    --primary: #6c5cff;
    --primary-hover: #7e70ff;
    --primary-contrast: #ffffff;
    --primary-soft: rgba(108, 92, 255, .16);
    --primary-border: rgba(124, 108, 255, .50);
    --grad-a: #8f7dff;
    --grad-b: #6aa3ff;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, .14);
    --warning: #f5a524;
    --warning-soft: rgba(245, 165, 36, .14);
    --danger: #f05252;
    --danger-soft: rgba(240, 82, 82, .14);
    --info: #4a8dff;
    --info-soft: rgba(74, 141, 255, .14);
    --header-bg: rgba(22, 27, 51, .84);
    --input-bg: #1a2040;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
    --shadow-md: 0 10px 30px rgba(5, 8, 25, .30);
    --shadow-lg: 0 24px 60px rgba(5, 8, 25, .38);
    --focus-ring: 0 0 0 3px rgba(124, 108, 255, .50);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6fc;
    --bg-glow-1: rgba(108, 92, 255, .10);
    --bg-glow-2: rgba(59, 130, 246, .06);
    --surface: #ffffff;
    --surface-2: #f3f4fb;
    --surface-3: #e9ebf7;
    --surface-hover: #f0f1fa;
    --border: #e2e5f2;
    --border-strong: #cdd2e8;
    --text: #0e1128;
    --text-muted: #434a6c;
    --text-subtle: #697092;
    --primary: #5b4bf0;
    --primary-hover: #4a3be0;
    --primary-soft: rgba(91, 75, 240, .10);
    --primary-border: rgba(91, 75, 240, .40);
    --grad-a: #6a52ff;
    --grad-b: #3b7bff;
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, .10);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, .10);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, .09);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, .09);
    --header-bg: rgba(255, 255, 255, .82);
    --input-bg: #ffffff;
    --shadow-sm: 0 1px 2px rgba(20, 24, 60, .06);
    --shadow-md: 0 10px 30px rgba(20, 24, 60, .08);
    --shadow-lg: 0 24px 60px rgba(20, 24, 60, .12);
    --focus-ring: 0 0 0 3px rgba(91, 75, 240, .30);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 500px at 85% -10%, var(--bg-glow-1), transparent 60%),
        radial-gradient(700px 400px at -10% 10%, var(--bg-glow-2), transparent 60%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--primary-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
html[data-theme="light"] a { color: var(--primary); }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; letter-spacing: -.02em; word-spacing: .04em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
p { margin: 0 0 1em; }

code, pre, kbd { font-family: var(--font-mono); font-size: .9em; }

::selection { background: var(--primary); color: #fff; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

[hidden] { display: none !important; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; }

/* Theme toggle shows the icon of the mode it switches to. */
html[data-theme="dark"] .theme-toggle .icon-moon,
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }

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

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 100;
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.pt-0 { padding-top: 0; }

.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--text-muted); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.gradient-text {
    background: linear-gradient(100deg, var(--grad-a), var(--grad-b));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: var(--header-h);
    display: flex; align-items: center; gap: 24px;
}

.brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.125rem; letter-spacing: -.02em;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
html[data-theme="light"] .brand { color: var(--text); }
.brand-mark { width: 32px; height: 32px; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 16px; }

.nav-link {
    display: inline-flex; align-items: center;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: .9375rem; font-weight: 600;
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease);
}
html[data-theme="light"] .nav-link { color: var(--text-muted); }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.header-actions .nav-toggle { display: none; }

.mobile-nav {
    display: none;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    padding-bottom: 16px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav .nav-link { display: flex; padding: 12px; }
.mobile-nav .row { margin-top: 12px; }
.mobile-nav .row .btn { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
    --btn-h: 42px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--btn-h); padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1;
    white-space: nowrap; cursor: pointer; user-select: none;
    transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease),
                color var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(180deg, var(--primary-hover), var(--primary));
    color: var(--primary-contrast);
    box-shadow: 0 6px 18px -6px rgba(108, 92, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .15);
}
html[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent; color: var(--text); border-color: var(--border-strong);
}
html[data-theme="light"] .btn-outline { color: var(--text); }
.btn-outline:hover { border-color: var(--primary-border); background: var(--primary-soft); }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
html[data-theme="light"] .btn-secondary { color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-muted); }
html[data-theme="light"] .btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
html[data-theme="light"] .btn-danger { color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.btn-sm { --btn-h: 34px; padding: 0 12px; font-size: .8125rem; }
.btn-lg { --btn-h: 50px; padding: 0 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }

.btn.is-success { background: var(--success); color: #fff; box-shadow: none; }

/* ---------- Badges & chips ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: .75rem; font-weight: 600; line-height: 1.5;
    background: var(--surface-3); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge .icon { width: 12px; height: 12px; }
.badge-primary { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-border); }
html[data-theme="light"] .badge-primary { color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge-info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }

.badge-official {
    background: linear-gradient(100deg, var(--grad-a), var(--grad-b));
    color: #fff; border: 0;
}

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: var(--radius-pill);
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-muted); font-size: .8125rem; font-weight: 500;
}
html[data-theme="light"] .chip { color: var(--text-muted); }
a.chip:hover { border-color: var(--primary-border); color: var(--text); text-decoration: none; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: var(--radius-pill);
    background: var(--primary-soft); border: 1px solid var(--primary-border);
    color: var(--text); font-size: .8125rem; font-weight: 600;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 1rem; }

.card-link { transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
.card-link:hover { border-color: var(--primary-border); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }

/* Category card */
.category-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; color: var(--text);
}
html[data-theme="light"] .category-card { color: var(--text); }
.category-card .category-icon {
    display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: var(--radius);
    background: var(--primary-soft); color: var(--primary-hover);
}
html[data-theme="light"] .category-card .category-icon { color: var(--primary); }
.category-card .category-icon .icon { width: 22px; height: 22px; }
.category-card strong { display: block; font-size: .9375rem; }
.category-card strong { font-weight: 700; }
.category-card span { font-size: .8125rem; color: var(--text-muted); }

/* Prompt card */
.prompt-card { display: flex; flex-direction: column; overflow: hidden; }

.prompt-card-media {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden;
    background: var(--surface-2);
}
.prompt-card-media img { width: 100%; height: 100%; object-fit: cover; }
.prompt-card-media.is-placeholder {
    display: grid; place-items: center;
    background:
        radial-gradient(120% 120% at 0% 0%, var(--media-a, rgba(143, 125, 255, .38)), transparent 58%),
        radial-gradient(120% 120% at 100% 100%, var(--media-b, rgba(106, 163, 255, .32)), transparent 58%),
        var(--surface-2);
    color: var(--text);
}
a.prompt-card-media:hover { text-decoration: none; }

/* Per-category placeholder colours (keyed by the category icon name). */
.media-image      { --media-a: rgba(143, 125, 255, .45); --media-b: rgba(255, 122, 182, .30); }
.media-video      { --media-a: rgba(255, 112, 112, .38); --media-b: rgba(255, 176, 84, .30); }
.media-pen        { --media-a: rgba(94, 160, 255, .40);  --media-b: rgba(143, 125, 255, .30); }
.media-code       { --media-a: rgba(54, 197, 168, .38);  --media-b: rgba(94, 160, 255, .30); }
.media-briefcase  { --media-a: rgba(245, 177, 61, .36);  --media-b: rgba(143, 125, 255, .28); }
.media-graduation { --media-a: rgba(80, 200, 120, .36);  --media-b: rgba(54, 197, 168, .28); }
.media-megaphone  { --media-a: rgba(255, 122, 182, .40); --media-b: rgba(245, 177, 61, .28); }
.media-zap        { --media-a: rgba(245, 197, 61, .38);  --media-b: rgba(255, 140, 84, .28); }
.media-flask      { --media-a: rgba(94, 200, 255, .38);  --media-b: rgba(80, 200, 120, .28); }
.media-grid       { --media-a: rgba(160, 170, 200, .32); --media-b: rgba(143, 125, 255, .28); }
.prompt-card-media.is-placeholder > .icon { width: 40px; height: 40px; opacity: .85; }
.prompt-card-media .badge-official { position: absolute; top: 10px; left: 10px; }

.prompt-card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; flex: 1; }
.prompt-card-title { margin: 0; font-size: 1rem; line-height: 1.35; }
.prompt-card-title a { color: var(--text); }
html[data-theme="light"] .prompt-card-title a { color: var(--text); }
.prompt-card-desc {
    margin: 0; color: var(--text-muted); font-size: .875rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.prompt-card-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: .8125rem; color: var(--text-subtle);
}
.prompt-card-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prompt-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.prompt-card-meta .icon { width: 14px; height: 14px; }
.prompt-card-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatar */
.avatar {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    color: #fff; font-weight: 700; font-size: .875rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; font-size: .6875rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }

/* Stat tiles (dashboards) */
.stat-tile {
    position: relative; overflow: hidden;
    padding: 18px 20px; border-radius: var(--radius-lg);
    color: #fff;
}
.stat-tile .stat-label { display: flex; align-items: center; gap: 8px; font-size: .8125rem; opacity: .9; }
.stat-tile .stat-label .icon { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: rgba(255, 255, 255, .18); }
.stat-tile .stat-value { margin-top: 10px; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.stat-violet { background: linear-gradient(135deg, #6c5cff, #8b5cf6); }
.stat-blue   { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-green  { background: linear-gradient(135deg, #0f9f6e, #16b981); }
.stat-orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-hint { font-size: .8125rem; color: var(--text-subtle); }
.form-error { font-size: .8125rem; color: var(--danger); }

.input, .select, .textarea {
    width: 100%; min-height: 44px; padding: 10px 14px;
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: .9375rem;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.select {
    appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a91b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}

.check { display: inline-flex; align-items: center; gap: 10px; font-size: .9375rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Search bar with attached button */
.search-bar {
    display: flex; align-items: center;
    padding: 6px; gap: 6px;
    background: var(--input-bg); border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: var(--focus-ring); }
.search-bar .icon { margin-left: 10px; color: var(--text-subtle); }
.search-bar input {
    flex: 1; min-width: 0; height: 42px; padding: 0 6px;
    background: transparent; border: 0; color: var(--text); font: inherit; font-size: .9375rem;
}
.search-bar input:focus { outline: none; box-shadow: none; }
.search-bar input::placeholder { color: var(--text-subtle); }

/* ---------- Feedback ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius);
    border: 1px solid transparent; font-size: .9375rem;
}
.alert .icon { margin-top: 2px; }
.alert p { margin: 0; }
.alert strong { display: block; margin-bottom: 2px; }
.alert-success { background: var(--success-soft); border-color: rgba(34, 197, 94, .30); color: var(--text); }
.alert-success .icon { color: var(--success); }
.alert-error   { background: var(--danger-soft);  border-color: rgba(240, 82, 82, .30); color: var(--text); }
.alert-error .icon { color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: rgba(245, 165, 36, .30); color: var(--text); }
.alert-warning .icon { color: var(--warning); }
.alert-info    { background: var(--info-soft);    border-color: rgba(74, 141, 255, .30); color: var(--text); }
.alert-info .icon { color: var(--info); }

.empty-state {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 48px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface);
}
.empty-state .empty-icon {
    display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px;
    border-radius: 50%; background: var(--primary-soft); color: var(--primary-hover);
}
html[data-theme="light"] .empty-state .empty-icon { color: var(--primary); }
.empty-state .empty-icon .icon { width: 26px; height: 26px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 420px; color: var(--text-muted); }

.skeleton {
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}
.skeleton-media { aspect-ratio: 16 / 10; border-radius: 0; }
.skeleton-line { height: 12px; margin-bottom: 10px; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast-region {
    position: fixed; right: 16px; bottom: 16px; z-index: 200;
    display: flex; flex-direction: column; gap: 10px;
    width: min(360px, calc(100vw - 32px));
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--radius);
    background: var(--surface-3); border: 1px solid var(--border-strong);
    color: var(--text); box-shadow: var(--shadow-lg); font-size: .9375rem;
    animation: toast-in .22s var(--ease);
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--danger); }
.toast-info .icon { color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
    padding: 12px 16px; text-align: left; white-space: nowrap;
    color: var(--text-subtle); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-hover); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 56px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 40px; }
.hero h1 { margin: 20px 0 16px; }
.hero-lead { max-width: 560px; font-size: 1.0625rem; color: var(--text-muted); }
.hero .search-bar { max-width: 560px; margin-top: 28px; }

.hero-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
    max-width: 560px; margin-top: 36px;
}
.hero-stats .stat strong {
    display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--primary-hover);
}
html[data-theme="light"] .hero-stats .stat strong { color: var(--primary); }
.hero-stats .stat strong { font-weight: 800; }
.hero-stats .stat span { font-size: .8125rem; font-weight: 500; color: var(--text-muted); }

/* Decorative illustration (own artwork, no third-party logos) */
.hero-visual { position: relative; aspect-ratio: 1 / 1; max-width: 500px; width: 100%; margin-left: auto; }
.hero-visual .orbit {
    position: absolute; inset: 6%; border-radius: 50%;
    border: 1px dashed var(--border-strong);
}
.hero-visual .orbit-2 { inset: 20%; border-style: solid; border-color: var(--border); }
.hero-visual .hero-core {
    position: absolute; inset: 24%;
    filter: drop-shadow(0 0 40px rgba(108, 92, 255, .45));
}
.hero-visual .hero-core svg { width: 100%; height: 100%; }

.float-tile {
    position: absolute; display: grid; place-items: center;
    width: 64px; height: 64px; border-radius: 18px;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    animation: float 6s ease-in-out infinite;
}
.float-tile .icon { width: 28px; height: 28px; }
.tile-1 { top: 4%;  left: 44%; color: #9c8cff; animation-delay: 0s; }
.tile-2 { top: 18%; left: 8%;  color: #36c5a8; animation-delay: -1.2s; }
.tile-3 { top: 14%; right: 4%; color: #b57bff; animation-delay: -2.4s; }
.tile-4 { bottom: 22%; left: 2%; color: #ff6fa5; animation-delay: -3.1s; }
.tile-5 { bottom: 10%; right: 10%; color: #f5b13d; animation-delay: -4.2s; }
.tile-6 { top: 48%; right: -2%; color: #5fa8ff; animation-delay: -5s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 48px; padding: 48px 0 24px;
    border-top: 1px solid var(--border); background: var(--surface);
    font-size: .9375rem;
}
html[data-theme="dark"] .site-footer { background: rgba(30, 36, 66, .6); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--text); }
.footer-about p { max-width: 320px; margin-top: 12px; color: var(--text-muted); }
.footer-bottom {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
    color: var(--text-subtle); font-size: .8125rem;
}

/* ---------- Prompt card extras ---------- */
.prompt-card-excerpt {
    margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    font-family: var(--font-mono); font-size: .8125rem; line-height: 1.55; color: var(--text-muted);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
a.badge:hover { border-color: var(--primary-border); color: var(--text); text-decoration: none; }

.flash-stack { display: grid; gap: 10px; padding-top: 20px; }

/* ---------- Prompt lists ---------- */
.list-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin: 12px 0 24px;
}
.list-title { margin-bottom: 6px; font-size: clamp(1.625rem, 3vw, 2.25rem); }
.list-count { margin: 0; color: var(--text-muted); font-weight: 600; }

.list-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.list-layout > * { min-width: 0; }

.list-sidebar {
    position: sticky; top: calc(var(--header-h) + 16px);
    padding: 16px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border);
}
.sidebar-title {
    margin: 0 0 12px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-subtle);
}
.category-nav { display: grid; gap: 2px; }
.category-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: .9rem; font-weight: 600;
}
html[data-theme="light"] .category-nav-link { color: var(--text-muted); }
.category-nav-link .icon { color: var(--text-subtle); }
.category-nav-link span:first-of-type { flex: 1; min-width: 0; }
.category-nav-link .count {
    flex: none; padding: 1px 8px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--text-subtle); font-size: .75rem;
}
.category-nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.category-nav-link.is-active { background: var(--primary-soft); color: var(--text); }
.category-nav-link.is-active .icon { color: var(--primary-hover); }
.category-nav-link.is-active .count { background: var(--primary); color: #fff; }

.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar-sm { flex: 1 1 280px; padding: 4px; box-shadow: none; }
.search-bar-sm input { height: 36px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.select-sm { min-height: 44px; width: auto; min-width: 160px; font-size: .875rem; }

.pagination {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    margin-top: 32px;
}
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-link {
    display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: .875rem;
}
html[data-theme="light"] .pagination-link { color: var(--text-muted); }
.pagination-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pagination-link.is-current { background: var(--primary); color: #fff; }
.pagination-gap { color: var(--text-subtle); padding: 0 4px; }

/* ---------- Prompt detail ---------- */
.breadcrumbs {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin: 8px 0 20px; font-size: .875rem; color: var(--text-subtle);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.detail-main { display: grid; gap: 20px; min-width: 0; }
.detail-aside { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }

.detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); overflow: hidden; }
.detail-hero.no-media { grid-template-columns: 1fr; }
.detail-media { position: relative; min-height: 260px; aspect-ratio: auto; height: 100%; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media.is-placeholder > .icon { width: 64px; height: 64px; }
.detail-info { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.detail-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.detail-desc { margin: 0; color: var(--text-muted); font-size: 1.0313rem; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-subtle); font-size: .875rem; }
.detail-stats > span { display: inline-flex; align-items: center; gap: 6px; }

.prompt-text-card .card-header h2 { margin: 0; font-size: 1rem; }
.prompt-text {
    margin: 0; padding: 20px; max-height: 520px; overflow: auto;
    white-space: pre-wrap; word-wrap: break-word;
    font-family: var(--font-mono); font-size: .9rem; line-height: 1.7; color: var(--text);
    background: var(--surface-2);
}
.prompt-text-hint {
    display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 20px;
    border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8125rem;
}
.prompt-text-hint .icon { color: var(--info); }

.detail-tags .sidebar-title { margin-bottom: 10px; }

.author { display: flex; align-items: center; gap: 12px; }
.author .avatar { width: 44px; height: 44px; }
.author strong { display: block; }
.author-bio { margin: 12px 0 0; }

.tool-list, .tip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tool-list a { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: .9375rem; }
html[data-theme="light"] .tool-list a { color: var(--text); }
.tool-dot {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    background: var(--primary-soft); color: var(--primary-hover); font-size: .8125rem; font-weight: 800;
}
.tip-list li { display: flex; gap: 8px; font-size: .875rem; color: var(--text-muted); }
.tip-list .icon { margin-top: 3px; color: var(--success); }

/* ---------- Categories page ---------- */
.category-tile { display: flex; gap: 16px; padding: 20px; color: var(--text); }
html[data-theme="light"] .category-tile { color: var(--text); }
.category-tile-icon {
    display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: var(--radius);
    background:
        radial-gradient(120% 120% at 0% 0%, var(--media-a), transparent 70%),
        radial-gradient(120% 120% at 100% 100%, var(--media-b), transparent 70%),
        var(--surface-2);
}
.category-tile-icon .icon { width: 24px; height: 24px; }
.category-tile-body { display: flex; flex-direction: column; gap: 6px; }
.category-tile-body strong { font-size: 1.0625rem; }
.category-tile-count {
    display: inline-flex; align-items: center; gap: 6px; margin-top: auto;
    color: var(--primary-hover); font-size: .875rem; font-weight: 700;
}
html[data-theme="light"] .category-tile-count { color: var(--primary); }

/* ---------- Call to action ---------- */
.cta-band {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: 32px; border-radius: var(--radius-xl);
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(143, 125, 255, .35), transparent 60%),
        radial-gradient(120% 160% at 100% 100%, rgba(106, 163, 255, .25), transparent 60%),
        var(--surface);
    border: 1px solid var(--primary-border);
}
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { margin: 0; color: var(--text-muted); }

/* ---------- Content pages ---------- */
.prose-container { max-width: 860px; }
.page-title { margin: 16px 0 12px; font-size: clamp(1.875rem, 4vw, 2.75rem); }
.lead { font-size: 1.125rem; color: var(--text-muted); }
.prose { margin-top: 8px; }
.prose h2 { margin-top: 36px; font-size: 1.375rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.prose-container > h2 { margin-top: 40px; font-size: 1.375rem; }
.about-stats { margin: 28px 0 12px; }
.about-stats strong { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary-hover); }
html[data-theme="light"] .about-stats strong { color: var(--primary); }
.about-stats span { color: var(--text-muted); font-size: .875rem; }
.step-card .category-icon {
    display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px;
    border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-hover);
}
.step-card h3 { margin-bottom: 6px; font-size: 1.0625rem; }

.contact-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; padding-top: 8px; }
.contact-points { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 14px; }
.contact-points li { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-weight: 500; }
.contact-points .icon {
    width: 36px; height: 36px; padding: 8px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary-hover);
}
.form-row { gap: 16px; }
.form-alert { margin-bottom: 16px; }
.form-note { margin: 12px 0 0; text-align: center; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Error page ---------- */
.error-page { padding: 96px 0; text-align: center; }
.error-page .error-code {
    font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; line-height: 1; letter-spacing: -.05em;
}
.error-page p { max-width: 460px; margin: 12px auto 28px; color: var(--text-muted); }

/* ---------- Dev pages ---------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.swatch-color { height: 64px; }
.swatch-meta { padding: 8px 12px; font-size: .75rem; color: var(--text-muted); }
.swatch-meta strong { display: block; color: var(--text); font-size: .8125rem; }
.sw-bg { background: var(--bg); }
.sw-surface { background: var(--surface); }
.sw-surface-2 { background: var(--surface-2); }
.sw-primary { background: var(--primary); }
.sw-gradient { background: linear-gradient(100deg, var(--grad-a), var(--grad-b)); }
.sw-success { background: var(--success); }
.sw-warning { background: var(--warning); }
.sw-danger { background: var(--danger); }
.sw-info { background: var(--info); }

.check-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.check-state.is-ok { color: var(--success); }
.check-state.is-warn { color: var(--warning); }
.check-state.is-fail { color: var(--danger); }

.demo-block + .demo-block { margin-top: 40px; }
.demo-block > h2 { font-size: 1.25rem; margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (min-width: 861px) {
    .mobile-nav.is-open { display: none; }
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { max-width: 380px; margin: 8px auto 0; }

    .list-layout { grid-template-columns: 1fr; gap: 16px; }
    .list-sidebar { position: static; padding: 0; background: none; border: 0; }
    .list-sidebar .sidebar-title { display: none; }
    .category-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
    .category-nav-link { flex: none; border: 1px solid var(--border); background: var(--surface); }
    .category-nav-link span:first-of-type { flex: none; }

    .detail-layout { grid-template-columns: 1fr; }
    .detail-aside { position: static; }
    .contact-layout { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 860px) {
    .main-nav, .header-actions .auth-actions { display: none; }
    .header-actions .nav-toggle { display: inline-flex; }
    .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    :root { --header-h: 60px; }
    .section { padding: 40px 0; }
    .hero { padding: 40px 0 32px; }
    .hero-visual { display: none; }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .search-bar .btn { padding: 0 14px; }
    .detail-hero { grid-template-columns: 1fr; }
    .detail-media { min-height: 200px; aspect-ratio: 16 / 10; }
    .detail-info { padding: 18px; }
    .filter-form, .filter-form .select-sm { width: 100%; }
    .filter-form .select-sm { flex: 1 1 140px; min-width: 0; }
    .cta-band { padding: 24px; }
    .toast-region { right: 16px; left: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
