/* ============================================================
   POMOCNIK – Premium Design System
   Google Font: Inter (loaded via <link> in header)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Orbitron:wght@700;900&display=swap');

/* ============================================================
   TOKENS – Light Mode
   ============================================================ */
:root {
    /* Palette */
    --bg:           #f0f4f9;
    --bg2:          #e6ecf5;
    --surface:      #ffffff;
    --surface2:     #f8fafd;
    --text:         #0f1827;
    --text2:        #3a4a5c;
    --muted:        #6b7d94;
    --line:         #d4dce9;
    --line-light:   #e8eef6;

    /* Brand */
    --primary:      #0f6b67;
    --primary-mid:  #127a75;
    --primary-dark: #0a504d;
    --primary-glow: rgba(15, 107, 103, .18);
    --primary-subtle: rgba(15, 107, 103, .08);

    /* Accent */
    --accent:       #e8a832;
    --accent-dark:  #c78a1a;
    --accent-subtle: rgba(232, 168, 50, .12);

    /* State */
    --danger:       #c0291c;
    --ok:           #15703b;

    /* Elevation */
    --shadow-xs:    0 1px 3px rgba(15, 24, 39, .06), 0 1px 2px rgba(15, 24, 39, .04);
    --shadow-sm:    0 4px 12px rgba(15, 24, 39, .07), 0 2px 4px rgba(15, 24, 39, .04);
    --shadow:       0 8px 24px rgba(15, 24, 39, .09), 0 4px 8px rgba(15, 24, 39, .05);
    --shadow-lg:    0 20px 48px rgba(15, 24, 39, .12), 0 8px 16px rgba(15, 24, 39, .06);
    --shadow-primary: 0 8px 24px rgba(15, 107, 103, .22);

    /* Radius */
    --r-sm:  6px;
    --r:     10px;
    --r-lg:  16px;
    --r-xl:  24px;
    --r-full: 9999px;

    /* Transition */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: 200ms;
}

/* ============================================================
   TOKENS – Dark Mode
   ============================================================ */
body.theme-dark {
    --bg:           #090e18;
    --bg2:          #0d1424;
    --surface:      #111b2e;
    --surface2:     #162035;
    --text:         #e8eff9;
    --text2:        #a8b8cc;
    --muted:        #6e849e;
    --line:         #1e2d42;
    --line-light:   #172135;

    --primary:      #2cc8b9;
    --primary-mid:  #26b5a7;
    --primary-dark: #1f9e91;
    --primary-glow: rgba(44, 200, 185, .18);
    --primary-subtle: rgba(44, 200, 185, .08);

    --accent:       #f0c038;
    --accent-dark:  #d4a420;
    --accent-subtle: rgba(240, 192, 56, .10);

    --danger:       #e05450;
    --ok:           #2db870;

    --shadow-xs:    0 1px 3px rgba(0, 0, 0, .25), 0 1px 2px rgba(0, 0, 0, .18);
    --shadow-sm:    0 4px 12px rgba(0, 0, 0, .30), 0 2px 4px rgba(0, 0, 0, .20);
    --shadow:       0 8px 24px rgba(0, 0, 0, .35), 0 4px 8px rgba(0, 0, 0, .22);
    --shadow-lg:    0 20px 48px rgba(0, 0, 0, .45), 0 8px 16px rgba(0, 0, 0, .28);
    --shadow-primary: 0 8px 24px rgba(44, 200, 185, .20);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(ellipse at 20% 0%, var(--primary-glow) 0%, transparent 55%),
                      radial-gradient(ellipse at 80% 100%, var(--accent-subtle) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.05rem, 2vw, 1.3rem); margin-bottom: 0.4em; }

p { color: var(--text2); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(16px, 4vw, 52px);
    height: 68px;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: var(--text);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    text-decoration: none !important;
    flex-shrink: 0;
    transition: opacity var(--dur) var(--ease);
}
.brand:hover { opacity: .82; }
.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--r-sm);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text2);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    text-decoration: none !important;
}
.site-nav a:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.site-nav a.button {
    padding: 7px 15px;
    color: #fff;
    background: var(--primary);
    border-radius: var(--r);
    font-size: 0.85rem;
}
.site-nav a.button:hover {
    background: var(--primary-dark);
    color: #fff;
}
.site-nav a.button.small {
    padding: 6px 13px;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-sm);
    min-width: 42px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav-toggle:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   LAYOUT
   ============================================================ */
main {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 60px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
    gap: 36px;
    align-items: center;
    padding: clamp(32px, 6vw, 80px) 0;
}

.hero-copy { display: grid; gap: 24px; }

.hero-copy h1 {
    max-width: 820px;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.hero-copy > p {
    max-width: 560px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Hero panel */
.hero-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 32px 28px;
    display: grid;
    align-content: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.hero-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: var(--primary-glow);
    border-radius: 50%;
    pointer-events: none;
}

.hero-logo {
    width: min(120px, 55%);
    height: auto;
    margin: 0 auto 4px;
    filter: drop-shadow(0 4px 12px var(--primary-glow));
}

.hero-panel div {
    display: grid;
    gap: 3px;
    padding: 16px 18px;
    border-radius: var(--r-lg);
    background: var(--primary-subtle);
    border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--line));
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.hero-panel div:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.hero-panel strong {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.hero-panel span {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}

/* Stats in band section */
.stats article {
    display: grid;
    gap: 3px;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--primary-subtle);
    border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--line));
}

.stats strong {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.03em;
}

/* ============================================================
   ACTIONS & BUTTONS
   ============================================================ */
.actions, .row-actions, .footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 22px;
    border: 0;
    border-radius: var(--r);
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--dur) var(--ease),
                transform var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease);
    position: relative;
    overflow: hidden;
}

.button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
    pointer-events: none;
}

.button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
    text-decoration: none;
    color: #fff;
}
.button:active { transform: translateY(0); box-shadow: none; }

.button.secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
}
.button.secondary:hover {
    background: var(--bg2);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.button.secondary::after { display: none; }

.button.danger { background: var(--danger); }
.button.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

.button.small { min-height: 36px; padding: 7px 14px; font-size: .82rem; }

.button:disabled, button:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

body.theme-dark .button.secondary {
    background: var(--surface2);
    border-color: var(--line);
    color: var(--text);
}
body.theme-dark .button.secondary:hover {
    background: color-mix(in srgb, var(--surface2) 80%, var(--primary-subtle));
}

/* ============================================================
   BAND & GRID SECTIONS
   ============================================================ */
.band {
    padding: 48px 0 32px;
}

.band > h2 {
    margin-bottom: 24px;
    font-size: 1.55rem;
    font-weight: 800;
}

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grid article, .band article {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
    position: relative;
    overflow: hidden;
}

.grid article::before, .band article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}

.grid article:hover, .band article:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.grid article:hover::before, .band article:hover::before {
    opacity: 1;
}

.grid article h3, .band article h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 700;
}

/* ============================================================
   FORM SHELLS & CARDS
   ============================================================ */
.form-shell, .dashboard, .admin, .listing-head {
    display: grid;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

.form-shell.narrow { max-width: 520px; }

.form-card, .helper-card, .profile-side, .identity-box,
details, .admin-message, .threads, .conversation, .admin-tab-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.form-card {
    display: grid;
    gap: 16px;
    padding: clamp(20px, 3.5vw, 32px);
}

label, fieldset {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-weight: 600;
    font-size: .87rem;
    letter-spacing: 0.01em;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
}

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.choice input[type="radio"],
.choice input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    padding: 0;
    flex: 0 0 16px;
    accent-color: var(--primary);
}

input, textarea, select {
    width: 100%;
    min-height: 44px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 10px 13px;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
    margin: 0 0 16px;
    padding: 14px 18px;
    border-radius: var(--r);
    background: var(--surface2);
    border: 1px solid var(--line);
    font-size: .9rem;
    font-weight: 500;
    animation: slideDown .25s var(--ease) both;
}
.flash.error {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
    color: var(--danger);
}
.flash.success {
    background: color-mix(in srgb, var(--ok) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
    color: var(--ok);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HELPER CARDS
   ============================================================ */
.helper-list { display: grid; gap: 16px; margin-top: 20px; }

.helper-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding: 22px;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.helper-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.helper-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.helper-meta {
    display: grid;
    gap: 8px;
    min-width: 190px;
    align-content: start;
}

.stars { color: var(--accent-dark); font-weight: 800; letter-spacing: 1px; }
.muted { color: var(--muted); font-size: .85rem; }

.empty {
    padding: 32px;
    background: var(--surface);
    border: 1.5px dashed var(--line);
    border-radius: var(--r-lg);
    text-align: center;
    color: var(--muted);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 28px 0 0;
}

.pagination a {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--text2);
    font-weight: 700;
    font-size: .88rem;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
                border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.pagination a:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
}
.pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
}
.profile-main, .profile-side { padding: 24px; }
.compact-form { display: grid; gap: 12px; margin-top: 18px; }

/* ============================================================
   MESSAGES
   ============================================================ */
.messages-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
}
.threads {
    padding: 14px;
    max-height: 400px;
    overflow-y: auto;
}
.threads a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    border-radius: var(--r);
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    transition: background var(--dur) var(--ease);
}
.threads a.active, .threads a:hover {
    background: var(--primary-subtle);
    text-decoration: none;
    color: var(--primary);
}
.threads span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #1a1000;
    font-size: .72rem;
    font-weight: 800;
}
.conversation { padding: 18px; }

.message-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.inline-notice { display: inline-flex; margin: 0; }

.blocked-notice {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.message-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
}
.message {
    max-width: 76%;
    padding: 11px 14px;
    border-radius: var(--r-lg);
    background: var(--surface2);
    border: 1px solid var(--line-light);
}
.message.mine {
    margin-left: auto;
    background: var(--primary-subtle);
    border-color: color-mix(in srgb, var(--primary) 20%, var(--line));
}
.message p { margin: 4px 0; font-size: .88rem; color: var(--text); }
.message small { color: var(--muted); font-size: .75rem; }
.reply-form { display: grid; gap: 10px; }

/* ============================================================
   IDENTITY BOX
   ============================================================ */
.identity-box {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: var(--r-lg);
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin { max-width: 1320px; }

details {
    padding: 16px;
    border-radius: var(--r-lg);
}
summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    user-select: none;
    padding: 2px 0;
    color: var(--text);
    list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 10px;
    font-size: .75em;
    transition: transform var(--dur) var(--ease);
    color: var(--primary);
}
details[open] summary::before { transform: rotate(90deg); }

.admin-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
}

.admin-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 7px 14px;
    background: var(--surface2);
    color: var(--text2);
    font-family: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
    white-space: nowrap;
}

.admin-tabs button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.admin-tabs button:hover:not(.active) {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-tab-panel {
    display: none;
    padding: 24px;
}
.admin-tab-panel.active { display: block; }
.admin-tab-panel h2 { margin-top: 0; }

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.inline-form label { min-width: 180px; }
.table-wrap { overflow-x: auto; margin-top: 14px; border-radius: var(--r); }

.users-scroll {
    max-height: 800px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.relation-blocks-scroll {
    max-height: 560px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.users-scroll table, .relation-blocks-scroll table { margin: 0; }
.users-scroll thead th, .relation-blocks-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-light);
    text-align: left;
    vertical-align: top;
    font-size: .88rem;
}
th {
    background: var(--primary-subtle);
    color: var(--text);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
tr:hover td { background: color-mix(in srgb, var(--primary-subtle) 50%, transparent); }

.mini-edit { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 6px; }
.admin-user-description { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface);
    font-size: .83rem;
    font-weight: 500;
}
.chip button {
    border: 0;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: var(--muted);
    transition: color var(--dur) var(--ease);
    padding: 0;
    line-height: 1;
}
.chip button:hover { color: var(--danger); }

.admin-message {
    padding: 16px;
    margin-top: 12px;
}
.admin-message.unread {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.admin-messages-scroll {
    max-height: 1020px;
    overflow-y: auto;
    padding-right: 6px;
}

/* ============================================================
   NOTICES & ALERTS
   ============================================================ */
.notice, .terms-alert {
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
    border-radius: var(--r);
    background: var(--accent-subtle);
    font-size: .9rem;
}

.payment-options .notice { flex-basis: 100%; margin: 0; }

.filters, .payment-options {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.filters label { min-width: 210px; }

.manage-list { display: grid; gap: 10px; margin-top: 14px; }
.manage-row {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface2);
    font-size: .9rem;
}

.content-page {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.legal-text {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    line-height: 1.75;
}

.terms-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.terms-alert p { margin: 0; flex: 1 1 280px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding: 28px clamp(16px, 4vw, 52px);
}

.footer-main .footer-brand strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.footer-main .footer-brand span {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.footer-links a {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.footer-links a:hover {
    color: var(--primary);
    background: var(--primary-subtle);
    text-decoration: none;
}

/* ── Visitor Counter strip ── */
.footer-counter {
    border-top: 1px solid var(--line-light);
    background: color-mix(in srgb, var(--surface) 60%, var(--bg));
    padding: 22px clamp(16px, 4vw, 52px);
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: center;
}

.counter-label {
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--muted);
}

.counter-digits {
    display: flex;
    align-items: stretch;
    gap: 3px;
    background: #0a0a0a;
    border: 2px solid #1a1a1a;
    border-radius: 10px;
    padding: 7px 10px;
    box-shadow:
        0 4px 20px rgba(0,0,0,.55),
        0 1px 4px rgba(0,0,0,.40),
        inset 0 1px 0 rgba(255,255,255,.06);
}

/* Each digit tile */
.counter-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 62px;
    background: linear-gradient(180deg, #232323 0%, #111111 48%, #141414 49%, #1e1e1e 100%);
    color: #ffffff;
    border: 1px solid #2e2e2e;
    border-radius: 6px;
    font-family: 'Orbitron', 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: digitFlip .5s cubic-bezier(.4,0,.2,1) both;
    text-shadow:
        0 0 14px rgba(255,255,255,.40),
        0 1px 2px rgba(0,0,0,.9);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        inset 0 -1px 0 rgba(0,0,0,.6),
        inset 1px 0 0 rgba(255,255,255,.03),
        inset -1px 0 0 rgba(255,255,255,.03);
}

/* Top-half gloss reflection */
.counter-digit::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 46%;
    background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 6px 6px 0 0;
}

/* Mechanical center-split line */
.counter-digit::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1.5px;
    background: rgba(0,0,0,.75);
    pointer-events: none;
}

/* Dot separator between groups of 3 */
.counter-sep {
    display: flex;
    align-items: center;
    font-family: 'Orbitron', monospace;
    font-size: .85rem;
    font-weight: 900;
    color: #3a3a3a;
    margin: 0 1px;
    align-self: center;
    line-height: 1;
    user-select: none;
}

@keyframes digitFlip {
    0%   { transform: rotateX(80deg) scaleY(.6); opacity: 0; }
    65%  { transform: rotateX(-8deg) scaleY(1.03); opacity: 1; }
    100% { transform: rotateX(0deg) scaleY(1); opacity: 1; }
}

/* ============================================================
   TERMS ALERT (top banner)
   ============================================================ */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .site-header { align-items: center; }
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none;
        position: fixed;
        top: 68px;
        left: 12px;
        right: 12px;
        padding: 16px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-xl);
        box-shadow: var(--shadow-lg);
        z-index: 99;
        gap: 4px;
        flex-direction: column;
        align-items: stretch;
    }
    .site-nav a { padding: 11px 14px; font-size: .9rem; }
    .site-nav.open { display: flex; }

    .hero { grid-template-columns: 1fr; gap: 28px; }
    .hero-panel { max-width: 460px; }
    .profile { grid-template-columns: 1fr; }
    .messages-layout { grid-template-columns: 1fr; }
    .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .helper-card { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    main { width: calc(100% - 20px); padding: 24px 0 40px; }
    .site-header { padding: 0 14px; }
    .brand span { font-size: .95rem; }
    .brand img { width: 34px; height: 34px; }
    .hero { padding: 20px 0; gap: 18px; }
    .hero-copy h1 { font-size: 1.8rem; }
    .hero-copy > p { font-size: .92rem; }
    .grid.three, .grid.four { grid-template-columns: 1fr; }
    .actions, .inline-form, .row-actions { display: grid; grid-template-columns: 1fr; }
    .filters, .payment-options { display: grid; grid-template-columns: 1fr; }
    .button { width: 100%; min-height: 42px; }
    .form-card, .profile-main, .profile-side,
    .conversation, .threads, details, .admin-tab-panel { padding: 14px; }
    .message { max-width: 100%; }
    .mini-edit { grid-template-columns: 1fr; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.2rem; }
    table { font-size: .82rem; }
    .counter-digit { width: 34px; height: 48px; font-size: 1.2rem; border-radius: 4px; }
    .counter-digits { padding: 5px 7px; gap: 2px; border-radius: 7px; }
    .footer-counter { gap: 14px; padding: 16px 14px; }
}

@media (max-width: 340px) {
    body { font-size: 13.5px; }
    .site-header { position: static; }
    .brand img { width: 28px; height: 28px; }
    .nav-toggle { min-width: 36px; min-height: 36px; }
    input, textarea, select { min-height: 38px; padding: 8px 10px; }
    .hero-copy h1 { font-size: 1.35rem; }
    .hero-panel strong, .stats strong { font-size: 1.5rem; }
    .counter-digit { width: 26px; height: 38px; font-size: .95rem; border-radius: 4px; }
}
