/* Tiko admin — application styles.
 * English UI, LTR, light theme. Sidebar is the only dark surface.
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--tiko-font-family);
    font-size: 14px;
    color: var(--tiko-text);
    background: var(--tiko-bg);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
button { font-family: inherit; }

/* ─────────────────────────────────────────────── App shell */
.app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--tiko-sidebar-bg);
    color: var(--tiko-sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 22px;
    border-bottom: 1px solid var(--tiko-sidebar-divider);
    margin-bottom: 22px;
}
.sidebar-brand .mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--tiko-primary);
    box-shadow: 0 4px 12px rgba(36, 211, 170, 0.30);
    flex-shrink: 0;
}
.sidebar-brand .name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-spacer { flex: 1; }

.nav-group { margin-bottom: 20px; }
.nav-group-label {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    color: var(--tiko-sidebar-label);
    padding: 0 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: var(--tiko-radius-sm);
    color: var(--tiko-sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.nav-item:hover {
    background: var(--tiko-sidebar-hover);
    color: #fff;
}
.nav-item.is-active {
    background: var(--tiko-sidebar-active);
    color: #fff;
}
.nav-item.is-active .nav-icon { color: var(--tiko-primary); }
.nav-item .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: currentColor;
    opacity: 0.85;
}
.nav-item:hover .nav-icon { opacity: 1; }

.nav-item-button {
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.nav-logout { margin: 0; }

/* ─────────────────────────────────────────────── Main column */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--tiko-bg);
}

.content {
    flex: 1;
    padding: 32px;
    min-width: 0;
    background: #eaebef8f;
}

/* ─────────────────────────────────────────────── Page header */
.page-header { margin-bottom: 24px; }
.page-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--tiko-text);
    letter-spacing: -0.2px;
}
.page-header p {
    margin: 0;
    font-size: 14px;
    color: var(--tiko-text-tertiary);
}
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.page-header-action { flex: 0 0 auto; }

/* ─────────────────────────────────────────────── Cards */
.card {
    background: var(--tiko-surface);
    border-radius: var(--tiko-radius-md);
    box-shadow: var(--tiko-elev-1);
    border: 1px solid var(--tiko-border-subtle);
    padding: 28px;
}

.welcome-card {
    text-align: center;
    padding: 64px 32px;
}
.welcome-card h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--tiko-text);
    letter-spacing: -0.3px;
}
.welcome-card p {
    margin: 0 auto;
    font-size: 14px;
    color: var(--tiko-text-tertiary);
    max-width: 520px;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────── Login screen */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, var(--tiko-bg) 0%, #E7EFEB 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--tiko-surface);
    border-radius: var(--tiko-radius-lg);
    box-shadow: var(--tiko-elev-3);
    border: 1px solid var(--tiko-border-subtle);
    padding: 40px 36px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}
.auth-brand .mark {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--tiko-surface-elevated);
    box-shadow: 0 4px 12px rgba(31, 42, 36, 0.12);
}
.auth-brand .mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.auth-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--tiko-text);
    letter-spacing: -0.2px;
}

.auth-subtitle {
    margin: 0 0 28px;
    text-align: center;
    color: var(--tiko-text-tertiary);
    font-size: 14px;
}

/* ─────────────────────────────────────────────── Forms */
.field { display: block; margin-bottom: 16px; }
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tiko-text-secondary);
    margin-bottom: 6px;
}
.field-input {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: var(--tiko-text);
    background: var(--tiko-bg);
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    padding: 11px 14px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.field-input::placeholder { color: var(--tiko-text-placeholder); }
.field-input:focus {
    outline: none;
    background: var(--tiko-surface);
    border-color: var(--tiko-border-focus);
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

/* ─────────────────────────────────────────────── Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--tiko-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, transform 60ms ease, box-shadow 120ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--tiko-primary);
    color: var(--tiko-on-primary);
    box-shadow: 0 2px 6px rgba(36, 211, 170, 0.25);
}
.btn-primary:hover  { background: var(--tiko-primary-hover); }
.btn-primary:active { background: var(--tiko-primary-pressed); }

.btn-block { width: 100%; margin-top: 8px; }

/* ─────────────────────────────────────────────── Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--tiko-radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}
.alert-error {
    background: var(--tiko-error-surface);
    color: var(--tiko-error-strong);
    border: 1px solid #FAD4D4;
}

/* ─────────────────────────────────────────────── Approved dashboard shell */
body {
    background: var(--tiko-surface-elevated);
}

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

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    background: var(--tiko-surface-elevated);
    transition: grid-template-columns 160ms ease;
}

.sidebar {
    height: 100vh;
    min-height: 0;
    padding: 22px 14px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #15161A;
    scrollbar-color: rgba(189, 199, 194, 0.32) transparent;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: var(--tiko-radius-pill);
    background: rgba(189, 199, 194, 0.22);
}

.sidebar svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar-brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    padding: 0 6px 24px;
    margin: 0;
    border-bottom: 0;
}

.brand-block {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    overflow: hidden;
    background: #FFFFFF;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.sidebar-brand .name {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle {
    color: var(--tiko-sidebar-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--tiko-radius-xs);
    color: var(--tiko-sidebar-text);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, transform 160ms ease;
}

.sidebar-toggle:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-toggle svg {
    width: 19px;
    height: 19px;
}

.sidebar-search {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    height: 40px;
    margin: 0 0 20px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--tiko-radius-sm);
    color: var(--tiko-sidebar-text);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-search-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.sidebar-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: #FFFFFF;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    box-shadow: none;
}

.sidebar-search input::placeholder {
    color: var(--tiko-sidebar-text);
}

.sidebar-search input:disabled {
    cursor: default;
    opacity: 1;
}

.sidebar-nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 18px;
}

.nav-section,
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.nav-section-label {
    margin: 0 0 8px;
    padding: 0 12px;
    color: var(--tiko-sidebar-label);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-item,
.nav-group-toggle {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 42px;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    margin: 0;
    border-radius: var(--tiko-radius-xs);
    border: 0;
    color: var(--tiko-sidebar-text);
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.nav-item:hover,
.nav-item.is-active,
.nav-group-toggle:hover,
.nav-group.has-active-item > .nav-group-toggle {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-disabled {
    cursor: default;
    opacity: 0.74;
}

.nav-item.is-disabled:hover {
    color: var(--tiko-sidebar-text);
    background: transparent;
}

.nav-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    color: currentColor;
}

.nav-item .nav-icon,
.nav-group-toggle .nav-icon {
    width: 22px;
    height: 22px;
    opacity: 1;
}

.nav-item.is-active .nav-icon,
.nav-group.has-active-item > .nav-group-toggle .nav-icon {
    color: var(--tiko-primary);
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-chevron {
    display: inline-flex;
    width: 17px;
    height: 17px;
    color: currentColor;
    opacity: 0.7;
    transition: transform 140ms ease;
}

.nav-group.is-collapsed .nav-chevron {
    transform: rotate(-90deg);
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 4px 0 2px 22px;
    padding-left: 13px;
    border-left: 1px solid rgba(189, 199, 194, 0.18);
}

.nav-group-items[hidden] {
    display: none;
}

.nav-logout {
    flex: 0 0 auto;
    margin-top: auto;
}

.nav-item-button {
    border: 0;
}

.brand-block:focus-visible,
.sidebar-toggle:focus-visible,
.nav-item:focus-visible,
.nav-group-toggle:focus-visible {
    outline: 2px solid var(--tiko-primary);
    outline-offset: 2px;
}

.sidebar-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.admin-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--tiko-radius-sm);
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.07);
}

.admin-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #15161A;
    background: #F3F7F4;
    font-size: 14px;
    font-weight: 800;
}

.admin-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.admin-meta strong,
.admin-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-meta strong {
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-meta small {
    color: var(--tiko-sidebar-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.admin-switch {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--tiko-sidebar-text);
}

@media (min-width: 821px) {
    html.sidebar-collapsed .app-shell {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    html.sidebar-collapsed .sidebar {
        padding-right: 12px;
        padding-left: 12px;
    }

    html.sidebar-collapsed .sidebar-brand {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        padding-right: 0;
        padding-left: 0;
    }

    html.sidebar-collapsed .brand-block {
        grid-template-columns: 42px;
        justify-content: center;
    }

    html.sidebar-collapsed .brand-copy,
    html.sidebar-collapsed .nav-section-label,
    html.sidebar-collapsed .nav-label,
    html.sidebar-collapsed .nav-chevron,
    html.sidebar-collapsed .nav-group-items,
    html.sidebar-collapsed .admin-meta,
    html.sidebar-collapsed .admin-switch {
        display: none;
    }

    html.sidebar-collapsed .sidebar-toggle {
        transform: rotate(180deg);
    }

    html.sidebar-collapsed .sidebar-search {
        width: 44px;
        justify-content: center;
        align-self: center;
        padding: 0;
    }

    html.sidebar-collapsed .sidebar-search input {
        display: none;
    }

    html.sidebar-collapsed .sidebar-nav {
        align-items: center;
        gap: 14px;
    }

    html.sidebar-collapsed .nav-section,
    html.sidebar-collapsed .nav-group {
        align-items: center;
        width: 100%;
    }

    html.sidebar-collapsed .nav-item,
    html.sidebar-collapsed .nav-group-toggle {
        grid-template-columns: 22px;
        justify-content: center;
        justify-items: center;
        width: 44px;
        min-height: 44px;
        padding: 0;
    }

    html.sidebar-collapsed .sidebar-footer {
        align-items: center;
    }

    html.sidebar-collapsed .admin-card {
        grid-template-columns: 38px;
        justify-content: center;
        width: 54px;
        padding: 8px;
    }

    html.sidebar-collapsed .nav-logout {
        width: 44px;
    }
}

.main {
    background: var(--tiko-surface-elevated);
}

.content {
    padding: 32px 30px 22px 32px;
}

/* ─────────────────────────────────────────────── Section placeholders */
.section-page {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--tiko-space-5);
}

/* The page header sets its own bottom margin; keep it out of the flex gap so the
 * spacing below the title stays as designed and isn't doubled. */
.section-page > .page-header {
    margin-bottom: 0;
}

.roadmap-panel {
    max-width: 920px;
}

.roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px 26px 26px;
}

.roadmap-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    padding: 17px 0;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.roadmap-row:first-child {
    padding-top: 0;
}

.roadmap-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.roadmap-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #111413;
    background: var(--tiko-primary-subtle);
    font-size: 12px;
    font-weight: 800;
}

.roadmap-row strong {
    display: block;
    margin: 1px 0 5px;
    color: var(--tiko-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.roadmap-row p {
    margin: 0;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

/* ─────────────────────────────────────────────── Dashboard */
.dashboard-page {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--tiko-space-5);
}

.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(31, 42, 36, 0.06);
    border-radius: var(--tiko-radius-lg);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(36, 211, 170, 0.10) 0%, rgba(255, 255, 255, 0) 46%),
        var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--tiko-primary);
}

.hero-copy {
    min-width: 0;
}

.hero-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--tiko-primary-pressed);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin: 0 0 8px;
    color: #111413;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.dashboard-hero p {
    margin: 0;
    max-width: 680px;
    color: var(--tiko-text-tertiary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
}

.hero-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: rgba(255, 255, 255, 0.78);
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.hero-actions a:hover {
    border-color: var(--tiko-border-strong);
    background: var(--tiko-surface-elevated);
    color: var(--tiko-text);
}

.hero-meta {
    display: flex;
    min-width: 230px;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid rgba(31, 42, 36, 0.07);
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.hero-meta span {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-meta strong {
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

/* Operations hub dashboard uses a denser 5-wide grid of clickable cards. */
.metric-grid.is-hub {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
    position: relative;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 18px 16px;
    border: 1px solid rgba(31, 42, 36, 0.065);
    border-radius: var(--tiko-radius-md);
    overflow: hidden;
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--metric-accent, var(--tiko-primary));
}

.metric-card h2 {
    margin: 0;
    padding-right: 6px;
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    color: #070908;
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.metric-card p {
    margin: 12px 0 0;
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.tone-peach { --metric-accent: #FDAF17; }
.tone-green { --metric-accent: #6BBF59; }
.tone-blue { --metric-accent: #5060BA; }
.tone-mint { --metric-accent: var(--tiko-primary); }
.tone-red { --metric-accent: var(--tiko-admin-red); }
.tone-purple { --metric-accent: #7C5AC7; }

/* ── Clickable metric cards (operations hub) */
.metric-card.is-clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.metric-card.is-clickable:hover {
    transform: translateY(-2px);
    border-color: rgba(31, 42, 36, 0.12);
    box-shadow: var(--tiko-elev-2);
}

/* ── Hero inline flag (needs attention / all clear) */
.hero-flag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: var(--tiko-radius-pill);
    background: var(--tiko-warning-surface);
    color: #8a5a00;
    font-size: 12px;
    font-weight: 700;
}

.hero-flag.is-clear {
    background: var(--tiko-success-surface);
    color: #1a7a63;
}

.hero-flag.is-neutral {
    background: var(--tiko-surface-2);
    color: var(--tiko-text-secondary);
}

/* ── Needs Attention strip */
.needs-attention {
    padding: 18px 20px 20px;
    border: 1px solid #F2CFCB;
    border-radius: var(--tiko-radius-lg);
    background: linear-gradient(180deg, #FFF5F3 0%, #FBEDED 100%);
}

.needs-attention-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.needs-attention-head h2 {
    margin: 0;
    color: var(--tiko-admin-red-strong);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.needs-attention-kicker {
    color: var(--tiko-admin-red);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.needs-attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.na-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 16px;
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    border: 1px solid rgba(198, 40, 40, 0.16);
    text-decoration: none;
    color: var(--tiko-text);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.na-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--tiko-elev-1);
}

.na-count {
    color: var(--tiko-admin-red);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    min-width: 36px;
    text-align: center;
}

.na-label {
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--tiko-text);
}

.na-go {
    color: var(--tiko-text-placeholder);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
    grid-template-areas:
        "status activity"
        "readiness readiness";
    gap: 20px;
}

.summary-panel {
    grid-area: status;
}

.dashboard-grid .side-panel:nth-of-type(2) {
    grid-area: activity;
}

.dashboard-grid .side-panel:nth-of-type(3) {
    grid-area: readiness;
}

.dashboard-grid .side-panel:nth-of-type(3) .readiness-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-health-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: none;
    margin-top: 18px;
}

.photo-health-grid .side-panel,
.photo-health-grid .side-panel:nth-of-type(2),
.photo-health-grid .side-panel:nth-of-type(3) {
    grid-area: auto;
}

.photo-health-grid .side-panel:nth-of-type(3) .readiness-list {
    display: flex;
    flex-direction: column;
}

.photo-stat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 34px 30px;
}

.photo-stat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 40px;
}

.photo-stat-row span:first-child {
    min-width: 0;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
}

.photo-stat-row strong {
    justify-self: end;
    color: var(--tiko-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.photo-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 26px 26px;
}

.photo-image-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    box-shadow: 0 4px 16px rgba(31, 42, 36, 0.035);
}

.photo-image-preview {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--tiko-surface-2);
    overflow: hidden;
}

.photo-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-image-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.photo-image-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.photo-image-title strong {
    min-width: 0;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.photo-image-meta,
.photo-image-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--tiko-text-tertiary);
    font-size: 11px;
    font-weight: 700;
}

.photo-query-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.photo-query-chips span {
    max-width: 100%;
    padding: 4px 7px;
    border-radius: var(--tiko-radius-pill);
    background: var(--tiko-surface-2);
    color: var(--tiko-text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.panel {
    min-width: 0;
    border: 1px solid rgba(31, 42, 36, 0.075);
    border-radius: var(--tiko-radius-lg);
    background: var(--tiko-surface-elevated);
    box-shadow: 0 8px 24px rgba(31, 42, 36, 0.025);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 26px 0;
}

.panel-head.compact {
    padding-top: 22px;
}

.panel-head h2 {
    margin: 0;
    color: #111413;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.15;
}

.side-panel .panel-head h2 {
    font-size: 19px;
    white-space: nowrap;
}

.panel-kicker {
    color: var(--tiko-text-placeholder);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-detail .panel .subhead {
    margin: 20px 24px 8px;
    color: var(--tiko-text-placeholder);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-list {
    display: flex;
    min-height: 240px;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 22px 26px 28px;
}

.status-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 9px;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
}

.status-row-top strong {
    font-size: 14px;
    font-weight: 800;
}

.status-track {
    height: 9px;
    border-radius: var(--tiko-radius-pill);
    background: var(--tiko-border-subtle);
    overflow: hidden;
}

.status-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tiko-primary);
}

.activity-list,
.readiness-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 26px 24px;
}

.activity-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.activity-dot,
.readiness-dot {
    width: 9px;
    height: 9px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--tiko-primary);
}

.activity-row strong {
    display: block;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.activity-row small {
    display: block;
    margin-top: 5px;
    color: var(--tiko-text-placeholder);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.empty-state {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 28px;
    text-align: center;
}

.compact-empty {
    min-height: 220px;
}

.left-empty {
    min-height: 210px;
    align-items: flex-start;
    text-align: left;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--tiko-text);
    font-size: 16px;
    font-weight: 800;
}

.empty-state p {
    max-width: 520px;
    margin: 0;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.readiness-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 38px;
}

.readiness-dot {
    margin-top: 0;
}

.readiness-dot.is-ready {
    background: var(--tiko-primary);
}

.readiness-dot.is-missing {
    background: var(--tiko-warning);
}

.readiness-row span:nth-child(2) {
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
}

.readiness-row strong {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 1240px) {
    .app-shell {
        grid-template-columns: 264px minmax(0, 1fr);
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid.is-hub {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "status"
            "activity"
            "readiness";
    }

    .dashboard-grid .side-panel:nth-of-type(3) .readiness-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding-bottom: 14px;
    }

    .sidebar-nav {
        gap: 24px;
    }

    .nav-logout {
        margin-top: 24px;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .dashboard-hero h1 {
        font-size: 25px;
    }

    .hero-meta {
        width: 100%;
        min-width: 0;
    }

    .hero-actions a {
        flex: 1 1 140px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid.is-hub {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .needs-attention-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 24px 16px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-search,
    .toolbar-select,
    .table-toolbar .toolbar-apply,
    .table-toolbar .toolbar-clear {
        width: 100%;
        min-width: 0;
    }

    .table-toolbar .toolbar-clear {
        justify-content: center;
        height: 40px;
        padding: 0 14px;
        border: 1px solid var(--tiko-border);
        border-radius: var(--tiko-radius-sm);
        background: var(--tiko-surface);
    }

}

/* ── Users table ───────────────────────────────────────────── */
.users-panel {
    padding-bottom: 8px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px 26px 20px;
}

.toolbar-search {
    display: flex;
    flex: 1 1 280px;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    padding: 0 14px;
    height: 42px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.toolbar-search:focus-within {
    border-color: var(--tiko-border-focus);
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.toolbar-search-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--tiko-text-placeholder);
}

.toolbar-search-icon svg {
    width: 100%;
    height: 100%;
}

.toolbar-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.toolbar-select {
    min-width: 150px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.toolbar-select:focus {
    border-color: var(--tiko-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.toolbar-apply {
    height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-primary);
    color: var(--tiko-on-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.toolbar-apply:hover {
    background: var(--tiko-primary-hover);
}

.toolbar-clear {
    height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.toolbar-clear:hover {
    color: var(--tiko-text);
}

.data-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    padding: 0 12px;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 12px 14px;
    color: var(--tiko-text-tertiary);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.data-table td {
    padding: 12px 14px;
    color: var(--tiko-text);
    vertical-align: middle;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--tiko-surface-2);
}

.data-table .num {
    text-align: right;
    white-space: nowrap;
}

.data-table .mono {
    font-variant-numeric: tabular-nums;
    color: var(--tiko-text-secondary);
    white-space: nowrap;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

a.user-cell {
    color: inherit;
    text-decoration: none;
}

a.user-cell:hover .user-cell-meta strong,
a.user-cell:focus-visible .user-cell-meta strong {
    color: var(--tiko-primary);
}

.user-cell-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--tiko-surface-2);
}

.user-cell-avatar.is-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tiko-primary-subtle);
    color: var(--tiko-primary-pressed);
    font-size: 15px;
    font-weight: 700;
}

.user-cell-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-cell-meta strong {
    color: var(--tiko-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.user-cell-meta small {
    color: var(--tiko-text-placeholder);
    font-size: 12px;
    font-weight: 500;
}

.country-cell {
    font-weight: 600;
    white-space: nowrap;
}

.muted-cell {
    color: var(--tiko-text-tertiary);
    white-space: nowrap;
}

.device-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.device-thumb {
    width: 32px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--tiko-surface-muted, #f1f3f2);
    flex: 0 0 auto;
}

.device-name {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.25;
}

.device-name small {
    font-size: 11px;
}

.type-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.verified-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tiko-info);
    color: #fff;
}

.verified-dot svg {
    width: 11px;
    height: 11px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--tiko-radius-pill);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.badge + .badge {
    margin-left: 6px;
}

.badge.is-active {
    background: var(--tiko-success-surface);
    color: var(--tiko-primary-pressed);
}

.badge.is-warning {
    background: var(--tiko-warning-surface);
    color: #9A6700;
}

.badge.is-danger {
    background: var(--tiko-error-surface);
    color: var(--tiko-error-strong);
}

.badge.is-muted {
    background: var(--tiko-surface-2);
    color: var(--tiko-text-tertiary);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 26px 18px;
}

.pagination-info {
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 600;
}

/* Reports queue: clamp a long report description/note to one readable cell. */
.cell-clip {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 18px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.pagination-btn:hover {
    border-color: var(--tiko-border-strong);
    background: var(--tiko-surface-2);
}

.pagination-btn.is-disabled {
    color: var(--tiko-text-disabled);
    background: var(--tiko-surface);
    cursor: default;
    pointer-events: none;
}

.pagination-btn.is-danger-action {
    color: var(--tiko-error-strong);
    border-color: rgba(218, 54, 51, 0.28);
    background: var(--tiko-error-surface);
    cursor: pointer;
}

.pagination-btn.is-danger-action:hover {
    border-color: rgba(218, 54, 51, 0.48);
    background: rgba(218, 54, 51, 0.12);
}

.notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--tiko-radius-sm);
    font-size: 13px;
    font-weight: 700;
}

.notice.is-success {
    color: var(--tiko-primary-pressed);
    background: var(--tiko-success-surface);
}

.notice.is-error {
    color: var(--tiko-error-strong);
    background: var(--tiko-error-surface);
}

.sticker-moderation-thumb {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.sticker-moderation-thumb img {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    object-fit: contain;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface-2);
}

.sticker-moderation-thumb strong,
.sticker-moderation-thumb small {
    display: block;
}

.sticker-moderation-thumb small {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 600;
}

.moderation-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}

/* Clickable listing rows */
.data-table tr.is-clickable {
    cursor: pointer;
}

.data-table tr.is-clickable:focus-visible {
    outline: 2px solid var(--tiko-border-focus);
    outline-offset: -2px;
}

.badge.is-info {
    background: var(--tiko-info-surface);
    color: var(--tiko-info);
}

/* ── User detail / edit page ───────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--tiko-text);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 18px;
    border-radius: var(--tiko-radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.flash-success {
    background: var(--tiko-success-surface);
    color: var(--tiko-primary-pressed);
}

.flash-error {
    background: var(--tiko-error-surface);
    color: var(--tiko-error-strong);
}

.detail-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.detail-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--tiko-surface-2);
}

.detail-avatar.is-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tiko-primary-subtle);
    color: var(--tiko-primary-pressed);
    font-size: 28px;
    font-weight: 800;
}

.detail-hero-meta h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--tiko-text);
}

.detail-hero-meta p {
    margin: 4px 0 10px;
    color: var(--tiko-text-tertiary);
    font-size: 14px;
    font-weight: 600;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-badges .badge + .badge {
    margin-left: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 22px;
}

.detail-main,
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.user-detail .panel {
    overflow: hidden;
}

.user-detail .panel > .side-note {
    padding: 6px 26px 0;
}

.user-detail .panel > .side-note + .data-table-wrap {
    margin-top: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
    padding: 22px 26px 26px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-row.span-2 {
    grid-column: 1 / -1;
}

.form-row > span {
    color: var(--tiko-text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.form-row textarea {
    resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--tiko-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.form-row input:disabled {
    background: var(--tiko-surface-2);
    color: var(--tiko-text-tertiary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    height: 42px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: var(--tiko-radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--tiko-primary);
    color: var(--tiko-on-primary);
}

.btn-primary:hover {
    background: var(--tiko-primary-hover);
}

.btn-secondary {
    background: var(--tiko-surface);
    border-color: var(--tiko-border);
    color: var(--tiko-text);
}

.btn-secondary:hover {
    border-color: var(--tiko-border-strong);
    background: var(--tiko-surface-2);
}

.btn-danger {
    background: var(--tiko-error-surface);
    color: var(--tiko-error-strong);
    border-color: transparent;
}

.btn-danger:hover {
    background: #fbdada;
}

.side-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px 24px;
}

.side-form button {
    align-self: flex-start;
}

.side-note {
    margin: 0;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.kv-list {
    display: flex;
    flex-direction: column;
    padding: 8px 24px 20px;
}

.kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--tiko-border-subtle);
    font-size: 13px;
}

.kv-row:last-child {
    border-bottom: 0;
}

.kv-row span {
    color: var(--tiko-text-tertiary);
    font-weight: 600;
}

.kv-row strong {
    color: var(--tiko-text);
    font-weight: 700;
}

.restriction-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.restriction-row:last-child {
    border-bottom: 0;
}

.restriction-row strong {
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
}

.restriction-row small {
    color: var(--tiko-text-placeholder);
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 1100px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Remote Config (settings) ───────────────────────────────────────────── */

.settings-page .section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--tiko-space-4);
    margin-bottom: var(--tiko-space-5);
}

.settings-page .section-head h1 {
    margin: 0 0 var(--tiko-space-1);
    font-size: 22px;
    font-weight: 700;
}

.settings-page .section-subtitle {
    margin: 0;
    max-width: 640px;
    color: var(--tiko-text-secondary);
    font-size: 13px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--tiko-space-5);
    max-width: 920px;
}

.settings-card {
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-lg);
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
    padding: var(--tiko-space-5);
    margin: 0;
}

.settings-card > legend {
    padding: 0 var(--tiko-space-2);
    font-size: 14px;
    font-weight: 700;
    color: var(--tiko-text);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tiko-space-4);
    margin-top: var(--tiko-space-2);
}

.settings-row {
    display: flex;
    flex-direction: column;
    gap: var(--tiko-space-2);
    min-width: 0;
}

.settings-row-wide {
    grid-column: 1 / -1;
}

.settings-row-bool {
    flex-direction: row;
    align-items: center;
    gap: var(--tiko-space-2);
}

.settings-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tiko-text-secondary);
}

.settings-row input[type="number"],
.settings-row input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font: inherit;
    font-size: 13px;
}

.settings-row input[type="number"]:focus,
.settings-row input[type="text"]:focus {
    outline: none;
    border-color: var(--tiko-border-focus);
}

.settings-row-bool input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tiko-primary);
    flex: none;
}

.tiers-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--tiko-space-1) 0 var(--tiko-space-3);
}

.tiers-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tiko-text-tertiary);
    padding: 0 var(--tiko-space-2) var(--tiko-space-1);
}

.tiers-table td {
    padding: var(--tiko-space-1) var(--tiko-space-2) var(--tiko-space-1) 0;
    vertical-align: middle;
}

.tiers-table input[type="number"],
.tiers-table input[type="text"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font: inherit;
    font-size: 13px;
}

/* Inline numeric field with a caption (min VIP level, segment seconds) sitting in
   an .inline-form row alongside text inputs and selects. */
.settings-inline-num {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tiko-text-tertiary);
}

.settings-inline-num input[type="number"] {
    width: 120px;
    padding: 7px 10px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font: inherit;
    font-size: 13px;
    text-transform: none;
}

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-error-strong);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.btn-icon-danger:hover {
    background: var(--tiko-error-surface);
    border-color: var(--tiko-error);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.settings-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: var(--tiko-space-3);
    padding: var(--tiko-space-4) 0;
    background: linear-gradient(to top, var(--tiko-bg) 60%, transparent);
}

@media (max-width: 720px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Support-ticket screenshots grid */
.ticket-shots {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tiko-space-3);
}

.ticket-shots a {
    display: block;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-md);
    overflow: hidden;
    line-height: 0;
}

.ticket-shots img {
    width: 132px;
    height: 132px;
    object-fit: cover;
    display: block;
}

/* --- App Realms page ---------------------------------------------------- */
.banner {
    margin-bottom: var(--tiko-space-4);
    padding: 12px 16px;
    border-radius: var(--tiko-radius-sm);
    border: 1px solid var(--tiko-border);
    font-size: 14px;
    font-weight: 600;
}

.banner.is-success {
    background: var(--tiko-success-surface);
    border-color: var(--tiko-success);
    color: var(--tiko-text);
}

.banner.is-danger {
    background: var(--tiko-error-surface);
    border-color: var(--tiko-error);
    color: var(--tiko-error-strong);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tiko-space-3);
    margin-top: var(--tiko-space-4);
}

.inline-form.compact {
    margin-top: 0;
    gap: 8px;
}

.inline-form input[type="text"],
.inline-form input[type="number"],
.inline-form select {
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
}

.inline-form.compact input[type="text"],
.inline-form.compact input[type="number"],
.inline-form.compact select {
    height: 36px;
}

.inline-form input[type="text"] {
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 360px;
}

.inline-form input[type="number"] {
    width: 140px;
    max-width: 100%;
    font-variant-numeric: tabular-nums;
}

.inline-form select {
    flex: 1 1 180px;
    max-width: 360px;
}

.inline-form.compact input[type="number"] {
    width: 96px;
}

.inline-form input[type="text"]:focus,
.inline-form input[type="number"]:focus,
.inline-form select:focus {
    border-color: var(--tiko-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

@media (max-width: 720px) {
    .inline-form {
        align-items: stretch;
    }

    .inline-form:not(.compact) input[type="text"],
    .inline-form:not(.compact) input[type="number"],
    .inline-form:not(.compact) select,
    .inline-form:not(.compact) .toolbar-apply,
    .inline-form:not(.compact) .btn-ghost,
    .inline-form:not(.compact) .toolbar-clear {
        width: 100%;
        max-width: none;
        flex-basis: 100%;
    }
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tiko-space-3);
}

/* ---------------------------------------------------------------------------
 * Reusable panel primitives
 * Generic building blocks any admin page can compose: a padded panel body, a
 * header action cluster, a ghost button, a compact inline note, and vertical
 * stacking. Named for behavior, not for any one page.
 * ------------------------------------------------------------------------- */

/* Content region of a .panel. Matches the horizontal rhythm of .panel-head
 * (26px) so a body lines up under the title. Use instead of letting forms and
 * tables butt against the panel edge. */
.panel-body {
    padding: var(--tiko-space-4) 26px 26px;
}

.panel-body > * + * {
    margin-top: var(--tiko-space-4);
}

/* Stacks a panel title and its kicker subtitle vertically, so the head can keep
 * actions on the opposite side via .panel-head's space-between. */
.panel-title-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--tiko-space-1);
}

/* Header-aligned cluster of small actions (Enable / Delete ...). Sits opposite
 * the title via .panel-head's space-between. */
.panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tiko-space-2);
}

/* A form that is itself one action in a cluster — strips the default top margin
 * .inline-form adds so buttons in .panel-actions / table cells stay aligned. */
.inline-action {
    margin: 0;
}

/* Low-emphasis button: bordered, transparent, for secondary row/panel actions.
 * .is-danger turns it into a destructive variant. */
.btn-ghost {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-ghost:hover {
    border-color: var(--tiko-border-strong);
    color: var(--tiko-text);
}

.btn-ghost.is-danger {
    color: var(--tiko-error-strong);
    border-color: rgba(217, 39, 39, 0.3);
}

.btn-ghost.is-danger:hover {
    background: var(--tiko-error-surface);
    border-color: var(--tiko-error);
}

/* A short, left-aligned empty/hint note that lives INSIDE a panel body — unlike
 * .empty-state it adds no 240px min-height, so it never blows up a card. */
.inline-empty {
    padding: var(--tiko-space-3) var(--tiko-space-4);
    border: 1px dashed var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text-tertiary);
    font-size: 13px;
}

.inline-empty p {
    margin: 0;
}

/* Visually separates a follow-up form (e.g. "add condition") from the content
 * above it inside the same panel body. */
.panel-divider {
    border: 0;
    border-top: 1px solid var(--tiko-border-subtle);
    margin: var(--tiko-space-4) 0 0;
}

.text-muted {
    color: var(--tiko-text-placeholder);
}

.text-right {
    text-align: right;
}

/* Posts admin */
.posts-admin .is-selected-row {
    background: var(--tiko-primary-subtle);
}

.post-list-text {
    display: flex;
    min-width: 260px;
    flex-direction: column;
    gap: 4px;
}

.post-list-text strong {
    font-size: 12px;
    color: var(--tiko-text-tertiary);
    text-transform: uppercase;
}

.post-list-text span {
    color: var(--tiko-text);
    line-height: 1.35;
}

.post-detail-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.admin-post-card {
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    overflow: hidden;
}

.admin-post-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.admin-post-card-head h3 {
    margin: 0;
    color: var(--tiko-text);
    font-size: 18px;
    font-weight: 800;
}

.admin-post-card-head p {
    margin: 5px 0 0;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
}

.admin-post-content {
    padding: 18px 20px;
    color: var(--tiko-text);
    font-size: 15px;
    line-height: 1.6;
    white-space: normal;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 0 20px 18px;
}

.admin-media-item {
    position: relative;
    display: flex;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface-2);
    color: var(--tiko-text-secondary);
    text-decoration: none;
}

.admin-media-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.admin-media-item small {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: var(--tiko-radius-pill);
    background: rgba(17, 20, 19, 0.76);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.admin-poll {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 18px;
}

.admin-poll-row {
    padding: 12px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface-2);
}

.admin-poll-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 700;
}

.admin-poll-bar {
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: var(--tiko-radius-pill);
    background: var(--tiko-border-subtle);
}

.admin-poll-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tiko-primary);
}

.admin-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 18px;
}

.admin-post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--tiko-border-subtle);
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 700;
}

.post-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.post-detail-grid h3,
.post-detail-panel .panel-body > section h3 {
    margin: 0 0 10px;
    color: var(--tiko-text);
    font-size: 16px;
    font-weight: 800;
}

.compact-table th,
.compact-table td {
    padding: 9px 12px;
}

.post-detail-admin {
    max-width: 1480px;
}

.post-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.back-link:hover {
    color: var(--tiko-text);
}

.post-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 18px;
    align-items: start;
}

.post-detail-main,
.post-detail-side {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 18px;
}

.post-avatar {
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--tiko-primary-subtle);
    color: var(--tiko-primary-pressed);
    font-size: 15px;
    font-weight: 800;
}

.post-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-user-line {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.post-user-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.post-user-meta strong,
.post-user-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-user-meta strong {
    color: var(--tiko-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.post-user-meta small {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.detail-post-card {
    overflow: hidden;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.detail-post-author {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--tiko-border-subtle);
}

.detail-post-author .post-user-line {
    flex: 1 1 auto;
}

.detail-post-copy {
    padding: 18px;
    color: var(--tiko-text);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: normal;
}

.detail-media-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 18px 18px;
}

.detail-media-item {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: #111413;
}

.detail-media-item img,
.detail-media-item video {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #111413;
}

.detail-media-item img {
    background: var(--tiko-surface-2);
}

.detail-media-item audio {
    display: block;
    width: calc(100% - 24px);
    margin: 18px 12px;
}

.detail-media-item figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--tiko-surface);
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.detail-media-item figcaption a,
.media-file-link {
    color: var(--tiko-primary-pressed);
    font-weight: 800;
    text-decoration: none;
}

.media-file-link {
    display: flex;
    min-height: 140px;
    align-items: center;
    justify-content: center;
    background: var(--tiko-surface-2);
}

.detail-poll,
.detail-tags {
    padding-right: 18px;
    padding-left: 18px;
}

.detail-post-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--tiko-border-subtle);
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 800;
}

.reaction-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-chip-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: var(--tiko-radius-pill);
    background: var(--tiko-primary-subtle);
    color: var(--tiko-primary-pressed);
    font-size: 12px;
    font-weight: 800;
}

.reaction-chip-row.is-compact {
    gap: 6px;
    margin-top: 8px;
}

.reaction-chip-row.is-compact span {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
}

.reaction-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.reaction-user-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.reaction-user-card > span {
    flex: 0 0 auto;
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.comment-thread-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    min-width: 0;
}

.comment-main {
    display: grid;
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.comment-item.is-reply .comment-main {
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
}

.comment-bubble {
    min-width: 0;
    padding: 12px 14px;
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-2);
    color: var(--tiko-text);
}

.comment-item.is-reply .comment-bubble {
    border-left: 3px solid var(--tiko-primary);
    background: var(--tiko-surface);
}

.comment-bubble-head,
.comment-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.comment-bubble-head {
    margin-bottom: 8px;
}

.comment-time,
.comment-mention,
.comment-meta-row {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.comment-mention {
    margin-bottom: 8px;
}

.comment-bubble p {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.comment-media {
    display: inline-flex;
    max-width: 280px;
    max-height: 260px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: var(--tiko-radius-sm);
    border: 1px solid var(--tiko-border-subtle);
    background: var(--tiko-surface);
}

.comment-media img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.comment-audio {
    width: min(100%, 360px);
    margin-bottom: 8px;
}

.comment-meta-row {
    margin-top: 10px;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0 222px;
}

.comment-item.is-reply .comment-actions {
    margin-left: 202px;
}

.comment-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 0 44px;
    padding-left: 16px;
    border-left: 2px solid var(--tiko-border-subtle);
}

.comment-more {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.admin-control-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-control-stack .inline-action,
.admin-control-stack button {
    width: 100%;
}

.detail-meta-table th {
    width: 38%;
}

.side-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-list-item {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.side-list-item strong {
    display: block;
    margin-bottom: 6px;
    color: var(--tiko-text);
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.side-list-item small {
    display: block;
    margin-top: 6px;
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.side-list-item p {
    margin: 8px 0 0;
    color: var(--tiko-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.js-post-action button[disabled] {
    cursor: wait;
    opacity: 0.68;
}

.two-column-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tiko-space-5);
    margin: var(--tiko-space-5) 0;
}

.pagination-row,
.pagination-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tiko-space-3);
    margin-top: var(--tiko-space-4);
    color: var(--tiko-text-secondary);
    font-size: 13px;
}

.settings-form label,
.settings-fieldset {
    display: flex;
    flex-direction: column;
    gap: var(--tiko-space-2);
    min-width: 0;
}

.settings-form label > span,
.settings-fieldset legend {
    color: var(--tiko-text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.settings-fieldset {
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-md);
    padding: var(--tiko-space-4);
}

.settings-form .check-row {
    flex-direction: row;
    align-items: center;
    gap: var(--tiko-space-2);
}

/* Text Safety */
.text-safety-admin {
    gap: 22px;
}

.text-safety-admin.is-loading {
    cursor: wait;
}

.text-safety-admin.is-loading .text-safety-panel,
.text-safety-admin.is-loading .text-safety-metrics,
.text-safety-admin.is-loading .text-safety-hero {
    opacity: 0.72;
    pointer-events: none;
}

.text-safety-admin button[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.text-safety-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 26px 28px;
    border: 1px solid rgba(31, 42, 36, 0.07);
    border-radius: var(--tiko-radius-lg);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(36, 211, 170, 0.12) 0%, rgba(80, 96, 186, 0.07) 48%, rgba(255, 255, 255, 0) 100%),
        var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.text-safety-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--tiko-primary);
}

.text-safety-hero-copy {
    min-width: 0;
}

.text-safety-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--tiko-primary-pressed);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.text-safety-hero h1 {
    margin-bottom: 7px;
    color: #111413;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.08;
}

.text-safety-hero p {
    max-width: 760px;
    color: var(--tiko-text-tertiary);
    font-weight: 600;
    line-height: 1.55;
}

.text-safety-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(132px, 1fr));
    gap: 10px;
}

.text-safety-hero-stats span {
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 14px 16px;
    border: 1px solid rgba(31, 42, 36, 0.07);
    border-radius: var(--tiko-radius-md);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 18px rgba(31, 42, 36, 0.04);
}

.text-safety-hero-stats strong {
    color: #111413;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.text-safety-hero-stats small {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.text-safety-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.text-safety-panel {
    overflow: hidden;
    border-color: rgba(31, 42, 36, 0.07);
    box-shadow: 0 12px 30px rgba(31, 42, 36, 0.035);
}

.text-safety-panel .panel-head {
    padding: 23px 26px 0;
}

.text-safety-panel .panel-head h2 {
    font-size: 22px;
}

.text-safety-toolbar {
    padding-top: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tiko-border-subtle);
    background: linear-gradient(180deg, rgba(243, 247, 244, 0.42), rgba(255, 255, 255, 0));
}

.text-safety-toolbar + .data-table-wrap {
    padding-top: 8px;
}

.text-safety-admin .data-table-wrap {
    padding-right: 18px;
    padding-left: 18px;
}

.text-safety-admin .data-table {
    min-width: 980px;
}

.text-safety-admin .data-table th {
    color: var(--tiko-text-placeholder);
}

.text-safety-admin .data-table td {
    line-height: 1.42;
}

.text-safety-admin .data-table tbody tr:hover {
    background: rgba(36, 211, 170, 0.06);
}

.text-safety-open {
    height: 32px;
    padding: 0 12px;
    text-decoration: none;
}

.text-safety-forms {
    align-items: start;
}

.text-safety-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: none;
    padding: 20px 26px 26px;
}

.text-safety-form label,
.text-safety-form .settings-fieldset {
    gap: 7px;
}

.text-safety-form label > span,
.text-safety-form .settings-fieldset legend {
    color: var(--tiko-text-secondary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.text-safety-form input[type="text"],
.text-safety-form input[type="number"],
.text-safety-form select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.text-safety-form input::placeholder {
    color: var(--tiko-text-placeholder);
    font-weight: 500;
}

.text-safety-form input:focus,
.text-safety-form select:focus {
    outline: none;
    border-color: var(--tiko-border-focus);
    background: var(--tiko-surface-elevated);
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.text-safety-form .is-wide,
.text-safety-form .settings-fieldset,
.text-safety-form .check-row,
.text-safety-form .toolbar-apply {
    grid-column: 1 / -1;
}

.text-safety-form .settings-fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    padding: 16px;
    border-style: solid;
    background: var(--tiko-surface);
}

.text-safety-form .settings-fieldset legend {
    padding: 0 6px;
}

.text-safety-form .check-row {
    min-height: 24px;
}

.text-safety-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--tiko-primary);
}

.text-safety-form .check-row span {
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 800;
}

.text-safety-form .toolbar-apply {
    width: 100%;
    margin-top: 2px;
    box-shadow: 0 8px 18px rgba(36, 211, 170, 0.22);
}

.text-safety-admin .pagination-row {
    margin: 16px 26px 22px;
}

@media (max-width: 1240px) {
    .text-safety-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .text-safety-forms {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .text-safety-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .text-safety-hero h1 {
        font-size: 25px;
    }

    .text-safety-hero-stats,
    .text-safety-metrics,
    .text-safety-form,
    .text-safety-form .settings-fieldset {
        grid-template-columns: 1fr;
    }

    .text-safety-admin .data-table-wrap {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 900px) {
    .admin-post-card-head,
    .post-detail-grid,
    .two-column-grid,
    .post-detail-layout,
    .comment-main,
    .comment-item.is-reply .comment-main {
        display: block;
    }

    .admin-post-card-head .detail-badges {
        margin-top: 12px;
    }

    .post-detail-side {
        margin-top: 18px;
    }

    .detail-post-author {
        flex-direction: column;
    }

    .comment-bubble {
        margin-top: 8px;
    }

    .comment-actions,
    .comment-item.is-reply .comment-actions {
        margin-left: 0;
    }

    .comment-replies {
        margin-left: 14px;
    }
}

@media (max-width: 820px) {
    .data-table-wrap {
        padding: 0;
    }

    .data-table th,
    .data-table td {
        padding: 10px 10px;
    }
}

/* Video Quota page */
.video-quota-page .page-header {
    max-width: 1120px;
}

.video-quota-page .page-header p {
    max-width: 1080px;
    line-height: 1.6;
}

.quota-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--tiko-space-4);
}

.quota-overview-card {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1px solid rgba(31, 42, 36, 0.06);
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.quota-overview-card span {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.quota-overview-card strong {
    color: #111413;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.quota-create-panel,
.quota-rule-panel {
    overflow: hidden;
}

.quota-create-panel .panel-head,
.quota-rule-panel .panel-head {
    align-items: flex-start;
    padding: 24px 26px 0;
}

.quota-rule-panel .panel-head h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.quota-rule-panel .panel-head h2 .badge + .badge {
    margin-left: 0;
}

.quota-create-panel .panel-body,
.quota-rule-panel .panel-body {
    padding-top: 18px;
}

.quota-create-form,
.quota-condition-form,
.quota-mini-form {
    display: grid;
    align-items: end;
    gap: var(--tiko-space-3);
    margin: 0;
}

.quota-create-form {
    grid-template-columns: minmax(300px, 1fr) minmax(130px, 150px) minmax(150px, 180px) auto;
}

.quota-condition-form {
    grid-template-columns: minmax(260px, 1.2fr) minmax(220px, 0.8fr) minmax(220px, 1fr) auto;
}

.quota-rule-editor {
    display: flex;
    flex-direction: column;
    gap: var(--tiko-space-4);
}

.quota-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: var(--tiko-space-3);
}

.quota-mini-form {
    grid-template-columns: minmax(140px, 1fr) auto;
    padding: var(--tiko-space-3);
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.quota-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.quota-field span {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.quota-field input[type="text"],
.quota-field input[type="number"],
.quota-field select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface-elevated);
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
}

.quota-field input::placeholder {
    color: var(--tiko-text-placeholder);
}

.quota-field input[type="text"]:focus,
.quota-field input[type="number"]:focus,
.quota-field select:focus {
    border-color: var(--tiko-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.quota-field-count input[type="number"] {
    font-weight: 700;
}

.quota-rule-panel .data-table-wrap {
    padding: 0;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
}

.quota-rule-panel .data-table {
    min-width: 720px;
}

.quota-rule-panel .panel-divider {
    margin-top: var(--tiko-space-5);
}

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

    .quota-create-form,
    .quota-condition-form,
    .quota-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .quota-overview-grid,
    .quota-create-form,
    .quota-condition-form,
    .quota-settings-grid,
    .quota-mini-form {
        grid-template-columns: 1fr;
    }

    .quota-create-form .toolbar-apply,
    .quota-condition-form .toolbar-apply,
    .quota-mini-form .btn-ghost {
        width: 100%;
    }
}

/* User Activity timeline (modules/activity) — shared by the global Activity page
 * and the per-user detail tab. Builds on .data-table / .badge primitives. */
.activity-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
}

.activity-user-name {
    font-weight: 600;
    color: var(--tiko-text);
}

.activity-user:hover .activity-user-name {
    text-decoration: underline;
}

.activity-action {
    font-weight: 600;
    color: var(--tiko-text);
    margin-inline-end: 8px;
}

.activity-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 420px;
}

/* HLS Transcode Profiles */
.hls-profiles-page {
    gap: 22px;
}

.hls-profiles-page .page-header {
    max-width: 980px;
}

.hls-profiles-page .page-header p {
    max-width: 960px;
    line-height: 1.55;
}

.hls-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--tiko-space-4);
}

.hls-overview-card {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1px solid rgba(31, 42, 36, 0.06);
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
}

.hls-overview-card span {
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.hls-overview-card strong {
    color: #111413;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.hls-profile-panel,
.hls-assignments-panel {
    overflow: hidden;
}

.hls-profile-panel .panel-head,
.hls-assignments-panel .panel-head {
    align-items: flex-start;
    padding: 24px 26px 0;
}

.hls-profile-panel .panel-head h2,
.hls-assignments-panel .panel-head h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hls-profile-panel .panel-head h2 .badge + .badge {
    margin-left: 0;
}

.hls-profile-panel .panel-body,
.hls-assignments-panel .panel-body {
    padding-top: 18px;
}

.hls-profile-form {
    max-width: none;
    gap: 18px;
}

.hls-profile-fields {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(120px, 150px) minmax(116px, 132px) minmax(116px, 132px);
    align-items: end;
    gap: var(--tiko-space-3);
    margin-top: 0;
}

.hls-profile-fields input[type="text"],
.hls-profile-fields select,
.hls-profile-fields .settings-inline-num input[type="number"] {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 42px;
}

.hls-profile-fields .settings-inline-num {
    min-width: 0;
}

.hls-ladder {
    gap: 10px;
    padding-top: var(--tiko-space-2);
}

.hls-tiers-table {
    table-layout: fixed;
    margin: 0 0 var(--tiko-space-3);
}

.hls-tiers-table th:nth-child(1),
.hls-tiers-table td:nth-child(1) {
    width: 160px;
}

.hls-tiers-table th:nth-child(4),
.hls-tiers-table td:nth-child(4) {
    width: 48px;
    padding-right: 0;
    text-align: right;
}

.hls-tiers-table th {
    padding-bottom: 8px;
}

.hls-tiers-table td {
    padding-top: 5px;
    padding-bottom: 5px;
}

.hls-tiers-table input[type="number"],
.hls-tiers-table input[type="text"] {
    height: 38px;
}

.hls-ladder .btn-secondary {
    align-self: flex-start;
}

.hls-profile-panel .settings-actions {
    position: static;
    margin-top: var(--tiko-space-1);
    padding: 0;
    background: transparent;
}

.hls-row-actions {
    margin-top: var(--tiko-space-4);
    padding-top: var(--tiko-space-4);
    border-top: 1px solid var(--tiko-border-subtle);
}

.hls-row-actions .toolbar-clear {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    text-decoration: none;
}

.hls-row-actions .toolbar-clear:hover {
    border-color: var(--tiko-border-strong);
    background: var(--tiko-surface-2);
}

.hls-assign-form {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    align-items: end;
    gap: var(--tiko-space-3);
    margin-top: 0;
}

.hls-assign-form input[type="text"],
.hls-assign-form select {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.hls-assign-form .toolbar-apply:disabled {
    cursor: default;
    opacity: 0.55;
}

.hls-assignments-table {
    margin-top: var(--tiko-space-4);
    padding: 0;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
}

.hls-assignments-panel .inline-empty {
    margin-top: var(--tiko-space-4);
}

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

    .hls-profile-fields {
        grid-template-columns: minmax(260px, 1fr) minmax(120px, 160px);
    }

    .hls-assign-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .hls-overview-grid,
    .hls-profile-fields,
    .hls-assign-form {
        grid-template-columns: 1fr;
    }

    .hls-tiers-table {
        min-width: 560px;
    }
}

/* Segmented tabs — view switcher (e.g. sticker search analytics). */
.segmented-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 18px 0 4px;
    background: var(--tiko-surface-2);
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-md);
}

.segmented-tab {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--tiko-radius-sm);
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.segmented-tab:hover {
    color: var(--tiko-text);
}

.segmented-tab.is-active {
    background: var(--tiko-surface-elevated);
    color: var(--tiko-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── Age verification attempts table ──────────────────────────────────── */
.age-attempts-panel {
    overflow: hidden;
}

.age-attempts-wrap {
    padding: 0;
    overflow-x: visible;
}

.age-attempts-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.age-attempts-table th,
.age-attempts-table td {
    padding: 14px 12px;
    vertical-align: top;
}

.age-attempts-table th:nth-child(1),
.age-attempts-table td:nth-child(1) {
    width: 6.5%;
}

.age-attempts-table th:nth-child(2),
.age-attempts-table td:nth-child(2) {
    width: 13%;
}

.age-attempts-table th:nth-child(3),
.age-attempts-table td:nth-child(3) {
    width: 8%;
}

.age-attempts-table th:nth-child(4),
.age-attempts-table td:nth-child(4) {
    width: 11%;
}

.age-attempts-table th:nth-child(5),
.age-attempts-table td:nth-child(5) {
    width: 18%;
}

.age-attempts-table th:nth-child(6),
.age-attempts-table td:nth-child(6) {
    width: 8%;
}

.age-attempts-table th:nth-child(7),
.age-attempts-table td:nth-child(7) {
    width: 22%;
}

.age-attempts-table th:nth-child(8),
.age-attempts-table td:nth-child(8) {
    width: 7%;
}

.age-attempts-table th:nth-child(9),
.age-attempts-table td:nth-child(9) {
    width: 6.5%;
}

.age-attempts-table .muted-cell {
    line-height: 1.35;
}

.age-attempt-id,
.age-attempt-decision,
.age-attempt-status,
.age-attempt-local,
.age-attempt-client,
.age-attempt-created {
    white-space: nowrap;
}

.age-attempt-user .user-cell {
    min-width: 0;
    gap: 10px;
}

.age-attempt-user .user-cell-avatar {
    width: 34px;
    height: 34px;
}

.age-attempt-user .user-cell-meta {
    overflow: hidden;
}

.age-attempt-user .user-cell-meta strong,
.age-attempt-user .user-cell-meta small,
.age-attempt-ai,
.age-attempt-client {
    overflow-wrap: anywhere;
}

.age-attempt-user .user-cell-meta strong,
.age-attempt-user .user-cell-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Age verification review cell ─────────────────────────────────────── */
.age-review-cell {
    min-width: 0;
}
.age-media {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.age-media-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}
.age-media-thumb {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: var(--tiko-radius-md);
    border: 1px solid var(--tiko-border);
    background: var(--tiko-surface-elevated);
    display: block;
}
.age-media-video {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: var(--tiko-radius-md);
    border: 1px solid var(--tiko-border);
    background: #000;
    display: block;
}
.age-media-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 92px;
    font-size: 11px;
    color: var(--tiko-text-secondary);
}
.age-media-dl {
    font-size: 11px;
    font-weight: 600;
    color: var(--tiko-primary);
    text-decoration: none;
}
.age-media-dl:hover {
    text-decoration: underline;
}
.age-media-fallback {
    width: 116px;
    height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 8px;
    border-radius: var(--tiko-radius-md);
    border: 1px dashed var(--tiko-border);
    background: var(--tiko-surface-elevated);
    font-size: 11px;
    font-weight: 600;
}
.age-media-fallback.is-busy {
    color: var(--tiko-warning);
    border-color: var(--tiko-warning);
}
.age-media-fallback.is-gone {
    color: var(--tiko-text-secondary);
}
.age-media-retry {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--tiko-radius-sm);
    border: 1px solid var(--tiko-warning);
    background: var(--tiko-surface);
    color: var(--tiko-warning);
    cursor: pointer;
}
.age-media-retry:hover {
    background: var(--tiko-warning-surface);
}
.age-review-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.age-review-form input[type="text"] {
    width: 100%;
    font-size: 12px;
    padding: 5px 8px;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
}
.age-review-form input[type="text"]:focus {
    outline: none;
    border-color: var(--tiko-border-focus);
}
.age-review-actions {
    display: flex;
    gap: 6px;
}
.btn-mini {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 6px;
    border-radius: var(--tiko-radius-sm);
    border: 1px solid var(--tiko-border);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.btn-mini:hover {
    background: var(--tiko-surface-elevated);
}
.btn-approve {
    border-color: var(--tiko-success);
    color: var(--tiko-success);
}
.btn-approve:hover {
    background: var(--tiko-success-surface);
}
.btn-reject {
    border-color: var(--tiko-error);
    color: var(--tiko-error);
}
.btn-reject:hover {
    background: var(--tiko-error-surface);
}
.btn-suspend {
    border-color: var(--tiko-warning);
    color: var(--tiko-warning);
}
.btn-suspend:hover {
    background: var(--tiko-warning-surface);
}

@media (max-width: 1280px) {
    .age-attempts-panel {
        overflow: visible;
    }

    .age-attempts-table,
    .age-attempts-table tbody,
    .age-attempts-table tr,
    .age-attempts-table td {
        display: block;
        width: 100%;
    }

    .age-attempts-table {
        border-collapse: separate;
    }

    .age-attempts-table thead {
        display: none;
    }

    .age-attempts-table tbody {
        display: grid;
        gap: 14px;
    }

    .age-attempts-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 18px;
        padding: 14px;
        border: 1px solid var(--tiko-border-subtle);
        border-radius: var(--tiko-radius-md);
        background: var(--tiko-surface);
    }

    .age-attempts-table tbody tr:hover {
        background: var(--tiko-surface);
    }

    .age-attempts-table td {
        min-width: 0;
        padding: 0;
        border-bottom: 0;
    }

    .age-attempts-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--tiko-text-tertiary);
        font-size: 10px;
        font-weight: 800;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .age-attempt-user,
    .age-attempt-ai,
    .age-review-cell {
        grid-column: 1 / -1;
    }

    .age-attempt-id,
    .age-attempt-decision,
    .age-attempt-status,
    .age-attempt-local,
    .age-attempt-client,
    .age-attempt-created {
        white-space: normal;
    }

    .age-attempt-user .user-cell {
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .age-attempts-table tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .age-media-thumb,
    .age-media-video,
    .age-media-cap {
        width: 104px;
    }

    .age-media-thumb,
    .age-media-video {
        height: 104px;
    }

    .age-review-actions {
        flex-wrap: wrap;
    }

    .btn-mini {
        min-width: 96px;
    }
}

/* Post detail — in-page moderation feedback (Fetch-first, no reload). */
.post-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 60;
    max-width: 340px;
    padding: 12px 18px;
    border-radius: var(--tiko-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 12px 28px rgba(17, 24, 20, 0.18);
}

.post-toast.is-success {
    background: var(--tiko-success);
}

.post-toast.is-error {
    background: var(--tiko-error-strong);
}

.admin-control-note {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--tiko-text-muted, #6B7772);
}

.comment-item.is-removed {
    opacity: 0.6;
}

.js-post-action button[aria-busy="true"] {
    opacity: 0.6;
    cursor: progress;
}

/* Comments pagination (Fetch-first) — loading state while swapping the partial. */
[data-comments-region].is-loading {
    opacity: 0.55;
    pointer-events: none;
}

[data-comments-nav] a.pagination-btn[aria-busy="true"] {
    opacity: 0.6;
    cursor: progress;
}

/* ── Topics admin ───────────────────────────────────────────── */
.topics-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--tiko-space-3);
}

.topics-stat-card {
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid rgba(31, 42, 36, 0.07);
    border-radius: var(--tiko-radius-md);
    background: var(--tiko-surface-elevated);
    box-shadow: 0 8px 24px rgba(31, 42, 36, 0.025);
}

.topics-stat-card .stat-value {
    color: var(--tiko-text);
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.topics-stat-card .stat-label {
    margin-top: 7px;
    color: var(--tiko-text-tertiary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.topics-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px 26px 26px;
}

.topics-form-create {
    padding-top: 18px;
}

.topic-field {
    min-width: 0;
}

.topic-field.is-wide,
.topic-form-actions {
    grid-column: 1 / -1;
}

.topic-field label,
.topic-featured-form label {
    display: block;
    margin: 0 0 7px;
    color: var(--tiko-text-secondary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.topic-field input,
.topic-field select,
.topic-field textarea,
.topic-featured-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--tiko-border);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
    color: var(--tiko-text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.topic-field input,
.topic-field select,
.topic-featured-form input {
    height: 42px;
    padding: 0 14px;
}

.topic-field textarea {
    min-height: 76px;
    resize: vertical;
    padding: 11px 14px;
}

.topic-field input::placeholder,
.topic-field textarea::placeholder {
    color: var(--tiko-text-placeholder);
}

.topic-field input:focus,
.topic-field select:focus,
.topic-field textarea:focus,
.topic-featured-form input:focus {
    outline: none;
    border-color: var(--tiko-border-focus);
    background: var(--tiko-surface-elevated);
    box-shadow: 0 0 0 3px var(--tiko-primary-subtle);
}

.topic-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.topics-toolbar {
    padding-top: 22px;
}

.topics-table .topic-title-link {
    color: var(--tiko-text);
    font-weight: 800;
    text-decoration: none;
}

.topics-table .topic-title-link:hover {
    color: var(--tiko-primary-pressed);
}

.topic-row-actions {
    gap: 6px;
    flex-wrap: nowrap;
}

.toolbar-apply.is-compact,
.btn-ghost.is-compact {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 1;
}

.topics-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 26px 20px;
    border-top: 1px solid var(--tiko-border-subtle);
}

.toolbar-apply.is-page,
.topic-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--tiko-radius-xs);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.toolbar-apply.is-page {
    box-shadow: none;
}

.topic-page-link {
    color: var(--tiko-text-secondary);
    border: 1px solid var(--tiko-border);
    background: var(--tiko-surface);
}

.topic-page-link:hover {
    color: var(--tiko-text);
    border-color: var(--tiko-border-strong);
}

.topic-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topic-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    color: var(--tiko-text);
    background: var(--tiko-surface-elevated);
    box-shadow: var(--tiko-elev-1);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.topic-back-link:hover {
    color: var(--tiko-primary-pressed);
    border-color: rgba(36, 211, 170, 0.35);
}

.topic-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px 26px 26px;
}

.topic-status-current {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.topic-status-current strong {
    color: var(--tiko-text-secondary);
    font-size: 13px;
    font-weight: 800;
}

.topic-featured-action {
    display: flex;
    margin-left: auto;
}

.topic-featured-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin: 0;
}

.topic-featured-form input {
    width: 78px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.topic-featured-form label {
    margin-bottom: 0;
    line-height: 32px;
}

.topic-detail-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 18px 26px;
    border-bottom: 1px solid var(--tiko-border-subtle);
    background: linear-gradient(180deg, rgba(36, 211, 170, 0.055), rgba(36, 211, 170, 0));
}

.topic-summary-metric {
    min-width: 96px;
    padding-right: 10px;
}

.topic-summary-metric strong {
    display: block;
    color: var(--tiko-text);
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.topic-summary-metric span {
    display: block;
    margin-top: 6px;
    color: var(--tiko-text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.topic-cover-preview {
    margin-left: auto;
}

.topic-cover-preview img {
    display: block;
    width: 58px;
    height: 58px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    object-fit: cover;
    box-shadow: var(--tiko-elev-1);
}

.topic-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--tiko-border-subtle);
    border-radius: var(--tiko-radius-sm);
    background: var(--tiko-surface);
}

.topic-color-chip span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid var(--tiko-border);
    border-radius: 6px;
}

.topic-color-chip code,
.topics-table code {
    color: var(--tiko-text-secondary);
    font-size: 12px;
}

.topic-post-content {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .topics-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .topics-stat-grid,
    .topics-form {
        grid-template-columns: 1fr;
    }

    .topic-form-actions {
        justify-content: stretch;
    }

    .topic-form-actions .toolbar-apply,
    .topic-featured-action,
    .topic-featured-form,
    .topic-featured-form .toolbar-apply,
    .topic-featured-form .btn-ghost {
        width: 100%;
    }

    .topic-status-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .topic-featured-action {
        margin-left: 0;
    }

    .topic-detail-summary {
        align-items: flex-start;
    }

    .topic-cover-preview {
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .topics-stat-grid {
        grid-template-columns: 1fr;
    }

    .topics-form,
    .topic-status-bar,
    .topic-detail-summary {
        padding-right: 18px;
        padding-left: 18px;
    }
}
