/*
 * DEPO Album — styles. Palette, fonts and the animated background are taken from front/
 * (public/styles/base/vars.scss, globals.css, common/Ellipses.module.scss). No build step.
 */

/* ── fonts (copied from front/public/fonts) ─────────────────────────── */
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ── tokens ──────────────────────────────────────────────────────────── */
:root {
    --bg: #18171a;            /* front body: rgba(24, 23, 26) */
    --surface: #27262b;       /* $blackColor */
    --surface-2: #2d2c31;
    --surface-3: #36353b;
    --line: rgb(255 255 255 / 0.08);
    --line-strong: rgb(255 255 255 / 0.16);
    --text: #fff;
    --muted: #a1a1aa;
    --gray: #71717a;          /* $grayColor */
    --yellow: #ffb500;        /* $yellowColor — first accent */
    --green: #469a58;         /* $greenColor — second accent */
    --spot: 83 245 126;       /* background spots (Ellipses) */
    --danger: #ef4444;
    --like: #ff4d6d;
    --radius: 10px;           /* $mainRadius */
    --radius-lg: 18px;
    --shadow: 0 2px 3px rgb(0 0 0 / 0.1), 0 8px 24px rgb(0 0 0 / 0.25);
    --trans: 280ms ease-in-out; /* $standartTrans */
    --header-h: 70px;
    --font: "Lato", "Source Sans 3", system-ui, sans-serif;
    --font-head: "Poppins", "Lato", sans-serif;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.accent { color: var(--yellow); }
.hint { color: var(--gray); font-size: 13px; }

/* ── animated background (port of front Ellipses) ───────────────────── */
@property --a-x { syntax: "<percentage>"; inherits: false; initial-value: 72%; }
@property --a-y { syntax: "<percentage>"; inherits: false; initial-value: 24%; }
@property --b-x { syntax: "<percentage>"; inherits: false; initial-value: 20%; }
@property --b-y { syntax: "<percentage>"; inherits: false; initial-value: 76%; }
@property --a-alpha { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --b-alpha { syntax: "<number>"; inherits: false; initial-value: 0; }

.ellipses {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    --a-x: 72%;
    --a-y: 24%;
    --b-x: 20%;
    --b-y: 76%;
    --a-alpha: 0;
    --b-alpha: 0;
    background-image:
        radial-gradient(circle 42vmax at var(--a-x) var(--a-y),
            rgb(var(--spot) / var(--a-alpha)) 0%,
            rgb(var(--spot) / calc(var(--a-alpha) * 0.78)) 18%,
            rgb(var(--spot) / calc(var(--a-alpha) * 0.45)) 40%,
            rgb(var(--spot) / calc(var(--a-alpha) * 0.18)) 62%,
            rgb(var(--spot) / calc(var(--a-alpha) * 0.05)) 82%,
            transparent 100%),
        radial-gradient(circle 42vmax at var(--b-x) var(--b-y),
            rgb(var(--spot) / var(--b-alpha)) 0%,
            rgb(var(--spot) / calc(var(--b-alpha) * 0.78)) 18%,
            rgb(var(--spot) / calc(var(--b-alpha) * 0.45)) 40%,
            rgb(var(--spot) / calc(var(--b-alpha) * 0.18)) 62%,
            rgb(var(--spot) / calc(var(--b-alpha) * 0.05)) 82%,
            transparent 100%);
    animation:
        fade-relocate-a 16s linear -4.8s infinite,
        fade-relocate-b 16s linear -8.8s infinite;
}

@keyframes fade-relocate-a {
    0%, 100% { --a-alpha: 0; }
    3% { --a-alpha: 0.15; }
    16% { --a-alpha: 0.24; }
    30% { --a-alpha: 0.34; }
    50% { --a-alpha: 0.27; }
    68% { --a-alpha: 0.2; }
    82% { --a-alpha: 0.16; }
    96% { --a-alpha: 0; }
}

@keyframes fade-relocate-b {
    0%, 100% { --b-alpha: 0; }
    3% { --b-alpha: 0.14; }
    16% { --b-alpha: 0.25; }
    30% { --b-alpha: 0.38; }
    50% { --b-alpha: 0.3; }
    68% { --b-alpha: 0.21; }
    82% { --b-alpha: 0.16; }
    96% { --b-alpha: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ellipses { animation: none; --a-alpha: 0.2; --b-alpha: 0.22; }
    html { scroll-behavior: auto; }
}

/* ── layout ──────────────────────────────────────────────────────────── */
.app-shell { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; padding: 24px 0 64px; }
.container { width: 100%; max-width: 1720px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.container--narrow { max-width: 980px; }
.section { margin-top: 40px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section__title { font-size: 22px; margin-bottom: 16px; }
.section__head .section__title { margin-bottom: 0; }
.section__meta { color: var(--muted); font-size: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: clamp(26px, 3vw, 36px); margin-bottom: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--yellow); font-weight: 700; margin-bottom: 12px; }
.panel {
    background: rgb(39 38 43 / 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}
.crumbs { margin-bottom: 16px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); transition: color var(--trans); }
.crumbs a:hover { color: var(--text); }

/* ── header ──────────────────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    background: rgb(24 23 26 / 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.header__brand { display: flex; align-items: center; gap: 10px; flex: none; }
.header__brand img { height: 32px; width: auto; }
.header__badge {
    font: 600 11px/1 var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--bg);
    background: var(--yellow);
    padding: 5px 8px;
    border-radius: 999px;
}
.header__nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.header__link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px; color: var(--muted);
    transition: color var(--trans), background var(--trans);
}
.header__link:hover { color: var(--text); background: rgb(255 255 255 / 0.05); }
.header__link.is-active { color: var(--text); background: rgb(255 255 255 / 0.08); }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header__actions form { margin: 0; }
.header__user { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; transition: background var(--trans); }
.header__user:hover { background: rgb(255 255 255 / 0.06); }
.header__user span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
.header__burger { display: none; margin-left: auto; width: 40px; height: 40px; background: none; border: 0; padding: 10px; cursor: pointer; }
.header__burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; margin: 4px 0; transition: transform var(--trans), opacity var(--trans); }

@media (max-width: 900px) {
    :root { --header-h: 56px; }
    .header__burger { display: block; }
    .header__nav {
        position: fixed; inset: var(--header-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: 16px; background: rgb(24 23 26 / 0.97); border-bottom: 1px solid var(--line);
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: opacity var(--trans), transform var(--trans), visibility var(--trans);
    }
    .header.is-open .header__nav { opacity: 1; transform: none; visibility: visible; }
    .header.is-open .header__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .header.is-open .header__burger span:nth-child(2) { opacity: 0; }
    .header.is-open .header__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .header__actions { margin: 8px 0 0; flex-wrap: wrap; }
}

/* ── buttons & chips ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
    font: 500 15px/1 var(--font-head); cursor: pointer; white-space: nowrap;
    transition: background var(--trans), border-color var(--trans), color var(--trans), transform 120ms ease, box-shadow var(--trans);
    background: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--yellow); color: #18171a; box-shadow: 0 2px 3px rgb(0 0 0 / 0.1), 0 8px 3px rgb(0 0 0 / 0.1); }
.btn--primary:hover { background: #ffc533; }
.btn--outline { border-color: var(--line-strong); color: var(--text); }
.btn--outline:hover { border-color: var(--yellow); color: var(--yellow); }
.btn--ghost { color: var(--muted); }
.btn--ghost:hover { color: var(--text); background: rgb(255 255 255 / 0.06); }
.btn--danger { border-color: rgb(239 68 68 / 0.4); color: var(--danger); }
.btn--danger:hover { background: rgb(239 68 68 / 0.12); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--xs { height: 28px; width: 28px; padding: 0; }
.btn--icon { width: 44px; padding: 0; }
.btn--sm.btn--icon { width: 36px; }
.btn--block { width: 100%; }
.btn--like { border-color: var(--line-strong); color: var(--text); }
.btn--like.is-liked { color: var(--like); border-color: rgb(255 77 109 / 0.5); background: rgb(255 77 109 / 0.1); }
.btn--like.is-liked .icon,
.chip--like.is-liked .icon { fill: currentColor; }
.btn--like.is-pop .icon,
.chip--like.is-pop .icon { animation: pop 380ms ease; }
@keyframes pop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.chip {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
    border-radius: 999px; border: 0; cursor: pointer; font-size: 13px; font-weight: 700;
    background: rgb(0 0 0 / 0.45); color: #fff; backdrop-filter: blur(6px);
    transition: background var(--trans), color var(--trans);
}
.chip:hover { background: rgb(0 0 0 / 0.65); }
.chip .icon { width: 15px; height: 15px; }
.chip--like.is-liked { color: var(--like); }
.link-more { display: inline-flex; align-items: center; gap: 4px; color: var(--yellow); font-weight: 700; font-size: 14px; }
.link-more .icon { width: 16px; height: 16px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; background: rgb(70 154 88 / 0.18); color: #7bd38f; margin-bottom: 12px;
}
.badge .icon { width: 14px; height: 14px; }
.badge--private { background: rgb(255 181 0 / 0.14); color: var(--yellow); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-3); font-size: 13px; transition: background var(--trans); }
.tag:hover { background: #45444b; }
.tag .icon { width: 14px; height: 14px; }

/* ── avatars ─────────────────────────────────────────────────────────── */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.avatar--initials { display: inline-grid; place-items: center; font: 600 14px/1 var(--font-head); color: var(--bg); background: linear-gradient(135deg, var(--yellow), #7bd38f); }
.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--xl { width: 96px; height: 96px; font-size: 32px; }
.author-row { display: flex; align-items: center; gap: 12px; }
.author-row strong { display: block; }
.author-row small { display: block; color: var(--muted); font-size: 13px; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: clamp(24px, 6vw, 72px); }
.hero__text { max-width: 720px; }
.hero__title { font-size: clamp(34px, 5.2vw, 64px); line-height: 1.05; letter-spacing: -0.02em; }
.hero__lead { margin-top: 16px; color: var(--muted); font-size: 18px; max-width: 560px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero__stats { display: flex; gap: 32px; }
.stat__value { display: block; font: 600 40px/1 var(--font-head); }
.stat__label { color: var(--muted); font-size: 14px; }

/* ── masonry gallery ─────────────────────────────────────────────────── */
.masonry { column-gap: 16px; columns: 5 260px; }
.card {
    position: relative; margin: 0 0 16px; break-inside: avoid; border-radius: var(--radius);
    overflow: hidden; background: var(--surface); opacity: 0; transform: translateY(12px);
    animation: card-in 500ms ease forwards;
}
@keyframes card-in { to { opacity: 1; transform: none; } }
.card__media { display: block; background: var(--surface-2); }
.card__media img { width: 100%; height: auto; transition: transform 600ms ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__overlay {
    position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 28px 10px 10px; background: linear-gradient(to top, rgb(0 0 0 / 0.72), transparent);
    opacity: 0; transition: opacity var(--trans);
}
.card:hover .card__overlay,
.card:focus-within .card__overlay { opacity: 1; }
@media (hover: none) { .card__overlay { opacity: 1; } }
.card__author { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; min-width: 0; }
.card__author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__stats { display: flex; gap: 6px; flex: none; }
.load-more { display: flex; justify-content: center; margin-top: 24px; }

/* ── albums ──────────────────────────────────────────────────────────── */
.albums-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 280px); gap: 20px; overflow-x: auto; padding: 6px 2px 16px; scroll-snap-type: x mandatory; }
.albums-row > * { scroll-snap-align: start; }
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.album-card { position: relative; display: block; padding-top: 10px; }
.album-card__stack,
.album-card__stack::before {
    position: absolute; left: 8%; right: 8%; top: 0; height: 30px; border-radius: var(--radius); background: var(--surface-3);
    transition: transform var(--trans);
}
.album-card__stack::before { content: ""; left: 6%; right: 6%; top: 5px; background: #45444b; }
.album-card__cover { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.album-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.album-card:hover .album-card__cover img { transform: scale(1.05); }
.album-card:hover .album-card__stack { transform: translateY(-4px); }
.album-card__empty { display: grid; place-items: center; height: 100%; color: var(--gray); }
.album-card__empty .icon { width: 40px; height: 40px; }
.album-card__badge {
    position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgb(0 0 0 / 0.55); backdrop-filter: blur(6px);
}
.album-card__badge .icon { width: 13px; height: 13px; }
.album-card__badge.is-private { color: var(--yellow); }
.album-card__body { display: block; padding: 12px 2px 0; }
.album-card__title { display: block; font: 600 16px/1.3 var(--font-head); }
.album-card__meta { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.album-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 28px; margin-bottom: 24px; }
.album-head__info { max-width: 720px; }
.album-head__desc { color: var(--muted); margin: 4px 0 16px; }
.album-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 24px; }
.profile__info { flex: 1; min-width: 200px; }
.profile__actions { display: flex; gap: 8px; }

/* ── photo page ──────────────────────────────────────────────────────── */
.photo-page__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .photo-page__grid { grid-template-columns: 1fr; } }
.viewer { position: relative; display: grid; place-items: center; min-height: 50vh; border-radius: var(--radius-lg); background: rgb(0 0 0 / 0.35); overflow: hidden; }
.viewer__frame { display: block; cursor: zoom-in; }
.viewer__frame img { max-height: calc(100vh - var(--header-h) - 120px); width: auto; margin: 0 auto; }
.viewer__nav {
    position: absolute; top: 50%; translate: 0 -50%; z-index: 2; display: grid; place-items: center;
    width: 48px; height: 48px; border-radius: 50%; background: rgb(0 0 0 / 0.5); backdrop-filter: blur(6px);
    transition: background var(--trans);
}
.viewer__nav:hover { background: rgb(0 0 0 / 0.8); }
.viewer__nav--prev { left: 12px; }
.viewer__nav--next { right: 12px; }
.photo-side { padding: 22px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--header-h) + 16px); }
.photo-side__caption { font-size: 15px; }
.photo-side__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-side__actions form { margin: 0; }
.meta-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 14px 0; border-block: 1px solid var(--line); }
.meta-list dt { color: var(--gray); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.meta-list dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; }
.add-to-album { display: flex; flex-direction: column; gap: 8px; }
.inline-field { display: flex; gap: 8px; }
.inline-field .input { flex: 1; }

.comments { margin-top: 24px; padding: 24px; }
.comments__list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; animation: card-in 400ms ease both; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment__author { font-weight: 700; }
.comment__delete { margin-left: auto; }
.comment__text { margin-top: 2px; overflow-wrap: anywhere; }
.comment-form { display: flex; align-items: flex-end; gap: 10px; }
.comment-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; }

/* ── forms ───────────────────────────────────────────────────────────── */
.form { padding: 28px; display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form__grid, .form__row { grid-template-columns: 1fr; } }
.form__actions { display: flex; gap: 12px; flex-wrap: wrap; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 700; font-size: 14px; color: #e4e4e7; }
.label .muted { font-weight: 400; }
.input {
    width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius);
    background: rgb(24 23 26 / 0.7); border: 1px solid var(--line-strong); color: var(--text);
    transition: border-color var(--trans), box-shadow var(--trans);
}
.input::placeholder { color: var(--gray); }
.input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgb(255 181 0 / 0.18); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { resize: vertical; }
.has-error .input { border-color: var(--danger); }
.field__error { color: #fca5a5; font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--yellow); }
.check.has-error span { color: #fca5a5; }
.password { position: relative; }
.password .input { padding-right: 44px; }
.password__toggle { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.alert--error { background: rgb(239 68 68 / 0.12); color: #fca5a5; border: 1px solid rgb(239 68 68 / 0.3); }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented__item { cursor: pointer; }
.segmented__item input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__item > span {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); transition: border-color var(--trans), background var(--trans);
}
.segmented__item .icon { grid-row: span 2; width: 22px; height: 22px; color: var(--muted); }
.segmented__item small { color: var(--muted); font-size: 13px; }
.segmented__item input:checked + span { border-color: var(--yellow); background: rgb(255 181 0 / 0.08); }
.segmented__item input:checked + span .icon { color: var(--yellow); }
.segmented__item input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }

.picker__group { font-size: 15px; margin: 12px 0 10px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 460px; overflow: auto; padding: 2px; }
.picker__item { position: relative; border-radius: var(--radius); overflow: hidden; }
.picker__photo { display: block; aspect-ratio: 1; cursor: pointer; }
.picker__photo input { position: absolute; opacity: 0; }
.picker__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--trans), opacity var(--trans); opacity: 0.75; }
.picker__check {
    position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid #fff; background: rgb(0 0 0 / 0.3); color: transparent; transition: background var(--trans), color var(--trans);
}
.picker__check .icon { width: 14px; height: 14px; }
.picker__item.is-selected .picker__photo img { opacity: 1; transform: scale(0.92); }
.picker__item.is-selected { outline: 2px solid var(--yellow); outline-offset: -2px; }
.picker__item.is-selected .picker__check { background: var(--yellow); border-color: var(--yellow); color: #18171a; }
.picker__photo input:focus-visible ~ .picker__check { outline: 2px solid var(--yellow); outline-offset: 2px; }
.picker__cover { position: absolute; right: 6px; bottom: 6px; cursor: pointer; }
.picker__cover input { position: absolute; opacity: 0; }
.picker__cover span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(0 0 0 / 0.5); color: var(--gray); font-size: 14px; transition: color var(--trans), background var(--trans); }
.picker__cover input:checked + span { color: #18171a; background: var(--yellow); }
.picker__item:not(.is-selected) .picker__cover { display: none; }

.danger-zone { margin-top: 24px; display: flex; justify-content: flex-end; }

/* ── upload ──────────────────────────────────────────────────────────── */
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    padding: 48px 20px; border-radius: var(--radius-lg); border: 2px dashed var(--line-strong); cursor: pointer;
    transition: border-color var(--trans), background var(--trans);
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover,
.dropzone.is-over { border-color: var(--yellow); background: rgb(255 181 0 / 0.05); }
.dropzone__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 181 0 / 0.12); color: var(--yellow); margin-bottom: 8px; }
.dropzone__icon .icon { width: 28px; height: 28px; }
.upload-queue { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.upload-queue:empty { display: none; }
.upload-item { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item__bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 6px; border-radius: 3px; background: rgb(0 0 0 / 0.5); overflow: hidden; }
.upload-item__bar span { display: block; height: 100%; width: 0; background: var(--yellow); transition: width 200ms ease; }
.upload-item__state { position: absolute; top: 8px; left: 8px; right: 8px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgb(0 0 0 / 0.55); width: fit-content; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item.is-done .upload-item__bar span { background: #7bd38f; }
.upload-item.is-error .upload-item__bar span { background: var(--danger); width: 100% !important; }
.upload-item.is-error .upload-item__state { color: #fca5a5; white-space: normal; }
.upload-item__remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.upload-item__remove .icon { width: 14px; height: 14px; }

/* ── auth ────────────────────────────────────────────────────────────── */
.auth { min-height: calc(100vh - var(--header-h) - 160px); display: grid; place-items: center; padding: 24px 16px; }
.auth__card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 16px; animation: card-in 500ms ease both; }
.auth__card--wide { max-width: 640px; }
.auth__title { font-size: 28px; }
.auth__switch { text-align: center; font-size: 14px; }

/* ── misc ────────────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty .icon { width: 36px; height: 36px; color: var(--gray); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination__item { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); }
.pagination__item.is-active { background: var(--yellow); color: #18171a; border-color: var(--yellow); }
.pagination__item.is-muted { opacity: 0.4; }
.error-page { text-align: center; padding-top: 10vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-page__code { font: 600 clamp(80px, 14vw, 160px)/1 var(--font-head); background: linear-gradient(135deg, var(--yellow), rgb(var(--spot))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer { border-top: 1px solid var(--line); padding: 24px 0; background: rgb(24 23 26 / 0.6); }
.footer__inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer__logo { height: 24px; width: auto; opacity: 0.8; }
.footer__note { color: var(--gray); font-size: 13px; }

/* toasts */
.toasts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 14px;
    animation: toast-in 300ms ease both;
}
.toast--success { border-left: 4px solid #7bd38f; }
.toast--error { border-left: 4px solid var(--danger); }
.toast.is-leaving { animation: toast-out 250ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ── lightbox ────────────────────────────────────────────────────────── */
.lightbox {
    position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto;
    background: rgb(12 12 14 / 0.94); backdrop-filter: blur(8px); opacity: 0; transition: opacity 220ms ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox__top,
.lightbox__bottom { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.lightbox__top { justify-content: space-between; }
.lightbox__meta { display: flex; flex-direction: column; min-width: 0; }
.lightbox__meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__meta small { color: var(--muted); }
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 72px; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transition: opacity 200ms ease; }
.lightbox__stage img.is-loading { opacity: 0.25; }
.lightbox__nav { position: absolute; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 0.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox__nav:hover { background: rgb(255 255 255 / 0.18); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__bottom { justify-content: center; }
.lightbox__counter { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
    .lightbox__stage { padding: 0 8px; }
    .lightbox__nav { bottom: 12px; top: auto; translate: none; }
}
body.has-lightbox { overflow: hidden; }
