:root {
    --bg: #f7f2e8;
    --panel: rgba(255, 251, 244, 0.9);
    --line: rgba(89, 77, 63, 0.12);
    --text: #2d241a;
    --muted: #6f6254;
    --accent: #0f766e;
    --accent-soft: #d5f3ef;
    --warm: #f59e0b;
    --danger: #c2410c;
    --danger-soft: #ffe2d4;
    --shadow: 0 20px 45px rgba(60, 42, 23, 0.12);
    --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 35%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.13), transparent 40%),
        linear-gradient(180deg, #fbf7f1 0%, #f5ecdd 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-shell { max-width: 1280px; margin: 0 auto; padding: 24px; }
.site-header, .site-footer, .site-header-inner, .site-footer-inner, .section-nav, .panel-card, .metric-card, .auth-panel, .modal-card, .pet-card, .empty-state {
    backdrop-filter: blur(14px);
}

.site-header,
.site-footer {
    position: relative;
    width: 100%;
}

.site-header::before,
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.site-header-inner,
.site-footer-inner,
.section-nav {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 250, 243, 0.75);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 24px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.site-header {
    z-index: 40;
    padding: 18px 24px 0;
}

.site-header::before {
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(255, 252, 247, 0.68)),
        linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.08));
    border-bottom: 1px solid rgba(89, 77, 63, 0.08);
}

.site-header-inner {
    max-width: 1560px;
    margin: 0 auto;
    gap: 24px;
    padding: 10px 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.site-footer {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    padding: 0 24px 24px;
    font-size: 0.92rem;
}

.site-footer::before {
    display: none;
}

.site-footer-inner {
    width: min(100%, 1440px);
    margin: 0 auto;
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 18px 20px 14px;
    color: #4f4234;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.footer-top {
    display: grid;
    width: min(100%, 1240px);
    margin: 0 auto;
    grid-template-columns: minmax(320px, 420px) minmax(720px, 780px);
    gap: 18px 44px;
    align-items: start;
    justify-content: center;
}

.footer-brand-block,
.footer-link-block,
.footer-meta-block {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.footer-brand-block {
    padding: 6px 0;
    border-radius: 28px;
    background: transparent;
    border: 0;
}

.footer-kicker,
.footer-title {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8b735c;
}

.footer-brand-block h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 1.6vw, 2rem);
    line-height: 1.04;
    color: #2f241a;
}

.footer-brand-block p {
    margin: 0;
    max-width: 34rem;
    color: #6d5946;
    line-height: 1.5;
}

.footer-brand-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.footer-logo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
    color: #fffaf2;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-logo.is-fallback {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(20, 184, 166, 0.82));
}

.footer-content-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px 28px;
    align-content: start;
    align-items: start;
}

.footer-inline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-inline-links.is-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.footer-inline-links a {
    display: inline-flex;
    align-items: center;
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #5a4a39;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-inline-links a:hover {
    background: transparent;
}

.footer-info-list {
    display: grid;
    gap: 6px;
}

.footer-info-item {
    display: grid;
    gap: 2px;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
}

.footer-info-item strong {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b735c;
}

.footer-info-item span {
    color: #5b4a39;
    line-height: 1.45;
}

.footer-qr-column {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 10px;
    min-width: 132px;
}

.footer-qr-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #8b735c;
}

.footer-qr-card {
    width: 112px;
    height: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(71, 54, 38, 0.12);
}

.footer-qr-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-empty-note {
    min-height: 0;
    display: flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    border: 0;
    color: #8e7966;
    background: transparent;
}

.footer-bottom-bar {
    width: min(100%, 1240px);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(124, 101, 79, 0.18);
    color: #7b6653;
    font-size: 0.85rem;
}

.brand-mark {
    display: flex;
    gap: 16px;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
}

.brand-mark > span:last-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex: 1;
    min-width: 0;
}
.brand-badge {
    display: inline-flex;
    width: 68px;
    height: 68px;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.18);
}

.brand-mark strong, .auth-brand h1, .hero h1, .section-head h1, .panel-card h2, .empty-state h2 {
    font-family: Georgia, "Times New Roman", serif;
}
.brand-mark strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}
.brand-mark em {
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--muted);
    font-style: normal;
}
.brand-mark small {
    display: block;
    font-size: 0.86rem;
    line-height: 1.4;
}
.brand-mark small, .muted, .eyebrow, .metric-card span { color: var(--muted); }
.header-links, .section-nav, .hero-actions, .inline-actions, .tag-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.header-links {
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}
.header-links a, .section-nav a, .pill-link {
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.65);
    border: 1px solid var(--line);
    color: var(--muted);
    transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.header-links a:hover,
.section-nav a:hover,
.pill-link:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.9);
    border-color: rgba(15, 118, 110, 0.16);
    color: var(--text);
}
.header-auth-actions,
.header-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.header-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font-weight: 700;
}

.header-action-link.is-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.2);
}

.header-action-link.is-ghost {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.6);
}

.header-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px 10px 10px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.header-user-menu {
    position: relative;
    flex-shrink: 0;
    z-index: 45;
}

.header-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 180px;
    padding: 10px 12px 10px 10px;
    border: 0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 1px rgba(89, 77, 63, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.header-user-trigger:hover,
.header-user-trigger[aria-expanded="true"] {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12), 0 12px 24px rgba(60, 42, 23, 0.08);
}

.header-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.header-user-avatar.is-large {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 1.1rem;
}

.header-user-copy {
    display: flex;
    align-items: center;
    min-width: 0;
    text-align: left;
    flex: 1;
}

.header-user-copy strong {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 800;
}

.header-user-caret {
    color: #8b7d6f;
    font-size: 0.95rem;
    transition: transform .2s ease;
}

.header-user-trigger[aria-expanded="true"] .header-user-caret {
    transform: rotate(180deg);
}

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 60;
    width: min(320px, calc(100vw - 48px));
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(89, 77, 63, 0.12);
    background: rgba(255, 252, 247, 0.96);
    box-shadow: 0 22px 48px rgba(60, 42, 23, 0.14);
    backdrop-filter: blur(18px);
}

.header-user-dropdown-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(89, 77, 63, 0.08);
}

.header-user-dropdown-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.header-user-dropdown-copy small,
.header-user-dropdown-copy span {
    color: var(--muted);
}

.header-user-dropdown-copy strong {
    font-size: 1.08rem;
    line-height: 1.2;
}

.header-user-dropdown-copy span {
    font-size: 0.88rem;
    line-height: 1.5;
}

.header-user-dropdown-links {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.header-user-dropdown-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(89, 77, 63, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-weight: 700;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.header-user-dropdown-link:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.18);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.header-user-dropdown-link.is-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}
.section-nav a.active { background: var(--accent); color: #fff; border-color: transparent; }
.page-content { padding: 28px 0; display: grid; gap: 24px; }

.hero, .detail-grid, .dashboard-grid, .card-grid, .stack-list { display: grid; gap: 20px; }
.hero { grid-template-columns: 1.3fr 1fr; align-items: stretch; }
.hero-panel, .detail-grid, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid .wide, .detail-grid .wide { grid-column: 1 / -1; }
.card-grid.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel-card, .metric-card, .pet-card, .auth-panel, .modal-card, .empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-card, .pet-card, .empty-state { padding: 22px; }
.metric-card { padding: 20px; }
.metric-card strong { display: block; margin-top: 12px; font-size: 2.1rem; }
.hero .lead { font-size: 1.1rem; line-height: 1.8; color: var(--muted); max-width: 640px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem; font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-head p { max-width: 720px; line-height: 1.8; color: var(--muted); }

.btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #14b8a6); color: #fff; box-shadow: 0 14px 30px rgba(15, 118, 110, 0.24); }
.btn.secondary { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 14px 30px rgba(245, 158, 11, 0.24); }
.btn.tertiary { background: rgba(255,255,255,0.8); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(194, 65, 12, 0.18); }

.stack-form, .inline-form { display: grid; gap: 14px; }
.inline-form { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
.compact-form { grid-template-columns: 1fr auto; }
label { display: grid; gap: 8px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(89, 77, 63, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
}

.section-nav {
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.section-nav a {
    min-height: 52px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.6);
}

.section-nav a.active {
    background: linear-gradient(135deg, var(--accent), #178f82);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.18);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.alert {
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
}
.alert.success { background: var(--accent-soft); color: var(--accent); border-color: rgba(15,118,110,.18); }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(194,65,12,.18); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: 0.92rem; }
.positive { color: var(--accent); }
.negative { color: var(--danger); }
.badge, .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.92rem;
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--line);
}
.badge.active, .tag.positive, .tag-button.positive { background: var(--accent-soft); color: var(--accent); }
.badge.muted, .tag.negative, .tag-button.negative { background: var(--danger-soft); color: var(--danger); }
.tag-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-button {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    background: #fff;
}

.meter-group { display: grid; gap: 8px; margin-top: 14px; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.92rem; }
.meter, .bar-track {
    height: 12px;
    background: rgba(89, 77, 63, 0.09);
    border-radius: 999px;
    overflow: hidden;
}
.meter span, .bar-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #14b8a6);
    border-radius: inherit;
}
.meter.warm span, .bar-track.warm span { background: linear-gradient(90deg, var(--warm), #f97316); }
.chart-row, .list-row, .student-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.chart-row .bar-track { flex: 1; }

.pet-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.pet-card { position: relative; overflow: hidden; }
.pet-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -40% auto;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(15,118,110,.14), transparent 70%);
    pointer-events: none;
}
.pet-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.pet-avatar-wrap { display: flex; justify-content: center; align-items: center; min-height: 170px; }
.pet-avatar-wrap.large { min-height: 230px; }

.pet-avatar {
    --pet-species-primary: #fff8e7;
    --pet-species-secondary: #ffd6a5;
    --pet-species-accent: #f59e0b;
    --pet-species-soft: rgba(245, 158, 11, 0.18);
    --pet-species-glow: rgba(255, 214, 165, 0.62);
    --pet-avatar-scale: 1;
    --pet-core-width: 72px;
    --pet-core-height: 86px;
    position: relative;
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    animation: floaty 3.2s ease-in-out infinite;
    transform: scale(var(--pet-avatar-scale));
    transform-origin: center center;
}
.pet-core, .pet-shell, .pet-wing, .pet-orbit, .pet-particles { position: absolute; border-radius: 999px; }
.pet-core {
    width: var(--pet-core-width);
    height: var(--pet-core-height);
    background: linear-gradient(180deg, var(--pet-species-primary) 0%, var(--pet-species-secondary) 100%);
    border-radius: 50% 50% 44% 44%;
    box-shadow: 0 10px 18px rgba(0,0,0,.12);
}
.pet-shell {
    width: 86px;
    height: 98px;
    border: 3px solid rgba(255,255,255,.75);
    border-top-color: var(--pet-species-soft);
    transform: rotate(-6deg);
}
.pet-orbit {
    inset: 8px;
    border: 2px dashed var(--pet-species-soft);
    animation: spin 10s linear infinite;
}
.orbit-b { inset: 18px; animation-duration: 8s; border-color: var(--pet-species-glow); }
.pet-wing {
    width: 26px;
    height: 46px;
    background: linear-gradient(180deg, rgba(255,255,255,.9), var(--pet-species-soft));
    top: 38px;
    display: none;
}
.wing-left { left: 6px; transform: rotate(-24deg); }
.wing-right { right: 6px; transform: rotate(24deg); }
.pet-particles {
    inset: -8px;
    box-shadow:
        14px 10px 0 rgba(255,255,255,.65),
        -18px 16px 0 var(--pet-species-glow),
        22px 46px 0 var(--pet-species-soft),
        -24px 52px 0 rgba(255,255,255,.65);
    opacity: 0;
}
.pet-species-mark {
    display: none;
}

.pet-image-shell {
    position: absolute;
    inset: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.pet-stage-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pet-avatar.has-stage-image {
    width: auto;
    height: auto;
    display: block;
    animation: none;
    transform: none;
}

.pet-avatar.has-stage-image .pet-image-shell {
    position: static;
    inset: auto;
    display: block;
    border-radius: 0;
    overflow: visible;
}

.pet-avatar.has-stage-image .pet-stage-image {
    width: auto;
    height: auto;
    max-width: 168px;
    max-height: 168px;
    object-fit: contain;
}

.pet-avatar.level-2 .pet-shell,
.pet-avatar.level-3 .pet-shell,
.pet-avatar.level-4 .pet-shell,
.pet-avatar.level-5 .pet-shell,
.pet-avatar.level-6 .pet-shell,
.pet-avatar.level-7 .pet-shell,
.pet-avatar.level-8 .pet-shell { border-top-color: var(--pet-species-accent); box-shadow: 0 0 18px var(--pet-species-glow); }
.pet-avatar.level-3 .pet-wing,
.pet-avatar.level-4 .pet-wing,
.pet-avatar.level-5 .pet-wing,
.pet-avatar.level-6 .pet-wing,
.pet-avatar.level-7 .pet-wing,
.pet-avatar.level-8 .pet-wing { display: block; animation: wingbeat .8s ease-in-out infinite alternate; }
.pet-avatar.level-4 .pet-core,
.pet-avatar.level-5 .pet-core,
.pet-avatar.level-6 .pet-core,
.pet-avatar.level-7 .pet-core,
.pet-avatar.level-8 .pet-core { box-shadow: 0 0 25px rgba(255,216,122,.7), 0 12px 20px rgba(0,0,0,.12); }
.pet-avatar.level-5 { transform: scale(1.14); }
.pet-avatar.level-6 .pet-orbit,
.pet-avatar.level-7 .pet-orbit,
.pet-avatar.level-8 .pet-orbit { border-style: solid; opacity: .52; }
.pet-avatar.level-6 .pet-particles,
.pet-avatar.level-7 .pet-particles,
.pet-avatar.level-8 .pet-particles { opacity: 1; animation: twinkle 2s ease-in-out infinite; }
.pet-avatar.level-7::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.65);
    box-shadow: 0 0 24px rgba(59,130,246,.28), 0 0 40px rgba(236,72,153,.2);
}
.pet-avatar.level-8 {
    transform: scale(1.22);
}
.pet-avatar.level-8::after {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.82);
    box-shadow: 0 0 28px rgba(59,130,246,.34), 0 0 56px rgba(236,72,153,.26), 0 0 72px var(--pet-species-glow);
}
.pet-avatar.level-8::before {
    content: "";
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    border: 2px dashed var(--pet-species-accent);
    opacity: .6;
    animation: spin 9s linear infinite reverse;
}
.pet-avatar.mood-sad .pet-core { filter: saturate(.78); }

.pet-avatar[data-stage-wings="none"] .pet-wing {
    display: none !important;
}

.pet-avatar[data-stage-wings="small"] .pet-wing,
.pet-avatar[data-stage-wings="wide"] .pet-wing {
    display: block;
    animation: wingbeat .8s ease-in-out infinite alternate;
}

.pet-avatar[data-stage-wings="small"] .pet-wing {
    width: 24px;
    height: 40px;
    top: 40px;
}

.pet-avatar[data-stage-wings="wide"] .pet-wing {
    width: 30px;
    height: 52px;
    top: 34px;
}

.pet-avatar[data-stage-orbit="solid"] .pet-orbit {
    border-style: solid;
    opacity: .52;
}

.pet-avatar[data-stage-orbit="dashed"] .pet-orbit {
    border-style: dashed;
    opacity: 1;
}

.pet-avatar[data-stage-particles="none"] .pet-particles {
    opacity: 0 !important;
    animation: none;
}

.pet-avatar[data-stage-particles="soft"] .pet-particles {
    opacity: .65;
    animation: twinkle 2.4s ease-in-out infinite;
}

.pet-avatar[data-stage-particles="full"] .pet-particles {
    opacity: 1;
    animation: twinkle 2s ease-in-out infinite;
}

.pet-avatar[data-stage-halo="none"]::before,
.pet-avatar[data-stage-halo="none"]::after {
    content: none !important;
}

.pet-avatar[data-stage-halo="soft"]::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.56);
    box-shadow: 0 0 18px var(--pet-species-glow);
}

.pet-avatar[data-stage-halo="strong"]::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.68);
    box-shadow: 0 0 24px var(--pet-species-glow), 0 0 38px rgba(59,130,246,.16);
}

.pet-avatar[data-stage-halo="epic"]::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.74);
    box-shadow: 0 0 26px rgba(59,130,246,.26), 0 0 44px rgba(236,72,153,.18), 0 0 56px var(--pet-species-glow);
}

.pet-avatar[data-stage-halo="legend"]::after {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.82);
    box-shadow: 0 0 28px rgba(59,130,246,.34), 0 0 56px rgba(236,72,153,.26), 0 0 72px var(--pet-species-glow);
}

.pet-avatar[data-stage-halo="legend"]::before,
.pet-avatar[data-stage-halo="epic"]::before {
    content: "";
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    border: 2px dashed var(--pet-species-accent);
    opacity: .6;
    animation: spin 9s linear infinite reverse;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(23, 17, 11, 0.45);
    padding: 24px;
    z-index: 120;
}
.modal-card { max-width: 460px; width: 100%; padding: 28px; position: relative; }
.modal-close {
    position: absolute;
    right: 16px;
    top: 12px;
    border: 0;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
}
.modal-pet { display: flex; justify-content: center; margin-bottom: 16px; }
.speech-bubble {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    color: var(--muted);
    margin: 16px 0;
}

.display-page .site-shell {
    max-width: 1480px;
}

.display-page .site-header::before {
    background:
        linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(255, 251, 245, 0.78)),
        linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.08));
}

.display-page .site-footer::before {
    background:
        radial-gradient(circle at 12% 18%, rgba(15, 118, 110, 0.16), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(245, 158, 11, 0.18), transparent 22%),
        linear-gradient(180deg, rgba(44, 32, 22, 0.94), rgba(30, 22, 16, 0.98));
}

.display-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
    gap: 22px;
    align-items: stretch;
}

.display-hero-copy {
    padding: 28px;
    display: grid;
    gap: 18px;
}

.display-hero-copy h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 4vw, 4.4rem);
    line-height: 1.04;
}

.display-hero-copy .lead {
    margin: 0;
    max-width: 860px;
}

.display-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.display-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.12);
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
}

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

.display-stat-card {
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,245,226,.84));
    border: 1px solid rgba(89,77,63,.1);
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}

.display-stat-card span,
.display-stat-card small {
    color: var(--muted);
}

.display-stat-card strong {
    font-size: clamp(1.9rem, 2.6vw, 2.8rem);
    line-height: 1;
}

.display-board-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.display-board-head h2 {
    margin: 8px 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.1rem;
}

.display-board-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.display-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.display-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(89,77,63,.1);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.display-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(89,77,63,.24);
}

.display-dot.happy {
    background: linear-gradient(135deg, rgba(15,118,110,.95), rgba(20,184,166,.82));
}

.display-dot.calm {
    background: linear-gradient(135deg, rgba(245,158,11,.95), rgba(249,115,22,.82));
}

.display-dot.sad {
    background: linear-gradient(135deg, rgba(194,65,12,.95), rgba(249,115,22,.68));
}

.display-dot.star {
    background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(236,72,153,.82));
}

.display-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
}

.display-card {
    position: relative;
    display: grid;
    gap: 16px;
    min-height: 100%;
    padding: 24px;
    cursor: pointer;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.5), transparent 36%),
        linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,245,226,.88));
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.display-card::before,
.display-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.display-card::before {
    inset: -30% auto auto -18%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,118,110,.12), transparent 70%);
}

.display-card::after {
    inset: auto -16% -22% auto;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,.12), transparent 72%);
}

.display-card > * {
    position: relative;
    z-index: 1;
}

.display-card:hover,
.display-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(15,118,110,.22);
    box-shadow: 0 24px 56px rgba(60, 42, 23, 0.18);
}

.display-card:focus-visible {
    outline: 3px solid rgba(15,118,110,.18);
    outline-offset: 4px;
}

.display-card-top,
.display-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.display-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(89,77,63,.1);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.display-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
}

.display-state.mood-happy {
    background: rgba(213,243,239,.9);
    color: var(--accent);
}

.display-state.mood-calm {
    background: rgba(255,244,214,.9);
    color: #b45309;
}

.display-state.mood-sad {
    background: rgba(255,226,212,.9);
    color: var(--danger);
}

.display-card-avatar {
    min-height: 184px;
    display: grid;
    place-items: center;
}

.display-card-avatar .pet-avatar-wrap {
    min-height: 184px;
}

.display-card-name {
    display: grid;
    gap: 6px;
}

.display-card-name h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 2vw, 2.3rem);
    line-height: 1.05;
}

.display-card-name p,
.display-card-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.display-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.display-mini-metric {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.08);
    display: grid;
    gap: 8px;
}

.display-mini-metric span {
    color: var(--muted);
    font-size: 0.9rem;
}

.display-mini-metric strong {
    font-size: 1.14rem;
    line-height: 1.2;
}

.display-meter-group {
    margin-top: 0;
}

.display-card-action {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.display-modal-backdrop {
    backdrop-filter: blur(10px);
}

.display-modal-card {
    max-width: 980px;
    padding: 30px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,245,226,.92));
    border: 1px solid rgba(89,77,63,.12);
    box-shadow: 0 30px 70px rgba(38, 30, 21, 0.26);
}

.display-modal-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(89,77,63,.1);
    color: var(--muted);
}

.display-modal-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 26px;
    align-items: center;
}

.display-modal-visual {
    display: grid;
    gap: 16px;
    justify-items: center;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.08);
}

.display-modal-rank {
    justify-self: start;
}

.display-modal-copy {
    display: grid;
    gap: 14px;
}

.display-modal-copy h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3vw, 3rem);
}

.display-modal-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.display-speech {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.8;
}

.display-modal-status {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.75);
    border: 1px solid rgba(89,77,63,.1);
    color: var(--muted);
    line-height: 1.7;
}

.display-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.display-modal-actions .btn {
    display: inline-flex;
    align-items: center;
    flex: 1 1 150px;
    justify-content: center;
}

.display-modal-actions .btn:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.search-bar { grid-template-columns: 1fr auto; align-items: center; }
.spotlight { background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,244,217,.9)); }

.auth-body {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(15,118,110,.18), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(245,158,11,.16), transparent 24%),
        linear-gradient(135deg, #f7efdf 0%, #efe5d1 50%, #fbf7f1 100%);
}

.auth-shell {
    width: min(1180px, 100%);
    margin: auto;
    display: grid;
    grid-template-columns: 1.05fr minmax(360px, 460px);
    gap: 24px;
    align-items: stretch;
}

.auth-showcase,
.auth-card-shell {
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid rgba(89, 77, 63, 0.1);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-showcase {
    padding: 34px;
    display: grid;
    gap: 22px;
    align-content: start;
    background:
        radial-gradient(circle at top right, rgba(20,184,166,.12), transparent 30%),
        linear-gradient(180deg, rgba(255,251,244,.88), rgba(255,244,222,.78));
}

.auth-showcase-head {
    display: flex;
    gap: 16px;
    align-items: center;
}

.auth-showcase-head h1 {
    margin: 8px 0 0;
    font-size: clamp(2rem, 3.6vw, 3.8rem);
    line-height: 1.02;
}

.auth-showcase-copy {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.9;
    white-space: pre-line;
}

.auth-feature-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.auth-feature-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.08);
}

.auth-feature-card strong {
    display: block;
    margin-bottom: 8px;
}

.auth-feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.auth-shortcuts,
.auth-form-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-shortcuts a,
.auth-form-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(89,77,63,.1);
    color: var(--muted);
}

.auth-card-shell {
    padding: 16px;
    display: grid;
}

.auth-panel {
    padding: 30px;
    display: grid;
    gap: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,237,.88));
}

.auth-form-intro h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.7rem, 2vw, 2.4rem);
}

.auth-form-intro p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.auth-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    gap: 12px;
    align-items: center;
}

.auth-captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-captcha-image {
    width: 168px;
    height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(89,77,63,.12);
    background: #fff;
    cursor: pointer;
    display: block;
}

.auth-inline-tip {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.08);
    color: var(--muted);
    line-height: 1.75;
}

.auth-panel .btn {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.admin-shell-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15,118,110,.12), transparent 30%),
        radial-gradient(circle at top right, rgba(245,158,11,.12), transparent 28%),
        linear-gradient(135deg, #f4ede0 0%, #eee3cf 52%, #f9f6ef 100%);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
}

.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    border: 0;
    background: rgba(28, 22, 16, 0.35);
}

.admin-sidebar,
.admin-topbar,
.admin-hero-card {
    background: rgba(255, 250, 243, 0.8);
    border: 1px solid rgba(89, 77, 63, 0.1);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.admin-sidebar {
    position: sticky;
    top: 22px;
    align-self: start;
    min-height: calc(100vh - 44px);
    padding: 22px;
    border-radius: 30px;
    display: grid;
    gap: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,245,226,.82));
}

.admin-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.admin-brand-badge,
.admin-user-avatar {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 28px rgba(15,118,110,.2);
}

.admin-brand strong,
.admin-sidebar-note h2,
.admin-topbar-copy strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
}

.admin-brand small,
.admin-sidebar-note p,
.admin-sidebar-footer span,
.admin-sidebar-footer small,
.admin-nav-item small,
.admin-user-meta small {
    color: var(--muted);
}

.admin-sidebar-note {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89,77,63,.08);
}

.admin-sidebar-note h2 {
    margin: 10px 0 12px;
    font-size: 1.55rem;
}

.admin-sidebar-note p,
.admin-sidebar-footer small {
    margin: 0;
    line-height: 1.78;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255,255,255,.62);
    border: 1px solid rgba(89,77,63,.08);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.admin-nav-item:hover {
    transform: translateY(-1px);
    border-color: rgba(15,118,110,.22);
}

.admin-nav-item strong {
    display: block;
    margin-bottom: 4px;
}

.admin-nav-item.active {
    background: linear-gradient(135deg, rgba(15,118,110,.14), rgba(20,184,166,.08));
    border-color: rgba(15,118,110,.24);
}

.admin-nav-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    color: var(--muted);
    font-weight: 800;
}

.admin-nav-item.active .admin-nav-code {
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(89,77,63,.08);
    display: grid;
    gap: 10px;
}

.admin-sidebar-footer strong {
    display: block;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.admin-main {
    display: grid;
    gap: 18px;
    align-content: start;
}

.admin-topbar {
    border-radius: 26px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.admin-topbar-left,
.admin-topbar-actions,
.admin-user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-topbar-copy strong {
    font-size: 1.1rem;
}

.admin-sidebar-toggle,
.admin-toplink,
.admin-user-trigger {
    border-radius: 999px;
    border: 1px solid rgba(89,77,63,.1);
    background: rgba(255,255,255,.82);
    color: var(--text);
}

.admin-sidebar-toggle,
.admin-toplink {
    padding: 10px 14px;
}

.admin-sidebar-toggle {
    display: none;
    cursor: pointer;
}

.admin-toplink {
    color: var(--muted);
}

.admin-user-menu {
    position: relative;
}

.admin-user-trigger {
    padding: 6px 8px 6px 6px;
    cursor: pointer;
}

.admin-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 0.96rem;
}

.admin-user-meta strong {
    display: block;
}

.admin-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 190px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(89,77,63,.1);
    box-shadow: 0 18px 36px rgba(38, 30, 21, 0.14);
    display: grid;
    gap: 6px;
    z-index: 30;
}

.admin-user-dropdown a {
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--muted);
}

.admin-user-dropdown a:hover {
    background: rgba(15,118,110,.08);
    color: var(--accent);
}

.admin-content {
    display: grid;
    gap: 24px;
}

.admin-hero-card {
    padding: 22px;
    border-radius: 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.admin-hero-card h2 {
    margin: 8px 0 10px;
}

.admin-hero-card p {
    margin: 0;
    max-width: 780px;
    color: var(--muted);
    line-height: 1.85;
}

.section-head.compact {
    align-items: center;
}

.empty-state { text-align: center; padding: 48px 24px; }

.install-body {
    position: relative;
    padding: 32px 20px 40px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(15,118,110,.18), transparent 26%),
        radial-gradient(circle at 82% 12%, rgba(245,158,11,.18), transparent 24%),
        radial-gradient(circle at 50% 80%, rgba(255,255,255,.55), transparent 35%),
        linear-gradient(180deg, #fbf7ef 0%, #f1e6d4 100%);
}
.install-body::before,
.install-body::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    filter: blur(12px);
    pointer-events: none;
}
.install-body::before {
    width: 320px;
    height: 320px;
    top: -100px;
    right: -80px;
    background: radial-gradient(circle, rgba(20,184,166,.18), transparent 70%);
}
.install-body::after {
    width: 260px;
    height: 260px;
    bottom: -60px;
    left: -60px;
    background: radial-gradient(circle, rgba(249,115,22,.16), transparent 70%);
}

.install-shell {
    position: relative;
    z-index: 1;
    max-width: 1340px;
    margin: 0 auto;
    display: grid;
    gap: 22px;
}

.install-hero,
.install-layout {
    display: grid;
    gap: 22px;
}

.install-hero {
    grid-template-columns: 1.12fr 420px;
    align-items: stretch;
}

.install-hero-copy,
.install-hero-visual {
    background: rgba(255, 250, 243, 0.72);
    border: 1px solid rgba(89, 77, 63, 0.08);
    border-radius: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.install-hero-copy {
    padding: 34px 34px 30px;
    display: grid;
    gap: 18px;
}

.install-hero-copy h1 {
    margin: 0;
    font-size: clamp(2.3rem, 4vw, 4.1rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.install-hero-copy p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.85;
}

.install-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.install-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(89, 77, 63, 0.1);
    color: var(--muted);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.install-hero-visual {
    position: relative;
    overflow: hidden;
    padding: 28px;
}

.install-visual-card {
    position: relative;
    min-height: 100%;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 20px;
    padding: 16px;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(15,118,110,.08), rgba(255,255,255,.56)),
        linear-gradient(180deg, rgba(255,245,228,.85), rgba(255,255,255,.6));
    border: 1px solid rgba(89, 77, 63, 0.08);
}

.install-orbit {
    position: absolute;
    inset: auto;
    border-radius: 50%;
    border: 1px dashed rgba(15,118,110,.24);
    animation: spin 14s linear infinite;
}

.install-orbit-a {
    width: 280px;
    height: 280px;
    top: 18px;
    right: 38px;
}

.install-orbit-b {
    width: 210px;
    height: 210px;
    bottom: 24px;
    left: 36px;
    border-color: rgba(245,158,11,.26);
    animation-direction: reverse;
    animation-duration: 11s;
}

.install-core-badge {
    position: relative;
    z-index: 1;
    width: 138px;
    height: 138px;
    display: grid;
    place-items: center;
    border-radius: 40px;
    background:
        linear-gradient(155deg, rgba(15,118,110,.94), rgba(20,184,166,.88));
    color: #fff;
    box-shadow: 0 22px 44px rgba(15,118,110,.28);
    text-align: center;
}

.install-core-badge span {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    opacity: 0.82;
}

.install-core-badge strong {
    display: block;
    margin-top: -8px;
    font-size: 3rem;
    line-height: 1;
}

.install-progress-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(89, 77, 63, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 34px rgba(60, 42, 23, 0.1);
    padding: 22px;
    display: grid;
    gap: 12px;
}

.install-progress-card strong { font-size: 1.95rem; }
.install-progress-card p { margin: 0; color: var(--muted); line-height: 1.7; }

.install-layout {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
}

.install-sidebar-wrap {
    display: grid;
    gap: 18px;
}

.install-sidebar {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.install-step {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(89, 77, 63, 0.08);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.install-step:hover { transform: translateY(-1px); }

.install-step-no {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255,255,255,0.92);
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.52);
}

.install-step strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
}

.install-step small {
    color: var(--muted);
    line-height: 1.6;
}

.install-step.current {
    background: linear-gradient(135deg, rgba(15,118,110,.12), rgba(20,184,166,.08));
    border-color: rgba(15,118,110,.22);
}

.install-step.current .install-step-no,
.install-step.done .install-step-no {
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    box-shadow: 0 12px 24px rgba(15,118,110,.2);
}

.install-step.done {
    background: linear-gradient(135deg, rgba(213,243,239,.65), rgba(255,255,255,.65));
}

.install-side-note {
    padding: 22px;
    display: grid;
    gap: 14px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.84), rgba(255,245,228,.82));
}

.install-side-note h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.install-side-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.install-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mini-stat {
    padding: 14px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(89, 77, 63, 0.08);
}

.mini-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
}

.install-main {
    min-height: 680px;
    padding: 18px;
    overflow: hidden;
}

.install-stage-shell {
    position: relative;
    display: grid;
    gap: 20px;
    padding: 22px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,250,243,.74));
    border: 1px solid rgba(89, 77, 63, 0.06);
}

.install-stage-shell::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 6px;
    border-radius: 26px 26px 0 0;
    background: linear-gradient(90deg, var(--accent), #14b8a6);
}

.install-stage-shell.theme-2::before { background: linear-gradient(90deg, #0f766e, #22c55e); }
.install-stage-shell.theme-3::before { background: linear-gradient(90deg, #0f766e, #0891b2); }
.install-stage-shell.theme-4::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.install-stage-shell.theme-5::before { background: linear-gradient(90deg, #f97316, #ea580c); }
.install-stage-shell.theme-6::before { background: linear-gradient(90deg, #16a34a, #0f766e); }

.install-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.install-stage-head h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 2.8vw, 2.7rem);
}

.install-stage-head p {
    margin: 0;
    max-width: 780px;
    color: var(--muted);
    line-height: 1.8;
}

.stage-kicker {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15,118,110,.1);
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 800;
}

.stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(89, 77, 63, 0.08);
    color: var(--text);
    white-space: nowrap;
}

.stage-pill.ok {
    background: rgba(213,243,239,.85);
    color: var(--accent);
    border-color: rgba(15,118,110,.15);
}

.stage-pill.warn {
    background: rgba(255,226,212,.85);
    color: var(--danger);
    border-color: rgba(194,65,12,.15);
}

.install-metric {
    min-height: 184px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,246,233,.9));
}

.install-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
    line-height: 1.05;
}

.install-metric strong.install-metric-value {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.02rem, 0.7vw + 0.88rem, 1.28rem);
    line-height: 1.28;
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.install-metric strong.install-metric-value.is-url,
.install-metric strong.install-metric-value.is-path {
    font-size: clamp(0.9rem, 0.45vw + 0.82rem, 1.08rem);
    line-height: 1.38;
}

.install-metric strong.install-metric-value.is-path {
    font-family: Consolas, "Segoe UI", sans-serif;
}

.install-metric p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

.install-feature-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.feature-tile {
    padding: 18px 18px 16px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,250,243,.78));
    border: 1px solid rgba(89, 77, 63, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.44);
}

.feature-tile strong {
    display: block;
    margin-bottom: 8px;
}

.feature-tile p {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
}

.install-note-strip {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(89, 77, 63, 0.08);
}

.install-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding-top: 4px;
}

.install-subcard {
    display: grid;
    gap: 14px;
    align-content: start;
    background:
        linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,248,237,.84));
}

.install-subcard h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.install-checks {
    display: grid;
    gap: 14px;
}

.check-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.78);
}

.check-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255,255,255,.9);
    color: var(--muted);
    font-weight: 900;
    letter-spacing: 0.06em;
}

.check-copy strong {
    display: block;
    margin-bottom: 4px;
}

.check-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.check-card.success {
    border-color: rgba(15,118,110,.18);
    background: linear-gradient(135deg, rgba(213,243,239,.62), rgba(255,255,255,.78));
}

.check-card.success .check-icon {
    background: linear-gradient(135deg, rgba(15,118,110,.92), rgba(20,184,166,.82));
    color: #fff;
}

.check-card.error {
    border-color: rgba(194,65,12,.18);
    background: linear-gradient(135deg, rgba(255,226,212,.82), rgba(255,255,255,.8));
}

.check-card.error .check-icon {
    background: linear-gradient(135deg, rgba(194,65,12,.92), rgba(249,115,22,.84));
    color: #fff;
}

.check-card.warning {
    border-color: rgba(245,158,11,.18);
    background: linear-gradient(135deg, rgba(255,244,214,.88), rgba(255,255,255,.82));
}

.check-card.warning .check-icon {
    background: linear-gradient(135deg, rgba(245,158,11,.92), rgba(249,115,22,.82));
    color: #fff;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes wingbeat {
    from { transform: rotate(-24deg) scaleY(0.92); }
    to { transform: rotate(-10deg) scaleY(1.04); }
}
@keyframes twinkle {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; }
}

@media (max-width: 980px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }
    .footer-top {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .footer-content-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .footer-qr-column {
        min-width: 0;
    }
    .header-right {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }
    .header-links {
        width: 100%;
        justify-content: flex-start;
    }
    .header-user-menu {
        width: 100%;
    }
    .header-user-trigger {
        width: 100%;
        min-width: 0;
    }
    .header-user-dropdown {
        width: 100%;
    }
    .hero, .hero-panel, .detail-grid, .dashboard-grid, .card-grid.three-up, .card-grid.four-up {
        grid-template-columns: 1fr;
    }
    .display-hero,
    .display-modal-layout {
        grid-template-columns: 1fr;
    }
    .display-board-head,
    .display-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .display-legend {
        justify-content: flex-start;
    }
    .display-stat-grid,
    .display-card-metrics {
        grid-template-columns: 1fr 1fr;
    }
    .auth-shell,
    .auth-feature-list {
        grid-template-columns: 1fr;
    }
    .auth-captcha-row {
        grid-template-columns: 1fr;
    }
    .auth-captcha-box {
        width: 100%;
        justify-content: flex-start;
    }
    .auth-captcha-image {
        width: 168px;
        max-width: 100%;
    }
    .admin-shell {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .admin-sidebar {
        position: fixed;
        top: 16px;
        left: 16px;
        bottom: 16px;
        width: min(320px, calc(100vw - 32px));
        min-height: auto;
        transform: translateX(-120%);
        transition: transform .25s ease;
        z-index: 30;
    }
    .admin-shell.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }
    .admin-shell.sidebar-open .admin-backdrop {
        display: block;
    }
    .admin-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .admin-topbar,
    .admin-topbar-left,
    .admin-topbar-actions,
    .admin-hero-card {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-topbar-actions {
        width: 100%;
    }
    .admin-user-trigger {
        width: 100%;
        justify-content: flex-start;
    }
    .admin-user-dropdown {
        left: 0;
        right: auto;
        width: 100%;
    }
    .install-header, .install-layout {
        grid-template-columns: 1fr;
    }
    .install-hero {
        grid-template-columns: 1fr;
    }
    .install-feature-band {
        grid-template-columns: 1fr;
    }
    .install-stage-head {
        flex-direction: column;
        align-items: stretch;
    }
    .check-card {
        grid-template-columns: 1fr;
    }
    .check-icon {
        width: 48px;
        height: 48px;
    }
    .install-mini-stats {
        grid-template-columns: 1fr;
    }
    .site-header-inner, .site-footer-inner, .section-head, .section-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .section-nav {
        justify-content: flex-start;
    }
    .section-nav a {
        width: 100%;
    }
    .footer-content-grid {
        grid-template-columns: 1fr;
    }
    .search-bar { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .display-page .site-shell {
        padding: 16px;
    }
    .display-hero-copy,
    .display-card,
    .display-modal-card {
        padding: 20px;
    }
    .display-stat-grid,
    .display-card-metrics {
        grid-template-columns: 1fr;
    }
    .display-card-top {
        flex-wrap: wrap;
    }
    .display-modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-right {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .site-shell {
        padding: 16px;
    }

    .site-header {
        padding: 12px 16px 0;
    }

    .site-footer {
        padding: 0 16px 16px;
    }

    .site-header-inner,
    .site-footer-inner,
    .section-nav {
        padding: 16px;
    }

    .footer-top {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .footer-content-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom-bar {
        width: 100%;
        min-width: 0;
    }

    .brand-badge {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 0.98rem;
    }

    .brand-mark strong {
        font-size: 1.45rem;
    }

    .brand-mark em {
        font-size: 0.82rem;
    }

    .footer-brand-header {
        grid-template-columns: 1fr;
    }

    .footer-bottom-bar {
        flex-direction: column;
    }

    .footer-qr-card {
        width: 96px;
        height: 96px;
    }

    .header-links a,
    .section-nav a {
        width: 100%;
        justify-content: center;
    }

    .header-user-card {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .header-user-copy span {
        max-width: none;
    }
}
