:root {
    --otomates-shell-width: 1480px;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-tint: #f8fbff;
    --surface-soft: #eef3f9;
    --ink: #17191f;
    --muted: #5e6778;
    --quiet: #8792a4;
    --line: #d8e0ea;
    --line-strong: #bdc8d8;
    --accent: #2f7fa7;
    --accent-strong: #1d5f83;
    --accent-soft: #e8f2f7;
    --accent-warm: #dd7a5a;
    --accent-warm-soft: #fff2eb;
    --success: #2f8f5b;
    --success-soft: #edf8f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Kumbh Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body.oto-ui-page {
    background:
        linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%);
}

body.is-locked {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.otomates-page {
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(244, 246, 250, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.oto-header .oto-shell,
.main-content,
.oto-page-intro.gallery-hero-band {
    width: min(var(--otomates-shell-width), calc(100% - 40px));
    margin: 0 auto;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.site-header-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding-bottom: 12px;
}

.site-header-browse {
    padding-top: 0;
    padding-bottom: 16px;
}

.filter-bar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(189, 200, 216, 0.45);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.filter-kicker,
.section-kicker,
.detail-kicker,
.detail-stage-label,
.detail-code-label,
.detail-meta-label {
    color: var(--quiet);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.oto-brand-wordmark {
    max-width: 100%;
    width: auto;
    height: 36px;
    display: block;
}

.header-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.search-field,
.sort-field {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.search-field {
    flex: 1 1 420px;
    min-width: min(420px, 100%);
}

.search-icon {
    color: var(--quiet);
    font-size: 13px;
}

.search-input,
.sort-select {
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.search-input {
    width: 100%;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--quiet);
}

.sort-field {
    gap: 8px;
}

.sort-label {
    color: var(--quiet);
    font-size: 13px;
    font-weight: 700;
}

.sort-select {
    min-width: 132px;
    cursor: pointer;
}

.btn-create,
.clear-filters-btn,
.detail-copy-btn {
    border-radius: 8px;
}

.btn-create {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-create:hover,
.btn-create:focus-visible {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    transform: translateY(-1px);
}

.btn-login {
    background: #5865F2;
    border-color: #5865F2;
}

.btn-login:hover,
.btn-login:focus-visible {
    background: #4752c4;
    border-color: #4752c4;
}

.user-info {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(18, 31, 45, 0.08);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(189, 200, 216, 0.85);
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    max-width: 156px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otomates-layout {
    min-height: 100vh;
}

.otomates-main {
    margin-left: 248px;
    min-width: 0;
    padding: 24px 28px 28px;
}

.main-content {
    width: 100%;
    margin: 0;
    padding: 0 0 40px;
}

.otomates-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    padding: 0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f7f9fc 100%);
    border-right: 1px solid rgba(223, 229, 238, 0.95);
    box-shadow: 10px 0 22px rgba(18, 31, 45, 0.03);
    z-index: 20;
    overflow-y: auto;
}

.otomates-sidebar-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 14px 16px;
}

.otomates-sidebar-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.otomates-sidebar-brand .oto-brand-wordmark {
    height: 36px;
}

.otomates-sidebar-actions,
.otomates-sidebar-auth {
    display: grid;
    gap: 10px;
}

.otomates-sidebar-auth {
    margin-top: auto;
}

.otomates-sidebar-btn,
.otomates-sidebar-user {
    width: 100%;
}

.otomates-sidebar-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 15px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.otomates-sidebar-btn i {
    font-size: 14px;
}

.otomates-sidebar-btn:hover,
.otomates-sidebar-btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.otomates-sidebar-btn-download {
    background: #ffffff;
    border: 1px solid rgba(210, 219, 231, 0.95);
    box-shadow: 0 4px 10px rgba(18, 31, 45, 0.03);
}

.otomates-sidebar-btn-download:hover,
.otomates-sidebar-btn-download:focus-visible {
    background: #ffffff;
    border-color: rgba(47, 127, 167, 0.52);
}

.otomates-sidebar-btn-create {
    color: #ffffff;
    background: linear-gradient(135deg, #4fb3d9 0%, #ffade3 100%);
    border: 1px solid transparent;
    box-shadow: 0 10px 22px rgba(79, 179, 217, 0.18);
}

.otomates-sidebar-btn-create:hover,
.otomates-sidebar-btn-create:focus-visible {
    background: linear-gradient(135deg, #3ea7d0 0%, #f39bd8 100%);
    box-shadow: 0 14px 28px rgba(79, 179, 217, 0.24);
}

.otomates-sidebar-btn-discord {
    color: #ffffff;
    background: #5865f2;
    border: 1px solid #5865f2;
    box-shadow: 0 10px 22px rgba(88, 101, 242, 0.16);
}

.otomates-sidebar-btn-discord:hover,
.otomates-sidebar-btn-discord:focus-visible {
    background: #4752c4;
    border-color: #4752c4;
}

.otomates-sidebar-user {
    justify-content: flex-start;
}

.otomates-main .main-content,
.otomates-main .otomates-footer-inner {
    width: 100%;
    max-width: none;
}

.oto-page-intro.gallery-hero-band {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 22px 24px;
    border: 1px solid rgba(215, 223, 234, 0.9);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(18, 31, 45, 0.04);
    background:
        radial-gradient(circle at top right, rgba(255, 173, 227, 0.13), transparent 24%),
        radial-gradient(circle at 12% 18%, rgba(79, 179, 217, 0.11), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 254, 0.97) 100%);
}

.otomates-main .oto-page-intro.gallery-hero-band {
    width: 100%;
    margin: 0 0 14px;
}

.gallery-hero-copy {
    max-width: 760px;
    gap: 6px;
}

.oto-page-intro.gallery-hero-band .oto-page-title {
    font-size: clamp(2rem, 3.2vw, 2.85rem);
    max-width: 12ch;
}

.oto-page-intro.gallery-hero-band .oto-page-copy {
    max-width: 58ch;
    font-size: 0.98rem;
    line-height: 1.58;
}

.gallery-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 420px;
    flex: 0 0 auto;
}

.browse-toolbar.oto-surface-panel {
    display: grid;
    gap: 12px;
    padding: 15px 16px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(215, 223, 234, 0.9);
    box-shadow: 0 6px 18px rgba(18, 31, 45, 0.035);
}

.browse-toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.browse-toolbar-row .clear-filters-btn {
    margin-left: auto;
}

.desktop-download-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line-strong);
    box-shadow: 0 8px 18px rgba(18, 31, 45, 0.05);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.desktop-download-btn i {
    font-size: 16px;
}

.desktop-download-btn:hover,
.desktop-download-btn:focus-visible {
    transform: translateY(-1px);
    background: #ffffff;
    border-color: var(--oto-accent);
    outline: none;
}

.desktop-download-btn.is-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #4fb3d9 0%, #ffade3 100%);
    border: 1px solid transparent;
    box-shadow: 0 12px 28px rgba(79, 179, 217, 0.22);
}

.desktop-download-btn.is-primary:hover,
.desktop-download-btn.is-primary:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(79, 179, 217, 0.3);
}

.desktop-download-btn.is-secondary {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line-strong);
}

.desktop-download-btn.is-secondary:hover,
.desktop-download-btn.is-secondary:focus-visible {
    transform: translateY(-1px);
    background: #ffffff;
    border-color: var(--oto-accent);
}

.gallery-create-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    color: var(--accent-strong);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.15s ease, background 0.15s ease;
}

.gallery-create-link.is-tertiary:hover,
.gallery-create-link.is-tertiary:focus-visible {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.64);
    outline: none;
}

.content-section {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}
.state-panel h2,
.detail-name {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.character-card {
    width: 100%;
    display: grid;
    gap: 0;
    text-align: left;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(188, 198, 212, 0.78);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(18, 31, 45, 0.035);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.character-card:hover,
.character-card:focus-visible {
    border-color: rgba(47, 127, 167, 0.45);
    box-shadow: 0 12px 28px rgba(18, 31, 45, 0.08);
    transform: translateY(-2px);
    outline: none;
}

.character-card.is-featured {
    background: linear-gradient(180deg, var(--surface) 0%, #fbfdff 100%);
}

.card-media {
    position: relative;
    aspect-ratio: 0.92;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbff 0%, #edf3f9 100%);
}

.card-media::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 44px;
    background: linear-gradient(180deg, rgba(244, 246, 250, 0) 0%, rgba(244, 246, 250, 0.96) 100%);
}

.card-image,
.card-placeholder {
    width: 100%;
    height: 100%;
    display: block;
}

.card-image {
    object-fit: cover;
    background: #ebf1f7;
}

.card-image--sprite {
    background-color: #ebf1f7;
    image-rendering: auto;
    animation-play-state: paused;
}

.character-card:hover .card-image--sprite,
.character-card:focus-visible .card-image--sprite {
    animation-play-state: running;
}

@keyframes cardSpritePlay {
    from { background-position-x: 0%; }
    to { background-position-x: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .card-image--sprite {
        animation: none !important;
    }
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--quiet);
    font-size: 34px;
}

.card-downloads {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(189, 200, 216, 0.65);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.card-body {
    display: grid;
    gap: 8px;
    padding: 13px 13px 14px;
}

.card-head {
    display: grid;
    gap: 3px;
}

.card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.card-code {
    color: var(--quiet);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.card-snippet {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
}

.card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 28px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(47, 127, 167, 0.16);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.tag-pill.warm {
    color: #9b533b;
    background: var(--accent-warm-soft);
    border-color: rgba(221, 122, 90, 0.16);
}

.card-behaviors {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(189, 200, 216, 0.65);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.card-behavior-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 11px;
    cursor: help;
}

.detail-behaviors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-behavior-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(47, 127, 167, 0.16);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--quiet);
    font-size: 12px;
    font-weight: 600;
}

.card-created {
    white-space: nowrap;
    flex-shrink: 0;
}

.card-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.card-author-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-soft, #eef2f6);
}

.card-author-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--quiet);
    font-size: 10px;
}

.card-author-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.clear-filters-btn,
.detail-copy-btn {
    min-height: 36px;
    padding: 0 12px;
    color: var(--accent-strong);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.detail-load-app-btn {
    min-height: 36px;
    padding: 0 12px;
    color: #fff;
    background: #6c5ce7;
    border: 1px solid #6c5ce7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}
.detail-load-app-btn:hover {
    background: #5b4bd5;
    color: #fff;
    text-decoration: none;
}

.clear-filters-btn:hover,
.clear-filters-btn:focus-visible,
.detail-copy-btn:hover,
.detail-copy-btn:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    outline: none;
}

.state-panel {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 24px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--oto-shadow-soft);
    backdrop-filter: blur(16px);
}

.gallery-status {
    min-height: 200px;
    border-style: solid;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.76);
}

.otomates-footer {
    margin-top: 10px;
    padding: 0 0 28px;
}

.otomates-footer-inner {
    width: 100%;
    margin: 0 auto;
    padding-top: 14px;
    border-top: 1px solid rgba(223, 229, 238, 0.95);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.otomates-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.otomates-footer-links a,
.otomates-footer-copy {
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.otomates-footer-links a:hover,
.otomates-footer-links a:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    outline: none;
}

.state-panel i {
    font-size: 28px;
    color: var(--quiet);
}

.state-panel p {
    max-width: 420px;
    font-size: 15px;
}

.btn-create-empty {
    margin-top: 4px;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 25, 34, 0.42);
    backdrop-filter: blur(10px);
}

.detail-panel {
    position: relative;
    width: min(100%, 1080px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(188, 198, 212, 0.72);
    border-radius: 8px;
    box-shadow: 0 28px 72px rgba(18, 31, 45, 0.2);
    backdrop-filter: blur(16px);
}

.detail-close {
    position: sticky;
    top: 14px;
    left: calc(100% - 50px);
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 14px 0 auto;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.detail-close:hover,
.detail-close:focus-visible {
    color: var(--ink);
    border-color: var(--accent);
    outline: none;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
    gap: 0;
    margin-top: -36px;
}

.detail-visual {
    padding: 26px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfdff 0%, #f1f5fa 62%, #ecf2f8 100%);
}

.detail-stage-shell {
    display: grid;
    gap: 10px;
}

.detail-stage {
    --detail-stage-ground-offset: 42px;
    --detail-stage-sprite-ground-shift: 0px;
    position: relative;
    min-height: 520px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 54%, #eef3f8 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.detail-stage-centerline {
    position: absolute;
    top: 18px;
    bottom: var(--detail-stage-ground-offset);
    left: 50%;
    width: 1px;
    display: none;
    background: rgba(135, 146, 164, 0.18);
    transform: translateX(-50%);
}

.detail-ground {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.detail-ground::before,
.detail-ground::after {
    content: "";
    position: absolute;
}

.detail-ground::before {
    left: 0;
    right: 0;
    bottom: var(--detail-stage-ground-offset);
    height: 1px;
    background: linear-gradient(90deg, rgba(118, 138, 166, 0) 0%, rgba(118, 138, 166, 0.62) 14%, rgba(118, 138, 166, 0.72) 50%, rgba(118, 138, 166, 0.62) 86%, rgba(118, 138, 166, 0) 100%);
}

.detail-ground::after {
    left: 0;
    right: 0;
    top: calc(100% - var(--detail-stage-ground-offset));
    bottom: 0;
    border-radius: 0 0 24px 24px;
    background:
        radial-gradient(ellipse at top center, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 34%, rgba(255, 255, 255, 0) 68%),
        linear-gradient(180deg, rgba(107, 139, 177, 0.09) 0%, rgba(107, 139, 177, 0.14) 46%, rgba(107, 139, 177, 0.2) 100%);
}

.detail-stage-canvas,
.detail-stage-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.detail-stage-canvas {
    display: block;
}

.detail-stage-canvas[hidden],
.detail-stage-fallback[hidden] {
    display: none;
}

.detail-stage-fallback {
    pointer-events: none;
}

.detail-sprite-anchor {
    --detail-scale: 1;
    position: absolute;
    left: 50%;
    bottom: calc(var(--detail-stage-ground-offset) - var(--detail-stage-sprite-ground-shift));
    transform: translateX(-50%) scale(var(--detail-scale));
    transform-origin: center bottom;
}

.detail-sprite {
    position: relative;
    transform-origin: center bottom;
}

.detail-sprite-sheet {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: auto;
}

@keyframes detailSpritePlay {
    from { background-position: 0 0; }
    to { background-position: 100% 0; }
}

.detail-content {
    display: grid;
    align-content: start;
    gap: 20px;
    padding: 28px 28px 32px;
}

.detail-top {
    display: grid;
    gap: 6px;
}

.detail-snippet {
    color: var(--muted);
    font-size: 15px;
}

.detail-code-row {
    display: block;
}

.detail-code-copy {
    display: grid;
    gap: 8px;
}

.detail-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.detail-code-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.detail-copy-btn.copied {
    color: var(--success);
    border-color: rgba(47, 143, 91, 0.35);
    background: var(--success-soft);
}

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

.detail-meta-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    background: var(--surface-tint);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.detail-meta-value {
    font-size: 18px;
    font-weight: 700;
}

.detail-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 30px;
}

.detail-section {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 700;
}

.detail-text,
.detail-steps {
    color: var(--muted);
    font-size: 15px;
}

.detail-steps {
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

@media (max-width: 980px) {
    .otomates-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .otomates-sidebar {
        position: static;
        width: auto;
        padding: 0;
        background: transparent;
        border-right: 0;
        box-shadow: none;
        overflow: visible;
    }

    .otomates-sidebar-shell {
        padding: 14px;
        min-height: 0;
    }

    .otomates-sidebar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .otomates-sidebar-auth {
        margin-top: 0;
    }

    .otomates-main {
        margin-left: 0;
        padding: 0;
    }

    .otomates-main .main-content,
    .otomates-main .otomates-footer-inner {
        width: min(calc(var(--otomates-shell-width) + 100px), calc(100% - 28px));
        margin-left: auto;
        margin-right: auto;
    }

    .oto-page-intro.gallery-hero-band {
        align-items: start;
        flex-direction: column;
    }

    .gallery-hero-actions {
        max-width: none;
        justify-content: flex-start;
    }

    .search-field {
        min-width: 0;
        flex: 1 1 280px;
    }

    .browse-toolbar-row {
        align-items: stretch;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-visual {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .detail-stage {
        min-height: 360px;
    }
}

@media (max-width: 720px) {
    .otomates-sidebar-brand .oto-brand-wordmark {
        height: 30px;
    }

    .oto-page-intro.gallery-hero-band {
        padding: 18px 18px 14px;
    }

    .gallery-hero-actions,
    .browse-toolbar-row {
        width: 100%;
    }

    .gallery-hero-actions > *,
    .browse-toolbar-row > .search-field,
    .browse-toolbar-row > .sort-field,
    .browse-toolbar-row > .clear-filters-btn {
        flex: 1 1 100%;
    }

    .gallery-hero-actions > * {
        justify-content: center;
    }

    .user-name {
        max-width: 104px;
    }

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

    .browse-toolbar-row .clear-filters-btn {
        width: 100%;
        margin-left: 0;
    }

    .detail-overlay {
        padding: 0;
        align-items: stretch;
    }

    .detail-panel {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .detail-close {
        top: 12px;
        margin-top: 12px;
    }

    .detail-layout {
        margin-top: -32px;
    }

    .detail-visual,
    .detail-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .detail-stage {
        min-height: 320px;
    }

    .otomates-footer {
        padding-bottom: 24px;
    }

    .otomates-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .otomates-sidebar-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .state-panel h2,
    .detail-name {
        font-size: 24px;
    }

    .oto-brand-wordmark {
        height: 26px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-snippet {
        min-height: 0;
    }

    .detail-code-box {
        align-items: start;
        flex-direction: column;
    }

    .detail-copy-btn {
        width: 100%;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* App-shell redesign overrides */

:root {
    --otomates-sidebar-width: 220px;
    --otomates-main-width: 1120px;
}

body.oto-ui-page {
    background:
        radial-gradient(circle at top right, rgba(105, 185, 234, 0.14), transparent 28%),
        radial-gradient(circle at 20% 8%, rgba(239, 157, 226, 0.08), transparent 20%),
        linear-gradient(180deg, #0a0d13 0%, #090c12 100%);
    color: #f5f7fb;
}

.otomates-layout {
    position: relative;
}

.oto-brand-wordmark {
    height: 34px;
}

.otomates-sidebar {
    width: var(--otomates-sidebar-width);
    background: linear-gradient(180deg, rgba(10, 13, 20, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.otomates-sidebar-shell {
    gap: 22px;
    padding: 20px 14px 18px;
}

.otomates-sidebar-brand {
    padding: 2px 8px 0;
}

.otomates-sidebar-btn {
    min-height: 48px;
    gap: 10px;
    padding: 0 14px;
    color: #dbe2ef;
    border-radius: 14px;
    border: 1px solid transparent;
}

.otomates-sidebar-btn i {
    width: 16px;
    text-align: center;
}

.otomates-sidebar-btn:hover,
.otomates-sidebar-btn:focus-visible {
    color: #ffffff;
}

.otomates-sidebar-btn-current {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.otomates-sidebar-btn-current:hover,
.otomates-sidebar-btn-current:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

.otomates-sidebar-btn-create {
    background: linear-gradient(135deg, rgba(96, 191, 239, 0.22) 0%, rgba(239, 157, 226, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.otomates-sidebar-btn-create:hover,
.otomates-sidebar-btn-create:focus-visible {
    background: linear-gradient(135deg, rgba(96, 191, 239, 0.3) 0%, rgba(239, 157, 226, 0.28) 100%);
    box-shadow: none;
}

.otomates-sidebar-btn-download {
    color: #b9c3d8;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.otomates-sidebar-btn-download:hover,
.otomates-sidebar-btn-download:focus-visible {
    background: rgba(255, 255, 255, 0.05);
}

.otomates-sidebar-btn-discord {
    background: linear-gradient(135deg, #5865f2 0%, #6a77ff 100%);
    border-color: transparent;
}

.otomates-sidebar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.oto-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.oto-user-name {
    color: #ffffff;
    font-weight: 700;
}

.otomates-main {
    margin-left: var(--otomates-sidebar-width);
    padding: 26px 28px 34px;
}

.otomates-main .main-content,
.otomates-main .otomates-footer-inner {
    width: min(var(--otomates-main-width), calc(100% - 8px));
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

.main-content {
    display: grid;
    gap: 18px;
    align-content: start;
    padding-bottom: 20px;
}

.oto-page-intro.gallery-hero-band {
    position: relative;
    padding: 30px 34px;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    background:
        radial-gradient(circle at 82% 22%, rgba(239, 157, 226, 0.16), transparent 20%),
        radial-gradient(circle at 18% 0%, rgba(105, 185, 234, 0.16), transparent 18%),
        linear-gradient(140deg, rgba(16, 21, 32, 0.98) 0%, rgba(11, 14, 22, 0.98) 100%);
}

.oto-page-intro.gallery-hero-band::after {
    content: "";
    position: absolute;
    right: 34px;
    top: 24px;
    width: 260px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, rgba(105, 185, 234, 0.14) 36%, transparent 72%);
    filter: blur(16px);
    opacity: 0.8;
    pointer-events: none;
}

.gallery-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 560px;
    display: grid;
    gap: 8px;
}

.oto-page-kicker,
.sort-label {
    color: #8d97ab;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.oto-page-intro.gallery-hero-band .oto-page-title {
    max-width: 10ch;
    font-size: clamp(2.35rem, 4vw, 3.6rem);
    line-height: 1.02;
    color: #f5f7fb;
}

.oto-page-intro.gallery-hero-band .oto-page-copy {
    max-width: 58ch;
    color: #c3cada;
    font-size: 1rem;
    line-height: 1.65;
}

.browse-toolbar.oto-surface-panel {
    padding: 14px 16px;
    margin-bottom: 0;
    background: rgba(15, 20, 30, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.browse-toolbar-row {
    gap: 12px;
}

.search-field,
.sort-field {
    min-height: 50px;
    padding: 0 14px;
    background: rgba(8, 11, 17, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
}

.search-icon,
.search-input::placeholder,
.sort-label {
    color: #8d97ab;
}

.search-input,
.sort-select {
    color: #f5f7fb;
}

.sort-select {
    min-width: 140px;
}

.clear-filters-btn {
    min-height: 44px;
    padding: 0 14px;
    margin-left: auto;
    color: #d7e0f3;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.clear-filters-btn:hover,
.clear-filters-btn:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
}

.content-section {
    gap: 16px;
    margin-bottom: 0;
}

.state-panel {
    min-height: 190px;
    color: #c3cada;
    background: rgba(14, 18, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: none;
    backdrop-filter: none;
}

.state-panel i {
    color: #8d97ab;
}

.state-panel p {
    max-width: 420px;
    color: #c3cada;
}

.card-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.character-card {
    background: linear-gradient(180deg, rgba(17, 21, 31, 0.98) 0%, rgba(11, 14, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}

.character-card:hover,
.character-card:focus-visible {
    border-color: rgba(105, 185, 234, 0.32);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.22);
    transform: translateY(-4px);
}

.card-media {
    aspect-ratio: 0.88;
    background:
        radial-gradient(circle at top, rgba(105, 185, 234, 0.16), transparent 34%),
        linear-gradient(180deg, #1b2230 0%, #111722 100%);
}

.card-media::after {
    height: 64px;
    background: linear-gradient(180deg, rgba(9, 12, 18, 0) 0%, rgba(9, 12, 18, 0.88) 100%);
}

.card-image {
    background: #1a2230;
}

.card-image--sprite {
    background-color: #1a2230;
}

.card-downloads {
    color: #ffffff;
    background: rgba(9, 12, 18, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-body {
    gap: 9px;
    padding: 14px 14px 15px;
}

.card-name {
    font-size: 18px;
    line-height: 1.18;
    color: #ffffff;
}

.card-code {
    color: #8d97ab;
    text-transform: uppercase;
}

.card-snippet {
    color: #c3cada;
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
}

.card-tags {
    min-height: 28px;
}

.tag-pill {
    min-height: 26px;
    color: #e7efff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tag-pill.warm {
    color: #ffe7f8;
    background: rgba(239, 157, 226, 0.14);
    border-color: rgba(239, 157, 226, 0.18);
}

.card-footer,
.card-created {
    color: #8d97ab;
}

.otomates-footer {
    padding: 0 28px 30px;
}

.otomates-footer-inner {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.otomates-footer-links a,
.otomates-footer-copy {
    color: #8d97ab;
    font-size: 13px;
}

.otomates-footer-links a:hover,
.otomates-footer-links a:focus-visible {
    color: #ffffff;
    text-decoration: none;
}

.detail-overlay {
    background: rgba(4, 7, 11, 0.72);
    backdrop-filter: blur(12px);
}

.detail-panel {
    background: rgba(13, 18, 27, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.36);
    backdrop-filter: none;
}

.detail-close {
    width: 38px;
    height: 38px;
    color: #c3cada;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.detail-close:hover,
.detail-close:focus-visible {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.14);
}

.detail-layout {
    margin-top: -38px;
}

.detail-visual {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top, rgba(105, 185, 234, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(17, 22, 34, 1) 0%, rgba(11, 15, 23, 1) 100%);
}

.detail-stage-label,
.detail-code-label,
.detail-meta-label,
.detail-kicker {
    color: #8d97ab;
    letter-spacing: 0.08em;
}

.detail-stage {
    min-height: 500px;
    background:
        radial-gradient(circle at top, rgba(239, 157, 226, 0.08), transparent 28%),
        linear-gradient(180deg, #141b28 0%, #101621 58%, #0d131d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.detail-stage-centerline {
    display: none;
}

.detail-ground {
    opacity: 0.92;
}

.detail-name {
    font-size: 2.25rem;
    color: #ffffff;
}

.detail-snippet,
.detail-text,
.detail-steps {
    color: #c3cada;
}

.detail-code-box,
.detail-meta-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.detail-code-value,
.detail-meta-value,
.detail-section h3 {
    color: #ffffff;
}

.detail-copy-btn {
    min-height: 38px;
    color: #dfe7f7;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.detail-copy-btn:hover,
.detail-copy-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.detail-copy-btn.copied {
    color: #bdf3cb;
    background: rgba(47, 143, 91, 0.14);
    border-color: rgba(47, 143, 91, 0.32);
}

.detail-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 1260px) {
    .otomates-main .main-content,
    .otomates-main .otomates-footer-inner {
        width: min(var(--otomates-main-width), calc(100% - 20px));
    }
}

@media (max-width: 980px) {
    .otomates-sidebar {
        position: static;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: linear-gradient(180deg, rgba(10, 13, 20, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%);
        overflow: visible;
    }

    .otomates-sidebar-shell {
        min-height: 0;
        gap: 16px;
        padding: 16px;
    }

    .otomates-sidebar-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .otomates-sidebar-auth {
        margin-top: 0;
    }

    .otomates-main {
        margin-left: 0;
        padding: 20px 16px 30px;
    }

    .otomates-main .main-content,
    .otomates-main .otomates-footer-inner {
        width: min(var(--otomates-main-width), 100%);
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-visual {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 720px) {
    .oto-brand-wordmark {
        height: 30px;
    }

    .oto-page-intro.gallery-hero-band {
        padding: 24px 22px;
        border-radius: 20px;
    }

    .oto-page-intro.gallery-hero-band::after {
        right: 18px;
        width: 180px;
        height: 88px;
    }

    .oto-page-intro.gallery-hero-band .oto-page-title {
        font-size: clamp(2rem, 9vw, 2.8rem);
    }

    .browse-toolbar-row {
        align-items: stretch;
    }

    .search-field,
    .sort-field,
    .clear-filters-btn {
        width: 100%;
        flex: 1 1 100%;
    }

    .clear-filters-btn {
        margin-left: 0;
    }

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

    .detail-overlay {
        padding: 0;
        align-items: stretch;
    }

    .detail-panel {
        width: 100%;
        min-height: 100dvh;
        max-height: 100vh;
        border-radius: 0;
        display: grid;
    }

    .detail-close {
        position: sticky;
        top: 12px;
        justify-self: end;
        margin-top: 12px;
        margin-right: 12px;
        z-index: 3;
    }

    .detail-layout {
        margin-top: 0;
        min-height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .detail-visual,
    .detail-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .detail-content {
        padding-bottom: 28px;
    }

    .detail-stage {
        min-height: 340px;
    }

    .otomates-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 560px) {
    .otomates-sidebar-actions {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .detail-name,
    .state-panel h2 {
        font-size: 1.9rem;
    }

    .detail-code-box {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-copy-btn {
        width: 100%;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* Light layout refinement */

:root {
    --otomates-sidebar-width: 268px;
    --otomates-main-width: 1260px;
}

body.oto-ui-page {
    background:
        radial-gradient(circle at top right, rgba(105, 185, 234, 0.16), transparent 30%),
        radial-gradient(circle at 16% 8%, rgba(239, 157, 226, 0.12), transparent 20%),
        linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
    color: #1b2432;
}

.oto-brand-wordmark,
.otomates-sidebar-brand .oto-brand-wordmark {
    width: 184px;
    max-width: 100%;
    height: auto;
}

.otomates-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 254, 0.98) 100%);
    border-right: 1px solid rgba(213, 222, 234, 0.96);
    box-shadow: 10px 0 28px rgba(18, 31, 45, 0.05);
}

.otomates-sidebar-shell {
    padding: 22px 18px 20px;
}

.otomates-sidebar-brand {
    padding: 4px 8px;
}

.otomates-sidebar-btn {
    color: #2a3649;
}

.otomates-sidebar-btn:hover,
.otomates-sidebar-btn:focus-visible {
    color: #18202d;
}

.otomates-sidebar-btn-current {
    background: rgba(47, 127, 167, 0.1);
    border-color: rgba(47, 127, 167, 0.12);
}

.otomates-sidebar-btn-current:hover,
.otomates-sidebar-btn-current:focus-visible {
    background: rgba(47, 127, 167, 0.14);
}

.otomates-sidebar-btn-create {
    color: #ffffff;
    background: linear-gradient(135deg, #55b4df 0%, #f0a8df 100%);
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(85, 180, 223, 0.18);
}

.otomates-sidebar-btn-create:hover,
.otomates-sidebar-btn-create:focus-visible {
    color: #ffffff;
    background: linear-gradient(135deg, #43a9d8 0%, #eb97d7 100%);
}

.otomates-sidebar-btn-download {
    color: #3b4b62;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(201, 212, 226, 0.95);
}

.otomates-sidebar-btn-download:hover,
.otomates-sidebar-btn-download:focus-visible {
    background: #ffffff;
    border-color: rgba(85, 180, 223, 0.34);
}

.otomates-sidebar-user {
    background: rgba(247, 250, 254, 0.98);
    border-color: rgba(213, 222, 234, 0.96);
}

.oto-user-name {
    color: #1b2432;
}

.otomates-main {
    padding: 28px 34px 34px;
}

.oto-page-intro.gallery-hero-band {
    border-color: rgba(215, 223, 234, 0.92);
    box-shadow: 0 18px 40px rgba(18, 31, 45, 0.06);
    background:
        radial-gradient(circle at 82% 22%, rgba(239, 157, 226, 0.18), transparent 20%),
        radial-gradient(circle at 18% 0%, rgba(105, 185, 234, 0.18), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
}

.oto-page-intro.gallery-hero-band .oto-page-title {
    color: #171d29;
}

.oto-page-intro.gallery-hero-band .oto-page-copy,
.state-panel p {
    color: #5e6778;
}

.oto-page-kicker,
.sort-label {
    color: #8693a8;
}

.browse-toolbar.oto-surface-panel {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(215, 223, 234, 0.92);
    box-shadow: 0 10px 24px rgba(18, 31, 45, 0.04);
}

.search-field,
.sort-field {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(189, 200, 216, 0.95);
}

.search-input,
.sort-select {
    color: #171d29;
}

.search-icon,
.search-input::placeholder,
.sort-label {
    color: #8792a4;
}

.clear-filters-btn {
    color: #2f7fa7;
    background: #ffffff;
    border-color: rgba(189, 200, 216, 0.95);
}

.clear-filters-btn:hover,
.clear-filters-btn:focus-visible {
    color: #1d5f83;
    background: #f3f8fc;
    border-color: rgba(47, 127, 167, 0.32);
}

.state-panel {
    color: #5e6778;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(215, 223, 234, 0.92);
}

.state-panel i {
    color: #8792a4;
}

.card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.character-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(188, 198, 212, 0.78);
    box-shadow: 0 8px 22px rgba(18, 31, 45, 0.045);
}

.character-card:hover,
.character-card:focus-visible {
    border-color: rgba(47, 127, 167, 0.36);
    box-shadow: 0 16px 32px rgba(18, 31, 45, 0.08);
}

.card-media {
    background: linear-gradient(180deg, #f8fbff 0%, #edf3f9 100%);
}

.card-media::after {
    background: linear-gradient(180deg, rgba(244, 246, 250, 0) 0%, rgba(244, 246, 250, 0.96) 100%);
}

.card-image,
.card-image--sprite {
    background: #ebf1f7;
}

.card-downloads {
    color: #1b2432;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(189, 200, 216, 0.7);
}

.card-name {
    color: #171d29;
}

.card-code,
.card-footer,
.card-created {
    color: #8792a4;
}

.card-snippet {
    color: #5e6778;
}

.tag-pill {
    color: #1d5f83;
    background: #e8f2f7;
    border-color: rgba(47, 127, 167, 0.16);
}

.tag-pill.warm {
    color: #9b533b;
    background: #fff2eb;
    border-color: rgba(221, 122, 90, 0.16);
}

.otomates-footer-inner {
    border-top-color: rgba(215, 223, 234, 0.92);
}

.otomates-footer-links a,
.otomates-footer-copy {
    color: #5e6778;
}

.otomates-footer-links a:hover,
.otomates-footer-links a:focus-visible {
    color: #171d29;
}

.detail-overlay {
    background: rgba(26, 34, 48, 0.28);
}

.detail-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(188, 198, 212, 0.72);
    box-shadow: 0 28px 72px rgba(18, 31, 45, 0.18);
}

.detail-close {
    color: #5e6778;
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(215, 223, 234, 0.92);
}

.detail-close:hover,
.detail-close:focus-visible {
    color: #171d29;
    border-color: rgba(47, 127, 167, 0.3);
}

.detail-visual {
    border-right-color: rgba(215, 223, 234, 0.92);
    background: linear-gradient(180deg, #fbfdff 0%, #f1f5fa 62%, #ecf2f8 100%);
}

.detail-stage {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 54%, #eef3f8 100%);
    border-color: rgba(215, 223, 234, 0.92);
}

.detail-stage-label,
.detail-code-label,
.detail-meta-label,
.detail-kicker {
    color: #8792a4;
}

.detail-ground {
    opacity: 1;
}

.detail-ground::before {
    background: linear-gradient(90deg, rgba(108, 142, 171, 0) 0%, rgba(108, 142, 171, 0.44) 14%, rgba(108, 142, 171, 0.56) 50%, rgba(108, 142, 171, 0.44) 86%, rgba(108, 142, 171, 0) 100%);
}

.detail-ground::after {
    background:
        radial-gradient(ellipse at top center, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.07) 34%, rgba(255, 255, 255, 0) 68%),
        linear-gradient(180deg, rgba(47, 127, 167, 0.045) 0%, rgba(47, 127, 167, 0.085) 42%, rgba(47, 127, 167, 0.14) 100%);
}

.detail-name,
.detail-code-value,
.detail-meta-value,
.detail-section h3 {
    color: #171d29;
}

.detail-snippet,
.detail-text,
.detail-steps {
    color: #5e6778;
}

.detail-code-box,
.detail-meta-item {
    background: #f8fbff;
    border-color: rgba(215, 223, 234, 0.92);
}

.detail-copy-btn {
    color: #1d5f83;
    background: #ffffff;
    border-color: rgba(189, 200, 216, 0.95);
}

.detail-copy-btn:hover,
.detail-copy-btn:focus-visible {
    background: #f3f8fc;
    border-color: rgba(47, 127, 167, 0.32);
}

.detail-section {
    border-top-color: rgba(215, 223, 234, 0.92);
}

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

@media (max-width: 980px) {
    .otomates-sidebar {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 254, 0.98) 100%);
        border-bottom: 1px solid rgba(213, 222, 234, 0.96);
    }

    .otomates-main {
        padding: 20px 16px 30px;
    }

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

@media (max-width: 720px) {
    .oto-brand-wordmark,
    .otomates-sidebar-brand .oto-brand-wordmark {
        width: 160px;
        height: auto;
    }

    .otomates-sidebar-shell {
        padding: 16px;
    }

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

.character-card {
    cursor: pointer;
}

.card-footer {
    justify-content: flex-start;
}

.card-created {
    margin-left: auto;
}

.card-author {
    max-width: calc(100% - 84px);
    color: inherit;
}

.card-author-link {
    text-decoration: none;
}

.card-author-link:hover,
.card-author-link:focus-visible {
    color: var(--oto-accent-strong);
    outline: none;
}

.detail-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-author-label {
    color: #8792a4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    color: #1b2432;
    background: #f8fbff;
    border: 1px solid rgba(215, 223, 234, 0.92);
    border-radius: 999px;
    text-decoration: none;
}

.detail-author-chip--link:hover,
.detail-author-chip--link:focus-visible {
    color: var(--oto-accent-strong);
    border-color: rgba(47, 127, 167, 0.3);
    background: #ffffff;
    outline: none;
}

.detail-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8eef5;
}

.detail-author-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8792a4;
    font-size: 11px;
}

.detail-author-name {
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .detail-author-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
