/* =====================================================================
   ReviewPilot admin
   1. Tokens & base       5. Profiles list      9. Review lists
   2. Top bar             6. Profile form      10. Review forms
   3. Page blocks         7. Profile links     11. Login
   4. Form controls       8. Comments
   ===================================================================== */

/* 1. Tokens & base ------------------------------------------------------ */
:root {
    --bg: #f5f1ee;
    --card: #ffffff;
    --ink: #1f1b18;
    --muted: #6f6660;
    --line: #e7dfd8;
    --field-line: #ddd3cb;
    --accent: #b3264a;
    --accent-ink: #ffffff;
    --accent-soft: #fbeff2;
    --danger: #c0392b;
    --ok-bg: #e7f5ec;
    --ok-ink: #1d6b3a;
    --err-bg: #fdecea;
    --err-ink: #8e2218;
    --star: #e69500;
    --brand-gradient: linear-gradient(135deg, #c93a60 0%, #9a2145 50%, #561230 100%);
    --button-gradient: linear-gradient(135deg, #c93a60, #9a2145);
    --card-shadow: 0 1px 2px rgba(31, 27, 24, .04), 0 10px 26px -20px rgba(31, 27, 24, .3);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 26px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.icon { width: 18px; height: 18px; flex: none; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 16px 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }

/* 2. Top bar ------------------------------------------------------------ */
.topbar {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 92% -60%, rgba(255, 255, 255, .16) 0 130px, transparent 131px),
        radial-gradient(circle at 101% 170%, rgba(255, 255, 255, .09) 0 150px, transparent 151px),
        radial-gradient(circle at 6% 160%, rgba(255, 255, 255, .07) 0 90px, transparent 91px),
        var(--brand-gradient);
    box-shadow: 0 12px 30px -18px rgba(122, 25, 55, .75);
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-tag {
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
}
.topbar-nav { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 99px;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, .86);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.nav-link .icon { width: 16px; height: 16px; }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.nav-link.is-active { color: #fff; background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .32); }
.nav-link.nav-cta { color: var(--accent); background: #fff; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45); }
.nav-link.nav-cta:hover { color: #7d1733; transform: translateY(-1px); }
.nav-link.nav-cta.is-active { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.topbar-user { display: flex; align-items: center; gap: 4px; }
.topbar-user form { margin: 0; }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 99px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    transition: background-color .15s;
}
.user-chip:hover, .user-chip.is-active { background: rgba(255, 255, 255, .22); }
.user-avatar {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    background: #fff;
}
.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 0;
    border-radius: 99px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .86);
    background: transparent;
    cursor: pointer;
}
.logout-button .icon { width: 16px; height: 16px; }
.logout-button:hover { color: #fff; background: rgba(255, 255, 255, .12); }
@media (max-width: 980px) {
    .topbar-nav {
        order: 3;
        flex-basis: calc(100% + 40px);
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -20px;
        padding: 0 20px 2px;
        scrollbar-width: none;
    }
    .topbar-nav::-webkit-scrollbar { display: none; }
    .topbar-user { margin-left: auto; }
}
@media (max-width: 520px) {
    .brand-tag, .logout-button span { display: none; }
    .user-chip { padding-right: 4px; }
    .user-chip > span:last-child { display: none; }
}

/* 3. Page blocks: hero, cards, buttons, alerts --------------------------- */
.page-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 20px;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 88% -30%, rgba(255, 255, 255, .16) 0 130px, transparent 131px),
        radial-gradient(circle at 104% 130%, rgba(255, 255, 255, .09) 0 170px, transparent 171px),
        var(--brand-gradient);
    box-shadow: 0 16px 36px -16px rgba(122, 25, 55, .6);
}
.page-hero-icon {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
}
.page-hero-icon .icon { width: 28px; height: 28px; }
.page-hero-avatar {
    width: 64px;
    height: 64px;
    flex: none;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .7);
}
.page-hero-text { flex: 1; min-width: 0; }
.page-hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.page-hero h1 { margin: 2px 0 4px; font-size: 27px; line-height: 1.2; }
.page-hero p { margin: 0; font-size: 14px; opacity: .88; }
.page-hero-aside { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .24);
}
.pill .icon { width: 14px; height: 14px; }
.page-hero .star-row { color: #ffd27a; }
@media (max-width: 640px) {
    .page-hero { flex-wrap: wrap; padding: 20px; }
    .page-hero h1 { font-size: 22px; }
    .page-hero-aside { width: 100%; justify-content: flex-start; }
}

.card, .form-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    transition: border-color .2s, box-shadow .2s;
}
.form-section { padding-bottom: 6px; }
@media (max-width: 560px) { .card, .form-section { padding: 18px 16px; } .form-section { padding-bottom: 4px; } }
.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0eae5;
}
.section-head > div:not(.photo-meter) { flex: 1; min-width: 0; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.section-icon, .empty-icon {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: linear-gradient(135deg, #fdf1f4, #f6dbe3);
}
.section-icon .icon { width: 21px; height: 21px; }
.list-title { margin: 26px 0 12px; font-size: 17px; }

.empty { text-align: center; padding: 44px 24px; }
.empty .empty-icon { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px; }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h2 { margin: 0 0 4px; font-size: 18px; }
.empty p { margin: 0 0 16px; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    color: var(--accent-ink);
    background: var(--button-gradient);
    box-shadow: 0 8px 18px -10px rgba(179, 38, 74, .75);
    transition: transform .15s, box-shadow .15s, filter .15s, background .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(179, 38, 74, .8); }
.btn:active { transform: none; }
.btn:disabled { cursor: progress; transform: none; filter: saturate(.75); opacity: .92; }
.btn .icon { width: 16px; height: 16px; }
.btn.secondary { color: var(--ink); background: #f1ebe6; box-shadow: none; }
.btn.secondary:hover { background: #e9e0d9; }
.btn.soft { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.btn.soft:hover { background: #f6dce4; }
.btn.danger { color: var(--danger); background: #fdecea; box-shadow: none; }
.btn.danger:hover { color: #fff; background: var(--danger); }
.btn-light { color: var(--accent); background: #fff; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45); }
.btn-light:hover { color: #7d1733; box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .5); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.small .icon { width: 14px; height: 14px; }
.btn.icon-only { padding-left: 9px; padding-right: 9px; }
.btn-primary { min-width: 150px; }
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    flex: none;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn.is-busy .spinner { display: inline-block; }
.btn.secondary .spinner, .btn.soft .spinner, .btn.danger .spinner { border-color: rgba(0, 0, 0, .15); border-top-color: currentColor; }
.spinner.big { display: block; width: 46px; height: 46px; border-width: 4px; border-color: #f4dce3; border-top-color: var(--accent); }

.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.alert.error { background: var(--err-bg); color: var(--err-ink); }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.form-alert { display: flex; gap: 12px; align-items: flex-start; }
.form-alert.error { border: 1px solid #f3c4bd; }
.form-alert.ok { border: 1px solid #bfe3cb; }
.form-alert > .icon { width: 22px; height: 22px; margin-top: 1px; }
.form-alert > ul { margin: 0; }

.saved-note { display: inline-flex; align-items: center; gap: 4px; color: var(--ok-ink); font-size: 13px; font-weight: 600; }
.saved-note .icon { width: 15px; height: 15px; }
.error-note { color: var(--danger); font-size: 13px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 12.5px;
    color: var(--muted);
    background: #f5f0ec;
}
.chip .icon { width: 13px; height: 13px; }

/* Save bar that stays at the bottom of long forms */
.form-actions {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 12px 12px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 32px -14px rgba(31, 27, 24, .3);
}
.form-actions form { margin: 0; }
.form-actions-status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.form-actions-status .icon { width: 16px; height: 16px; color: var(--accent); }
.form-actions-status a { font-weight: 600; text-decoration: none; }
.form-actions .btn { padding: 12px 20px; }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #cbbfb5; }
.status-dot.ok { background: #2f9e5a; box-shadow: 0 0 0 4px rgba(47, 158, 90, .16); }
.status-dot.pending { background: #e69500; animation: pulse 1s ease-in-out infinite; }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(192, 57, 43, .14); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(230, 149, 0, .2); } }
@media (max-width: 560px) {
    .form-actions { flex-wrap: wrap; bottom: 8px; }
    .form-actions-status { flex-basis: 100%; }
    .form-actions .btn, .form-actions form { flex: 1; }
    .form-actions form .btn { width: 100%; }
}

/* 4. Form controls ------------------------------------------------------ */
.field { margin-bottom: 18px; }
.field > label, .field > .label {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
}
.req { color: var(--accent); font-weight: 700; }
.counter { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=month],
input[type=password], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--field-line);
    border-radius: 11px;
    font: inherit;
    color: var(--ink);
    background: #fcfbfa;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #cbbdb1; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(179, 38, 74, .12);
}
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
::placeholder { color: #b9aea5; }
textarea { min-height: 110px; line-height: 1.6; resize: vertical; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.has-error .choice { border-color: #e7a197; }
.field-error { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--danger); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

/* Chips: checkboxes (.choice) and radios (.radio) */
.choices, .radios { display: flex; flex-wrap: wrap; gap: 8px; }
.choice, .radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px 8px 11px;
    border: 1px solid var(--field-line);
    border-radius: 999px;
    font-weight: 500;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background-color .15s, color .15s;
}
.choice:hover, .radio:hover { border-color: #c9b9ad; }
.choice:has(input:checked), .radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box {
    width: 19px;
    height: 19px;
    border-radius: 6px;
    border: 1.5px solid #c8bab0;
    background: #fff;
    display: grid;
    place-items: center;
    transition: background-color .15s, border-color .15s;
}
.choice input:checked + .choice-box { background: var(--accent); border-color: var(--accent); }
.choice input:checked + .choice-box::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}
.choice input:focus-visible + .choice-box { box-shadow: 0 0 0 4px rgba(179, 38, 74, .2); }
.radio input { margin: 0; }
.radio img { width: 20px; height: 20px; }

/* Number / star pickers */
.stars { display: flex; gap: 4px; flex-wrap: wrap; }
.stars label {
    min-width: 38px;
    padding: 6px 9px;
    border: 1px solid var(--field-line);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.stars label:hover { border-color: #c9b9ad; }
.stars label span { color: var(--star); }
.stars label:has(input:checked) { color: #fff; border-color: transparent; background: var(--button-gradient); box-shadow: 0 6px 14px -8px rgba(179, 38, 74, .8); }
.stars label:has(input:checked) span { color: #fff; }
.stars label:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(179, 38, 74, .2); }
.stars input { position: absolute; opacity: 0; pointer-events: none; }

/* 5. Profiles list ------------------------------------------------------ */
.page-profiles .list { display: grid; gap: 12px; }
.page-profiles .item {
    display: grid;
    grid-template-columns: 30px 84px 1fr auto;
    gap: 0 16px;
    align-items: center;
    padding: 12px 16px 12px 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: border-color .15s, box-shadow .15s;
}
.page-profiles .item:hover { border-color: #dccfc5; box-shadow: 0 1px 2px rgba(31, 27, 24, .04), 0 14px 30px -20px rgba(31, 27, 24, .4); }
.page-profiles .item.dragging {
    position: relative;
    z-index: 5;
    border-color: var(--accent);
    box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .3);
    opacity: .97;
}
.page-profiles .handle {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b3aaa3;
    border-radius: 9px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.page-profiles .handle:hover { background: #f4efeb; color: var(--accent); }
.page-profiles .dragging .handle { cursor: grabbing; }
.page-profiles .item img { width: 84px; height: 84px; object-fit: cover; border-radius: 14px; display: block; }
/* Placeholder for a profile with no picture yet (an empty src would re-request the page). */
.page-profiles .item .no-photo { width: 84px; height: 84px; border-radius: 14px; display: grid;
    place-items: center; background: var(--accent-soft); color: var(--muted); }
.page-profiles .item .no-photo .icon { width: 28px; height: 28px; }
.page-profiles .item .name { font-weight: 700; font-size: 16px; }
.page-profiles .item .meta { color: var(--muted); font-size: 13px; font-weight: 400; }
.page-profiles .item .title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-profiles .item .info { min-width: 0; }
.page-profiles .item .buttons { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.page-profiles .item form { margin: 0; }
/* The delete form stretches its icon button to the height of the text buttons. */
.page-profiles .item .buttons form { display: flex; }
.page-profiles .item [data-links-toggle][aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.page-profiles .links-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
}
.page-profiles .links-open .links-panel { grid-template-rows: 1fr; }
.page-profiles .links-inner {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.page-profiles .links-inner .link-row { margin: 12px 0 0 8px; padding: 10px 12px; }
.page-profiles .links-inner .link-row + .link-row { margin-left: 0; }
.page-profiles .links-inner .label { margin-bottom: 6px; font-size: 13px; }
.page-profiles .links-inner .link-box { flex-wrap: nowrap; }
.page-profiles .links-inner .link-box input { flex-basis: 0; padding: 7px 10px; font-size: 13px; }
.page-profiles .nick { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.page-profiles .nick input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 280px;
    padding: 4px 9px;
    border: 1px dashed #e0cfbd;
    border-radius: 8px;
    font-weight: 700;
    color: var(--accent);
    background: #fffaf2;
}
.page-profiles .nick input::placeholder { font-weight: 500; color: #b3aaa3; }
.page-profiles .nick input:focus { border-style: solid; box-shadow: 0 0 0 3px rgba(179, 38, 74, .12); }
.page-profiles .nick .status { font-size: 12px; color: var(--ok-ink); min-width: 42px; }
.page-profiles .nick .status.error { color: var(--danger); }
.page-profiles .order-status { font-size: 13px; color: var(--muted); min-height: 20px; margin: -8px 0 8px; }
.page-profiles .order-status.ok { color: var(--ok-ink); }
.page-profiles .order-status.error { color: var(--danger); }
@media (max-width: 860px) {
    .page-profiles .item { grid-template-columns: 26px 64px 1fr; gap: 0 12px; }
    .page-profiles .item img,
    .page-profiles .item .no-photo { width: 64px; height: 64px; }
    .page-profiles .item .buttons { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; margin-top: 12px; }
    .page-profiles .links-inner { grid-template-columns: 1fr; gap: 0; }
    .page-profiles .links-inner .link-row, .page-profiles .links-inner .link-row + .link-row { margin: 10px 0 0; }
}

/* 6. Profile form ------------------------------------------------------- */
.page-profile-form textarea { min-height: 220px; }
.nickname-field { padding: 12px 14px 14px; border: 1px dashed #e6d5bd; border-radius: 13px; background: #fffaf2; }
.nickname-field .icon { width: 16px; height: 16px; color: #a8741a; }
.nickname-field input { background: #fff; }

.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.rate { display: block; }
.rate-name { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.rate-input { position: relative; display: block; }
.rate-input .dollar { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.rate-input input { padding-left: 28px; }
@media (max-width: 560px) { .rates { grid-template-columns: 1fr; } }

/* Pictures */
.photos-section.has-error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.photos-section.over { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179, 38, 74, .16); }
.photo-meter { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.photo-meter-text { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.photo-meter-bar { width: 160px; height: 6px; border-radius: 99px; background: #efe8e2; overflow: hidden; }
.photo-meter-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e27a94, var(--accent));
    transition: width .3s ease, background .3s;
}
.photo-meter.ok .photo-meter-text { color: var(--ok-ink); }
.photo-meter.ok .photo-meter-bar span { background: linear-gradient(90deg, #56b97d, #1d6b3a); }
.photo-meter.bad .photo-meter-text { color: var(--danger); }
.photo-meter.bad .photo-meter-bar span { background: var(--danger); }
@media (max-width: 640px) {
    .photo-meter { width: 100%; align-items: flex-start; }
    .photo-meter-bar { width: 100%; }
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 36px 20px;
    margin-bottom: 18px;
    text-align: center;
    border: 2px dashed #dccfc4;
    border-radius: 16px;
    background: linear-gradient(180deg, #fdfbfa, #f8f2ee);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone:focus-visible, .photos-section.over .dropzone { outline: none; border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 6px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: #fff;
    box-shadow: 0 8px 20px -8px rgba(179, 38, 74, .5);
    transition: transform .2s;
}
.page-profile-form .dropzone-icon .icon { width: 28px; height: 28px; }
.dropzone:hover .dropzone-icon, .photos-section.over .dropzone-icon { transform: translateY(-3px); }
.dropzone-title { font-size: 15px; font-weight: 600; }
.dropzone-title u { color: var(--accent); text-underline-offset: 3px; }
.dropzone-hint { font-size: 12.5px; color: var(--muted); }
.photos-section.has-photos .dropzone { display: none; }

.photo-grid {
    position: relative;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.photos-section:not(.has-photos) .photo-grid { display: none; }
@media (max-width: 480px) { .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.photo-tile, .photo-add, .photo-placeholder { aspect-ratio: 1; border-radius: 14px; }
.photo-tile {
    position: relative;
    overflow: hidden;
    background: #eee7e1;
    box-shadow: 0 1px 3px rgba(31, 27, 24, .12);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    animation: tile-in .25s ease;
}
.photo-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform .35s ease, filter .3s;
}
.photo-tile:hover img { transform: scale(1.05); }
.photo-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .38) 0, transparent 32%, transparent 60%, rgba(0, 0, 0, .5));
    opacity: .55;
    transition: opacity .2s;
}
.photo-tile:hover::after, .photo-tile:focus-within::after { opacity: 1; }
.photo-tile.is-main { box-shadow: 0 0 0 3px var(--accent), 0 10px 22px -10px rgba(179, 38, 74, .7); }
@keyframes tile-in { from { opacity: 0; transform: scale(.9); } }

.photo-index {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    justify-content: center;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(20, 16, 14, .6);
    backdrop-filter: blur(4px);
}
.photo-tile.is-main .photo-index { background: var(--accent); letter-spacing: .02em; }
.page-profile-form .photo-index .icon { width: 13px; height: 13px; fill: currentColor; }

.photo-remove {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 5;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    cursor: pointer;
    transition: background-color .15s, color .15s, transform .15s;
}
.photo-remove:hover, .photo-remove:focus-visible { outline: none; color: #fff; background: var(--danger); transform: scale(1.1); }
.page-profile-form .photo-remove .icon { width: 15px; height: 15px; stroke-width: 2.6; }

.photo-bar {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
}
.photo-tile:hover .photo-bar, .photo-tile:focus-within .photo-bar { opacity: 1; transform: none; }
@media (hover: none) {
    .photo-bar { opacity: 1; transform: none; }
    .photo-tile::after { opacity: 1; }
}
.photo-handle, .photo-main {
    height: 30px;
    border: 0;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(255, 255, 255, .93);
    cursor: pointer;
    transition: color .15s, background-color .15s;
}
.photo-handle { width: 30px; padding: 0; cursor: grab; touch-action: none; }
.photo-handle:hover, .photo-main:hover, .photo-handle:focus-visible, .photo-main:focus-visible { outline: none; color: var(--accent); background: #fff; }
.photo-handle:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.page-profile-form .photo-handle .icon, .page-profile-form .photo-main .icon { width: 15px; height: 15px; }
.photo-tile.is-main .photo-main { visibility: hidden; }

/* Upload state on a tile */
.photo-status {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    background: rgba(20, 16, 14, .5);
}
.photo-tile.is-queued .photo-status, .photo-tile.is-uploading .photo-status, .photo-tile.is-error .photo-status { display: flex; }
.photo-tile.is-queued img, .photo-tile.is-uploading img { filter: saturate(.5) brightness(.85); }
.photo-tile.is-queued .photo-bar, .photo-tile.is-uploading .photo-bar, .photo-tile.is-error .photo-bar { display: none; }
.ring { position: relative; width: 50px; height: 50px; }
.progress-ring { width: 50px; height: 50px; transform: rotate(-90deg); display: block; }
.progress-ring circle { fill: none; stroke-width: 4; }
.progress-ring .track { stroke: rgba(255, 255, 255, .25); }
.progress-ring .value { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.photo-tile.is-queued .progress-ring .value { opacity: 0; }
.photo-tile.is-queued .progress-ring { animation: spin 1.4s linear infinite; }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.status-icon { display: none; }
.photo-tile.is-error .photo-status { background: rgba(125, 28, 20, .82); }
.photo-tile.is-error .ring { display: none; }
.photo-tile.is-error .status-icon { display: block; }
.page-profile-form .status-icon .icon { width: 26px; height: 26px; }
.photo-tile.is-error .status-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.photo-retry {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    padding: 6px 12px;
    border: 0;
    border-radius: 99px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #7d1c14;
    background: #fff;
    cursor: pointer;
}
.photo-tile.is-error .photo-retry { display: inline-flex; }
.page-profile-form .photo-retry .icon { width: 13px; height: 13px; }

.photo-done {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #2f9e5a;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
    opacity: 0;
    pointer-events: none;
}
.page-profile-form .photo-done .icon { width: 24px; height: 24px; stroke-width: 2.6; }
.photo-tile.just-done .photo-done { animation: done-pop 1.2s ease forwards; }
@keyframes done-pop {
    0% { opacity: 0; transform: scale(.4); }
    20% { opacity: 1; transform: scale(1.1); }
    35% { transform: scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: scale(.9); }
}

.photo-tile.is-removing { opacity: 0; transform: scale(.85); transition: opacity .17s, transform .17s; pointer-events: none; }
.photo-tile.is-dragging {
    position: fixed;
    z-index: 1000;
    margin: 0;
    cursor: grabbing;
    pointer-events: none;
    animation: none;
    box-shadow: 0 24px 48px -14px rgba(0, 0, 0, .5), 0 0 0 3px #fff;
}
.photo-tile.is-dragging.is-main { box-shadow: 0 24px 48px -14px rgba(0, 0, 0, .5), 0 0 0 3px var(--accent); }
.photo-tile.is-dragging img { transform: none; }
.photo-placeholder { border: 2px dashed var(--accent); background: var(--accent-soft); }
body.is-photo-dragging, body.is-photo-dragging * { cursor: grabbing !important; }

.photo-add label {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px dashed #dccfc4;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: #fcfaf8;
    cursor: pointer;
    transition: border-color .15s, color .15s, background-color .15s;
}
.photo-add label:hover, .photo-add label:focus-visible, .photos-section.over .photo-add label {
    outline: none;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.page-profile-form .photo-add .icon { width: 28px; height: 28px; }
.photos-section.is-full .photo-add { display: none; }

.photo-notice { margin: -6px 0 16px; padding: 10px 14px; border-radius: 11px; font-size: 13px; color: #7a4b00; background: #fff4df; }


/* Saving overlay: blocks the page so nothing can be clicked twice */
.busy {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(31, 27, 24, .45);
    backdrop-filter: blur(3px);
    animation: fade-in .2s ease;
}
.busy-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(360px, 100%);
    padding: 30px 28px;
    text-align: center;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45);
}
.busy-card .spinner { margin-bottom: 4px; }
.busy-card strong { font-size: 17px; }
.busy-card span:last-child { font-size: 13.5px; color: var(--muted); }
@keyframes fade-in { from { opacity: 0; } }

/* 7. Share links (profiles list) --------------------------------------- */
.link-row { padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf8; }
.link-row:last-child { margin-bottom: 6px; }
.link-row .label { font-weight: 700; margin-bottom: 8px; }
.link-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-box input {
    flex: 1 1 260px;
    min-width: 0;
    width: auto;
    padding: 8px 12px;
    font: 14px ui-monospace, Consolas, monospace;
    background: #fff;
}

/* 8. Comments ----------------------------------------------------------- */
.page-comments .grid { display: grid; grid-template-columns: 190px 1fr; gap: 0 14px; }
.page-comments textarea { min-height: 90px; }
.page-comments .add { margin-bottom: 8px; }
.page-comments .add .field:last-of-type { margin-bottom: 0; }
.page-comments .list { display: grid; gap: 12px; }
.page-comments .comment { margin: 0; scroll-margin-top: 16px; }
.page-comments .comment .field:last-child { margin-bottom: 0; }
.page-comments .comment.saved { border-color: var(--ok-ink); box-shadow: 0 0 0 3px var(--ok-bg), var(--card-shadow); }
.page-comments .comment.removing { opacity: .4; pointer-events: none; transition: opacity .15s; }
.page-comments .preview { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14px; line-height: 1.3; }
.page-comments .preview .user-avatar { width: 36px; height: 36px; font-size: 15px; color: #fff; background: var(--button-gradient); }
.page-comments .preview .meta { font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row-actions .saved-note, .row-actions .error-note { margin-right: auto; }
.row-actions form { margin: 0; }
@media (max-width: 560px) { .page-comments .grid { grid-template-columns: 1fr; } }

/* 9. Review lists (Babylon + PD) ---------------------------------------- */
.review-list { display: grid; gap: 12px; }
.review-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    scroll-margin-top: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.review-item:hover { border-color: #dccfc5; }
.review-item.no-icon { grid-template-columns: 1fr auto; }
.review-item.saved { border-color: var(--ok-ink); box-shadow: 0 0 0 3px var(--ok-bg), var(--card-shadow); }
.review-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #fdf1f4, #f6dbe3); }
.review-icon img { width: 32px; height: 32px; display: block; }
.review-item .info { min-width: 0; }
.review-item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item .excerpt { margin-top: 6px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item .buttons { display: flex; gap: 6px; align-items: center; }
.review-item form { margin: 0; }
.star-row { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
@media (max-width: 600px) {
    .review-item { grid-template-columns: 44px 1fr; }
    .review-item.no-icon { grid-template-columns: 1fr; }
    .review-item .buttons { grid-column: 1 / -1; justify-content: flex-end; }
}

/* 10. Review forms (Babylon + PD) --------------------------------------- */
.review-form textarea.tall { min-height: 170px; }
.page-pd-review-form textarea { min-height: 220px; }
.page-pd-review-form .stars label { min-width: 0; padding: 6px 10px; }
.rating-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.rating-table td { padding: 9px 0; border-bottom: 1px solid #f0eae5; vertical-align: middle; }
.rating-table td:first-child { width: 40%; padding-right: 12px; font-size: 14px; font-weight: 600; }
.rating-table tr:last-child td { border-bottom: 0; }
.custom-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0eae5; }
.custom-row:last-child { border-bottom: 0; margin-bottom: 12px; }
@media (max-width: 560px) {
    .custom-row { grid-template-columns: 1fr; }
    .rating-table td { display: block; width: auto; border: 0; padding: 4px 0; }
    .rating-table td:first-child { width: auto; padding-top: 10px; }
    .rating-table tr { display: block; border-bottom: 1px solid #f0eae5; padding-bottom: 8px; }
}

/* 11. Login & password -------------------------------------------------- */
.page-login .wrap { max-width: 430px; padding-top: 64px; }
.auth-card { padding: 32px 30px; text-align: center; }
.auth-card .field { text-align: left; }
.auth-card .form-alert { text-align: left; }
.auth-card .btn { width: 100%; margin-top: 4px; padding: 12px; }
.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 14px 28px -12px rgba(122, 25, 55, .7);
}
.auth-icon .icon { width: 30px; height: 30px; }
.auth-card h1 { margin: 0; font-size: 24px; }
.auth-card .sub { margin: 2px 0 22px; }
.page-password .wrap { max-width: 640px; }

/* 12. Telegram, admins & visitors --------------------------------------- */
.tag {
    display: inline-block;
    padding: 1px 8px;
    margin-left: 6px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    color: var(--muted);
    background: #efe8e2;
}
.tag.super { color: #fff; background: var(--accent); }
.tag.you { color: var(--ok-ink); background: var(--ok-bg); }
.tag.warn { color: #8a5a00; background: #fbecc9; }

.tg-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #fcfaf8; border: 1px solid var(--line); }
.tg-status.ok { background: var(--ok-bg); border-color: #bfe3cb; color: var(--ok-ink); }
.tg-status .icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.tg-status .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tg-status.ok .meta { color: var(--ok-ink); }
.tg-connect { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.tg-connect form { margin: 0; }
.tg-waiting { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tg-manual { margin-top: 16px; border-top: 1px solid #f0eae5; padding-top: 12px; }
.tg-manual summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.tg-manual .link-box { margin-top: 10px; }

.page-admins .list { display: grid; gap: 12px; margin-bottom: 20px; }
.page-admins .item {
    display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
    padding: 14px 18px; background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: var(--card-shadow);
}
.page-admins .name { font-weight: 700; font-size: 16px; }
.page-admins .meta { color: var(--muted); font-size: 13px; }
.page-admins .buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page-admins .buttons form { margin: 0; }
.pw-reset { position: relative; }
.pw-reset summary { list-style: none; }
.pw-reset summary::-webkit-details-marker { display: none; }
.pw-reset .link-box { margin-top: 8px; }
@media (max-width: 560px) {
    .page-admins .item { grid-template-columns: 1fr; }
    .page-admins .buttons { justify-content: flex-start; }
}

.chip.ok { color: var(--ok-ink); background: var(--ok-bg); }
.chip.warn { color: #8a5a00; background: #fbecc9; }
.chip.bad { color: var(--danger); background: #fdecea; }

.sub-banner { display: flex; flex-wrap: wrap; gap: 12px; margin: -4px 0 18px; align-items: stretch; }
.sub-stat {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; border-radius: 14px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--card-shadow);
}
.sub-stat-icon {
    width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center;
    color: var(--accent); background: linear-gradient(135deg, #fdf1f4, #f6dbe3);
}
.sub-stat-icon .icon { width: 19px; height: 19px; }
.sub-stat-text { display: flex; flex-direction: column; line-height: 1.15; }
.sub-stat-text b { font-size: 18px; font-weight: 800; }
.sub-stat-text small { font-size: 12px; color: var(--muted); }
.sub-stat.warn .sub-stat-icon { color: #8a5a00; background: #fbecc9; }
.sub-stat.warn .sub-stat-text b { color: #8a5a00; }
.sub-help {
    display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 240px;
    padding: 12px 16px; border-radius: 14px; text-decoration: none; color: #fff;
    background: var(--brand-gradient); box-shadow: 0 12px 26px -14px rgba(122, 25, 55, .6);
    transition: transform .15s, box-shadow .15s;
}
.sub-help:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -14px rgba(122, 25, 55, .7); }
.sub-help > .icon:first-child { width: 22px; height: 22px; flex: none; }
.sub-help > .icon:last-child { width: 16px; height: 16px; flex: none; opacity: .8; margin-left: auto; }
.sub-help span { display: flex; flex-direction: column; line-height: 1.25; }
.sub-help small { font-size: 12px; opacity: .9; }

.visit-count {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; border-radius: 9px; font-size: 13px; white-space: nowrap;
    color: var(--muted); background: #f4efeb;
}
.visit-count.ready { color: var(--accent); background: var(--accent-soft); }
.visit-count b { font-weight: 800; }
.visit-count .icon { width: 15px; height: 15px; }
.visit-count .spinner { width: 14px; height: 14px; border-width: 2px; }

.suggest { position: relative; }
.suggest-menu {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
    margin: 0; padding: 6px; list-style: none;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 36px -16px rgba(31, 27, 24, .4); max-height: 280px; overflow-y: auto;
}
.suggest-menu li {
    padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.suggest-menu li b { color: var(--accent); }
.suggest-menu li.active, .suggest-menu li:hover { background: var(--accent-soft); }

/* Admin cards (Admins page): header, stat strip, login strip, inline Manage panel */
.admin-card {
    display: block; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: border-color .2s, box-shadow .2s;
}
.admin-card.manage-open { border-color: #e6cdd5; box-shadow: 0 1px 2px rgba(31, 27, 24, .04), 0 22px 44px -28px rgba(122, 25, 55, .5); }
.acard-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.acard-avatar {
    width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
    font-size: 19px; font-weight: 800; color: var(--accent); background: linear-gradient(135deg, #fdf1f4, #f3d3dd);
}
.acard-avatar.super { color: #fff; background: var(--brand-gradient); box-shadow: 0 10px 20px -12px rgba(122, 25, 55, .8); }
.acard-ident { flex: 1 1 auto; min-width: 0; }
.acard-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 16.5px; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
.acard-name .tag { margin-left: 0; }
.acard-sub { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; color: var(--muted); font-size: 13px; }
.acard-sub span + span::before { content: "·"; margin-right: 6px; }
.status-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px;
    font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--muted); background: #f3eee9;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.ok { color: var(--ok-ink); background: var(--ok-bg); }
.status-pill.ok i { box-shadow: 0 0 0 3px rgba(29, 107, 58, .18); }
.status-pill.warn { color: #8a5a00; background: #fbecc9; }
.status-pill.bad { color: var(--danger); background: #fdecea; }
.acard-manage .icon:last-child { transition: transform .25s; }
.admin-card.manage-open .acard-manage .icon:last-child { transform: rotate(180deg); }

.acard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.astat { display: flex; align-items: flex-start; gap: 11px; min-width: 0; padding: 13px 18px; }
.astat + .astat { border-left: 1px solid var(--line); }
.astat-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: #f5f0ec; }
.astat-icon .icon { width: 17px; height: 17px; }
.astat[data-stat="limit"] .astat-icon { color: var(--accent); background: var(--accent-soft); }
.astat.ok .astat-icon { color: var(--ok-ink); background: var(--ok-bg); }
.astat.warn .astat-icon { color: #8a5a00; background: #fbecc9; }
.astat.bad .astat-icon { color: var(--danger); background: #fdecea; }
.astat.bad b { color: var(--danger); }
.astat-body { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.astat-body small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.astat-body b { margin-top: 3px; font-size: 15.5px; font-weight: 750; }
.astat-body b span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.astat-sub { margin-top: 1px; overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.meter { display: block; height: 6px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #efe8e2; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--button-gradient); transition: width .3s; }
.meter.full i { background: #d98a00; }

.acard-login { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 11px 18px; border-top: 1px solid var(--line); background: #fbf8f6; }
.acard-login-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.acard-login-label .icon { width: 15px; height: 15px; }
.cred {
    display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%;
    padding: 3px 4px 3px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.cred small { margin-right: 6px; font-size: 12px; color: var(--muted); }
.cred code { padding-right: 4px; font: 600 13.5px ui-monospace, Consolas, monospace; color: var(--ink); overflow-wrap: anywhere; }
.cred code.muted { padding: 4px 8px 4px 0; font: 500 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--muted); }
.icon-btn {
    display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0;
    border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.icon-btn:disabled { cursor: progress; opacity: .6; }
.icon-btn .icon { width: 15px; height: 15px; }
.icon-btn.done { color: var(--ok-ink); background: var(--ok-bg); }

.admin-item [data-manage-toggle][aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.admin-manage-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.admin-item.manage-open .admin-manage-panel { grid-template-rows: 1fr; }
.admin-manage-inner { min-height: 0; overflow: hidden; }
.admin-manage-body {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
    padding: 16px 18px 18px; border-top: 1px solid var(--line); background: #f7f3ef;
}
.msetting {
    display: grid; align-content: start; gap: 10px; min-width: 0;
    padding: 14px 15px; background: var(--card); border: 1px solid var(--line); border-radius: 13px;
}
.msetting.wide { grid-column: 1 / -1; }
.msetting-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.msetting-head > .icon { width: 17px; height: 17px; color: var(--accent); flex: none; }
.msetting-head b { font-weight: 700; }
.msetting-head small { flex-basis: 100%; margin: -2px 0 0 25px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.msetting-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msetting-row.between { justify-content: space-between; }
.msetting-row > form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msetting-row > form.grow { flex: 1 1 220px; }
.msetting-row input { width: auto; min-width: 0; padding: 8px 12px; font-size: 14px; }
.msetting-row input[type=text], .msetting-row input[type=password] { flex: 1 1 170px; }
.msetting-status { font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 1px; }
.msetting-status.ok { color: var(--ok-ink); }
.msetting-status.bad { color: var(--danger); }
.msetting-status.pending { color: #8a5a00; }
.msetting-status:empty { display: none; }
.msetting.danger-zone { border-color: #f0c8c2; background: #fdf6f5; }
.msetting.danger-zone .msetting-head { flex: 1 1 280px; }
.msetting.danger-zone .msetting-head > .icon { color: var(--danger); }

.stepper {
    display: inline-flex; align-items: stretch; overflow: hidden; flex: none;
    border: 1px solid var(--field-line); border-radius: 10px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179, 38, 74, .12); }
.stepper button { width: 34px; padding: 0; border: 0; font: inherit; font-size: 17px; line-height: 1; color: var(--ink); background: #f7f2ee; cursor: pointer; }
.stepper button:hover { color: var(--accent); background: var(--accent-soft); }
.msetting-row .stepper input[type=number] {
    flex: none; width: 64px; padding: 8px 4px; border: 0; border-radius: 0; text-align: center;
    font-weight: 700; background: #fff; box-shadow: none; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.preset-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.preset {
    padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--muted); background: #fff; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.preset:hover { color: var(--accent); border-color: #e6cdd5; }
.preset.active { color: var(--accent); background: var(--accent-soft); border-color: #eec4d1; }

.vchoices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vchoice {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
    font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px;
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.vchoice:hover { border-color: #e2b3c1; box-shadow: 0 12px 24px -18px rgba(122, 25, 55, .55); transform: translateY(-1px); }
.vchoice:disabled { cursor: progress; opacity: .7; transform: none; }
.vchoice-icon {
    width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
    color: #fff; background: var(--button-gradient); box-shadow: 0 8px 16px -10px rgba(179, 38, 74, .8);
}
.vchoice-icon .icon { width: 18px; height: 18px; }
.vchoice[value="set"] .vchoice-icon { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.vchoice-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.vchoice-text b { font-size: 14px; }
.vchoice-text small { font-size: 12.5px; color: var(--muted); }
.vchoice-text small span { font-weight: 650; color: var(--ink); }

.pass-field { position: relative; display: flex; flex: 1 1 220px; min-width: 0; }
.pass-field input { flex: 1 1 auto; padding-right: 42px; }
@keyframes filled-flash { from { border-color: var(--accent); background: var(--accent-soft); } }
.filled-in { animation: filled-flash 1.6s ease-out; }
.pass-field .icon-btn { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); }

@media (max-width: 720px) {
    .acard-stats, .admin-manage-body, .vchoices { grid-template-columns: 1fr; }
    .astat + .astat { border-left: 0; border-top: 1px solid var(--line); }
    .astat { padding: 11px 16px; }
}
@media (max-width: 560px) {
    .acard-head { flex-wrap: wrap; padding: 14px 16px; }
    .acard-ident { flex-basis: calc(100% - 60px); }
    .acard-manage { margin-left: auto; }
    .acard-login, .admin-manage-body { padding-left: 16px; padding-right: 16px; }
    .cred { flex: 1 1 100%; }
    .cred code { flex: 1; }
}

.field-wide { grid-column: 1 / -1; }
.check-status { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.check-status.ok { color: var(--ok-ink); }
.check-status.bad { color: var(--danger); }
.check-status.pending, .check-status.warn { color: #8a5a00; }

.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfaf8; }
.contact > div:first-child { margin-bottom: 8px; font-size: 14px; }
.contact .meta { color: var(--muted); font-weight: 400; }

.visitor-list { display: grid; gap: 2px; }
.visitor { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 12px 4px; border-bottom: 1px solid #f2ece7; }
.visitor:last-child { border-bottom: 0; }
.visitor .dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #cbbfb5; }
.visitor.online .dot { background: #2f9e5a; box-shadow: 0 0 0 4px rgba(47, 158, 90, .16); }
.visitor .name { font-weight: 600; font-size: 14.5px; }
.visitor .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.visitor .chips { margin-top: 5px; }
@media (max-width: 560px) {
    .visitor { grid-template-columns: 14px 1fr; }
    .visitor .when { grid-column: 2; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
