:root {
    --red: #ed1c24;
    --red-hover: #d9141c;
    --red-soft: #fff1f2;
    --red-pale: #fff8f8;
    --black: #101114;
    --charcoal: #202126;
    --ink: #17181c;
    --muted: #6f717a;
    --muted-2: #9698a0;
    --line: #e7e8ec;
    --line-strong: #d8d9df;
    --paper: #ffffff;
    --canvas: #f5f6f8;
    --success: #177245;
    --success-soft: #ecf8f1;
    --warning: #9a6700;
    --warning-soft: #fff7e5;
    --danger: #c71920;
    --info: #315981;
    --shadow-xs: 0 1px 2px rgba(16, 17, 20, .04);
    --shadow-sm: 0 8px 24px rgba(16, 17, 20, .06);
    --shadow: 0 18px 55px rgba(16, 17, 20, .09);
    --shadow-lg: 0 28px 80px rgba(16, 17, 20, .14);
    --radius-xs: 9px;
    --radius-sm: 13px;
    --radius: 18px;
    --radius-lg: 26px;
    --sidebar: 260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { display: block; }
.icon { flex: 0 0 auto; }
[hidden] { display: none !important; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    padding: 20px 14px 16px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.sidebar-overlay { display: none; }
.brand-wrap {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 7px 18px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    width: 47px;
    height: 47px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 4px;
    border: 1px solid #ededf0;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand strong { display: block; color: var(--black); font-size: 15px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }

.main-nav { display: grid; gap: 5px; }
.main-nav a {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding: 0 13px;
    border-radius: 12px;
    color: #5f6169;
    font-size: 13px;
    font-weight: 750;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.main-nav a:hover { color: var(--black); background: #f5f5f7; transform: translateX(1px); }
.main-nav a.active { color: var(--red); background: var(--red-soft); }
.main-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 21px;
    border-radius: 0 4px 4px 0;
    background: var(--red);
}
.nav-label { margin: 22px 12px 7px; color: #a1a2aa; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.nav-count {
    min-width: 22px;
    height: 20px;
    margin-left: auto;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
}
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; padding-top: 20px; }
.install-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px dashed #efb8bb;
    border-radius: 12px;
    color: var(--red);
    background: var(--red-pale);
    font-weight: 800;
}
.mini-profile {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 33px;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafafa;
}
.mini-profile strong, .mini-profile small { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; }
.mini-profile strong { font-size: 11px; }
.mini-profile small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.mini-profile > a { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 9px; }
.mini-profile > a:hover { color: var(--red); background: var(--red-soft); }

.main-area { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px clamp(20px, 3.1vw, 42px);
    border-bottom: 1px solid rgba(231, 232, 236, .88);
    background: rgba(255, 255, 255, .91);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.topbar-title { min-width: 0; margin-right: auto; }
.topbar-title span { display: block; font-size: 17px; font-weight: 900; letter-spacing: -.025em; }
.topbar-title small { display: block; max-width: 420px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #5d5f67;
    background: #fff;
    box-shadow: var(--shadow-xs);
}
.icon-button:hover { color: var(--red); border-color: #efc1c4; background: var(--red-pale); }
.notice-button { position: relative; }
.notice-button > span {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
}
.avatar {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #fff;
    background: var(--black);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .02em;
}
.mobile-only, .mobile-dock { display: none; }
.content { width: min(100% - 48px, 1260px); margin: 0 auto; padding: 32px 0 64px; flex: 1; }
.app-footer { padding: 18px 28px 28px; color: var(--muted-2); font-size: 10px; text-align: center; }

/* Common */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.page-head p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-xs);
}
.card-pad { padding: 24px; }
.card-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-header h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 20px; }
.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--red);
    border-radius: 12px;
    color: #fff;
    background: var(--red);
    box-shadow: 0 8px 18px rgba(237, 28, 36, .16);
    font-size: 12px;
    font-weight: 850;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); background: var(--red-hover); border-color: var(--red-hover); box-shadow: 0 12px 24px rgba(237, 28, 36, .21); }
.button.secondary { color: var(--black); background: #fff; border-color: var(--line-strong); box-shadow: none; }
.button.secondary:hover { color: var(--red); border-color: #edb5b8; background: var(--red-pale); }
.button.black { color: #fff; border-color: var(--black); background: var(--black); box-shadow: 0 8px 18px rgba(16,17,20,.15); }
.button.black:hover { background: #24252a; }
.button.ghost { color: var(--red); border-color: transparent; background: transparent; box-shadow: none; }
.button.ghost:hover { background: var(--red-soft); }
.button.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.button.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 10px; }
.button.block { width: 100%; }
.inline-form { display: inline-flex; }

.badge {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #585a63;
    background: #f2f2f4;
    font-size: 9px;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
}
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.black { color: #fff; background: var(--black); }
.badge.outline { color: #666871; background: #fff; border: 1px solid var(--line); }
.badge.green { color: var(--success); background: var(--success-soft); }
.badge.amber { color: var(--warning); background: var(--warning-soft); }

.alert { position: relative; margin: 0 0 16px; padding: 13px 42px 13px 15px; border: 1px solid; border-radius: 13px; font-size: 12px; }
.alert button { position: absolute; top: 7px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; font-size: 19px; }
.alert-success { color: #175f3c; border-color: #bce3cd; background: var(--success-soft); }
.alert-danger { color: #8d161b; border-color: #efc0c2; background: #fff0f1; }
.alert-warning { color: #785100; border-color: #eedcae; background: var(--warning-soft); }
.alert-info { color: #31546f; border-color: #cadce8; background: #f1f7fb; }

/* Dashboard */
.hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 26px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--black);
    box-shadow: var(--shadow);
}
.hero-card::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    right: -100px;
    top: -115px;
    border-radius: 50%;
    border: 48px solid rgba(237,28,36,.92);
    opacity: .85;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.04; letter-spacing: -.05em; }
.hero-card p { max-width: 670px; margin: 10px 0 21px; color: #c6c7cb; font-size: 13px; }
.hero-search {
    max-width: 700px;
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
}
.hero-search input { min-width: 0; flex: 1; height: 44px; padding: 0 13px; color: #fff; border: 0; outline: 0; background: transparent; }
.hero-search input::placeholder { color: #a9aab0; }
.hero-search .button { min-height: 42px; color: var(--black); border-color: #fff; background: #fff; box-shadow: none; }
.hero-card > .button.secondary { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-card > .button.secondary:hover { border-color: #fff; background: #fff; color: var(--black); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 18px 0; }
.stat-card {
    min-height: 128px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.stat-card:hover { transform: translateY(-2px); border-color: #eab8bb; box-shadow: var(--shadow-sm); }
.stat-icon, .song-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--red);
    background: var(--red-soft);
}
.stat-card small { margin-top: 17px; color: var(--muted); font-size: 10px; font-weight: 750; }
.stat-card strong { margin-top: 1px; color: var(--black); font-size: 27px; letter-spacing: -.04em; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.song-list { display: grid; }
.song-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line);
    transition: background .16s ease;
}
.song-row:last-child { border-bottom: 0; }
.song-row:hover { background: #fafafa; }
.song-row h3 { margin: 0; overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.song-meta { min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 9px; }
.song-meta a:hover { color: var(--red); }
.row-arrow { color: #a1a2a9; font-size: 21px; text-align: center; }
.notice-list { display: grid; gap: 10px; }
.card-body .notice-list { gap: 9px; }
.notice-card {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.notice-card.unread { border-color: #efc0c2; background: var(--red-pale); }
.notice-card.unread::before { content: ""; position: absolute; top: 16px; right: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.notice-card h3 { margin: 0; padding-right: 16px; font-size: 12px; }
.notice-card p { margin: 5px 0 8px; color: var(--muted); font-size: 10px; white-space: pre-line; }
.notice-card footer { color: var(--muted-2); font-size: 8px; font-weight: 750; }
.empty-state { display: grid; justify-items: center; padding: 48px 20px; text-align: center; }
.empty-state h3 { margin: 13px 0 4px; font-size: 14px; }
.empty-state p { max-width: 390px; margin: 0 0 16px; color: var(--muted); font-size: 11px; }

/* Song library */
.filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 160px 160px 190px auto;
    align-items: center;
    gap: 9px;
    padding: 11px;
    margin-bottom: 14px;
}
.filter-bar-3 { grid-template-columns: minmax(260px, 1fr) 190px auto; }
.search-wrap { position: relative; min-width: 0; }
.search-wrap .icon { position: absolute; top: 50%; left: 13px; color: var(--muted-2); transform: translateY(-50%); }
.search-wrap input { padding-left: 42px; }
.input, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
    width: 100%;
    min-height: 43px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: 0;
    color: var(--ink);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 150px; padding-top: 12px; padding-bottom: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #e78f94; box-shadow: 0 0 0 4px rgba(237,28,36,.08); }
input:disabled, select:disabled { color: #a2a3aa; background: #f4f4f6; }
.library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 9px;
}
.library-head strong { color: var(--black); font-size: 11px; }
.compact-song-list { display: grid; }
.compact-song-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    border-bottom: 1px solid var(--line);
    transition: background .16s ease;
}
.compact-song-row:last-child { border-bottom: 0; }
.compact-song-row:hover { background: #fafafa; }
.compact-song-row .song-icon { width: 36px; height: 36px; border-radius: 11px; }
.compact-song-main { min-width: 0; }
.compact-song-title-line { min-width: 0; display: flex; align-items: center; gap: 8px; }
.compact-song-title-line h3 { min-width: 0; margin: 0; overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.compact-song-summary { min-width: 0; margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.compact-song-meta { min-width: 0; display: flex; align-items: center; gap: 6px; margin-top: 4px; overflow: hidden; color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.mobile-song-type, .mobile-song-divider { display: none; }
.compact-song-meta a { color: #5c5e66; font-weight: 800; }
.compact-song-meta a:hover { color: var(--red); }
.compact-song-action { min-width: 112px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span { min-width: 35px; height: 35px; display: grid; place-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 10px; font-weight: 850; }
.pagination a:hover { color: var(--red); border-color: #efb6b9; }
.pagination span[aria-current] { color: #fff; border-color: var(--red); background: var(--red); }
.pagination .ellipsis { border: 0; background: transparent; color: var(--muted); }

/* Song detail */
.song-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.song-detail h1 { margin: 0 0 9px; font-size: clamp(29px, 4vw, 48px); line-height: 1.05; letter-spacing: -.05em; }
.song-detail h3 { margin: 22px 0 10px; font-size: 13px; }
.audio-player { width: 100%; height: 44px; }
.lyrics { padding: 20px; border: 1px solid var(--line); border-radius: 14px; color: #2c2d31; background: #fafafa; font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.detail-list { display: grid; }
.detail-item { display: grid; gap: 3px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-item:first-child { padding-top: 0; }
.detail-item:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-item small { color: var(--muted-2); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.detail-item strong { overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.detail-item a:hover { color: var(--red); }

/* Forms and profile */
.form-card { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin: 0 0 7px; color: #3f4046; font-size: 10px; font-weight: 850; }
.hint { color: var(--muted); font-size: 9px; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.file-box { padding: 14px; border: 1px dashed #d6d7dc; border-radius: 12px; background: #fafafa; }
.file-box input { width: 100%; }
.check-row { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 11px; }
.check-row input { margin-top: 2px; accent-color: var(--red); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.check-card { min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.check-card:has(input:checked) { border-color: #ecaaae; background: var(--red-pale); }
.check-card input { margin-top: 2px; accent-color: var(--red); }
.check-card strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.profile-header { display: grid; grid-template-columns: 78px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 24px; }
.profile-header .avatar { width: 78px; height: 78px; border-radius: 22px; font-size: 19px; }
.profile-header h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.profile-header p { margin: 4px 0 11px; color: var(--muted); font-size: 11px; }
.profile-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Admin */
.admin-tabs { display: flex; gap: 6px; margin: -5px 0 18px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0 13px; border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 800; }
.admin-tabs a.active { color: #fff; background: var(--black); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #fafafa; font-size: 8px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfc; }
.table-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.table-actions select, .table-actions input { min-height: 35px; width: auto; min-width: 120px; font-size: 9px; }

/* Public and auth */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.public-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(18px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.public-header nav { display: flex; align-items: center; gap: 14px; font-size: 11px; font-weight: 800; }
.public-footer { margin-top: auto; padding: 25px; color: var(--muted); background: #fafafa; font-size: 10px; text-align: center; }
.landing { flex: 1; background: radial-gradient(circle at 85% 15%, rgba(237,28,36,.08), transparent 30%), #fff; }
.landing-hero { width: min(100% - 40px, 1180px); min-height: calc(100vh - 130px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr); align-items: center; gap: 70px; padding: 70px 0; }
.eyebrow { display: inline-flex; align-items: center; min-height: 29px; padding: 0 11px; border: 1px solid #f0c3c5; border-radius: 999px; color: var(--red); background: var(--red-pale); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.landing h1 { max-width: 720px; margin: 18px 0; font-size: clamp(44px, 7vw, 78px); line-height: .98; letter-spacing: -.065em; }
.landing h1 span { color: var(--red); }
.landing-copy > p { max-width: 650px; margin: 0 0 25px; color: var(--muted); font-size: 15px; }
.landing-actions, .feature-pills { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.feature-pills { margin-top: 25px; }
.feature-pills span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #64666e; background: #fff; font-size: 9px; font-weight: 750; }
.hero-visual { position: relative; padding: 24px; border: 1px solid #f0d9da; border-radius: 32px; background: var(--red-soft); }
.hero-visual::before { content: ""; position: absolute; inset: 34px -18px -18px 34px; border-radius: 30px; background: var(--black); z-index: 0; }
.mock-app { position: relative; z-index: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: #fff; box-shadow: var(--shadow-lg); }
.mock-top { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.mock-song { display: grid; gap: 9px; padding: 14px; }
.mock-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.mock-row strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mock-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.auth-wrap { min-height: calc(100vh - 124px); display: grid; place-items: center; padding: 40px 16px 60px; background: radial-gradient(circle at 80% 8%, rgba(237,28,36,.08), transparent 28%), var(--canvas); }
.auth-card { width: min(100%, 510px); padding: 30px; border: 1px solid var(--line); border-radius: 23px; background: #fff; box-shadow: var(--shadow); }
.auth-card.wide { width: min(100%, 760px); }
.auth-card h1 { margin: 0 0 6px; font-size: 29px; letter-spacing: -.045em; }
.auth-card > p { margin: 0 0 23px; color: var(--muted); font-size: 12px; }
.auth-footer { margin-top: 18px; color: var(--muted); font-size: 10px; text-align: center; }
.auth-footer a { color: var(--red); font-weight: 850; }

/* Responsive */
@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .song-detail { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: minmax(240px, 1fr) 1fr 1fr; }
    .filter-bar .search-wrap { grid-column: 1 / -1; }
    .filter-bar .button { width: 100%; }
}

@media (max-width: 900px) {
    .sidebar { width: min(86vw, 300px); transform: translateX(-104%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(16,17,20,.22); }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(16,17,20,.48); backdrop-filter: blur(2px); }
    body.menu-open .sidebar-overlay { display: block; }
    .main-area { margin-left: 0; }
    .mobile-only { display: inline-grid; }
    .topbar { min-height: 64px; padding: 8px 13px; }
    .content { width: min(100% - 24px, 1260px); padding: 22px 0 104px; }
    .app-footer { padding-bottom: 96px; }
    .mobile-dock {
        position: fixed;
        left: 9px;
        right: 9px;
        bottom: max(9px, env(safe-area-inset-bottom));
        z-index: 45;
        min-height: 65px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        padding: 5px;
        border: 1px solid rgba(220,221,226,.95);
        border-radius: 20px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 18px 46px rgba(16,17,20,.19);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .mobile-dock a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border-radius: 14px; color: #7b7d85; font-size: 8px; font-weight: 850; }
    .mobile-dock a.active { color: var(--red); background: var(--red-soft); }
    .mobile-dock .dock-add { margin: 0 3px; color: #fff; background: var(--red); box-shadow: 0 8px 18px rgba(237,28,36,.25); }
    .mobile-dock .dock-add.active { color: #fff; background: var(--red); }
    .dock-count { position: absolute; top: 2px; right: calc(50% - 19px); min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--red); font-size: 7px; font-style: normal; }
    .landing-hero { grid-template-columns: 1fr; gap: 54px; padding: 55px 0 80px; }
    .landing-copy { text-align: center; }
    .landing-copy > p { margin-left: auto; margin-right: auto; }
    .landing-actions, .feature-pills { justify-content: center; }
    .hero-visual { width: min(100%, 570px); margin: 0 auto; }
    .grid-equal { grid-template-columns: 1fr; }
    .filter-bar-3 { grid-template-columns: 1fr 1fr; }
    .filter-bar-3 .search-wrap { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
    body { font-size: 13px; }
    .public-header { min-height: 66px; padding: 10px 13px; }
    .public-header nav { gap: 7px; }
    .public-header nav > a:first-child { display: none; }
    .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
    .brand strong { font-size: 13px; }
    .topbar .avatar { display: none; }
    .topbar-title span { font-size: 14px; }
    .topbar-title small { max-width: 170px; font-size: 9px; }
    .icon-button { width: 38px; height: 38px; border-radius: 11px; }
    .content { width: min(100% - 18px, 1260px); padding-top: 16px; }
    .page-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
    .page-head h1 { font-size: 27px; }
    .page-head p { margin-top: 5px; font-size: 11px; }
    .page-actions { width: 100%; }
    .page-actions .button { flex: 1; min-width: 0; }
    .card { border-radius: 16px; }
    .card-pad { padding: 17px 15px; }
    .card-header { min-height: 66px; align-items: flex-start; padding: 15px; }
    .card-header h2 { font-size: 14px; }
    .card-header p { font-size: 9px; }
    .card-body { padding: 15px; }
    .hero-card { grid-template-columns: 1fr; gap: 17px; padding: 24px 19px; border-radius: 21px; }
    .hero-card::after { width: 190px; height: 190px; right: -95px; top: -95px; border-width: 34px; }
    .hero-card h1 { font-size: 29px; }
    .hero-card p { max-width: 90%; margin: 8px 0 18px; font-size: 11px; }
    .hero-search { flex-direction: column; gap: 7px; padding: 0; border: 0; background: transparent; }
    .hero-search input { min-height: 43px; padding: 0 12px; border-radius: 11px; color: var(--black); background: #fff; }
    .hero-search input::placeholder { color: #8a8c93; }
    .hero-search .button, .hero-card > .button.secondary { width: 100%; }
    .stats-grid { gap: 9px; margin: 12px 0; }
    .stat-card { min-height: 111px; padding: 14px; border-radius: 15px; }
    .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
    .stat-card small { margin-top: 13px; font-size: 8px; }
    .stat-card strong { font-size: 23px; }
    .song-row { grid-template-columns: 37px minmax(0,1fr); gap: 10px; padding: 11px 14px; }
    .song-row .song-icon { width: 36px; height: 36px; border-radius: 10px; }
    .song-row h3 { font-size: 11px; }
    .song-row .row-arrow { display: none; }
    .song-meta { gap: 5px; font-size: 8px; }
    .filter-bar, .filter-bar-3 { grid-template-columns: 1fr 1fr; gap: 7px; padding: 8px; }
    .filter-bar .search-wrap, .filter-bar-3 .search-wrap { grid-column: 1 / -1; }
    .filter-bar .button, .filter-bar-3 .button { grid-column: 1 / -1; min-height: 39px; }
    .filter-bar select { min-width: 0; font-size: 10px; padding: 0 8px; }
    .library-head { align-items: flex-start; flex-direction: column; gap: 2px; padding: 10px 12px; }
    .compact-song-row { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 9px; padding: 10px 11px; }
    .compact-song-row .song-icon { width: 33px; height: 33px; border-radius: 10px; }
    .compact-song-title-line { gap: 5px; }
    .compact-song-title-line h3 { font-size: 11px; }
    .compact-song-title-line .badge { display: none; }
    .compact-song-summary { display: none; }
    .compact-song-meta { margin-top: 3px; font-size: 7.5px; }
    .mobile-song-type, .mobile-song-divider { display: inline; }
    .mobile-song-type { color: var(--red); font-weight: 850; }
    .compact-song-meta span:nth-of-type(n+5) { display: none; }
    .compact-song-action { min-width: 34px; width: 34px; height: 34px; padding: 0; border-radius: 10px; font-size: 0; }
    .compact-song-action .icon { width: 15px; height: 15px; }
    .song-detail h1 { font-size: 31px; }
    .lyrics { padding: 15px; font-size: 12px; line-height: 1.75; }
    .form-grid, .check-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .profile-header { grid-template-columns: 62px minmax(0,1fr); gap: 12px; padding: 17px 14px; }
    .profile-header .avatar { width: 62px; height: 62px; border-radius: 18px; font-size: 15px; }
    .profile-header h1 { font-size: 21px; }
    .profile-header > .button { grid-column: 1 / -1; width: 100%; }
    .notice-card { grid-template-columns: 34px minmax(0,1fr); padding: 12px; }
    .notice-card .song-icon { width: 34px; height: 34px; }
    .auth-wrap { padding: 22px 9px 42px; }
    .auth-card { padding: 21px 15px; border-radius: 18px; }
    .auth-card h1 { font-size: 25px; }
    .landing-hero { width: min(100% - 28px, 1180px); padding-top: 42px; }
    .landing h1 { font-size: 43px; }
    .landing-copy > p { font-size: 13px; }
    .hero-visual { padding: 14px; border-radius: 23px; }
    .hero-visual::before { inset: 26px -9px -10px 26px; border-radius: 22px; }
    .mock-row .badge { display: none; }
    .admin-tabs { margin-bottom: 13px; }
    .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
    .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
    .table-wrap thead { display: none; }
    .table-wrap tbody { display: grid; gap: 10px; }
    .table-wrap tr { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-xs); }
    .table-wrap td { position: relative; min-height: 39px; padding: 10px 12px 10px 42%; border-bottom: 1px solid var(--line); font-size: 9px; }
    .table-wrap td:last-child { border-bottom: 0; }
    .table-wrap td::before { content: attr(data-label); position: absolute; left: 12px; top: 11px; width: 35%; overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
    .table-actions { align-items: stretch; flex-direction: column; }
    .table-actions select, .table-actions input, .table-actions .button { width: 100% !important; min-width: 0 !important; }
}

@media (max-width: 390px) {
    .topbar-title small { max-width: 125px; }
    .stats-grid { gap: 7px; }
    .stat-card { padding: 12px; }
    .filter-bar, .filter-bar-3 { grid-template-columns: 1fr; }
    .filter-bar .search-wrap, .filter-bar .button, .filter-bar-3 .search-wrap, .filter-bar-3 .button { grid-column: auto; }
    .mobile-dock { left: 6px; right: 6px; bottom: max(6px, env(safe-area-inset-bottom)); }
    .mobile-dock a { font-size: 7px; }
}

/* ========================================================================== 
   LFC Choir v4 — premium public welcome and landing-slide administration
   ========================================================================== */
.signin-note {
    margin-top: 15px;
    padding: 12px 13px;
    border: 1px solid #f1d5d6;
    border-radius: 12px;
    color: #676970;
    background: #fff8f8;
    font-size: 10px;
    line-height: 1.55;
}
.button.tiny { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 9px; }
.button.danger-outline { color: var(--danger); border-color: #f0c5c7; background: #fff; box-shadow: none; }
.button.danger-outline:hover { color: #fff; border-color: var(--danger); background: var(--danger); box-shadow: none; }
.public-install-link { border: 0; color: var(--red); background: transparent; font-size: 11px; font-weight: 850; }

.landing-page { background: #fff; }
.landing-page .public-shell { background: #fff; }
.landing-page .public-header {
    position: relative;
    z-index: 30;
    min-height: 84px;
    border-bottom-color: rgba(231,232,236,.75);
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.landing-page .public-header .brand-mark { border-color: #f0f0f2; box-shadow: 0 8px 24px rgba(16,17,20,.06); }
.landing-page .public-header nav > a:not(.button) { color: #53555d; }
.landing-page .public-header nav > a:not(.button):hover { color: var(--red); }

.welcome-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 72px) clamp(52px, 7vw, 96px);
    background:
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,255,255,.93)),
        radial-gradient(circle at 15% 20%, rgba(237,28,36,.13), transparent 33%);
}
.welcome-hero::before {
    content: "";
    position: absolute;
    inset: auto -18vw -36vw auto;
    width: 72vw;
    height: 72vw;
    z-index: -2;
    border: 1px solid rgba(237,28,36,.1);
    border-radius: 50%;
}
.welcome-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e6e7eb 18%, #e6e7eb 82%, transparent);
}
.welcome-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(3px); pointer-events: none; }
.welcome-glow-one { top: 7%; right: 4%; width: 250px; height: 250px; background: rgba(237,28,36,.09); }
.welcome-glow-two { left: -90px; bottom: 8%; width: 190px; height: 190px; background: rgba(16,17,20,.045); }
.welcome-hero-inner {
    width: min(100%, 1280px);
    min-height: min(720px, calc(100vh - 156px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .82fr);
    align-items: center;
    gap: clamp(45px, 7vw, 100px);
}
.welcome-copy-stage { min-width: 0; }
.welcome-brand-note {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px 11px;
    border: 1px solid #efeff2;
    border-radius: 999px;
    color: #5f6168;
    background: rgba(255,255,255,.78);
    box-shadow: 0 8px 22px rgba(16,17,20,.04);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}
.welcome-brand-note .icon { color: var(--red); }
.welcome-copy-slide { display: none; }
.welcome-copy-slide.active { display: block; animation: welcomeCopyIn .55s ease both; }
@keyframes welcomeCopyIn { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
.welcome-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid #f1c9cb;
    border-radius: 999px;
    color: var(--red);
    background: #fff7f7;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.welcome-copy-slide h1 {
    max-width: 820px;
    margin: 18px 0 20px;
    color: #111216;
    font-size: clamp(48px, 6.4vw, 84px);
    line-height: .98;
    letter-spacing: -.066em;
}
.welcome-copy-slide p {
    max-width: 680px;
    margin: 0;
    color: #65676f;
    font-size: clamp(14px, 1.35vw, 18px);
    line-height: 1.72;
}
.welcome-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 29px; }
.welcome-primary { min-height: 49px; gap: 10px; padding: 0 19px; border-radius: 14px; }
.welcome-secondary { min-height: 49px; padding: 0 18px; color: #1d1e22; border-color: #dedfe4; background: #fff; box-shadow: 0 7px 18px rgba(16,17,20,.04); }
.welcome-secondary:hover { color: var(--red); border-color: #efbfc1; background: #fff8f8; }
.welcome-proof {
    max-width: 680px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: clamp(34px, 5vw, 58px);
    padding-top: 24px;
    border-top: 1px solid #e8e9ed;
}
.welcome-proof > div { min-width: 0; padding-right: 18px; }
.welcome-proof > div + div { padding-left: 18px; border-left: 1px solid #e8e9ed; }
.welcome-proof strong { display: block; overflow: hidden; color: #17181c; font-size: clamp(19px, 2vw, 27px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.welcome-proof span { display: block; margin-top: 3px; color: #83858d; font-size: 9px; font-weight: 700; }

.founder-slider { min-width: 0; }
.founder-frame {
    position: relative;
    width: min(100%, 535px);
    aspect-ratio: 4 / 5;
    margin: 0 auto;
    overflow: hidden;
    border: 8px solid #fff;
    border-radius: clamp(24px, 3vw, 38px);
    background: #16171b;
    box-shadow: 0 34px 90px rgba(16,17,20,.2), 0 0 0 1px rgba(16,17,20,.08);
}
.founder-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: inherit;
    pointer-events: none;
}
.founder-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transform: scale(1.035); transition: opacity .65s ease, transform 1.2s ease; }
.founder-slide.active { opacity: 1; transform: scale(1); }
.founder-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.founder-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(8,9,12,.06) 30%, rgba(8,9,12,.78) 100%); pointer-events: none; }
.founder-badge {
    position: absolute;
    top: 19px;
    left: 19px;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 999px;
    color: #fff;
    background: rgba(13,14,18,.38);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.founder-badge span { width: 7px; height: 7px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,.22); }
.founder-caption { position: absolute; left: 25px; right: 90px; bottom: 24px; z-index: 6; color: #fff; }
.founder-caption span { display: block; color: #ff6b70; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.founder-caption strong { display: block; margin-top: 5px; font-size: clamp(16px, 2vw, 23px); letter-spacing: -.025em; }
.slider-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 8;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 13px;
    color: #fff;
    background: rgba(15,16,20,.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background .2s ease, transform .2s ease;
}
.slider-arrow:hover { background: var(--red); transform: translateY(-1px); }
.slider-prev { right: 68px; }
.slider-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.slider-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: #d1d2d7; transition: width .25s ease, background .25s ease; }
.slider-dots button.active { width: 28px; background: var(--red); }

.welcome-strip {
    width: min(calc(100% - 36px), 1180px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: -1px auto 0;
    border-left: 1px solid #e8e9ed;
    border-right: 1px solid #e8e9ed;
    background: #fff;
}
.welcome-strip > div { position: relative; min-height: 125px; display: grid; align-content: center; padding: 25px 28px 25px 68px; }
.welcome-strip > div + div { border-left: 1px solid #e8e9ed; }
.welcome-strip span { position: absolute; left: 27px; top: 30px; color: var(--red); font-size: 10px; font-weight: 900; }
.welcome-strip strong { font-size: 15px; letter-spacing: -.02em; }
.welcome-strip small { margin-top: 5px; color: #7c7e86; font-size: 9px; line-height: 1.5; }

.welcome-section { width: min(calc(100% - 40px), 1180px); margin: 0 auto; padding: clamp(76px, 9vw, 126px) 0; }
.welcome-section-head { max-width: 780px; margin-bottom: 42px; }
.welcome-section-head > span, .welcome-cta > div > span { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.welcome-section-head h2, .workflow-copy h2, .welcome-cta h2 { margin: 12px 0 15px; color: #131418; font-size: clamp(34px, 4.5vw, 58px); line-height: 1.05; letter-spacing: -.055em; }
.welcome-section-head p, .workflow-copy > p { max-width: 690px; margin: 0; color: #6d6f77; font-size: 13px; line-height: 1.75; }
.welcome-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.welcome-feature-card { min-height: 365px; display: flex; flex-direction: column; padding: 29px; border: 1px solid #e7e8ec; border-radius: 24px; background: #fff; box-shadow: 0 16px 45px rgba(16,17,20,.045); }
.welcome-feature-card.feature-red { border-color: #f2c9cb; background: linear-gradient(145deg, #fff, #fff5f5); }
.welcome-feature-card.feature-dark { color: #fff; border-color: #17181c; background: #17181c; box-shadow: 0 25px 60px rgba(16,17,20,.16); }
.welcome-feature-icon { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: auto; border: 1px solid #ededf0; border-radius: 15px; color: var(--red); background: #fff; box-shadow: 0 8px 24px rgba(16,17,20,.06); }
.feature-dark .welcome-feature-icon { color: #fff; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.08); box-shadow: none; }
.welcome-feature-card small { margin-top: 36px; color: var(--red); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.feature-dark small { color: #ff676c; }
.welcome-feature-card h3 { margin: 11px 0 12px; font-size: 23px; line-height: 1.18; letter-spacing: -.035em; }
.welcome-feature-card p { margin: 0; color: #74767e; font-size: 11px; line-height: 1.7; }
.feature-dark p { color: #b9bac0; }

.welcome-workflow {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(430px, 1fr);
    align-items: start;
    gap: clamp(55px, 8vw, 110px);
    border-top: 1px solid #e6e7eb;
}
.workflow-copy { position: sticky; top: 120px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 25px; color: var(--red); font-size: 11px; font-weight: 900; }
.workflow-list { display: grid; }
.workflow-list article { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; padding: 29px 0; border-bottom: 1px solid #e7e8ec; }
.workflow-list article:first-child { padding-top: 0; }
.workflow-list article > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #f0c5c7; border-radius: 13px; color: var(--red); background: #fff7f7; font-size: 12px; font-weight: 900; }
.workflow-list strong { display: block; font-size: 18px; letter-spacing: -.025em; }
.workflow-list p { margin: 7px 0 0; color: #74767e; font-size: 11px; line-height: 1.7; }

.welcome-cta {
    width: min(calc(100% - 40px), 1180px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 35px;
    margin: 0 auto clamp(40px, 6vw, 76px);
    padding: clamp(38px, 6vw, 68px);
    overflow: hidden;
    border-radius: 30px;
    color: #fff;
    background: linear-gradient(130deg, #15161a 0%, #202126 72%, #ed1c24 160%);
    box-shadow: 0 30px 75px rgba(16,17,20,.2);
}
.welcome-cta h2 { max-width: 760px; margin-bottom: 0; color: #fff; }
.welcome-cta .welcome-actions { flex: 0 0 auto; margin-top: 0; }
.welcome-cta .welcome-secondary { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); box-shadow: none; }
.welcome-cta .welcome-secondary:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.14); }

.landing-page .public-footer { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 30px clamp(20px, 5vw, 72px); color: #85878f; border-top: 1px solid #e7e8ec; background: #fafafa; text-align: left; }
.landing-page .public-footer strong { display: block; color: #1b1c20; font-size: 14px; }
.landing-page .public-footer span { display: block; margin-top: 4px; font-size: 9px; }
.landing-page .public-footer small { font-size: 9px; }

.slide-admin-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); gap: 18px; align-items: start; }
.slide-editor { position: sticky; top: 88px; }
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 22px; color: var(--muted); font-size: 10px; }
.slide-edit-preview { width: 100%; aspect-ratio: 16 / 8; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #f3f4f6; }
.slide-edit-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.admin-slide-list { display: grid; }
.admin-slide-item { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.admin-slide-item:last-child { border-bottom: 0; }
.admin-slide-item > img { width: 128px; height: 142px; object-fit: cover; object-position: center top; border-radius: 14px; background: #f2f3f5; }
.admin-slide-copy { min-width: 0; }
.admin-slide-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.admin-slide-title strong { min-width: 0; font-size: 12px; line-height: 1.4; }
.admin-slide-copy > small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; font-weight: 750; }
.admin-slide-copy > p { margin: 9px 0 13px; color: var(--muted); font-size: 9px; line-height: 1.55; }

@media (max-width: 1050px) {
    .welcome-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(330px, .8fr); gap: 45px; }
    .welcome-copy-slide h1 { font-size: clamp(45px, 6vw, 68px); }
    .welcome-feature-card { min-height: 330px; padding: 24px; }
    .slide-admin-grid { grid-template-columns: 1fr; }
    .slide-editor { position: static; }
}

@media (max-width: 820px) {
    .landing-page .public-header { min-height: 72px; }
    .welcome-hero { padding-top: 34px; }
    .welcome-hero-inner { min-height: auto; grid-template-columns: 1fr; gap: 42px; }
    .welcome-copy-stage { text-align: center; }
    .welcome-brand-note, .welcome-eyebrow { margin-left: auto; margin-right: auto; }
    .welcome-copy-slide p { margin-left: auto; margin-right: auto; }
    .welcome-actions { justify-content: center; }
    .welcome-proof { margin-left: auto; margin-right: auto; text-align: left; }
    .founder-frame { width: min(100%, 490px); }
    .welcome-strip { grid-template-columns: 1fr; }
    .welcome-strip > div + div { border-top: 1px solid #e8e9ed; border-left: 0; }
    .welcome-strip > div { min-height: 108px; }
    .welcome-feature-grid { grid-template-columns: 1fr; }
    .welcome-feature-card { min-height: 285px; }
    .welcome-workflow { grid-template-columns: 1fr; gap: 45px; }
    .workflow-copy { position: static; }
    .welcome-cta { align-items: flex-start; flex-direction: column; }
    .welcome-cta .welcome-actions { width: 100%; }
}

@media (max-width: 650px) {
    .landing-page .public-header { min-height: 66px; }
    .landing-page .public-header nav > a:first-of-type { display: inline-flex; }
    .landing-page .public-header .brand small { display: none; }
    .landing-page .public-header nav { gap: 5px; }
    .landing-page .public-header nav > a:not(.button), .public-install-link { font-size: 9px; }
    .landing-page .public-header .button.small { min-height: 33px; padding: 0 10px; }
    .welcome-hero { padding: 26px 14px 57px; }
    .welcome-brand-note { margin-bottom: 19px; font-size: 8px; }
    .welcome-copy-slide h1 { margin: 15px 0; font-size: clamp(39px, 12vw, 54px); line-height: 1.01; }
    .welcome-copy-slide p { font-size: 12px; line-height: 1.67; }
    .welcome-actions { align-items: stretch; flex-direction: column; margin-top: 23px; }
    .welcome-actions .button { width: 100%; }
    .welcome-proof { grid-template-columns: 1fr; gap: 0; margin-top: 31px; padding-top: 0; border-top: 0; text-align: center; }
    .welcome-proof > div { padding: 13px 0; border-top: 1px solid #e8e9ed; }
    .welcome-proof > div + div { padding-left: 0; border-left: 0; }
    .welcome-proof strong { font-size: 21px; }
    .founder-frame { width: min(100%, 430px); border-width: 6px; border-radius: 25px; }
    .founder-badge { top: 13px; left: 13px; padding: 7px 9px; font-size: 7px; }
    .founder-caption { left: 18px; right: 82px; bottom: 17px; }
    .founder-caption strong { font-size: 15px; }
    .slider-arrow { right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 11px; }
    .slider-prev { right: 56px; }
    .welcome-strip { width: min(calc(100% - 24px), 1180px); }
    .welcome-strip > div { min-height: 102px; padding: 21px 18px 21px 55px; }
    .welcome-strip span { left: 18px; top: 24px; }
    .welcome-section { width: min(calc(100% - 28px), 1180px); padding: 72px 0; }
    .welcome-section-head { margin-bottom: 27px; text-align: center; }
    .welcome-section-head h2, .workflow-copy h2, .welcome-cta h2 { font-size: 34px; }
    .welcome-section-head p, .workflow-copy > p { font-size: 11px; }
    .welcome-feature-card { min-height: 285px; padding: 22px; border-radius: 20px; }
    .welcome-feature-card h3 { font-size: 21px; }
    .workflow-copy { text-align: center; }
    .workflow-copy .welcome-eyebrow { margin-left: auto; margin-right: auto; }
    .text-link { justify-content: center; }
    .workflow-list article { grid-template-columns: 40px minmax(0, 1fr); gap: 13px; padding: 22px 0; }
    .workflow-list article > span { width: 38px; height: 38px; }
    .workflow-list strong { font-size: 15px; }
    .workflow-list p { font-size: 10px; }
    .welcome-cta { width: min(calc(100% - 28px), 1180px); margin-bottom: 28px; padding: 31px 22px; border-radius: 23px; text-align: center; }
    .welcome-cta .welcome-actions { align-items: stretch; }
    .landing-page .public-footer { min-height: 140px; align-items: flex-start; flex-direction: column; gap: 14px; padding: 28px 18px; text-align: center; }
    .landing-page .public-footer > * { width: 100%; }
    .admin-slide-item { grid-template-columns: 92px minmax(0, 1fr); gap: 11px; padding: 12px; }
    .admin-slide-item > img { width: 92px; height: 114px; border-radius: 11px; }
    .admin-slide-title { align-items: flex-start; flex-direction: column; }
    .admin-slide-copy > p { display: none; }
    .admin-slide-copy .table-actions { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-copy-slide.active { animation: none; }
    .founder-slide { transition: opacity .2s ease; transform: none; }
}

/* V5 loading states and progress */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 22px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(247, 247, 249, .88);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
    transition: opacity .18s ease, visibility .18s ease;
}
.page-loader.is-visible { opacity: 1; visibility: visible; pointer-events: all; }
.page-loader-card {
    width: min(100%, 320px);
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 29px 27px 25px;
    border: 1px solid rgba(225, 226, 231, .95);
    border-radius: 23px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 90px rgba(16, 17, 20, .17);
    text-align: center;
}
.page-loader-logo {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    animation: loader-pulse 1.5s ease-in-out infinite;
}
.page-loader-logo img { width: 100%; height: 100%; object-fit: contain; }
.page-loader-card strong { font-size: 15px; letter-spacing: -.025em; }
.page-loader-card > span:not(.page-loader-logo) { margin-top: 5px; color: var(--muted); font-size: 10px; }
.loader-track { width: 100%; height: 7px; position: relative; margin-top: 20px; overflow: hidden; border-radius: 999px; background: #f0f1f3; }
.loader-track i { position: absolute; inset: 0 auto 0 0; width: 36%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff6b70); animation: loader-sweep 1.15s ease-in-out infinite; }
.page-loader.has-progress .loader-track i { animation: none; transition: width .18s ease; }
.page-loader-card small { min-height: 15px; margin-top: 8px; color: var(--red); font-size: 9px; font-weight: 900; }
@keyframes loader-sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
@keyframes loader-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.button.is-busy { cursor: wait; opacity: .82; }
.button.is-busy::after { content: ""; width: 14px; height: 14px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .7s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }

/* Photo gallery */
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gallery-search-form { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(170px, .35fr) auto auto; gap: 9px; }
.search-field { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }
.search-field:focus-within { border-color: #ef9da1; box-shadow: 0 0 0 4px rgba(237,28,36,.07); }
.search-field .icon { color: var(--muted-2); }
.search-field input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; }
.gallery-result-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.gallery-result-count strong { color: var(--black); font-size: 15px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.gallery-card {
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: inherit;
    background: #fff;
    box-shadow: var(--shadow-xs);
    text-align: left;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.gallery-card:hover { transform: translateY(-3px); border-color: #e3b0b3; box-shadow: 0 18px 42px rgba(16,17,20,.1); }
.gallery-image-wrap { aspect-ratio: 4 / 3; display: block; overflow: hidden; background: #eceef1; }
.gallery-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-card:hover .gallery-image-wrap img { transform: scale(1.025); }
.gallery-card-copy { min-height: 92px; display: flex; align-items: flex-start; flex-direction: column; padding: 14px 15px 15px; }
.gallery-card-copy strong { width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-card-copy small { width: 100%; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-card-copy em { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; color: var(--red); font-size: 8px; font-style: normal; font-weight: 800; }
.gallery-empty { margin-top: 0; padding: 70px 20px; }

body.lightbox-open { overflow: hidden; }
.gallery-lightbox { position: fixed; inset: 0; z-index: 9998; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 44px 24px 24px; color: #fff; background: rgba(8, 9, 11, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.gallery-lightbox-stage { min-height: 0; display: grid; place-items: center; }
.gallery-lightbox-stage img { max-width: min(100%, 1280px); max-height: calc(100vh - 185px); object-fit: contain; border-radius: 13px; box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.gallery-lightbox-close { position: absolute; top: 17px; right: 17px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; color: #fff; background: rgba(255,255,255,.1); }
.gallery-lightbox-copy { width: min(100%, 850px); margin: 18px auto 0; text-align: center; }
.gallery-lightbox-copy strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.gallery-lightbox-copy p { max-width: 720px; margin: 7px auto 0; color: #d0d1d5; font-size: 11px; line-height: 1.65; }
.gallery-lightbox-copy small { display: block; margin-top: 8px; color: #9ea0a7; font-size: 9px; }

.gallery-upload-card { max-width: 900px; }
.gallery-dropzone { min-height: 190px; position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; overflow: hidden; padding: 28px; border: 1.5px dashed #e2a4a7; border-radius: 18px; color: var(--muted); background: linear-gradient(145deg, #fff, #fff7f7); text-align: center; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.gallery-dropzone.is-dragging { transform: scale(.995); border-color: var(--red); background: var(--red-soft); }
.gallery-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.gallery-drop-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 15px; color: var(--red); background: #fff; box-shadow: var(--shadow-sm); }
.gallery-dropzone strong { color: var(--black); font-size: 13px; }
.gallery-dropzone small { font-size: 9px; }
.gallery-preview-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.gallery-preview-grid:empty { display: none; }
.gallery-preview-grid figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gallery-preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-preview-grid figcaption { overflow: hidden; padding: 7px; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.readonly-field { min-height: 42px; display: flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #f7f7f8; }

.gallery-admin-editor { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 24px; margin-bottom: 18px; }
.gallery-admin-editor-image { min-height: 320px; overflow: hidden; border-radius: 16px; background: #eceef1; }
.gallery-admin-editor-image img { width: 100%; height: 100%; object-fit: cover; }
.admin-gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-gallery-card { min-width: 0; overflow: hidden; }
.admin-gallery-image { aspect-ratio: 4 / 3; position: relative; overflow: hidden; background: #eef0f2; }
.admin-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.admin-gallery-image .badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 5px 15px rgba(16,17,20,.13); }
.admin-gallery-copy { padding: 14px; }
.admin-gallery-copy > strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-gallery-copy > small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.admin-gallery-copy > p { min-height: 30px; margin: 9px 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.admin-gallery-copy .table-actions { margin-top: 12px; }

.dashboard-gallery-card { margin: 18px 0; overflow: hidden; }
.dashboard-gallery-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 15px; }
.dashboard-gallery-photo { min-width: 0; position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 13px; background: #eceef1; }
.dashboard-gallery-photo::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.dashboard-gallery-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.dashboard-gallery-photo:hover img { transform: scale(1.035); }
.dashboard-gallery-photo span { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; overflow: hidden; color: #fff; font-size: 8px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-gallery-empty { min-height: 120px; display: flex; align-items: center; gap: 13px; padding: 20px; }
.dashboard-gallery-empty > span { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--red); background: var(--red-soft); }
.dashboard-gallery-empty div { margin-right: auto; }
.dashboard-gallery-empty strong { display: block; font-size: 12px; }
.dashboard-gallery-empty small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

/* Let admin statistic cards adapt when new modules are added. */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

@media (max-width: 1100px) {
    .gallery-grid, .admin-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-gallery-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-gallery-photo:nth-child(5) { display: none; }
}

@media (max-width: 820px) {
    .gallery-toolbar { align-items: stretch; flex-direction: column; }
    .gallery-search-form { grid-template-columns: minmax(0, 1fr) minmax(155px, .45fr) auto; }
    .gallery-search-form .button.ghost { grid-column: 1 / -1; }
    .gallery-result-count { align-self: flex-end; }
    .gallery-grid, .admin-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-admin-editor { grid-template-columns: 1fr; }
    .gallery-admin-editor-image { min-height: 280px; max-height: 520px; }
    .gallery-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-gallery-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-gallery-photo:nth-child(4), .dashboard-gallery-photo:nth-child(5) { display: none; }
}

@media (max-width: 650px) {
    .page-loader-card { width: min(100%, 286px); padding: 25px 22px 22px; border-radius: 20px; }
    .page-loader-logo { width: 52px; height: 52px; }
    .gallery-search-form { display: grid; grid-template-columns: 1fr; }
    .gallery-search-form .button, .gallery-search-form select { width: 100%; }
    .gallery-result-count { align-self: flex-start; }
    .gallery-grid, .admin-gallery-grid { gap: 10px; }
    .gallery-card { border-radius: 14px; }
    .gallery-card-copy { min-height: 82px; padding: 11px 11px 12px; }
    .gallery-card-copy strong { font-size: 10px; }
    .gallery-card-copy small, .gallery-card-copy em { font-size: 7px; }
    .gallery-lightbox { padding: 56px 12px 18px; }
    .gallery-lightbox-stage img { max-height: calc(100vh - 200px); border-radius: 8px; }
    .gallery-lightbox-copy { margin-top: 13px; }
    .gallery-lightbox-copy strong { font-size: 14px; }
    .gallery-dropzone { min-height: 165px; padding: 22px 15px; }
    .gallery-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .admin-gallery-copy { padding: 10px; }
    .admin-gallery-copy > p { display: none; }
    .admin-gallery-copy .table-actions { align-items: stretch; flex-direction: column; }
    .admin-gallery-copy .table-actions form, .admin-gallery-copy .table-actions .button { width: 100%; }
    .dashboard-gallery-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
    .dashboard-gallery-photo:nth-child(3), .dashboard-gallery-photo:nth-child(4), .dashboard-gallery-photo:nth-child(5) { display: none; }
    .dashboard-gallery-empty { align-items: flex-start; flex-wrap: wrap; }
    .dashboard-gallery-empty .button { width: 100%; }
}

@media (max-width: 390px) {
    .gallery-grid, .admin-gallery-grid { grid-template-columns: 1fr; }
    .gallery-image-wrap, .admin-gallery-image { aspect-ratio: 16 / 10; }
    .gallery-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader-logo, .loader-track i, .button.is-busy::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 650px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ========================================================================== 
   LFC Choir v8 — role approvals, church-member controls, mail diagnostics
   ========================================================================== */
.static-setting { cursor: default; }
.setting-check-on {
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 6px;
    color: #fff;
    background: var(--red);
}
.card-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.card-section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.card-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.smtp-test-card { max-width: 920px; margin-top: 18px; }
.smtp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.smtp-summary-grid > div {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
}
.smtp-summary-grid small { display: block; color: var(--muted-2); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.smtp-summary-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 10px; }
.smtp-test-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.mail-log-card { max-width: 920px; margin-top: 18px; }
.mail-error-text { display: inline-block; max-width: 520px; margin-top: 5px; color: var(--danger); line-height: 1.45; overflow-wrap: anywhere; }
.mobile-gallery-add { display: none; }
.leader-members-table .badge.green { color: #17623a; background: #e8f7ef; }

/* Prevent long titles, usernames, church names, lyrics and metadata from breaking mobile. */
.song-main-card,
.song-detail-aside,
.song-detail-head,
.song-view-meta,
.song-detail .detail-list,
.song-detail .detail-item { min-width: 0; }
.song-main-card { overflow: hidden; }
.song-detail h1 { max-width: 100%; overflow-wrap: anywhere; word-break: normal; }
.song-view-meta { display: flex; align-items: center; flex-wrap: wrap; white-space: normal; }
.song-view-meta > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.song-view-meta .badge { white-space: normal; }
.song-detail .alert { max-width: 100%; overflow-wrap: anywhere; }
.audio-player { display: block; max-width: 100%; }
.lyrics { max-width: 100%; overflow-x: hidden; overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 650px) {
    .mobile-gallery-add {
        position: fixed;
        right: 14px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        z-index: 42;
        min-height: 43px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 14px;
        border-radius: 999px;
        color: #fff;
        background: var(--red);
        box-shadow: 0 13px 30px rgba(237,28,36,.3);
        font-size: 10px;
        font-weight: 900;
    }
    .gallery-toolbar { margin-bottom: 76px; }
    .song-detail-head .page-actions,
    .song-detail-head .page-actions form,
    .song-detail-head .page-actions .button { width: 100%; }
    .song-detail { width: 100%; display: block; }
    .song-main-card,
    .song-detail-aside { width: 100%; max-width: 100%; padding: 16px 14px; }
    .song-detail-aside { margin-top: 12px; }
    .song-detail h1 { font-size: clamp(25px, 9vw, 34px); line-height: 1.08; }
    .song-view-meta { gap: 6px; font-size: 8px; }
    .song-view-meta .badge { width: auto; max-width: 100%; }
    .lyrics { padding: 13px 12px; border-radius: 12px; font-size: 11.5px; line-height: 1.7; }
    .detail-item { grid-template-columns: minmax(88px, .42fr) minmax(0, 1fr); align-items: start; gap: 10px; }
    .detail-item:first-child { padding-top: 0; }
    .detail-item small { padding-top: 2px; }
    .smtp-summary-grid { grid-template-columns: 1fr; }
    .smtp-test-form { grid-template-columns: 1fr; }
    .smtp-test-form .button { width: 100%; }
    .card-section-head { flex-direction: column; }
    .leader-members-table td { padding-left: 39%; }
}
