:root {
    --bg: #0a0810;
    --panel: #0c0a12;
    --panel-art: #120c18;
    --surface: #15121d;
    --border: rgba(255, 255, 255, 0.10);
    --text: #f4f2f7;
    --muted: #8b8794;
    --label: #9a96a8;
    --icon: #5e5a69;
    --icon-strong: #7d7989;
    --accent: #ff4d8d;
    --accent-soft: #ff7aa8;
    --accent-hover: #ff6398;
    --on-accent: #1a0710;
    --error-bg: rgba(244, 63, 94, 0.14);
    --error-border: rgba(244, 63, 94, 0.4);
    --error-text: #ffc2cf;
    --ok-bg: rgba(16, 185, 129, 0.14);
    --ok-border: rgba(16, 185, 129, 0.4);
    --ok-text: #b9f3dd;
    --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --admin-sidebar-width: 248px;
    --admin-topbar-height: 66px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: inherit; }

/* ---------- Public project index ---------- */
.home-page {
    min-height: 100vh;
    background: #fff8f7;
    color: #291715;
}

.home-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 64px;
    background: rgba(255, 248, 247, 0.9);
    border-bottom: 1px solid rgba(146, 110, 107, 0.18);
    backdrop-filter: blur(14px);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1;
}

.home-topbar__inner,
.home-shell,
.home-footer__inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.home-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 64px;
    min-height: 0;
    padding: 0;
}

.home-topbar__menu,
.home-topbar__actions,
.home-topbar__nav {
    display: flex;
    align-items: center;
}

.home-topbar__menu {
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 32px;
    min-width: 0;
}

.home-menu-toggle {
    display: none;
    appearance: none;
    padding: 0;
    margin: 0;
    font: inherit;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
    color: #291715;
    text-decoration: none;
}

.home-brand__mark {
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e31b23;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.home-brand__text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.home-topbar__nav {
    gap: 24px;
    flex-wrap: wrap;
}

.home-topbar__nav a,
.home-topbar__nav span,
.home-nav-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5f5e5e;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
}

.home-topbar__nav a:hover,
.home-topbar__nav a.is-active,
.home-topbar__nav span.is-active,
.home-nav-dropdown.is-active .home-nav-dropdown__toggle,
.home-nav-dropdown__toggle:hover,
.home-nav-dropdown__toggle:focus-visible {
    color: #b90014;
}

.home-topbar__nav span.is-disabled {
    color: rgba(95, 94, 94, 0.46);
    cursor: default;
}

.home-nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}

.home-nav-dropdown__toggle {
    gap: 5px;
    cursor: pointer;
}

.home-nav-dropdown__toggle span {
    color: currentColor;
    font-size: 13px;
    line-height: 1;
    transition: transform 160ms ease;
}

.home-nav-dropdown.is-open .home-nav-dropdown__toggle span {
    transform: rotate(180deg);
}

.home-nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: none;
    min-width: 190px;
    padding: 8px;
    border: 1px solid rgba(146, 110, 107, 0.18);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(41, 23, 21, 0.14);
}

.home-nav-dropdown__menu::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 8px;
}

.home-nav-dropdown:hover .home-nav-dropdown__menu,
.home-nav-dropdown:focus-within .home-nav-dropdown__menu,
.home-nav-dropdown.is-open .home-nav-dropdown__menu {
    display: grid;
    gap: 4px;
}

.home-topbar__nav .home-nav-dropdown__menu a {
    display: flex;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    color: #5f5e5e;
    font-size: 14px;
}

.home-topbar__nav .home-nav-dropdown__menu a:hover,
.home-topbar__nav .home-nav-dropdown__menu a:focus-visible,
.home-topbar__nav .home-nav-dropdown__menu a.is-active {
    background: #fff0ee;
    color: #b90014;
}

.home-topbar__actions {
    gap: 14px;
}

.home-search {
    position: relative;
    width: min(320px, 34vw);
}

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

.home-search__input {
    width: 100%;
    height: 40px;
    min-height: 0;
    padding: 0 16px;
    border: 1px solid rgba(146, 110, 107, 0.2);
    border-radius: 999px;
    background: #fff0ee;
    color: #291715;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    outline: none;
}

.home-search__input::placeholder {
    color: #8f6a66;
}

.home-search__input:focus {
    border-color: rgba(227, 27, 35, 0.55);
    box-shadow: 0 0 0 3px rgba(227, 27, 35, 0.12);
}

.home-search__suggestions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(380px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(146, 110, 107, 0.2);
    border-radius: 14px;
    background: #fffdfa;
    box-shadow: 0 18px 44px rgba(41, 23, 21, 0.16);
}

.home-search-suggestion {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    color: #291715;
    text-align: left;
    text-decoration: none;
}

.home-search-suggestion:hover,
.home-search-suggestion:focus {
    background: #fff0ee;
    outline: none;
}

.home-search-suggestion__cover {
    display: grid;
    place-items: center;
    width: 42px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    background: #f2deda;
    color: #9b2b31;
    font-size: 13px;
    font-weight: 800;
}

.home-search-suggestion__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-search-suggestion__body {
    min-width: 0;
}

.home-search-suggestion__body strong,
.home-search-suggestion__body span,
.home-search-suggestion__body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-search-suggestion__body strong {
    font-size: 14px;
}

.home-search-suggestion__body span {
    margin-top: 2px;
    color: #73534f;
    font-size: 13px;
}

.home-search-suggestion__body small {
    margin-top: 4px;
    color: #a2484c;
    font-size: 12px;
    font-weight: 700;
}

.home-search-suggestion--more {
    display: flex;
    min-height: 44px;
    justify-content: center;
    border-top: 1px solid rgba(146, 110, 107, 0.15);
    color: #b90014;
    font-weight: 800;
}

.home-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 40px;
    min-height: 0;
    padding: 0 16px;
    border: 1px solid rgba(146, 110, 107, 0.2);
    border-radius: 999px;
    background: #fff0ee;
    color: #5d3f3c;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.home-icon-button--primary {
    border-color: #e31b23;
    background: #e31b23;
    color: #ffffff;
}

.home-shell {
    padding: 32px 0 48px;
}

.search-page {
    min-height: 100vh;
    background: #fff8f7;
    color: #291715;
}

.search-shell {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.search-head {
    margin-bottom: 24px;
}

.search-kicker {
    margin: 0 0 8px;
    color: #b90014;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.search-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 42px;
    line-height: 1.05;
}

.search-head p:last-child {
    margin: 12px 0 0;
    color: #73534f;
}

.search-results-table {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.search-result-cell {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    min-height: 236px;
    padding: 10px;
    border: 1px solid rgba(231, 189, 184, 0.8);
    border-radius: 12px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.search-result-cell:hover {
    border-color: rgba(227, 27, 35, 0.35);
    box-shadow: 0 12px 28px rgba(41, 23, 21, 0.08);
}

.search-result__cover {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    background: #f2deda;
    color: #9b2b31;
    font-size: 20px;
    font-weight: 800;
}

.search-result__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result__body {
    display: grid;
    grid-template-rows: minmax(38px, auto) auto;
    align-content: space-between;
    gap: 10px;
    min-width: 0;
}

.search-result-cell h2 {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.search-result-cell h2 a {
    color: inherit;
    text-decoration: none;
}

.search-result-cell h2 a:hover {
    color: #b90014;
}

.search-result__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-quick-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(185, 0, 20, 0.24);
    border-radius: 999px;
    background: #fff0ee;
    color: #b90014;
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.search-quick-action--favorite {
    font-size: 17px;
}

.search-quick-action:hover,
.search-quick-action:focus-visible,
.search-quick-action.is-done,
.search-quick-action.is-in-collection,
.search-quick-action.is-favorite {
    background: #b90014;
    color: #ffffff;
    outline: none;
}

.search-quick-action[aria-disabled="true"] {
    cursor: default;
}

.search-quick-action[aria-disabled="true"]:hover {
    transform: none;
}

.search-quick-action:disabled {
    cursor: wait;
    opacity: 0.7;
}

.search-toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.search-result-tip {
    width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 16px;
    background: #291715;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    box-shadow: 0 24px 60px rgba(41, 23, 21, 0.28);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.search-result-tip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.search-result-tip.is-error {
    background: #b90014;
}

.search-result-tip.is-hiding {
    opacity: 0;
    transform: translateY(18px);
}

.search-empty {
    padding: 28px;
    border: 1px solid rgba(231, 189, 184, 0.8);
    border-radius: 12px;
    background: #ffffff;
}

.search-empty h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 24px;
}

.search-empty p {
    margin: 8px 0 0;
    color: #73534f;
}

.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.search-pagination a,
.search-pagination span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(146, 110, 107, 0.2);
    border-radius: 999px;
    background: #fff0ee;
    color: #5d3f3c;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.search-pagination a {
    color: #b90014;
}

.home-hero {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.home-hero__feature,
.home-promo-card,
.home-topics-card,
.home-news-card,
.home-community-card,
.home-widget,
.home-support {
    border: 1px solid rgba(231, 189, 184, 0.8);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.home-hero__feature {
    grid-column: span 8;
    position: relative;
    min-height: 400px;
    background: linear-gradient(180deg, rgba(41, 23, 21, 0.08), rgba(41, 23, 21, 0.55)),
        linear-gradient(135deg, rgba(205, 229, 255, 0.2), rgba(227, 27, 35, 0.12));
}

.home-hero__overlay,
.home-promo-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
}

.home-hero__content,
.home-promo-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 24px;
}

.home-chip,
.home-kicker,
.home-news-card__meta,
.home-topics-card__head span,
.home-section-tabs span,
.home-highlight-item span,
.home-community-card__head span,
.home-community-card__meta span,
.home-streaming__head span,
.home-widget__footer,
.home-footer__nav span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.home-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e31b23;
    color: #ffffff;
    margin-bottom: 16px;
}

.home-hero__content h1,
.home-promo-card__content h2,
.home-section-head h2,
.home-streaming__head h2,
.home-community h2,
.home-widget__head h2,
.home-support h2 {
    margin: 0;
    font-family: var(--font-display);
}

.home-hero__content h1 {
    max-width: 760px;
    color: #ffffff;
    font-size: 32px;
    line-height: 1.25;
}

.home-hero__content p,
.home-promo-card__content,
.home-news-card__body,
.home-streaming-card__content p,
.home-community-card__body p,
.home-ranking-item p,
.home-support p,
.home-footer__brand p {
    color: #fff9f8;
    line-height: 1.6;
}

.home-hero__content p {
    max-width: 720px;
    margin: 12px 0 0;
}

.home-hero__stack {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-promo-card {
    position: relative;
    min-height: 192px;
    background: linear-gradient(180deg, rgba(41, 23, 21, 0.14), rgba(41, 23, 21, 0.5)),
        linear-gradient(135deg, rgba(148, 204, 255, 0.18), rgba(227, 27, 35, 0.1));
}

.home-kicker {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 8px;
}

.home-promo-card__content h2 {
    color: #ffffff;
    font-size: 20px;
    line-height: 1.4;
}

.home-topics-card {
    padding: 24px;
    background: #fff0ee;
}

.home-topics-card__head,
.home-section-head,
.home-streaming__head,
.home-widget__head,
.home-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-topics-card__head h2,
.home-widget__head h2 {
    font-size: 20px;
    color: #291715;
}

.home-topics-card__head span {
    color: #5f5e5e;
}

.home-topics-list {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.home-topics-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 0 0 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(146, 110, 107, 0.18);
}

.home-topics-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.home-topics-list li span {
    color: #b90014;
    opacity: 0.5;
    font-weight: 700;
}

.home-topics-list li strong {
    color: #5d3f3c;
    font-size: 14px;
    line-height: 1.4;
}

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

.home-main-column {
    grid-column: span 8;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.home-sidebar {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.home-section-head {
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(231, 189, 184, 0.6);
}

.home-section-head h2 {
    position: relative;
    padding-left: 20px;
    font-size: 32px;
    color: #291715;
}

.home-section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 8px;
    height: 32px;
    border-radius: 999px;
    background: #e31b23;
}

.home-section-tabs {
    display: flex;
    gap: 16px;
}

.home-section-tabs span {
    color: #5f5e5e;
}

.home-section-tabs span.is-active {
    color: #b90014;
    border-bottom: 2px solid #b90014;
    padding-bottom: 4px;
}

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

.home-news-cta {
    display: flex;
    justify-content: center;
    margin-top: -8px;
}

.home-news-cta__button {
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid rgba(231, 189, 184, 0.8);
    border-radius: 999px;
    background: #fff0ee;
    color: #b90014;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.home-news-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.home-news-card__media {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #fddbd7, #cde5ff);
}

.home-news-card__body {
    padding: 16px;
    color: #5d3f3c;
}

.home-news-card__meta {
    color: #5f5e5e;
}

.home-news-card__body h3 {
    margin: 8px 0 0;
    font-size: 20px;
    line-height: 1.35;
    color: #291715;
}

.home-streaming {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(231, 189, 184, 0.8);
}

.home-streaming__head {
    padding: 14px 24px;
    background: #e31b23;
}

.home-streaming__head h2 {
    color: #ffffff;
    font-size: 20px;
}

.home-streaming__head span {
    color: rgba(255, 255, 255, 0.8);
}

.home-streaming__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
    background: #ffe9e6;
}

.home-streaming-card {
    display: flex;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(41, 23, 21, 0.08);
}

.home-streaming-card__cover {
    display: grid;
    place-items: center;
    width: 96px;
    min-height: 128px;
    padding: 10px;
    border-radius: 6px;
    background: #fddbd7;
    color: #5d3f3c;
    font-size: 12px;
    text-align: center;
}

.home-streaming-card__content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.home-streaming-card__content h3 {
    margin: 0;
    color: #291715;
    font-size: 14px;
    line-height: 1.4;
}

.home-streaming-card__content p,
.home-streaming-card__content span {
    margin: 0;
    color: #5f5e5e;
    font-size: 11px;
}

.home-community h2 {
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 4px solid #e31b23;
    color: #291715;
    font-size: 20px;
}

.home-community-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-community-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: #ffffff;
}

.home-community-card__avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #ffdad6;
    color: #93000d;
    font-weight: 700;
}

.home-community-card__body {
    flex: 1;
    color: #5d3f3c;
}

.home-community-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-community-card__head strong {
    color: #b90014;
}

.home-community-card__head span,
.home-community-card__meta span {
    color: #5f5e5e;
    font-size: 12px;
}

.home-community-card__body p {
    margin: 8px 0 12px;
    color: #5d3f3c;
}

.home-community-card__meta {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid rgba(146, 110, 107, 0.12);
}

.home-widget__head {
    padding: 16px;
    background: #fddbd7;
    border-bottom: 1px solid rgba(231, 189, 184, 0.8);
}

.home-widget__head--accent {
    background: #e31b23;
}

.home-widget__head--accent h2 {
    color: #ffffff;
}

.home-widget__body {
    padding: 16px;
    background: #ffffff;
}

.home-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-ranking-item + .home-ranking-item {
    margin-top: 16px;
}

.home-ranking-item__rank {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #fff0ee;
    color: #b90014;
    font-weight: 700;
    border: 1px solid rgba(231, 189, 184, 0.8);
}

.home-ranking-item strong,
.home-highlight-item strong,
.home-footer__brand strong {
    color: #291715;
}

.home-ranking-item p {
    margin: 4px 0 0;
    color: #5f5e5e;
    font-size: 12px;
}

.home-widget__footer {
    padding: 14px 16px;
    text-align: center;
    color: #b90014;
    background: #fff0ee;
    border-top: 1px solid rgba(231, 189, 184, 0.8);
}

.home-highlight-list {
    background: #ffffff;
}

.home-highlight-item {
    padding: 16px;
}

.home-highlight-item + .home-highlight-item {
    border-top: 1px solid rgba(231, 189, 184, 0.6);
}

.home-highlight-item span {
    color: #b90014;
    display: block;
    margin-bottom: 6px;
}

.home-highlight-item strong {
    display: block;
    font-size: 14px;
    line-height: 1.45;
}

.home-support {
    padding: 24px;
    text-align: center;
    background: #f9faff;
    border: 2px dashed rgba(0, 95, 147, 0.2);
}

.home-support__icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #cde5ff;
    color: #005f93;
    font-size: 24px;
}

.home-support h2 {
    color: #004b74;
    font-size: 20px;
}

.home-support p {
    margin: 10px 0 16px;
    color: #005f93;
}

.home-support button {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #005f93;
    color: #ffffff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.home-footer {
    border-top: 1px solid rgba(231, 189, 184, 0.8);
    background: #fddbd7;
}

.home-footer__inner {
    padding: 24px 0;
}

.home-footer__brand strong {
    display: block;
    font-size: 20px;
    margin-bottom: 6px;
}

.home-footer__brand p {
    margin: 0;
    color: #5d3f3c;
}

.home-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.home-footer__nav span {
    color: #5f5e5e;
}

.project-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0810 0%, #131118 48%, #07131a 100%);
    color: var(--text);
}

.project-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
}

.project-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 800;
    text-decoration: none;
}

.project-brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 14px;
}

.project-nav__links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--label);
    font-size: 14px;
    font-weight: 800;
}

.project-nav__links a {
    text-decoration: none;
}

.project-nav__links a:hover {
    color: var(--accent-soft);
}

.project-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 46px;
    width: min(1160px, calc(100% - 40px));
    min-height: calc(100vh - 92px);
    margin: 0 auto;
    padding: 34px 0 78px;
}

.project-hero__copy h1 {
    max-width: 820px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 72px;
    line-height: 0.95;
    letter-spacing: 0;
}

.project-hero__copy p:not(.eyebrow) {
    max-width: 650px;
    margin: 24px 0 0;
    color: #c7c2ce;
    font-size: 18px;
    line-height: 1.75;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.project-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 800;
    text-decoration: none;
}

.project-button:hover {
    border-color: rgba(255, 77, 141, 0.44);
}

.project-button--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.project-console {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(12, 10, 18, 0.82);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
}

.project-console__bar {
    display: flex;
    gap: 7px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.project-console__bar span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
}

.project-console__bar span:nth-child(2) { background: #fbbf24; }
.project-console__bar span:nth-child(3) { background: #34d399; }

.project-console dl {
    margin: 0;
    padding: 10px 0;
}

.project-console div {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-console div:last-child { border-bottom: none; }

.project-console dt {
    color: var(--accent-soft);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.project-console dd {
    margin: 8px 0 0;
    color: #ddd8e5;
    line-height: 1.6;
}

.project-section {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 82px 0;
}

.project-section__head {
    max-width: 720px;
}

.project-section__head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 46px;
    line-height: 1.04;
    letter-spacing: 0;
}

.project-section__head p:not(.eyebrow) {
    margin: 18px 0 0;
    color: #c7c2ce;
    font-size: 16px;
    line-height: 1.7;
}

.project-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.project-feature {
    min-height: 250px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.project-feature__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(255, 77, 141, 0.14);
    color: var(--accent-soft);
}

.project-feature__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-feature h3 {
    margin: 22px 0 10px;
    font-family: var(--font-display);
    font-size: 22px;
}

.project-feature p {
    margin: 0;
    color: #c7c2ce;
    line-height: 1.7;
}

.project-section--split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 42px;
    align-items: start;
}

.project-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.project-steps li {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
    align-items: center;
    min-height: 74px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #ddd8e5;
    line-height: 1.5;
}

.project-steps span {
    color: var(--accent-soft);
    font-family: var(--font-display);
    font-weight: 800;
}

.project-steps code {
    color: #f9a8c6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95em;
}

.project-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 70px;
}

.project-strip span {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--label);
    font-size: 13px;
    font-weight: 800;
}

/* ---------- Login split layout ---------- */
.login-split {
    --bg: #e9e9ee;
    --panel: #ffffff;
    --panel-art: #e9e9ee;
    --surface: #f7f7fb;
    --border: rgba(24, 24, 27, 0.08);
    --text: #18181b;
    --muted: #6b7280;
    --label: #52525b;
    --icon: #a1a1aa;
    --icon-strong: #71717a;
    --accent: #6d28d9;
    --accent-soft: #8b5cf6;
    --accent-hover: #5b21b6;
    --on-accent: #ffffff;
    --ok-bg: rgba(16, 185, 129, 0.10);
    --ok-border: rgba(16, 185, 129, 0.22);
    --ok-text: #047857;
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg);
}

.login-art {
    position: relative;
    width: 46%;
    min-height: 100vh;
    background-color: var(--panel-art);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: inset -1px 0 0 rgba(24, 24, 27, 0.08);
}

.login-art__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(233, 233, 238, 0.08) 0%, rgba(233, 233, 238, 0.04) 40%, rgba(233, 233, 238, 0.14) 100%);
}

.login-panel {
    flex: 1;
    min-height: 100vh;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-box { width: 100%; max-width: 380px; }

.eyebrow {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.login-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.login-lead {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 34px;
}

/* ---------- Form controls ---------- */
.lbl {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--label);
    margin-bottom: 8px;
}

.control { position: relative; margin-bottom: 20px; }

.control__icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--icon);
    pointer-events: none;
}

.control input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px 14px 46px;
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.control input::placeholder { color: var(--icon); }

.control input:focus {
    border-color: rgba(109, 40, 217, 0.42);
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.10);
}

.control--pw input { padding-right: 46px; }

.toggle-password {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--icon-strong);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.toggle-password:hover { color: var(--accent); background: rgba(109, 40, 217, 0.06); }

.toggle-password:focus-visible {
    outline: none;
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.16);
}

.toggle-password svg { width: 19px; height: 19px; display: block; }

/* Una sola icona alla volta: occhio quando la password è nascosta,
   occhio sbarrato quando è visibile (classe .is-on aggiunta via JS). */
.toggle-password .icon-eye-off { display: none; }
.toggle-password.is-on .icon-eye { display: none; }
.toggle-password.is-on .icon-eye-off { display: block; }

/* ---------- Remember + link row ---------- */
.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 26px;
}

.remember { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }

.remember__box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(24, 24, 27, 0.18);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background 0.15s, border-color 0.15s;
}

.remember__box svg { width: 12px; height: 12px; color: var(--on-accent); opacity: 0; }

.remember input:checked + .remember__box {
    background: var(--accent);
    border-color: var(--accent);
}
.remember input:checked + .remember__box svg { opacity: 1; }

.remember input:focus-visible + .remember__box {
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

.remember__text { font-size: 13.5px; color: var(--label); }

.link-accent {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.link-accent:hover { color: var(--accent); }

.login-foot {
    margin: 20px 0 0;
    color: var(--label);
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
}

/* ---------- Accent button ---------- */
.btn-accent {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 15px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(109, 40, 217, 0.24);
    transition: background 0.15s, transform 0.12s;
}
.btn-accent:hover { background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%); transform: translateY(-1px); }

/* ---------- Alerts ---------- */
.alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
}
.alert-error { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text); }
.alert-success { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text); }

/* ---------- Recovery (centered card, same palette) ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.auth-card--wide { max-width: 560px; }

.auth-head { text-align: left; margin-bottom: 28px; }
.auth-head h1 { font-family: var(--font-display); margin: 14px 0 8px; font-size: 28px; color: var(--text); }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.auth-badge {
    display: inline-block;
    font-family: var(--font-display);
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--label); }

.field input[type="text"],
.field input[type="search"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
    border-color: rgba(255, 77, 141, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.12);
}

.field-hint {
    margin: -10px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.password-meter {
    height: 8px;
    margin-top: -8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}
.password-meter__bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--error-text);
    transition: width 0.18s ease, background 0.18s ease;
}
.password-meter[data-score="1"] .password-meter__bar { width: 25%; background: #fb7185; }
.password-meter[data-score="2"] .password-meter__bar { width: 50%; background: #fbbf24; }
.password-meter[data-score="3"] .password-meter__bar { width: 75%; background: #2ad3c2; }
.password-meter[data-score="4"] .password-meter__bar { width: 100%; background: var(--ok-text); }

.consent-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: var(--label);
    font-size: 13.5px;
    line-height: 1.45;
    cursor: pointer;
}
.consent-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.consent-check__box {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.consent-check__box svg {
    width: 13px;
    height: 13px;
    color: var(--on-accent);
    opacity: 0;
}
.consent-check input:checked + .consent-check__box {
    background: var(--accent);
    border-color: var(--accent);
}
.consent-check input:checked + .consent-check__box svg { opacity: 1; }
.consent-check input:focus-visible + .consent-check__box {
    box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.18);
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px -8px rgba(255, 77, 141, 0.5);
    transition: background 0.15s, transform 0.12s;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-ghost {
    width: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
    padding: 10px 18px;
    font-size: 14px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); transform: none; }

.link { color: var(--accent-soft); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--accent); }

.auth-foot { text-align: center; margin: 22px 0 0; font-size: 14px; }

/* ---------- Backend: layout e navigazione ---------- */
.admin-shell {
    min-height: 100vh;
    display: block;
    max-width: none;
    margin: 0;
    padding: var(--admin-topbar-height) 0 0 var(--admin-sidebar-width);
}
.admin-shell > :not(.admin-topbar):not(.admin-sidebar):not(.app-modal):not(.app-collection-fab) {
    margin: 0 32px 24px;
}
.admin-shell > :not(.admin-topbar):not(.admin-sidebar):not(.app-modal):not(.app-collection-fab):nth-child(3) { margin-top: 32px; }

.admin-topbar {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: var(--admin-topbar-height);
    padding: 0 24px;
    background: rgba(12, 10, 18, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.admin-brand__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.admin-topbar__user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }

.admin-sidebar {
    position: fixed;
    z-index: 20;
    top: var(--admin-topbar-height);
    bottom: 0;
    left: 0;
    width: var(--admin-sidebar-width);
    overflow-y: auto;
    padding: 24px 16px;
    background: var(--panel);
    border-right: 1px solid var(--border);
}
.admin-menu { display: flex; flex-direction: column; gap: 8px; }
.admin-menu__group { display: flex; flex-direction: column; gap: 6px; }
.admin-menu__label,
.admin-menu__item {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}
.admin-menu__label { color: var(--text); }
.admin-menu__item {
    border: 1px solid transparent;
    color: var(--label);
}
.admin-menu__item--child {
    min-height: 36px;
    margin-left: 12px;
    padding-left: 18px;
    font-weight: 600;
}
a.admin-menu__item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.admin-menu__item.is-active { background: var(--surface); border-color: var(--border); color: var(--text); }
.admin-menu__item--disabled { opacity: 0.72; }

.admin-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
}
.muted { color: var(--muted); }

.page-head { margin-bottom: 20px; }
.page-title { font-family: var(--font-display); font-size: 26px; margin: 8px 0 4px; }
.backlink { color: var(--accent-soft); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.backlink:hover { color: var(--accent); }
.meta-line { color: var(--muted); font-size: 13px; margin: 0; }
.meta-line code { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; }

.card-title { font-family: var(--font-display); font-size: 19px; margin: 0 0 16px; }
.section-gap { margin-top: 24px; }
.quick-links { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.detail-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
}
.detail-media { min-width: 0; }
.detail-cover {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface);
    display: block;
}
.detail-cover--empty {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    color: var(--icon);
    font-size: 13px;
}
.detail-body { min-width: 0; }
.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 22px;
    margin: 0;
}
.detail-list div { min-width: 0; }
.detail-list dt {
    color: var(--label);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}
.detail-list dd {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}
.detail-description {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.detail-description p {
    margin: 0;
    color: var(--label);
    line-height: 1.6;
}
.detail-pre {
    max-height: 360px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--label);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ---------- Backend: bottoni compatti ---------- */
.btn-sm { width: auto; padding: 9px 16px; font-size: 13.5px; box-shadow: none; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-danger {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    box-shadow: none;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.24); transform: none; }
.inline-form { display: inline-block; }
.inline-link-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
}
.inline-link-form input[type="number"] {
    width: 108px;
    min-height: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
}
.inline-link-form input[type="number"]:focus {
    border-color: rgba(255, 77, 141, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.12);
}

/* ---------- Backend: riepilogo ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}
.stat-card__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.stat-card__label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.publisher-summary {
    margin-bottom: 24px;
}
.publisher-summary .list-head {
    align-items: flex-start;
}
.publisher-summary .list-head strong {
    font-family: var(--font-display);
    font-size: 20px;
    white-space: nowrap;
}
.publisher-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.publisher-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}
.publisher-summary__row span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.publisher-summary__row strong {
    font-family: var(--font-display);
    font-size: 18px;
    white-space: nowrap;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.chart-card { min-width: 0; }
.chart-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.chart-card__head .card-title { margin-bottom: 4px; }
.chart-card__head .muted { margin: 0; font-size: 13px; }
.chart-card__head strong {
    font-family: var(--font-display);
    font-size: 22px;
    white-space: nowrap;
}
.trend-chart {
    width: 100%;
    height: 170px;
    display: block;
    overflow: visible;
}
.trend-chart line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}
.trend-chart__area {
    fill: rgba(255, 77, 141, 0.12);
    stroke: none;
}
.trend-chart__line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.chart-line--volumes .trend-chart__area { fill: rgba(42, 211, 194, 0.13); }
.chart-line--volumes .trend-chart__line { stroke: #2ad3c2; }
.chart-line--scraped .trend-chart__area { fill: rgba(255, 194, 87, 0.13); }
.chart-line--scraped .trend-chart__line { stroke: #ffc257; }
.chart-card__foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Backend: liste e tabelle ---------- */
.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.list-head .card-title { margin: 0; }

.list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.searchbar input[type="search"] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-ui);
    min-width: 230px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbar input[type="search"]:focus {
    border-color: rgba(255, 77, 141, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.12);
}

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--label);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.cell-title { font-weight: 600; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions .btn { margin-left: 6px; }
.table-link { color: inherit; text-decoration: none; }
.table-link:hover { color: var(--accent-soft); }

.log-tabs {
    padding-top: 18px;
}
.log-tabs__head {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.log-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--label);
    font-family: var(--font-ui);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.log-tabs__tab span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 12px;
}
.log-tabs__tab:hover,
.log-tabs__tab.is-active {
    border-color: var(--border);
    background: var(--panel);
    color: var(--text);
}
.log-tabs__tab.is-active span {
    background: rgba(255, 77, 141, 0.16);
    color: var(--accent-soft);
}
.log-tabs__panel[hidden] {
    display: none;
}

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

.news-tag-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin: 18px 0 8px;
}
.news-tag-form__actions {
    display: flex;
    align-items: end;
}
.news-tag-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}
.news-tag-delete {
    display: inline-flex;
    margin-top: 8px;
}
.log-filters {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}
.log-filters label {
    display: grid;
    gap: 6px;
    min-width: 170px;
}
.log-filters label span {
    color: var(--label);
    font-size: 12px;
    font-weight: 700;
}
.log-filters input,
.log-filters select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 8px 10px;
    outline: none;
}
.log-filters input:focus,
.log-filters select:focus {
    border-color: rgba(255, 77, 141, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.12);
}
.log-table-wrap {
    max-height: 520px;
    overflow: auto;
}
.log-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--panel);
}
.log-table__date {
    white-space: nowrap;
}
.log-table__details {
    max-width: 360px;
    overflow-wrap: anywhere;
    color: var(--label);
    font-size: 13px;
}

.cover-thumb {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface);
    display: block;
}
.cover-thumb--empty {
    display: grid;
    place-items: center;
    color: var(--icon);
    font-size: 10px;
    border: 1px solid var(--border);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--label);
    white-space: nowrap;
}
.badge--warning {
    background: rgba(255, 194, 87, 0.13);
    border-color: rgba(255, 194, 87, 0.36);
    color: #ffd891;
}
.badge--danger {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    font-size: 14px;
    color: var(--muted);
}
.pagination a { color: var(--accent-soft); text-decoration: none; font-weight: 600; }
.pagination a:hover { color: var(--accent); }
.pagination__disabled { opacity: 0.35; }

/* ---------- Backend: form ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}
.form-grid .field--full { grid-column: 1 / -1; }

.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field input[type="date"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input[type="text"]:focus,
.field input[type="url"]:focus,
.field input[type="number"]:focus,
.field input[type="date"]:focus,
.field input[type="search"]:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(255, 77, 141, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.12);
}
.field select option { background: var(--panel); color: var(--text); }
.field textarea { min-height: 110px; resize: vertical; }
.field textarea.textarea-tall { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.check-inline {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--label);
    cursor: pointer;
}
.check-inline input { accent-color: var(--accent); width: 16px; height: 16px; }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }

.add-volume-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.add-volume-form .field { width: 130px; }
.add-volume-form .field--grow { flex: 1; min-width: 200px; width: auto; }
.add-volume-form .btn { margin-bottom: 1px; }

/* ---------- Area utente ---------- */
.app-shell {
    --bg: #e9e9ee;
    --panel: #ffffff;
    --surface: #f7f7fb;
    --border: rgba(24, 24, 27, 0.08);
    --text: #18181b;
    --muted: #6b7280;
    --label: #71717a;
    --icon: #a1a1aa;
    --icon-strong: #52525b;
    --accent: #6d28d9;
    --accent-soft: #8b5cf6;
    --accent-hover: #5b21b6;
    --on-accent: #ffffff;
    --error-bg: rgba(244, 63, 94, 0.08);
    --error-border: rgba(244, 63, 94, 0.16);
    --error-text: #be123c;
    --ok-bg: rgba(16, 185, 129, 0.09);
    --ok-border: rgba(16, 185, 129, 0.18);
    --ok-text: #047857;
    --admin-sidebar-width: 232px;
    --admin-topbar-height: 74px;
    background: var(--bg);
    color: var(--text);
}
.app-shell.admin-shell {
    padding-top: var(--admin-topbar-height);
    padding-left: var(--admin-sidebar-width);
}
.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}
.app-shell .admin-brand__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.app-shell .admin-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(24, 24, 27, 0.08);
}
.app-brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(109, 40, 217, 0.22);
}
.app-userbar form { margin: 0; }
.app-userbar {
    gap: 10px;
}
.app-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(109, 40, 217, 0.14);
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #38bdf8 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}
.app-avatar--sm {
    width: 38px;
    height: 38px;
}
.app-avatar--lg {
    width: 86px;
    height: 86px;
    font-size: 24px;
}
.app-avatar span {
    line-height: 1;
}
.app-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.app-userbar__identity {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}
.app-userbar__identity span {
    color: var(--muted);
    font-weight: 500;
}
.app-icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--label);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.app-icon-button:hover {
    border-color: rgba(109, 40, 217, 0.2);
    color: var(--accent);
    background: #faf5ff;
    box-shadow: 0 10px 18px rgba(109, 40, 217, 0.08);
}
.app-icon-button svg { width: 18px; height: 18px; }
.app-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 18px 14px;
}
.app-sidebar .admin-menu__item {
    gap: 10px;
    border-radius: 14px;
    color: #3f3f46;
    font-weight: 600;
}
.app-sidebar .admin-menu__item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-sidebar .admin-menu__item.is-active {
    border-color: transparent;
    background: rgba(109, 40, 217, 0.12);
    color: var(--accent);
}
.app-sidebar .admin-menu__item--disabled {
    opacity: 1;
    color: #52525b;
}
.app-dashboard {
    display: grid;
    gap: 22px;
    max-width: 1220px;
}
.app-profile-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 28px;
    border: 1px solid rgba(185, 0, 20, 0.12);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(185, 0, 20, 0.16), transparent 24%),
        linear-gradient(180deg, #fff9f8 0%, #ffffff 100%);
    box-shadow: 0 18px 40px rgba(41, 23, 21, 0.08);
}
.app-avatar--hero {
    width: 104px;
    height: 104px;
    border: 4px solid rgba(227, 27, 35, 0.16);
    box-shadow: 0 16px 30px rgba(185, 0, 20, 0.12);
    font-size: 28px;
}
.app-profile-hero__content h1 {
    margin: 0;
    color: #291715;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}
.app-profile-hero__meta {
    margin: 6px 0 0;
    color: #7a5551;
    font-size: 15px;
    font-weight: 600;
}
.app-profile-hero__summary {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 15px;
}
.app-profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.app-profile-pill {
    display: grid;
    gap: 2px;
    min-width: 140px;
    padding: 12px 14px;
    border: 1px solid rgba(231, 189, 184, 0.7);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}
.app-profile-pill strong {
    color: #b90014;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.04em;
}
.app-profile-pill span {
    color: #5d3f3c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.app-profile-hero__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.app-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
    gap: 20px;
    align-items: start;
}
.app-dashboard-main,
.app-dashboard-side {
    display: grid;
    gap: 20px;
}
.app-panel {
    padding: 24px;
    border: 1px solid rgba(231, 189, 184, 0.78);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(41, 23, 21, 0.05);
}
.app-panel--media {
    background: linear-gradient(180deg, #fffefe 0%, #fff8f7 100%);
}
.app-section-kicker {
    margin: 0 0 6px;
    color: #b90014;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.app-welcome {
    position: relative;
    overflow: hidden;
    padding: 30px 30px 28px;
    border: 1px solid rgba(109, 40, 217, 0.08);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}
.app-welcome .eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    letter-spacing: 0.16em;
}
.app-welcome h1 {
    max-width: 760px;
    margin: 0 0 8px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}
.app-welcome p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}
.app-dashboard__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 20px;
    align-items: start;
}
.app-stats-band {
    width: 100%;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}
.app-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.app-section-head h2 {
    margin: 0 0 4px;
    font-size: 22px;
    letter-spacing: -0.03em;
}
.app-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}
.app-shell .badge {
    padding: 7px 12px;
    border: 1px solid rgba(109, 40, 217, 0.14);
    background: #faf5ff;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}
.app-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.app-filter-pill {
    padding: 8px 12px;
    border: 1px solid rgba(231, 189, 184, 0.78);
    border-radius: 999px;
    background: #fff0ee;
    color: #6f4d49;
    font-size: 12px;
    font-weight: 700;
}
.app-filter-pill.is-active {
    background: #ffffff;
    color: #b90014;
    box-shadow: 0 8px 18px rgba(185, 0, 20, 0.08);
}
.app-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.app-stat-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.app-stat-card {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border: 1px solid rgba(109, 40, 217, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafe 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.app-stat-card .stat-card__value {
    line-height: 1;
    color: var(--accent);
    font-size: 34px;
    letter-spacing: -0.04em;
}
.app-stat-card .stat-card__label {
    display: block;
    line-height: 1.35;
    color: #3f3f46;
}
.app-empty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px dashed rgba(109, 40, 217, 0.18);
    border-radius: 16px;
    background: #fcfcff;
    color: var(--muted);
    font-size: 13.5px;
}
.app-empty-row__icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(109, 40, 217, 0.08);
    color: var(--accent);
}
.app-empty-row__icon svg {
    width: 16px;
    height: 16px;
}
.app-latest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.app-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.app-media-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(231, 189, 184, 0.78);
    border-radius: 18px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.app-media-card:hover {
    transform: translateY(-2px);
    border-color: rgba(185, 0, 20, 0.24);
    box-shadow: 0 18px 28px rgba(185, 0, 20, 0.08);
}
.app-media-card__cover {
    min-height: 188px;
    background: #fddbd7;
}
.app-media-card__cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.app-media-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    min-width: 0;
}
.app-media-card__eyebrow {
    color: #8e44ad;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.app-media-card__body strong {
    color: #291715;
    font-size: 19px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.app-media-card__body > span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.app-media-card__body small {
    margin-top: auto;
    color: #7a5551;
    font-size: 12px;
    font-weight: 600;
}
.app-latest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(109, 40, 217, 0.08);
    border-radius: 18px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.app-latest-item:hover {
    border-color: rgba(109, 40, 217, 0.24);
    background: #fcfaff;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(109, 40, 217, 0.08);
}
.app-latest-item__cover,
.app-result-item__cover {
    display: grid;
    place-items: center;
    width: 44px;
    height: 62px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: #f4f4f5;
}
.app-latest-item__cover img,
.app-result-item__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-latest-item__body,
.app-result-item__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}
.app-latest-item__body strong,
.app-result-item__body strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.app-latest-item__body span,
.app-result-item__body span {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.app-activity-list {
    display: grid;
    gap: 10px;
}
.app-activity-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}
.app-activity-item:hover {
    background: #fff3f1;
    transform: translateX(2px);
}
.app-activity-item__cover {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 14px;
    background: #fddbd7;
    color: #b90014;
    font-size: 13px;
    font-weight: 800;
}
.app-activity-item__cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.app-activity-item__body {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.app-activity-item__body strong {
    color: #291715;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.app-activity-item__body span,
.app-activity-item__body small {
    color: var(--muted);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}
.app-summary-list {
    display: grid;
    gap: 10px;
}
.app-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(231, 189, 184, 0.7);
}
.app-summary-row:last-child {
    border-bottom: 0;
}
.app-summary-row span {
    color: var(--muted);
    font-size: 13px;
}
.app-summary-row strong {
    color: #291715;
    font-size: 14px;
}
.app-summary-actions {
    margin-top: 18px;
}
.app-collection-fab {
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.app-collection-fab__button {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: var(--on-accent);
    box-shadow: 0 18px 42px rgba(109, 40, 217, 0.28);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.app-collection-fab__button:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-1px);
}
.app-collection-fab__button svg {
    width: 26px;
    height: 26px;
}
.app-collection-menu {
    display: flex;
    flex-direction: column;
    width: min(220px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.12);
}
.app-collection-menu[hidden] { display: none; }
.app-collection-menu button {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.app-collection-menu button:last-child { border-bottom: 0; }
.app-collection-menu button:hover:not(:disabled) {
    background: #faf5ff;
}
.app-collection-menu button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.66;
}
.has-app-modal {
    overflow: hidden;
    overscroll-behavior: contain;
}
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: -webkit-fill-available;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.app-modal[hidden] { display: none; }
.app-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 24, 27, 0.38);
}
.app-modal__panel {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100svh - 32px);
    max-height: min(760px, calc(100dvh - 32px));
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.16);
}
.app-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 14px;
}
.app-modal__head h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.03em;
}
.app-add-tabs {
    display: flex;
    gap: 8px;
    padding: 0 22px 16px;
}
.app-add-tabs button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f5f5f8;
    color: var(--label);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.app-add-tabs button.is-active {
    border-color: rgba(109, 40, 217, 0.16);
    background: #faf5ff;
    color: var(--accent);
}
.app-search-panel {
    padding: 0 22px 22px;
}
.app-search-panel[hidden] { display: none; }
.app-modal__status {
    min-height: 21px;
    margin: 10px 0 12px;
    color: var(--muted);
    font-size: 13px;
}
.app-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.app-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.app-result-item:hover:not(:disabled) {
    border-color: rgba(109, 40, 217, 0.22);
    background: #fcfaff;
}
.app-result-item:disabled {
    cursor: default;
    opacity: 0.9;
}
.app-result-item__body {
    flex: 1;
}
.app-result-item__action {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}
.app-result-item.is-added .app-result-item__action {
    color: #7dd3fc;
}
.app-scanner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #050507;
}
.app-scanner__reader,
.app-scanner__reader > div,
.app-scanner__reader [id$="__scan_region"] {
    width: 100%;
    height: 100%;
}
.app-scanner video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.app-scanner canvas {
    display: none;
}
.app-alert {
    margin: 0;
}
.app-settings-panel {
    width: min(760px, 100%);
}
.app-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 22px 22px;
}
.app-settings-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fcfcff;
}
.app-settings-card h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.app-settings-card .auth-form-grid {
    gap: 12px;
}
.app-settings-card .field-hint {
    margin: -6px 0 0;
}
.app-settings-card .btn-sm {
    align-self: flex-start;
}
.app-avatar-card {
    align-items: flex-start;
}
.app-cover-card {
    align-items: stretch;
}
.app-cover-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(35, 102, 135, 0.9), rgba(185, 0, 20, 0.74)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.13) 0 12px, rgba(255, 255, 255, 0.04) 12px 24px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.app-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-settings-page {
    gap: 24px;
}
.app-settings-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 26px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
}
.app-settings-hero .eyebrow {
    margin: 0 0 8px;
    color: #b90014;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.app-settings-hero h1 {
    margin: 0;
    color: #291715;
    font-family: "Hanken Grotesk", sans-serif;
    font-size: 36px;
    line-height: 42px;
}
.app-settings-hero p:last-child {
    max-width: 620px;
    margin: 6px 0 0;
    color: #5f5e5e;
    font-size: 15px;
    line-height: 1.5;
}
.app-settings-hero .btn-ghost {
    flex: 0 0 auto;
    background: #ffffff;
    color: #b90014;
    box-shadow: none;
}
.app-settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.app-settings-nav {
    position: sticky;
    top: calc(var(--admin-topbar-height) + 24px);
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #ffffff;
}
.app-settings-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #5f5e5e;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.app-settings-nav a:hover,
.app-settings-nav a:focus {
    background: #ffe2de;
    color: #291715;
    outline: none;
}
.app-settings-sections {
    display: grid;
    gap: 24px;
}
.app-settings-section {
    scroll-margin-top: calc(var(--admin-topbar-height) + 24px);
    display: grid;
    gap: 16px;
}
.app-settings-section__head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}
.app-settings-section__head h2 {
    margin: 0;
    color: #291715;
    font-family: "Hanken Grotesk", sans-serif;
    font-size: 24px;
    line-height: 30px;
}
.app-settings-section__head p {
    margin: 4px 0 0;
    color: #5f5e5e;
    font-size: 14px;
    line-height: 1.45;
}
.app-settings-page .app-settings-grid {
    padding: 0;
}
.app-settings-page .app-settings-grid--media {
    grid-template-columns: minmax(260px, 0.86fr) minmax(360px, 1.14fr);
}
.app-settings-page .app-settings-card {
    border-color: #e7bdb8;
    border-radius: 8px;
    background: #ffffff;
}
.app-settings-page .app-cover-preview {
    aspect-ratio: 16 / 7;
}
.field input[type="file"] {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--label);
    font-size: 13.5px;
    font-family: var(--font-ui);
}
.field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f5f5f8;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.app-shell .field > span,
.app-shell .field-hint,
.app-shell .consent-check {
    color: var(--label);
}
.app-shell .field input[type="text"],
.app-shell .field input[type="search"],
.app-shell .field input[type="email"],
.app-shell .field input[type="password"] {
    background: #ffffff;
    border-color: rgba(24, 24, 27, 0.1);
    color: var(--text);
}
.app-shell .field input:focus {
    border-color: rgba(109, 40, 217, 0.4);
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1);
}
.app-shell .consent-check__box {
    border-color: rgba(24, 24, 27, 0.16);
    background: #ffffff;
}
.app-shell .consent-check input:checked + .consent-check__box {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    border-color: transparent;
}
.app-shell .btn,
.app-shell .btn-sm {
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: #ffffff;
    box-shadow: 0 14px 26px rgba(109, 40, 217, 0.18);
}
.app-shell .btn:hover,
.app-shell .btn-sm:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
}
.app-shell .btn-ghost {
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}
.app-shell .btn-ghost:hover {
    background: #f5f5f8;
}

/* ---------- Scheda manga pubblica ---------- */
.manga-page {
    min-height: 100vh;
    background: #100e16;
    color: var(--text);
}
.manga-nav {
    position: relative;
    z-index: 2;
}
.manga-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #100e16 0%, #17131d 46%, #07131a 100%);
}
.manga-hero__banner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}
.manga-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(16, 14, 22, 0.98) 0%, rgba(16, 14, 22, 0.78) 48%, rgba(16, 14, 22, 0.95) 100%);
}
.manga-hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: end;
    gap: 30px;
    width: min(1160px, calc(100% - 40px));
    min-height: 360px;
    margin: 0 auto;
    padding: 42px 0 50px;
}
.manga-cover {
    display: grid;
    place-items: center;
    width: 210px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}
.manga-cover img,
.manga-volume__cover img,
.manga-extra__cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.manga-hero__copy h1 {
    max-width: 820px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 58px;
    line-height: 1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.manga-subtitle {
    margin: 14px 0 0;
    color: #c7c2ce;
    font-size: 18px;
    line-height: 1.5;
}
.manga-badges,
.manga-chips,
.manga-editions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.manga-badges {
    margin-top: 22px;
}
.manga-badges span,
.manga-chips span,
.manga-editions span,
.manga-version__labels span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--label);
    font-size: 12.5px;
    font-weight: 800;
}
.manga-owned-badge,
.manga-badges .manga-owned-badge,
.manga-version__labels .manga-owned-badge {
    border-color: rgba(52, 211, 153, 0.34);
    background: rgba(52, 211, 153, 0.14);
    color: #b9f3dd;
}
.manga-content {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 70px;
}
.manga-facts,
.manga-panel,
.manga-empty {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}
.manga-facts {
    align-self: start;
    position: sticky;
    top: 18px;
}
.manga-facts dl {
    margin: 0;
}
.manga-facts div {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.manga-facts div:last-child {
    border-bottom: 0;
}
.manga-facts dt,
.manga-volume__meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.manga-facts dd,
.manga-volume__meta dd {
    margin: 5px 0 0;
    color: var(--text);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.manga-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.manga-panel {
    padding: 24px;
}
.manga-description {
    margin: 0;
    color: #d8d3df;
    line-height: 1.78;
}
.manga-chip-groups {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}
.manga-chip-group h3 {
    margin: 0 0 9px;
    font-family: var(--font-display);
    font-size: 16px;
}
.manga-volume-list,
.manga-version-list {
    display: grid;
    gap: 12px;
}
.manga-volume,
.manga-version {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.manga-version.is-owned {
    border-color: rgba(52, 211, 153, 0.3);
}
.manga-volume__cover {
    width: 74px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}
.manga-volume__body {
    min-width: 0;
}
.manga-volume__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.manga-volume__head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.manga-volume__head span {
    flex: 0 0 auto;
    color: var(--accent-soft);
    font-family: var(--font-display);
    font-weight: 800;
}
.manga-volume__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 0;
}
.manga-editions {
    margin-top: 12px;
}
.manga-version__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.manga-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.manga-extra {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.manga-extra__cover {
    display: grid;
    place-items: center;
    width: 44px;
    height: 62px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}
.manga-extra__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}
.manga-extra__body strong {
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.manga-extra__body span {
    color: var(--muted);
    font-size: 12.5px;
}
.manga-empty {
    width: min(760px, calc(100% - 40px));
    margin: 80px auto;
    padding: 32px;
}
.manga-empty h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 36px;
}
.manga-empty p:last-child {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .home-topbar {
        height: auto;
    }
    .home-topbar__brand-group,
    .home-content,
    .home-hero,
    .home-footer__inner {
        grid-template-columns: 1fr;
    }
    .home-topbar__brand-group,
    .home-footer__inner {
        display: grid;
    }
    .home-topbar__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        height: auto;
        padding: 10px 0;
    }
    .home-brand {
        min-width: 0;
    }
    .home-brand__text {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .home-menu-toggle {
        display: inline-flex;
        flex: 0 0 42px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        height: 42px;
        min-height: 42px;
        border: 1px solid rgba(146, 110, 107, 0.22);
        border-radius: 12px;
        background: #fff0ee;
        color: #291715;
        cursor: pointer;
    }
    .home-menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: transform 180ms ease, opacity 180ms ease;
    }
    .home-menu-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .home-menu-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }
    .home-menu-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
    .home-topbar__menu {
        display: none !important;
        grid-column: 1 / -1;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 10px 0 4px;
    }
    .home-topbar__menu.is-open {
        display: flex !important;
    }
    .home-topbar__nav {
        display: flex;
        align-items: stretch;
        flex-direction: column !important;
        gap: 6px;
        width: 100%;
        overflow: visible;
        padding-bottom: 0;
    }
    .home-topbar__nav a,
    .home-topbar__nav span,
    .home-nav-dropdown__toggle {
        justify-content: space-between;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 12px;
        background: rgba(255, 240, 238, 0.78);
        font-size: 14px;
    }
    .home-topbar__nav a.is-active,
    .home-topbar__nav span.is-active,
    .home-nav-dropdown.is-active .home-nav-dropdown__toggle {
        background: #ffffff;
        box-shadow: inset 0 0 0 1px rgba(227, 27, 35, 0.26);
    }
    .home-nav-dropdown {
        display: grid;
        width: 100%;
        gap: 6px;
    }
    .home-nav-dropdown__toggle {
        width: 100%;
    }
    .home-nav-dropdown__menu {
        position: static;
        display: none;
        min-width: 0;
        width: 100%;
        padding: 0 0 0 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .home-nav-dropdown__menu::before {
        display: none;
    }
    .home-nav-dropdown:hover .home-nav-dropdown__menu,
    .home-nav-dropdown:focus-within .home-nav-dropdown__menu {
        display: none;
    }
    .home-nav-dropdown.is-open .home-nav-dropdown__menu {
        display: grid;
    }
    .home-topbar__nav .home-nav-dropdown__menu a {
        min-height: 40px;
        padding: 0 14px;
        background: rgba(255, 250, 247, 0.86);
        font-size: 13px;
    }
    .home-topbar__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }
    .home-search {
        width: auto;
    }
    .home-hero__lead h1 {
        font-size: 50px;
    }
    .home-news-grid,
    .home-streaming__grid {
        grid-template-columns: 1fr;
    }
    .project-hero__copy h1 {
        font-size: 52px;
    }
    .project-section__head h2 {
        font-size: 36px;
    }
    .project-nav {
        align-items: flex-start;
        flex-direction: column;
    }
    .project-nav__links {
        flex-wrap: wrap;
    }
    .project-hero,
    .project-section--split,
    .manga-content {
        grid-template-columns: 1fr;
    }
    .project-hero {
        min-height: auto;
        padding-top: 36px;
    }
    .project-feature-grid {
        grid-template-columns: 1fr;
    }
    .manga-hero__content {
        grid-template-columns: 150px minmax(0, 1fr);
        align-items: center;
        min-height: 300px;
    }
    .manga-cover {
        width: 150px;
    }
    .manga-hero__copy h1 {
        font-size: 42px;
    }
    .manga-facts {
        position: static;
    }
    .login-split { flex-direction: column; }
    .login-art { width: 100%; min-height: 220px; }
    .login-panel { min-height: auto; padding: 40px 24px; }
    .app-dashboard__grid,
    .app-dashboard-layout {
        grid-template-columns: 1fr;
    }
    .app-profile-hero {
        grid-template-columns: 1fr;
        justify-items: start;
    }
    .app-profile-hero__actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .search-results-table {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .home-shell,
    .home-topbar__inner,
    .home-footer__inner {
        width: min(1240px, calc(100% - 28px));
    }
    .home-topbar__nav,
    .home-hero__cta,
    .home-tablist,
    .home-footer__nav {
        width: 100%;
    }
    .home-topbar__nav,
    .home-footer__nav {
        justify-content: flex-start;
    }
    .home-search {
        flex: 1 1 auto;
        min-width: min(100%, 240px);
        width: auto;
    }
    .home-icon-button--primary {
        padding-right: 14px;
        padding-left: 14px;
    }
    .search-head h1 {
        font-size: 34px;
    }
    .search-results-table {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-section-head,
    .home-streaming__head {
        align-items: flex-start;
        flex-direction: column;
    }
    .home-streaming-card,
    .home-community-card,
    .home-ranking__item {
        grid-template-columns: 1fr;
    }
    .home-community-card__avatar,
    .home-ranking__badge {
        width: 48px;
        height: 48px;
    }
    .auth-form-grid { grid-template-columns: 1fr; }
    .admin-shell {
        display: block;
        min-height: 100vh;
        padding: 0;
    }
    .admin-topbar {
        position: sticky;
        top: 0;
        flex-wrap: wrap;
        min-height: auto;
        padding: 14px 18px;
    }
    .admin-topbar__user {
        width: 100%;
        justify-content: space-between;
    }
    .admin-sidebar {
        position: static;
        width: auto;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 18px;
    }
    .admin-menu {
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }
    .admin-menu__group {
        flex-direction: row;
        align-items: center;
    }
    .admin-menu__item--child {
        margin-left: 0;
        padding-left: 12px;
    }
    .admin-shell > :not(.admin-topbar):not(.admin-sidebar),
    .admin-shell > :not(.admin-topbar):not(.admin-sidebar):nth-child(3) {
        margin: 20px 18px;
    }
    .app-dashboard { gap: 14px; }
    .app-profile-hero {
        padding: 22px;
        border-radius: 20px;
    }
    .app-avatar--hero {
        width: 88px;
        height: 88px;
    }
    .app-profile-hero__content h1 { font-size: 28px; }
    .app-profile-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .app-panel {
        padding: 18px;
    }
    .app-welcome {
        padding: 24px 22px;
        border-radius: 20px;
    }
    .app-welcome h1 { font-size: 26px; }
    .app-stats-band { padding: 18px; }
    .app-section-head { flex-direction: column; }
    .app-stat-grid,
    .app-stat-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-latest-grid {
        grid-template-columns: 1fr;
    }
    .app-media-grid {
        grid-template-columns: 1fr;
    }
    .app-media-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .app-media-card__cover {
        min-height: 160px;
    }
    .manga-volume__meta,
    .manga-extra-grid {
        grid-template-columns: 1fr;
    }
    .app-settings-grid {
        grid-template-columns: 1fr;
    }
    .form-grid { grid-template-columns: 1fr; }
    .news-tag-form,
    .news-tag-row {
        grid-template-columns: 1fr;
    }
    .news-tag-form__actions,
    .news-tag-delete {
        align-items: stretch;
    }
    .news-tag-form__actions .btn,
    .news-tag-delete .btn,
    .news-tag-row .btn {
        width: 100%;
    }
    .detail-card { grid-template-columns: 1fr; }
    .detail-cover { max-width: 180px; }
    .detail-list { grid-template-columns: 1fr; }
    .dashboard-charts { grid-template-columns: 1fr; }
    .chart-card__head { flex-direction: column; }
}

@media (max-width: 460px) {
    .home-topbar__inner {
        width: calc(100% - 24px);
        padding: 8px 0 10px;
    }
    .home-brand__mark {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 13px;
    }
    .home-brand__text {
        font-size: 16px;
    }
    .home-topbar__actions {
        grid-template-columns: 1fr;
    }
    .home-hero__lead,
    .home-card,
    .home-news-card__body,
    .home-widget__head,
    .home-widget__body,
    .home-widget__item,
    .home-support,
    .home-streaming__grid,
    .home-community-card {
        padding-left: 18px;
        padding-right: 18px;
    }
    .home-hero__lead {
        min-height: auto;
        padding-top: 26px;
        padding-bottom: 26px;
    }
    .home-hero__lead h1 {
        font-size: 38px;
    }
    .home-topbar__actions,
    .home-hero__cta,
    .home-topbar__button,
    .home-cta {
        width: 100%;
    }
    .home-search,
    .home-icon-button--primary {
        width: 100%;
    }
    .home-icon-button--primary {
        min-height: 40px;
    }
    .home-search__suggestions {
        left: 0;
        right: auto;
        width: 100%;
    }
    .search-results-table {
        grid-template-columns: 1fr;
    }
    .search-result-cell {
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: none;
        align-items: center;
        min-height: 96px;
        gap: 12px;
    }
    .search-result__cover {
        width: 56px;
        height: 76px;
        aspect-ratio: auto;
    }
    .project-hero__copy h1 {
        font-size: 38px;
    }
    .project-section__head h2 {
        font-size: 30px;
    }
    .project-actions,
    .project-button {
        width: 100%;
    }
    .project-steps li {
        grid-template-columns: 1fr;
    }
    .manga-hero__content {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .manga-cover {
        width: 128px;
    }
    .manga-hero__copy h1 {
        font-size: 34px;
    }
    .manga-volume,
    .manga-version {
        grid-template-columns: 56px minmax(0, 1fr);
    }
    .manga-volume__cover {
        width: 56px;
    }
    .manga-volume__head {
        flex-direction: column;
        gap: 6px;
    }
    .app-userbar__identity { font-size: 12.5px; }
    .app-avatar--sm {
        width: 34px;
        height: 34px;
    }
    .app-stat-grid,
    .app-stat-grid--three {
        grid-template-columns: 1fr;
    }
    .app-profile-pills,
    .app-filter-pills {
        flex-direction: column;
    }
    .app-profile-pill {
        min-width: 0;
    }
    .app-modal {
        align-items: center;
        padding: 12px;
    }
    .app-modal__panel {
        max-height: calc(100dvh - 24px);
    }
    .app-result-item__action {
        align-self: flex-start;
    }
}

/* ---------- Dashboard utente: allineamento al template di riferimento ---------- */
.app-template-dashboard {
    --bg: #f5f5f5;
    --panel: #fff8f7;
    --surface: #ffe9e6;
    --border: #e7bdb8;
    --text: #291715;
    --muted: #5f5e5e;
    --label: #5d3f3c;
    --icon: #926e6b;
    --icon-strong: #5d3f3c;
    --accent: #b90014;
    --accent-soft: #e31b23;
    --accent-hover: #93000d;
    --on-accent: #ffffff;
    --admin-sidebar-width: 256px;
    --admin-topbar-height: 64px;
    font-family: "Inter", sans-serif;
    background: var(--bg);
}
.app-template-dashboard h1,
.app-template-dashboard h2,
.app-template-dashboard h3,
.app-template-dashboard .admin-brand__title,
.app-template-dashboard .btn {
    font-family: "Hanken Grotesk", sans-serif;
}
.app-template-dashboard.app-shell.admin-shell {
    padding-top: var(--admin-topbar-height);
    padding-left: var(--admin-sidebar-width);
}
.app-template-dashboard .app-topbar {
    min-height: var(--admin-topbar-height);
    padding: 0 24px;
    background: rgba(255, 248, 247, 0.92);
    border-color: rgba(231, 189, 184, 0.5);
}
.app-template-dashboard .admin-brand {
    gap: 0;
}
.app-template-dashboard .app-brand-mark {
    display: none;
}
.app-template-dashboard .admin-brand__title {
    color: #b90014;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.app-template-dashboard .app-avatar {
    border-color: #e31b23;
    background: #fddbd7;
    color: #b90014;
}
.app-template-dashboard .app-userbar__identity {
    color: #291715;
}
.app-template-dashboard .app-userbar__identity span {
    color: #5f5e5e;
}
.app-template-dashboard .app-icon-button {
    border-color: transparent;
    border-radius: 50%;
    background: transparent;
    color: #b90014;
}
.app-template-dashboard .app-icon-button:hover {
    border-color: transparent;
    background: #fff0ee;
    color: #93000d;
    box-shadow: none;
}
.app-template-dashboard .app-sidebar {
    top: var(--admin-topbar-height);
    width: var(--admin-sidebar-width);
    padding: 24px;
    background: #ffffff;
    border-color: rgba(231, 189, 184, 0.55);
}
.app-sidebar__intro {
    margin-bottom: 20px;
}
.app-sidebar__intro h2 {
    margin: 0;
    color: #b90014;
    font-size: 20px;
    font-weight: 700;
}
.app-sidebar__intro p {
    margin: 3px 0 0;
    color: #5f5e5e;
    font-size: 13px;
    line-height: 1.45;
}
.app-template-dashboard .app-sidebar .admin-menu {
    gap: 8px;
}
.app-template-dashboard .app-sidebar .admin-menu__item {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #5f5e5e;
    font-size: 14px;
    font-weight: 600;
}
.app-template-dashboard .app-sidebar .admin-menu__item.is-active {
    background: #e31b23;
    color: #ffffff;
}
.app-template-dashboard .app-sidebar .admin-menu__item:not(.is-active):hover {
    background: #ffe2de;
    color: #291715;
    transform: translateX(2px);
}
.app-template-dashboard > .app-dashboard,
.app-template-dashboard > .app-dashboard:nth-child(3) {
    width: min(1280px, calc(100% - 48px));
    max-width: 1280px;
    margin: 32px auto 48px;
    padding: 0;
    gap: 40px;
}
.app-template-dashboard .app-profile-hero {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    padding: 24px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
    box-shadow: none;
}
.app-template-dashboard .app-avatar--hero {
    width: 96px;
    height: 96px;
    border: 4px solid #e31b23;
    box-shadow: none;
    font-size: 26px;
}
.app-template-dashboard .app-profile-hero__content h1 {
    color: #291715;
    font-size: 32px;
    line-height: 40px;
    letter-spacing: 0;
}
.app-template-dashboard .app-profile-hero__meta {
    margin: 2px 0 0;
    color: #5f5e5e;
    font-size: 14px;
    font-style: italic;
    font-weight: 400;
}
.app-template-dashboard .app-profile-pills {
    gap: 16px;
    margin-top: 16px;
}
.app-template-dashboard .app-profile-pill {
    display: block;
    min-width: 118px;
    padding: 8px 16px;
    border: 1px solid rgba(231, 189, 184, 0.35);
    border-radius: 8px;
    background: #fff0ee;
}
.app-template-dashboard .app-profile-pill span {
    display: block;
    color: #b90014;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.app-template-dashboard .app-profile-pill strong {
    display: block;
    margin-top: 1px;
    color: #291715;
    font-family: "Hanken Grotesk", sans-serif;
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 0;
}
.app-template-dashboard .app-profile-hero__actions {
    min-width: 190px;
    gap: 8px;
}
.app-template-dashboard .app-profile-hero__actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px 24px;
    border: 0;
    border-radius: 8px;
    background: #b90014;
    color: #ffffff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 700;
}
.app-template-dashboard .app-profile-hero__actions .btn svg {
    width: 16px;
    height: 16px;
}
.app-template-dashboard .app-profile-hero__actions .btn-ghost {
    background: #fddbd7;
    color: #5d3f3c;
}
.app-template-dashboard .app-dashboard-layout {
    grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr);
    gap: 24px;
}
.app-template-dashboard .app-dashboard-main,
.app-template-dashboard .app-dashboard-side {
    gap: 40px;
}
.app-template-dashboard .app-library-section {
    min-width: 0;
}
.app-template-dashboard .app-section-head {
    align-items: center;
    margin-bottom: 16px;
}
.app-template-dashboard .app-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-template-dashboard .app-section-title__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #337ab7;
}
.app-template-dashboard .app-library-section--manga .app-section-title__icon {
    color: #8e44ad;
}
.app-template-dashboard .app-library-section--community .app-section-title__icon {
    color: #b90014;
}
.app-template-dashboard .app-section-title__icon svg {
    width: 30px;
    height: 30px;
}
.app-template-dashboard .app-section-head h2 {
    margin: 0;
    color: #291715;
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: capitalize;
}
.app-template-dashboard .app-filter-pills {
    gap: 0;
    margin: 0;
    padding: 4px;
    border-radius: 8px;
    background: #ffe9e6;
}
.app-template-dashboard .app-filter-pill {
    padding: 6px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #5f5e5e;
    font-size: 12px;
    line-height: 20px;
}
.app-template-dashboard .app-filter-pill.is-active {
    background: #fff8f7;
    color: #b90014;
    box-shadow: 0 1px 3px rgba(41, 23, 21, 0.1);
}
.app-template-dashboard .app-media-grid {
    gap: 16px;
}
.app-template-dashboard .app-community-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.app-template-dashboard .app-community-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 82px;
    padding: 12px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.app-template-dashboard .app-community-item:hover {
    border-color: #b90014;
    background: #fff0ee;
    box-shadow: 0 4px 12px rgba(41, 23, 21, 0.05);
}
.app-template-dashboard .app-community-item__avatar,
.app-template-dashboard .app-community-item__cover {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #fddbd7;
    color: #b90014;
    font-weight: 800;
}
.app-template-dashboard .app-community-item__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
.app-template-dashboard .app-community-item__cover {
    width: 54px;
    height: 54px;
    border-radius: 7px;
}
.app-template-dashboard .app-community-item__avatar img,
.app-template-dashboard .app-community-item__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-template-dashboard .app-community-item__body {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.app-template-dashboard .app-community-item__body > span {
    display: -webkit-box;
    overflow: hidden;
    color: #291715;
    font-size: 14px;
    line-height: 20px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.app-template-dashboard .app-community-item__body strong {
    color: #b90014;
    font-weight: 800;
}
.app-template-dashboard .app-community-item__body small {
    overflow: hidden;
    color: #5f5e5e;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-template-dashboard .app-media-card {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 0;
    min-height: 178px;
    overflow: hidden;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
    box-shadow: none;
}
.app-template-dashboard .app-media-card__link {
    display: flex;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.app-template-dashboard .app-media-card:hover {
    transform: none;
    border-color: #b90014;
    box-shadow: 0 4px 12px rgba(41, 23, 21, 0.05);
}
.app-template-dashboard .app-favorite-button {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #9f8582;
    box-shadow: 0 8px 18px rgba(41, 23, 21, 0.12);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.app-template-dashboard .app-favorite-button:hover,
.app-template-dashboard .app-favorite-button:focus-visible {
    color: #b90014;
    transform: translateY(-1px);
}
.app-template-dashboard .app-favorite-button.is-favorite {
    background: #b90014;
    color: #ffffff;
}
.app-template-dashboard .app-favorite-button:disabled {
    cursor: wait;
    opacity: 0.7;
}
.app-template-dashboard .app-media-card__cover {
    position: relative;
    display: block;
    flex: 0 0 178px;
    width: 178px;
    min-height: 178px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fddbd7;
}
.app-template-dashboard .app-media-card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.app-template-dashboard .app-media-card:hover .app-media-card__cover img {
    transform: scale(1.04);
}
.app-template-dashboard .app-media-card__tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(142, 68, 173, 0.92);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.app-template-dashboard .app-media-card__body {
    display: flex;
    flex: 1;
    gap: 7px;
    min-width: 0;
    padding: 16px 16px 14px;
}
.app-template-dashboard .app-media-card__body strong {
    color: #291715;
    font-family: "Hanken Grotesk", sans-serif;
    font-size: 20px;
    line-height: 28px;
}
.app-template-dashboard .app-media-card__body > span:not(.app-media-card__action) {
    color: #5f5e5e;
    font-size: 12px;
}
.app-template-dashboard .app-media-card__body small {
    margin: 2px 0 0;
    color: #5f5e5e;
    font-size: 12px;
    font-weight: 500;
}
.app-template-dashboard .app-media-card__action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: auto;
    color: #b90014;
    font-size: 12px;
    font-weight: 800;
}
.app-template-dashboard .app-empty-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 118px;
    padding: 20px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
    color: #5f5e5e;
    font-size: 14px;
}
.app-template-dashboard .app-empty-row__icon {
    border-radius: 50%;
    background: #ffe9e6;
    color: #b90014;
}
.app-template-dashboard .app-panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #fff8f7;
    box-shadow: none;
}
.app-template-dashboard .app-widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 16px;
    border-bottom: 1px solid #e7bdb8;
}
.app-template-dashboard .app-widget-head h2 {
    margin: 0;
    color: #291715;
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}
.app-template-dashboard .app-widget-head__icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: #b90014;
}
.app-template-dashboard .app-widget-head__icon svg {
    width: 22px;
    height: 22px;
}
.app-template-dashboard .app-widget-head--stats {
    border-bottom: 0;
    padding-bottom: 4px;
}
.app-template-dashboard .app-widget-head--stats .app-widget-head__icon {
    color: #ff5722;
}
.app-template-dashboard .app-panel--objectives .app-widget-head {
    padding: 18px 20px 8px;
}
.app-template-dashboard .app-panel--objectives .app-objective-summary {
    gap: 14px;
    margin: 0;
    padding: 12px 20px 20px;
}
.app-template-dashboard .app-panel--objectives .app-profile-pill {
    padding: 12px 16px;
}
.app-template-dashboard .app-activity-list {
    gap: 0;
}
.app-template-dashboard .app-activity-item {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(231, 189, 184, 0.3);
    border-radius: 0;
}
.app-template-dashboard .app-activity-item:last-child {
    border-bottom: 0;
}
.app-template-dashboard .app-activity-item:hover {
    background: #fff0ee;
    transform: none;
}
.app-template-dashboard .app-activity-item__cover {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.app-template-dashboard .app-activity-item__body {
    gap: 5px;
}
.app-template-dashboard .app-activity-item__body > span {
    color: #291715;
    font-size: 14px;
    line-height: 20px;
}
.app-template-dashboard .app-activity-item__body strong {
    color: #b90014;
    font-size: inherit;
}
.app-template-dashboard .app-activity-item__body small {
    color: #5f5e5e;
    font-size: 12px;
    font-style: italic;
}
.app-template-dashboard .app-panel > .app-empty-row {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.app-template-dashboard .app-collection-stats {
    display: grid;
    gap: 18px;
    padding: 16px;
}
.app-template-dashboard .app-collection-stat > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #5f5e5e;
    font-size: 14px;
}
.app-template-dashboard .app-collection-stat strong {
    color: #291715;
}
.app-template-dashboard .app-collection-stat__track {
    display: block;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #ffe9e6;
}
.app-template-dashboard .app-collection-stat__track > span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: #ff5722;
}
.app-template-dashboard .app-collection-stat--2 .app-collection-stat__track > span {
    background: #8e44ad;
}
.app-template-dashboard .app-collection-stat--3 .app-collection-stat__track > span {
    background: #337ab7;
}
.app-template-dashboard .app-collection-stat--4 .app-collection-stat__track > span {
    background: #16a085;
}
.app-template-dashboard .app-collection-fab__button {
    background: #b90014;
    box-shadow: 0 18px 42px rgba(185, 0, 20, 0.26);
}
.app-template-dashboard .app-collection-fab__button:hover {
    background: #93000d;
}

/* ---------- Public user profile ---------- */
.public-profile-page {
    min-height: 100vh;
    background: #fff8f7;
    color: #291715;
}

.public-profile-hero,
.public-profile-content {
    width: min(1180px, calc(100% - 48px));
    margin-right: auto;
    margin-left: auto;
}

.public-profile-hero {
    margin-top: 28px;
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.public-profile-cover {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 250px;
    padding: 22px 24px;
    background:
        linear-gradient(135deg, rgba(35, 102, 135, 0.9), rgba(185, 0, 20, 0.74)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.13) 0 12px, rgba(255, 255, 255, 0.04) 12px 24px);
}

.public-profile-cover.has-image {
    padding: 0;
    background: #291715;
}

.public-profile-cover img {
    width: 100%;
    min-height: 250px;
    object-fit: cover;
}

.public-profile-cover span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.86);
    color: #5d3f3c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.public-profile-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 22px;
    padding: 24px 24px 24px;
}

.public-profile-avatar {
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    overflow: hidden;
    border: 5px solid #ffffff;
    border-radius: 999px;
    background: #fddbd7;
    color: #b90014;
    font-family: "Hanken Grotesk", sans-serif;
    font-size: 34px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(41, 23, 21, 0.12);
}

.public-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-profile-identity__main {
    min-width: 0;
    padding-top: 18px;
}

.public-profile-identity__main h1 {
    margin: 2px 0 10px;
    color: #291715;
    font-family: var(--font-display);
    font-size: 34px;
    line-height: 42px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.public-profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.public-profile-stats span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(231, 189, 184, 0.8);
    border-radius: 8px;
    background: #fff8f7;
    color: #5f5e5e;
    font-size: 13px;
    font-weight: 700;
}

.public-profile-stats strong {
    color: #291715;
    font-size: 18px;
}

.public-profile-follow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 126px;
    min-height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: #b90014;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.public-profile-follow:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.public-profile-content {
    display: grid;
    gap: 34px;
    padding: 34px 0 56px;
}

.public-profile-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.public-profile-section__head h2 {
    margin: 0;
    color: #291715;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 36px;
}

.public-profile-section__head span {
    color: #b90014;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.public-profile-placeholder-list,
.public-profile-media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.public-profile-placeholder-card,
.public-profile-media-card,
.public-profile-empty {
    border: 1px solid #e7bdb8;
    border-radius: 8px;
    background: #ffffff;
}

.public-profile-placeholder-card {
    min-height: 230px;
    padding: 14px;
}

.public-profile-placeholder-card > span {
    display: block;
    height: 150px;
    margin-bottom: 14px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(51, 122, 183, 0.28), rgba(142, 68, 173, 0.24)),
        #fff0ee;
}

.public-profile-placeholder-card strong,
.public-profile-placeholder-card small {
    display: block;
}

.public-profile-placeholder-card strong {
    color: #291715;
    font-size: 16px;
}

.public-profile-placeholder-card small {
    margin-top: 3px;
    color: #5f5e5e;
    font-size: 12px;
    font-weight: 700;
}

.public-profile-media-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.public-profile-media-card:hover {
    border-color: #b90014;
    transform: translateY(-2px);
}

.public-profile-media-card__cover {
    display: block;
    aspect-ratio: 3 / 4;
    background: #fddbd7;
}

.public-profile-media-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-profile-media-card__body {
    display: grid;
    gap: 4px;
    padding: 13px 14px 15px;
}

.public-profile-media-card__body strong {
    color: #291715;
    font-size: 16px;
    line-height: 22px;
}

.public-profile-media-card__body span {
    color: #5f5e5e;
    font-size: 12px;
    font-weight: 700;
}

.public-profile-empty {
    display: grid;
    gap: 4px;
    padding: 22px;
    color: #5f5e5e;
}

.public-profile-empty strong {
    color: #291715;
}

@media (max-width: 1080px) {
    .public-profile-placeholder-list,
    .public-profile-media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-template-dashboard .app-profile-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .app-template-dashboard .app-profile-hero__actions {
        grid-column: 1 / -1;
        width: 100%;
        flex-direction: row;
    }
    .app-template-dashboard .app-dashboard-layout {
        grid-template-columns: 1fr;
    }
    .app-template-dashboard .app-dashboard-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-settings-layout,
    .app-settings-page .app-settings-grid--media {
        grid-template-columns: 1fr;
    }
    .app-settings-nav {
        position: static;
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .app-settings-nav::-webkit-scrollbar {
        display: none;
    }
    .app-settings-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .public-profile-hero,
    .public-profile-content {
        width: auto;
        margin-right: 14px;
        margin-left: 14px;
    }
    .public-profile-hero {
        margin-top: 16px;
    }
    .public-profile-cover {
        min-height: 170px;
        padding: 16px;
    }
    .public-profile-cover.has-image {
        padding: 0;
    }
    .public-profile-cover img {
        min-height: 170px;
    }
    .public-profile-identity {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
        padding: 18px 16px 18px;
        text-align: center;
    }
    .public-profile-avatar {
        width: 104px;
        height: 104px;
        font-size: 28px;
    }
    .public-profile-identity__main {
        padding-top: 0;
    }
    .public-profile-identity__main h1 {
        font-size: 28px;
        line-height: 34px;
    }
    .public-profile-stats {
        justify-content: center;
    }
    .public-profile-follow {
        width: 100%;
    }
    .public-profile-content {
        padding-top: 24px;
        padding-bottom: 36px;
    }
    .public-profile-placeholder-list,
    .public-profile-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .public-profile-section__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .app-template-dashboard.app-shell.admin-shell {
        padding: 0;
    }
    .app-template-dashboard .app-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        padding: 10px 14px;
    }
    .app-template-dashboard .admin-brand {
        min-width: 0;
    }
    .app-template-dashboard .admin-brand__title {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 22px;
        line-height: 28px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-template-dashboard .app-userbar {
        width: auto;
        justify-content: flex-end;
        gap: 6px;
    }
    .app-template-dashboard .app-userbar form {
        flex: 0 0 auto;
    }
    .app-template-dashboard .app-avatar {
        width: 34px;
        height: 34px;
    }
    .app-template-dashboard .app-icon-button {
        width: 36px;
        height: 36px;
    }
    .app-template-dashboard .app-sidebar {
        position: sticky;
        top: var(--admin-topbar-height);
        bottom: auto;
        z-index: 25;
        width: auto;
        padding: 8px 14px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(18px);
    }
    .app-template-dashboard .app-sidebar__intro {
        display: none;
    }
    .app-template-dashboard .app-sidebar .admin-menu {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .app-template-dashboard .app-sidebar .admin-menu::-webkit-scrollbar {
        display: none;
    }
    .app-template-dashboard .app-sidebar .admin-menu__item {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 9px 12px;
        white-space: nowrap;
    }
    .app-template-dashboard .app-sidebar .admin-menu__item:not(.is-active):hover {
        transform: none;
    }
    .app-template-dashboard > .app-dashboard,
    .app-template-dashboard > .app-dashboard:nth-child(3) {
        width: auto;
        margin: 16px 14px calc(34px + env(safe-area-inset-bottom));
        gap: 24px;
    }
    .app-template-dashboard .app-profile-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
        padding: 18px;
        text-align: center;
    }
    .app-template-dashboard .app-avatar--hero {
        width: 84px;
        height: 84px;
        font-size: 23px;
    }
    .app-template-dashboard .app-profile-hero__content {
        width: 100%;
        min-width: 0;
    }
    .app-template-dashboard .app-profile-hero__content h1 {
        font-size: 28px;
        line-height: 34px;
        overflow-wrap: anywhere;
    }
    .app-template-dashboard .app-profile-pills {
        justify-content: center;
        gap: 10px;
    }
    .app-template-dashboard .app-profile-hero__actions {
        grid-column: auto;
        width: 100%;
        flex-direction: column;
        min-width: 0;
    }
    .app-template-dashboard .app-profile-hero__actions .btn {
        min-height: 44px;
    }
    .app-template-dashboard .app-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .app-template-dashboard .app-filter-pills {
        width: 100%;
        overflow-x: auto;
        flex-direction: row;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .app-template-dashboard .app-filter-pills::-webkit-scrollbar {
        display: none;
    }
    .app-template-dashboard .app-filter-pill {
        flex: 0 0 auto;
    }
    .app-template-dashboard .app-media-card {
        display: flex;
    }
    .app-template-dashboard .app-media-card__cover {
        flex-basis: 132px;
        width: 132px;
        min-height: 156px;
        aspect-ratio: 2 / 3;
    }
    .app-template-dashboard .app-media-card__body {
        padding: 14px;
    }
    .app-template-dashboard .app-media-card__body strong {
        font-size: 18px;
        line-height: 24px;
    }
    .app-template-dashboard .app-dashboard-side {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .app-template-dashboard .app-modal {
        align-items: center;
        justify-content: center;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .app-template-dashboard .app-modal__panel {
        width: min(680px, 100%);
        max-height: calc(100dvh - 24px);
        border: 1px solid var(--border);
        border-radius: 18px;
    }
    .app-template-dashboard .app-modal__head {
        position: sticky;
        top: 0;
        z-index: 1;
        align-items: center;
        padding: 16px 16px 12px;
        background: var(--panel);
    }
    .app-template-dashboard .app-add-tabs,
    .app-template-dashboard .app-search-panel,
    .app-template-dashboard .app-settings-grid {
        padding-right: 16px;
        padding-left: 16px;
    }
    .app-template-dashboard .app-settings-card {
        padding: 16px;
    }
    .app-template-dashboard .app-collection-fab {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
    }
    .app-template-dashboard .app-toast-stack {
        right: 12px;
        bottom: calc(86px + env(safe-area-inset-bottom));
        left: 12px;
    }
    .app-template-dashboard .app-objective-toast {
        width: 100%;
    }
    .app-settings-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
        padding: 18px;
    }
    .app-settings-hero h1 {
        font-size: 30px;
        line-height: 36px;
    }
    .app-settings-layout {
        gap: 16px;
    }
    .app-settings-nav {
        position: sticky;
        top: calc(var(--admin-topbar-height) + 56px);
        z-index: 15;
        margin-right: -14px;
        margin-left: -14px;
        padding: 8px 14px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }
    .app-settings-section {
        scroll-margin-top: calc(var(--admin-topbar-height) + 112px);
    }
    .app-settings-section__head h2 {
        font-size: 22px;
        line-height: 28px;
    }
    .app-settings-page .app-settings-grid {
        padding-right: 0;
        padding-left: 0;
    }
    .app-settings-page .auth-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .public-profile-placeholder-list,
    .public-profile-media-grid {
        grid-template-columns: 1fr;
    }
    .public-profile-placeholder-card {
        min-height: 0;
    }
    .public-profile-placeholder-card > span {
        height: 120px;
    }
    .public-profile-media-card {
        flex-direction: row;
        min-height: 132px;
    }
    .public-profile-media-card__cover {
        flex: 0 0 96px;
        aspect-ratio: auto;
    }

    .app-template-dashboard .app-userbar__identity {
        display: none;
    }
    .app-template-dashboard .app-profile-pills {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-template-dashboard .app-profile-pill {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        text-align: left;
    }
    .app-template-dashboard .app-profile-pill span {
        font-size: 10px;
        line-height: 15px;
    }
    .app-template-dashboard .app-profile-pill strong {
        font-size: 19px;
        line-height: 25px;
    }
    .app-template-dashboard .app-section-head h2 {
        font-size: 26px;
        line-height: 32px;
    }
    .app-template-dashboard .app-section-title__icon {
        width: 28px;
        height: 28px;
    }
    .app-template-dashboard .app-section-title__icon svg {
        width: 26px;
        height: 26px;
    }
    .app-template-dashboard .app-media-card {
        min-height: 132px;
    }
    .app-template-dashboard .app-media-card__cover {
        flex-basis: 96px;
        width: 96px;
        min-height: 132px;
    }
    .app-template-dashboard .app-media-card__tag {
        top: 6px;
        right: 6px;
        max-width: calc(100% - 12px);
        overflow: hidden;
        padding: 3px 6px;
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-template-dashboard .app-media-card__body {
        gap: 5px;
        padding: 12px;
    }
    .app-template-dashboard .app-media-card__body strong {
        font-size: 16px;
        line-height: 21px;
    }
    .app-template-dashboard .app-media-card__action {
        justify-content: flex-start;
    }
    .app-template-dashboard .app-widget-head {
        min-height: 52px;
        padding: 13px 14px;
    }
    .app-template-dashboard .app-community-preview {
        grid-template-columns: 1fr;
    }
    .app-template-dashboard .app-activity-item {
        padding: 14px;
    }
    .app-template-dashboard .app-collection-stats {
        gap: 14px;
        padding: 14px;
    }
    .app-template-dashboard .app-modal__head h2 {
        font-size: 22px;
        line-height: 28px;
    }
    .app-template-dashboard .app-result-item {
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    .app-template-dashboard .app-result-item__action {
        padding-top: 2px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .app-template-dashboard .admin-brand__title {
        font-size: 19px;
    }
    .app-template-dashboard .app-sidebar .admin-menu__item {
        padding-right: 10px;
        padding-left: 10px;
        font-size: 13px;
    }
    .app-template-dashboard .app-profile-pills {
        grid-template-columns: 1fr;
    }
    .app-template-dashboard .app-media-card__cover {
        flex-basis: 84px;
        width: 84px;
    }
}
