@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-border: #c7d2fe;
    --primary-foreground: #ffffff;
    --bg: #f4f5f7;
    --surface: #fafaf9;
    --surface-2: #f1f3f5;
    --surface-3: #e8eaed;
    --border: #e2e5e9;
    --hover-bg: color-mix(in srgb, var(--primary) 5%, var(--surface-2));
    --hover-border: color-mix(in srgb, var(--primary) 18%, var(--border));
    --text: #0f172a;
    --muted: #64748b;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --info-bg: #e0f2fe;
    --info-text: #075985;
    --warn-bg: #fef3c7;
    --warn-text: #92400e;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.16);
    --primary-border: rgba(129, 140, 248, 0.35);
    --primary-foreground: #ffffff;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #263449;
    --surface-3: #334155;
    --border: #334155;
    --hover-bg: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
    --hover-border: color-mix(in srgb, var(--primary) 24%, var(--border));
    --text: #f1f5f9;
    --muted: #94a3b8;
    --danger: #ef4444;
    --danger-hover: #f87171;
    --success-bg: rgba(22, 163, 74, 0.16);
    --success-text: #86efac;
    --error-bg: rgba(220, 38, 38, 0.16);
    --error-text: #fca5a5;
    --info-bg: rgba(14, 165, 233, 0.16);
    --info-text: #7dd3fc;
    --warn-bg: rgba(217, 119, 6, 0.18);
    --warn-text: #fcd34d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 22px 56px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.1), transparent 34rem),
        linear-gradient(180deg, var(--bg), var(--surface-2));
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-md);
    transform: translateY(-140%);
    transition: transform 0.16s ease;
}
.skip-link:focus {
    transform: translateY(0);
    text-decoration: none;
}

.muted {
    color: var(--muted);
}
.right {
    text-align: right;
}
.nowrap {
    white-space: nowrap;
}

/* Topbar ----------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}
.topbar-inner {
    max-width: none;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    transition:
        gap 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    line-height: 0;
    transition: opacity 0.16s ease;
}
.brand:hover {
    text-decoration: none;
    opacity: 0.92;
}
.theme-logo,
.brand-logo,
.auth-brand-logo {
    display: inline-block;
    width: auto;
    height: 50px;
    max-width: min(210px, 38vw);
    object-fit: contain;
    vertical-align: middle;
    transition:
        height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.16s ease;
}
.theme-logo-dark,
.auth-brand-logo.theme-logo-dark {
    display: none;
}
[data-theme="dark"] .theme-logo-light,
[data-theme="dark"] .auth-brand-logo.theme-logo-light {
    display: none;
}
[data-theme="dark"] .theme-logo-dark,
[data-theme="dark"] .auth-brand-logo.theme-logo-dark {
    display: inline-block;
}
.mainnav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    overflow: visible;
    transition:
        gap 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        flex 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.36s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0s;
}
.mainnav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65em;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        background-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease,
        padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        min-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.mainnav a:hover {
    background: var(--hover-bg);
    color: var(--text);
    text-decoration: none;
}
.mainnav a.active {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow);
}
.nav-svg,
.icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}
.nav-svg {
    opacity: 0.74;
    transition:
        width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.16s ease;
}
.icon-fallback {
    display: none;
}
svg:not(:defined) + .icon-fallback,
.nav-svg:empty + .icon-fallback {
    display: inline-flex;
    width: 16px;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}
.mainnav a.active .nav-svg {
    opacity: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    transition: gap 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.account-area {
    margin-left: auto;
}
.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.account-chip:hover,
.account-chip[aria-expanded="true"] {
    background: var(--surface-2);
    border-color: var(--hover-border);
    text-decoration: none;
}
.user-menu {
    position: relative;
}
.notif-menu {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 30;
}
.dropdown-menu.open {
    display: grid;
    gap: 4px;
    animation: slideFadeIn 0.16s ease both;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.65em;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 700;
}
.dropdown-menu a:hover {
    background: var(--hover-bg);
    text-decoration: none;
}
.notification-btn {
    position: relative;
}
.notification-btn[aria-expanded="true"],
.notification-btn.is-open {
    background: var(--surface-2);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: 0 0 0 3px var(--primary-soft);
    color: var(--primary);
    transform: none;
}
.notification-btn[aria-expanded="true"] .icon,
.notification-btn.is-open .icon {
    opacity: 1;
}
.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.account-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.account-meta strong {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    color: var(--text);
    transition:
        max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.account-meta small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-chip {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

/* Layout ----------------------------------------------------------------- */
.page {
    max-width: 1180px;
    margin: 28px auto;
    padding: 0 20px;
}
.container.narrow {
    max-width: 520px;
    margin: 0 auto;
}
.row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.col {
    flex: 1;
    min-width: 260px;
}

h1,
h2,
h3 {
    color: var(--text);
    letter-spacing: -0.025em;
}
h1 {
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.2;
    margin: 0 0 18px;
    font-weight: 800;
}
h2 {
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 0 14px;
    font-weight: 700;
}

/* Cards ------------------------------------------------------------------ */
.card,
.stat,
.auth-card,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.card {
    padding: 22px;
    margin-bottom: 18px;
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    padding: 18px;
    transition:
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}
.stat:hover {
    background: var(--hover-bg);
    box-shadow: var(--shadow-md);
}
.stat .num {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--primary);
}
.stat .label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 6px;
}

/* Tables ----------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
tbody tr:last-child td {
    border-bottom: 0;
}
tbody tr {
    transition: background-color 0.14s ease;
}
tbody tr:hover td {
    background: var(--hover-bg);
}
tbody tr.clickable-row {
    cursor: pointer;
}
tbody tr.clickable-row:hover td {
    background: var(--hover-bg);
}
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Forms ------------------------------------------------------------------ */
label {
    display: block;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}
input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    margin-top: 5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-weight: 400;
    outline: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder,
textarea::placeholder {
    color: var(--muted);
}
input[type="checkbox"] {
    appearance: none;
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    min-height: 0;
    margin: 0 8px 0 0;
    padding: 0;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    vertical-align: -4px;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}
input[type="checkbox"]::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid var(--primary-foreground);
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) scale(0.75);
    transition:
        opacity 0.12s ease,
        transform 0.12s ease;
}
input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
}
input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}
input[type="checkbox"]:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="checkbox"]:active:not(:disabled) {
    transform: scale(0.94);
}
input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
input[type="radio"] {
    width: auto;
    min-height: 0;
    margin: 0 7px 0 0;
    accent-color: var(--primary);
}
.inline-checkbox input[type="checkbox"] {
    margin-top: 0;
}
textarea {
    min-height: 116px;
    resize: vertical;
}
.inline-checkbox {
    display: flex;
    align-items: center;
    font-weight: 500;
	cursor: pointer;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Buttons ---------------------------------------------------------------- */
.btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}
.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
    background: var(--surface-2);
    box-shadow: var(--shadow);
}
.btn:focus-visible,
.icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
    border-color: var(--primary);
}
.btn-sm {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.82rem;
}
.btn-block {
    width: 100%;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--text);
}
.icon-btn {
    min-height: 34px;
    padding: 7px 12px;
}

/* Alerts ----------------------------------------------------------------- */
.alert {
    animation: slideFadeIn 0.24s ease both;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 500;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: color-mix(in srgb, var(--success-text) 20%, transparent);
}
.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: color-mix(in srgb, var(--error-text) 20%, transparent);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: color-mix(in srgb, var(--info-text) 20%, transparent);
}
.alert-warn {
    background: var(--warn-bg);
    color: var(--warn-text);
    border-color: color-mix(in srgb, var(--warn-text) 20%, transparent);
}

/* Badges / chips --------------------------------------------------------- */
.badge,
.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
}
.tag-chip {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: transparent;
    margin: 2px;
}

/* Auth card -------------------------------------------------------------- */
.auth-shell {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 42px 0;
}
.auth-card {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 34px;
    box-shadow: var(--shadow-lg);
}
.auth-brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 34px;
    line-height: 0;
}
.auth-brand-logo {
    height: 48px;
    max-width: min(260px, 80vw);
}
.auth-heading {
    margin-bottom: 24px;
}
.auth-card h1 {
    font-size: clamp(1.75rem, 4vw, 2.15rem);
    line-height: 1.1;
    margin: 0 0 8px;
}
.auth-card p {
    margin: 0;
}
.auth-form {
    display: grid;
    gap: 2px;
}
.auth-form label {
    margin-bottom: 14px;
}
.auth-form .btn {
    margin-top: 4px;
}
.auth-shell + .sitefooter {
    margin-top: -20px;
}

/* Tabs ------------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}
.tabs button {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
}
.tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Tag suggestions -------------------------------------------------------- */
.tag-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.tag-suggest button {
    cursor: pointer;
}

/* Misc ------------------------------------------------------------------- */
.js-time {
    cursor: pointer;
    border-bottom: 1px dotted var(--muted);
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-head h1 {
    margin: 0;
}
.page-head:has(.rd-breadcrumb) {
    align-items: flex-start;
}
.page-head:has(.rd-breadcrumb) .btn,
.page-head:has(.rd-breadcrumb) .page-actions {
    margin-top: 2px;
}
.sitefooter {
    max-width: 1180px;
    margin: 34px auto;
    padding: 0 20px 26px;
    text-align: center;
}
.list-search {
    /*max-width: 340px;*/
    margin-bottom: 14px;
}
.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}
.help {
    font-size: 0.70rem;
    color: var(--muted);
    font-weight: 400;
}
.page-description {
    margin: 4px 0 0;
    max-width: 680px;
}
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.card-head h2 {
    margin: 0;
}
.card-head p {
    margin: 4px 0 0;
}
.card-kicker {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}
.compact-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.compact-list a,
.compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.compact-list a:hover {
    background: var(--hover-bg);
    text-decoration: none;
}
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.meta-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.avatar-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar-initials,
.avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    flex: 0 0 auto;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    grid-area: 1 / 1;
}
.avatar span {
    grid-area: 1 / 1;
}
.avatar:not(.avatar-fallback-only) span {
    opacity: 0;
}
.avatar-fallback-only span {
    opacity: 1;
}
.avatar-lg {
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}
.avatar-sm {
    font-size: 0.78rem;
}
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.toolbar .list-search {
    margin-bottom: 0;
}
.status-active {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: transparent;
}
.status-disabled,
.status-inactive {
    color: var(--muted);
    background: var(--surface-2);
}
.status-admin {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: transparent;
}
.update-preview {
    max-width: 42rem;
}
.blocker-text {
    color: var(--error-text);
    font-weight: 500;
}
.empty h2 {
    margin-bottom: 6px;
}
.empty p {
    margin: 0;
}
.empty-actions {
    margin-top: 14px;
}

/* Modern forms and profile ------------------------------------------------ */
.modern-form {
    display: grid;
    gap: 14px;
}
.modern-form[hidden],
.comment-edit-form[hidden] {
    display: none !important;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px 18px;
    align-items: start;
}
.form-grid-3 {
    grid-template-columns: minmax(180px, 1fr) minmax(230px, 1fr);
}
.form-meta-grid {
    grid-template-columns: repeat(2, minmax(120px, 180px));
    margin-top: 0;
}
.field-label {
    display: block;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}
.time-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(86px, 120px));
    gap: 10px;
}
.time-inputs label {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.textarea-sm {
    min-height: 78px;
}
.update-form textarea[name="content"] {
    min-height: 128px;
}
input[type="file"] {
    padding: 8px;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
}
.profile-hero h2 {
    margin: 0 0 2px;
}
.profile-hero p {
    margin: 0 0 10px;
}
.profile-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.role-card-list {
    display: grid;
    gap: 12px;
}
.role-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}
.role-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.role-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
}
.role-action {
    padding-bottom: 12px;
}
.add-item-form,
.add-item-panel {
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed var(--primary-border);
    border-radius: var(--radius-lg);
    background: var(--primary-soft);
}
.add-item-form label,
.add-item-panel label {
    margin-bottom: 0;
}
.settings-compact {
    max-width: 520px;
}
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.quick-actions .btn .icon {
    width: 15px;
    height: 15px;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0;
}
.notification-unread {
    border-color: var(--primary-border);
    background: var(--primary-soft);
}
.top-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 9999;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    box-shadow: 0 0 16px var(--primary);
    opacity: 0;
    pointer-events: none;
    transition:
        width 0.22s ease,
        opacity 0.12s ease;
}
.top-progress.is-loading {
    width: 78%;
    opacity: 1;
}
.top-progress.is-done {
    width: 100%;
    opacity: 0;
    transition:
        width 0.16s ease,
        opacity 0.28s ease 0.1s;
}

/* Motion and interaction feedback ---------------------------------------- */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes softPulse {
    0%,
    100% {
        box-shadow: var(--shadow);
    }
    50% {
        box-shadow:
            0 0 0 4px var(--primary-soft),
            var(--shadow-md);
    }
}
.page {
    animation: pageEnter 0.28s ease both;
}
.page.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.14s ease,
        transform 0.14s ease;
}
.card,
.stat,
.auth-card {
    transition:
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}
.card:focus-within,
.auth-card:focus-within {
    border-color: var(--hover-border);
}
.btn.is-pressed,
.icon-btn.is-pressed,
.mainnav a.is-pressed,
.tag-suggest button.is-pressed {
    transform: scale(0.97);
}
.btn.is-loading {
    pointer-events: none;
    opacity: 0.78;
}
.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
:target {
    scroll-margin-top: 86px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
    .mobilenav,
    .nav-backdrop,
    .mainnav,
    .nav-toggle,
    .topbar-inner,
    .brand,
    .brand-logo,
    .mainnav a,
    .nav-dropdown-trigger {
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1280px) {
    .topbar-inner {
        gap: 8px;
        padding: 10px 16px;
    }
    .brand-logo,
    .theme-logo {
        height: 40px;
        max-width: min(180px, 34vw);
    }
    .mainnav {
        gap: 0;
    }
    .mainnav a,
    .nav-dropdown-trigger {
        gap: 0.4em;
        min-height: 32px;
        padding: 5px 6px;
        font-size: 0.8rem;
    }
    .mainnav .nav-svg,
    .mainnav .icon {
        width: 14px;
        height: 14px;
    }
    .topbar-right {
        gap: 6px;
        flex-shrink: 0;
    }
    .account-meta strong {
        max-width: 100px;
        font-size: 0.8rem;
    }
}

@media (max-width: 820px) {
    .topbar-inner {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }
    .mainnav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .topbar-right {
        margin-left: auto;
    }
    .account-meta {
        display: none;
    }
}

@media (max-width: 560px) {
    .page {
        margin-top: 20px;
        padding: 0 14px;
    }
    .card,
    .auth-card {
        padding: 18px;
    }
    .page-head {
        align-items: stretch;
    }
    .page-head .btn,
    .page-head form {
        width: 100%;
    }
    th,
    td {
        padding: 10px;
    }
    .form-grid-3,
    .role-grid {
        grid-template-columns: 1fr;
    }
    .time-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .profile-hero {
        align-items: flex-start;
    }
    .account-chip {
        padding: 4px;
    }
    .role-action {
        padding-bottom: 0;
    }
}

.comment-list {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}
.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.comment-bubble {
    flex: 1;
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: var(--radius-lg);
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-meta-main {
    min-width: 0;
}
.comment-edit-btn {
    flex-shrink: 0;
    margin-top: 0;
    opacity: 0.55;
}
.comment-edit-btn:hover,
.comment-edit-btn:focus-visible {
    opacity: 1;
}
.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.attachment-thumb {
    display: block;
    width: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.attachment-thumb img {
    display: block;
    width: 100%;
    height: 80px;
    object-fit: cover;
}
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 12px;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}
.dropzone input[type="file"] {
    display: none;
}
.dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.drag-handle {
    cursor: grab;
    user-select: none;
    color: var(--muted);
    width: 28px;
    text-align: center;
}
tr.is-dragging {
    opacity: 0.55;
}
.channel-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 12px 0;
}
.nested-card {
    margin-top: 12px;
    background: var(--surface-2);
}
.notification-unread {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

/* ============================================================================
   Z — toasts + modal dialogs (loaded via assets/zui.js)
   ========================================================================== */

/* ---- Toasts -------------------------------------------------------------- */
#ztoast-root {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(300px, calc(100vw - 32px));
    pointer-events: none;
}
.ztoast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(16px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    cursor: default;
}
.ztoast.is-in {
    opacity: 1;
    transform: translateX(0);
}
.ztoast.is-leaving {
    opacity: 0;
    transform: translateX(16px);
}
.ztoast-success {
    border-left-color: var(--success-text);
}
.ztoast-error {
    border-left-color: var(--error-text);
}
.ztoast-info {
    border-left-color: var(--info-text);
}
.ztoast-warn {
    border-left-color: var(--warn-text);
}
.ztoast-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    display: inline-flex;
    margin-top: 1px;
}
.ztoast-success .ztoast-icon {
    color: var(--success-text);
}
.ztoast-error .ztoast-icon {
    color: var(--error-text);
}
.ztoast-info .ztoast-icon {
    color: var(--info-text);
}
.ztoast-warn .ztoast-icon {
    color: var(--warn-text);
}
.ztoast-icon svg {
    width: 16px;
    height: 16px;
}
.ztoast-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.ztoast-body strong {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.ztoast-body span,
.ztoast-msg {
    font-size: 0.88rem;
    line-height: 1.35;
    word-wrap: break-word;
}
.ztoast-close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 4px;
}
.ztoast-close:hover {
    color: var(--text);
    background: var(--surface-3);
}

/* ---- Modal overlay + dialog --------------------------------------------- */
.zmodal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9100;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.zmodal-overlay.is-in {
    opacity: 1;
}
.zmodal-overlay.is-leaving {
    opacity: 0;
}
.zmodal {
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(480px, 100%);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}
.zmodal-overlay.is-in .zmodal {
    transform: translateY(0) scale(1);
}
.zmodal-wide {
    width: min(720px, 100%);
}
.zmodal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.zmodal-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: inline-flex;
}
.zmodal-icon svg {
    width: 22px;
    height: 22px;
}
.zmodal-icon-info {
    color: var(--info-text);
}
.zmodal-icon-warn {
    color: var(--warn-text);
}
.zmodal-icon-danger {
    color: var(--error-text);
}
.zmodal-icon-success {
    color: var(--success-text);
}
.zmodal-title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.zmodal-x {
    flex: 0 0 auto;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.6rem;
    line-height: 1;
    padding: 0 4px;
    border-radius: 4px;
}
.zmodal-x:hover {
    color: var(--text);
    background: var(--surface-3);
}
.zmodal-body {
    padding: 18px 20px;
    overflow-y: auto;
    line-height: 1.55;
}
.zmodal-body p {
    margin: 0 0 10px;
}
.zmodal-body p:last-child {
    margin-bottom: 0;
}
.zmodal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.zmodal-foot .btn {
    min-height: 38px;
}

@media (max-width: 640px) {
    #ztoast-root {
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
    }
    .zmodal {
        width: 100%;
        border-radius: var(--radius);
    }
    .zmodal-overlay {
        padding: 8px;
        align-items: flex-end;
    }
    .zmodal-overlay.is-in .zmodal {
        transform: translateY(0);
    }
    .zmodal-foot {
        flex-direction: column-reverse;
    }
    .zmodal-foot .btn {
        width: 100%;
    }
}

/* ============================================================================
   Responsive nav v2 — Tools dropdown + mobile off-canvas drawer
   ========================================================================== */

/* Hamburger toggle — collapses on desktop, expands below 1024px */
.nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    max-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.88) rotate(-24deg);
    pointer-events: none;
    overflow: hidden;
    transition:
        opacity 0.32s cubic-bezier(0.34, 1.15, 0.64, 1),
        transform 0.34s cubic-bezier(0.34, 1.15, 0.64, 1),
        max-width 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.16s ease,
        color 0.16s ease,
        visibility 0s linear 0.34s;
}
.nav-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nav-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.nav-toggle .icon,
.nav-toggle svg {
    width: 22px;
    height: 22px;
}
.nav-toggle .icon-fallback {
    font-size: 1.35rem;
    line-height: 1;
}

/* Tools dropdown inside main nav (desktop) */
.nav-dropdown {
    position: relative;
    display: inline-flex;
}
.nav-dropdown-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65em;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: var(--radius);
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.16s ease,
        color 0.16s ease,
        padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        min-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] {
    background: var(--surface-2);
    color: var(--text);
}
/* The shared .dropdown-menu rule is right-aligned by default; the Tools one
   anchors to the left of its trigger. */
.nav-dropdown .dropdown-menu {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
}

/* Account dropdown headings + separators */
.dropdown-heading {
    padding: 6px 10px 2px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.dropdown-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
}

/* Mobile drawer + backdrop */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 9050;
    opacity: 0;
    transition:
        opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        backdrop-filter 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        -webkit-backdrop-filter 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-backdrop.open {
    opacity: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
body.nav-open {
    overflow: hidden;
}
.mobilenav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 9060;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mobilenav.open {
    transform: translateX(0);
}
@keyframes mobilenavLinkIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.mobilenav.is-entering .mobilenav-body a {
    animation: mobilenavLinkIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(1) {
    animation-delay: 0.03s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(2) {
    animation-delay: 0.05s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(3) {
    animation-delay: 0.07s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(4) {
    animation-delay: 0.09s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(5) {
    animation-delay: 0.11s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(6) {
    animation-delay: 0.13s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(7) {
    animation-delay: 0.15s;
}
.mobilenav.is-entering .mobilenav-body a:nth-of-type(n + 8) {
    animation-delay: 0.17s;
}
.mobilenav.is-entering .mobilenav-section,
.mobilenav.is-entering .mobilenav-sep {
    animation: mobilenavLinkIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.08s;
}
.mobilenav-head {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.mobilenav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
/* Always show app name in the drawer (wordmark scales in the mobile header). */
.mobilenav-brand .theme-logo,
.mobilenav-brand .brand-logo {
    height: 50px;
    max-width: min(240px, 72vw);
}
.mobilenav-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}
.mobilenav-foot {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mobilenav-foot-link {
    display: flex;
    align-items: center;
    gap: 0.7em;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.mobilenav-foot-link:hover {
    background: var(--hover-bg);
    text-decoration: none;
}
.mobilenav-account {
    position: relative;
}
.mobilenav-account-chip {
    width: 100%;
    justify-content: flex-start;
}
.mobilenav-account-chip .account-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.mobilenav-account-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(100% + 8px);
}
.mobilenav a {
    display: flex;
    align-items: center;
    gap: 0.7em;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    transition:
        background-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}
.mobilenav a:hover,
.mobilenav a.active {
    background: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
}
.mobilenav a.active .nav-svg,
.mobilenav a:hover .nav-svg {
    opacity: 1;
}
.mobilenav-sep {
    height: 1px;
    background: var(--border);
    margin: 10px 4px 6px;
}
.mobilenav-section {
    padding: 4px 14px 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ---- Below 1024px: hide desktop nav, show hamburger ------------------- */
@media (max-width: 1024px) {
    /* override the legacy 820px wrap behaviour — we use a drawer instead */
    .topbar-inner {
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 8px 14px;
        min-height: 56px;
    }
    .mainnav {
        flex: 0 0 0;
        max-width: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        pointer-events: none;
        gap: 0;
        overflow: hidden;
        transition:
            gap 0.28s cubic-bezier(0.4, 0, 0.2, 1),
            flex 0.34s cubic-bezier(0.4, 0, 0.2, 1),
            max-width 0.34s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s linear 0.34s;
    }
    .nav-toggle {
        max-width: 44px;
        opacity: 1;
        visibility: visible;
        transform: scale(1) rotate(0deg);
        pointer-events: auto;
        margin-right: 2px;
        transition:
            opacity 0.34s cubic-bezier(0.34, 1.15, 0.64, 1),
            transform 0.36s cubic-bezier(0.34, 1.15, 0.64, 1),
            max-width 0.34s cubic-bezier(0.4, 0, 0.2, 1),
            margin 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            background-color 0.16s ease,
            color 0.16s ease,
            visibility 0s linear 0s;
    }
    .nav-toggle[aria-expanded="true"] {
        transform: scale(1) rotate(90deg);
    }
    .brand {
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
    }
    .brand-logo,
    .theme-logo {
        height: 35px;
        max-width: min(150px, 42vw);
    }
    .topbar-right {
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
    }
    .topbar-right .icon-btn {
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
    }
    .account-meta {
        display: none;
    }
    .account-chip {
        width: 40px;
        height: 40px;
        padding: 3px;
        justify-content: center;
        align-items: center;
    }
}
.mobilenav .mobilenav-account-chip {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 8px 12px;
    justify-content: flex-start;
}
.mobilenav .mobilenav-account-chip .account-meta {
    display: flex;
}
@media (max-width: 420px) {
    .brand-logo,
    .theme-logo {
        max-width: min(130px, 48vw);
    }
}

/* ============================================================================
   Inline actor chips — telemetry surfacing (created/approved/uploaded by)
   ========================================================================== */
.avatar-xs {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.62rem;
}
.avatar-xs img {
    width: 20px;
    height: 20px;
}
.actor-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    cursor: default;
}
.actor-chip .actor-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
}
.actor-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--muted);
}
.actor-meta .muted {
    color: var(--surface-3);
}
@media (max-width: 420px) {
    .actor-chip .actor-name {
        display: none;
    }
}

/* ============================================================================
   Phase 2 — approval badges, view-only update render, table toolbar
   ========================================================================== */

/* Approval status badges */
.status-approved {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: transparent;
}
.status-ack {
    color: var(--info-text);
    background: var(--info-bg);
    border-color: transparent;
}
.status-pending {
    color: var(--warn-text);
    background: var(--warn-bg);
    border-color: transparent;
}
.status-declined {
    color: var(--error-text);
    background: var(--error-bg);
    border-color: transparent;
}

.update-window-banner {
    margin-bottom: 14px;
    font-weight: 600;
}
.update-window-before_open {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid color-mix(in srgb, var(--info-text) 20%, transparent);
}
.update-window-open {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid color-mix(in srgb, var(--success-text) 20%, transparent);
}
.update-window-grace {
    background: var(--warn-bg);
    color: var(--warn-text);
    border: 1px solid color-mix(in srgb, var(--warn-text) 20%, transparent);
}
.update-window-closed {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
}
.approval-by-line {
    margin-top: 3px;
    display: flex;
    align-items: center;
}
.approval-by-line .actor-chip .actor-name {
    display: none;
}

/* Approval banner on the update page */
.approval-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.approval-banner-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.approval-banner-approved {
    border-left: 4px solid var(--success-text);
}
.approval-banner-ack {
    border-left: 4px solid var(--info-text);
}
.approval-banner-pending {
    border-left: 4px solid var(--warn-text);
}
.approval-banner-declined {
    border-left: 4px solid var(--danger);
}

/* Admin two-column update review (Phase 5) */
.update-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}
.update-review-preview,
.update-review-sidebar {
    display: grid;
    gap: 16px;
    align-content: start;
}
.meeting-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.meeting-row-actions .inline-form {
    display: inline;
}
.inline-form {
    display: inline;
}

/* Project create/edit (Phase 8) */
.project-edit-sections {
    display: grid;
    gap: 16px;
}
.section-card .card-head h2 {
    margin: 0;
    font-size: 1.05rem;
}
.section-subhead {
    margin: 18px 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
}
.project-edit-flags {
    margin-top: 4px;
}
.field-span-2 {
    grid-column: 1 / -1;
}
.project-doc-list {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.project-doc-empty {
    margin-top: 12px;
}
.project-edit-actions {
    margin-top: 4px;
}
.danger-zone {
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}
@media (max-width: 640px) {
    .project-edit-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0 -16px -16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
    }
    .project-edit-actions .btn-primary {
        flex: 1;
    }
    .project-edit-form {
        padding-bottom: 8px;
    }
}

.review-action-buttons {
    flex-wrap: wrap;
}
.update-resubmit-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}
@media (max-width: 640px) {
    .update-review-layout {
        grid-template-columns: 1fr;
    }
}

.resubmit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-weight: 600;
}

/* View-only update render (admin reading a member's update) */
.update-readonly {
    display: grid;
    gap: 16px;
}
.update-readonly-section {
    display: grid;
    gap: 4px;
}
.update-readonly-content {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.update-readonly .form-meta-grid {
    margin-bottom: 4px;
}

/* Table toolbar: count left, rows + exports right (Phase 8 moved here too) */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rows-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}
.rows-control span {
    font-weight: 600;
}
.rows-control select {
    width: auto;
    min-width: 64px;
    max-width: 90px;
    padding: 4px 8px;
}
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 560px) {
    .table-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================================================
   Phase 3 — WYSIWYG editor + notification popup + composer
   ========================================================================== */

/* ---- WYSIWYG editor ----------------------------------------------------- */
.wysiwyg-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.wysiwyg-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease;
}
.wysiwyg-btn:hover {
    background: var(--surface-2);
    border-color: var(--surface-3);
}
.wysiwyg-btn.is-active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}
.wysiwyg-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}
.wysiwyg-surface {
    min-height: 160px;
    max-height: 480px;
    overflow-y: auto;
    padding: 14px 16px;
    line-height: 1.6;
    outline: none;
    color: var(--text);
}
.wysiwyg-surface:focus {
    box-shadow: inset 0 0 0 2px var(--primary-soft);
}
.wysiwyg-surface.is-empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}
.wysiwyg-surface h3 {
    margin: 0.6em 0 0.3em;
    font-size: 1.15rem;
}
.wysiwyg-surface h4 {
    margin: 0.6em 0 0.3em;
    font-size: 1rem;
}
.wysiwyg-surface p {
    margin: 0 0 0.6em;
}
.wysiwyg-surface ul,
.wysiwyg-surface ol {
    margin: 0 0 0.6em 1.4em;
}
.wysiwyg-surface a {
    color: var(--primary);
}
.wysiwyg-surface blockquote {
    margin: 0 0 0.6em;
    padding: 4px 12px;
    border-left: 3px solid var(--surface-3);
    color: var(--muted);
}

/* ---- Notification popup (header bell) ----------------------------------- */
.notif-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
    flex-direction: column;
    max-height: min(560px, 80vh);
}
.notif-popup.open {
    display: flex;
}
.notif-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.notif-popup-head h3 {
    margin: 0;
    font-size: 0.98rem;
}
.notif-popup-head .notif-popup-mark {
    background: none;
    border: 0;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0;
}
.notif-popup-body {
    overflow-y: auto;
    flex: 1;
}
.notif-popup-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}
.notif-popup-item:last-child {
    border-bottom: 0;
}
.notif-popup-item:hover {
    background: var(--hover-bg);
    text-decoration: none;
}
.notif-popup-item.unread {
    background: var(--primary-soft);
}
.notif-popup-item.unread:hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--hover-bg));
}
.notif-popup-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    background: var(--primary);
}
.notif-popup-item:not(.unread) .notif-popup-dot {
    background: transparent;
}
.notif-popup-body-content {
    flex: 1;
    min-width: 0;
}
.notif-popup-body-content strong {
    font-size: 0.88rem;
    display: block;
    margin-bottom: 2px;
}
.notif-popup-body-content .notif-popup-text {
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}
.notif-popup-body-content .notif-popup-time {
    font-size: 0.72rem;
    color: var(--muted);
}
.notif-popup-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.notif-popup-foot a {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
}
.notif-popup-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.notif-menu.is-open {
    z-index: 51;
}

/* subtle unread badge pulse (respects reduced-motion) */
.notification-count.pulse {
    animation: notifPulse 0.6s ease;
}
@keyframes notifPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

/* ---- Channel chips (compose page) --------------------------------------- */
.channel-grid {
    display: grid;
    gap: 8px;
}
.channel-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}
.channel-card input {
    flex: 0 0 auto;
}
.channel-card.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.channel-card-label {
    flex: 1;
}
.channel-card-label strong {
    display: block;
    font-size: 0.9rem;
}
.channel-card-label .help {
    display: block;
    margin: 0;
}

/* ---- Template picker ---------------------------------------------------- */
.template-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}
.template-picker select {
    flex: 1;
    min-width: 200px;
}

/* ---- Notifications page (grouped) --------------------------------------- */
.notif-day-group {
    margin-bottom: 18px;
}
.notif-day-heading {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.notif-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.notif-row:hover {
    background: var(--hover-bg);
}
.notif-row.unread {
    background: var(--primary-soft);
    border-color: transparent;
}
.notif-row input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 3px;
}
.notif-row-body {
    flex: 1;
    min-width: 0;
}
.notif-row-body strong {
    font-size: 0.92rem;
}
.notif-row-body .notif-row-text {
    font-size: 0.86rem;
    color: var(--muted);
    margin: 2px 0 4px;
}
.notif-row-meta {
    font-size: 0.74rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.notif-row-meta .badge {
    font-size: 0.68rem;
    padding: 1px 6px;
}
.notif-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .template-picker {
        flex-direction: column;
        align-items: stretch;
    }
    .template-picker select {
        min-width: 0;
        width: 100%;
    }
    .modern-form select[multiple] {
        width: 100%;
        min-height: 120px;
    }
    .approval-by-line {
        margin-top: 4px;
        font-size: 0.78rem;
    }
    .approval-by-line .actor-meta {
        flex-wrap: wrap;
        gap: 2px 4px;
    }
    .page-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 860px) {
    .notif-popup {
        position: fixed;
        top: calc(56px + 8px);
        right: 14px;
        left: 14px;
        width: auto;
        max-height: min(480px, calc(100vh - 80px));
    }
}

@media (max-width: 560px) {
    .wysiwyg-toolbar {
        overflow-x: auto;
    }
}

/* ============================================================================
   Phase 4 — Member groups redesign
   ========================================================================== */
.groups-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.groups-filter-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.groups-filter-form label {
    margin-bottom: 0;
    min-width: 180px;
}
.groups-toolbar-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.groups-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.group-card {
    margin-bottom: 0;
}
.group-card-head {
    align-items: flex-start;
}
.group-head-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.group-meta-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 6px 0 2px;
}
.group-badge-auto {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}
.group-multi {
    min-height: 148px;
}
.group-create-card {
    border-style: dashed;
    border-color: var(--primary-border);
    background: color-mix(in srgb, var(--primary-soft) 44%, var(--surface));
}

@media (min-width: 980px) {
    .groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .groups-toolbar-actions,
    .groups-filter-form,
    .groups-filter-form .form-actions {
        width: 100%;
    }
    .groups-toolbar-actions .btn,
    .groups-filter-form .btn {
        flex: 1;
    }
    .group-head-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================================================
   Phase 5 — Meetings
   ========================================================================== */
.meeting-response-actions {
    flex-wrap: wrap;
}
.meeting-response-actions .btn {
    min-width: 130px;
}

/* ============================================================================
   Phase 4.1 — Member groups UX overhaul
   ========================================================================== */
.groups-main-search {
    max-width: 520px;
}
.groups-summary-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}
.group-builder {
    position: relative;
    overflow: hidden;
}
.group-builder::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--primary-soft) 55%, transparent),
        transparent 42%
    );
    pointer-events: none;
}
.group-builder > * {
    position: relative;
}
.group-builder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.group-builder-head h2 {
    margin: 0;
}
.group-builder-head p {
    margin: 4px 0 0;
}
.group-builder-form {
    gap: 16px;
}
.group-basics-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}
.group-builder-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.group-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
    padding: 12px;
    display: grid;
    gap: 10px;
    min-height: 340px;
}
.group-picker[data-picker-readonly="1"] {
    opacity: 0.88;
}
.group-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.group-picker-head h3 {
    margin: 0;
    font-size: 1rem;
}
.group-picker-head .help {
    margin-top: 2px;
}
.group-picker-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}
.group-picker-search {
    margin-top: 0;
}
.group-picker-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: auto;
    padding: 6px;
    min-height: 180px;
    max-height: 280px;
    display: grid;
    align-content: start;
    gap: 4px;
}
.picker-empty {
    padding: 12px;
    margin: 0;
}
.picker-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
}
.picker-item input[type="checkbox"] {
    grid-row: 1 / span 2;
}
.picker-item:hover {
    background: var(--hover-bg);
    border-color: var(--hover-border);
}
.picker-item-main {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}
.picker-item-sub {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.2;
}
.group-picker-foot {
    display: grid;
    gap: 8px;
}
.group-picker-count {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.group-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}
.group-picker-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
}
.group-submit-row {
    margin-top: 2px;
}
.group-item-card {
    border: 1px solid color-mix(in srgb, var(--border) 78%, var(--primary-soft));
    background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}
.group-card-auto {
    border-color: color-mix(in srgb, var(--primary-border) 60%, var(--border));
}
.group-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.group-item-top h2 {
    margin: 0;
}
.group-item-form {
    gap: 14px;
}

@media (max-width: 980px) {
    .group-basics-grid,
    .group-builder-panels {
        grid-template-columns: 1fr;
    }
    .group-picker {
        min-height: 300px;
    }
}

@media (max-width: 640px) {
    .group-item-top {
        flex-direction: column;
    }
    .group-head-actions {
        width: 100%;
    }
    .group-picker-actions {
        width: 100%;
    }
    .group-picker-actions .btn {
        flex: 1;
    }
}

.group-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
.group-preview-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface);
}
.group-preview-block strong {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.group-preview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}
.group-editor {
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}
.group-editor > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.group-editor > summary::-webkit-details-marker {
    display: none;
}
.group-editor > summary::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}
.group-editor[open] > summary::before {
    content: "−";
}

.meeting-audience-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
    padding: 12px;
}
.meeting-audience-head {
    margin-bottom: 10px;
}
.meeting-audience-head h3 {
    margin: 0;
}
.meeting-audience-head .help {
    margin-top: 3px;
}
.meeting-audience-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.meeting-audience-panels .group-picker {
    min-height: 310px;
}

@media (max-width: 980px) {
    .group-preview-grid,
    .meeting-audience-panels {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Phase 7 — project docs + members create flow
   ========================================================================== */
.doc-slots {
    display: grid;
    gap: 12px;
}
.doc-slot {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    background: var(--surface-2);
}
.doc-slot-grid {
    display: grid;
    grid-template-columns: minmax(190px, 220px) 1fr;
    gap: 12px;
    align-items: start;
}
.doc-slot-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 190px;
    aspect-ratio: 1 / 1;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}
.doc-slot-dropzone:hover,
.doc-slot-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.doc-slot-dropzone input[type="file"] {
    display: none;
}
.doc-slot-dropzone-copy {
    display: grid;
    gap: 4px;
}
.doc-slot-dropzone-copy strong {
    display: block;
}
.doc-slot-dropzone-copy span {
    font-size: 0.84rem;
    color: var(--muted);
}
.doc-slot-fields {
    display: grid;
    gap: 8px;
}

.guided-member-create .guided-step {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    background: var(--surface-2);
}
.guided-member-create .guided-step h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

@media (max-width: 720px) {
    .doc-slot-grid {
        grid-template-columns: 1fr;
    }
    .doc-slot-dropzone {
        min-height: 160px;
    }
}

/* Notification composer live preview */
.notif-live-preview {
    margin-top: 16px;
}
.notif-preview-grid {
    display: grid;
    gap: 14px;
}
@media (min-width: 720px) {
    .notif-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.notif-preview-pane {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--surface-2);
}
.notif-preview-pane h3 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.notif-preview-subject {
    margin: 0;
    font-weight: 600;
}
.notif-preview-body {
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}
.notif-preview-sms {
    margin: 0;
    font-family: ui-monospace, monospace;
    font-size: 0.88rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.live-search-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
}

/* Settings delivery + export split ----------------------------------- */
.settings-panel-shortcuts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-delivery-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-delivery-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.settings-delivery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.settings-enable-toggle {
    margin: 0;
}
.settings-delivery-fields {
    margin-top: 12px;
}
.leave-half-day-toggle {
    cursor: pointer;
    user-select: none;
}
.leave-half-day-toggle input[type="checkbox"] {
    cursor: pointer;
}

.export-split {
    display: inline-flex;
    align-items: stretch;
}
.export-split-main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.export-split-menu {
    position: relative;
}
.export-split-caret {
    list-style: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid color-mix(in srgb, var(--primary-fg, #fff) 25%, transparent);
    padding-inline: 8px;
    cursor: pointer;
}
.export-split-caret::-webkit-details-marker {
    display: none;
}
.export-split-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 168px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 30;
    padding: 4px;
}
.export-split-item {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.export-split-item:hover {
    background: var(--hover-bg);
}

/* Updates feed toolbar --------------------------------------------------- */
.updates-toolbar {
    gap: 12px;
}
.updates-toolbar .card-kicker {
    flex: 1;
}
.updates-toolbar .toolbar-right {
    margin-left: auto;
}
.activity-label {
    font-size: 0.85rem;
}
td.update-actions {
    width: 1%;
    white-space: nowrap;
}

/* --- Combobox (searchable single-select) -------------------------------- */
.combobox {
    position: relative;
}
.combobox.is-open {
    z-index: 45;
}
.combobox-control {
    position: relative;
    display: flex;
    align-items: stretch;
}
.combobox-input {
    width: 100%;
    padding-right: 2.25rem;
}
.combobox-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.25rem;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.combobox-list {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.combobox-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.combobox-option:hover,
.combobox-option.is-selected {
    background: var(--surface-2);
}
.combobox-option-sub,
.pill-select-option-sub {
    font-size: 0.82rem;
    color: var(--muted);
}

/* --- Pill multi-select -------------------------------------------------- */
.pill-select {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 6px 8px;
}
.pill-select:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}
.pill-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.pill-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    font-size: 0.86rem;
}
.pill-chip-remove {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}
.pill-chip-remove:hover {
    color: var(--danger);
}
.pill-select-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px 2px;
    min-height: 32px;
}
.pill-select-input:focus {
    outline: none;
}
.pill-select-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 220px;
    overflow: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.pill-select-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.pill-select-option:hover {
    background: var(--surface-2);
}

/* --- Password show/hide ------------------------------------------------- */
.password-field {
    position: relative;
    display: block;
}
.password-field input {
    width: 100%;
    padding-right: 2.5rem;
}
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover {
    color: var(--text);
}

/* --- Meeting view overhaul ---------------------------------------------- */
.meeting-view-grid {
    display: grid;
    gap: 16px;
}
.meeting-location-link {
    word-break: break-all;
}
.meeting-audience-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Leave half-day ----------------------------------------------------- */
.leave-half-day-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.leave-half-day-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Member leave totals (admin) ---------------------------------------- */
.leave-member-totals {
    margin-bottom: 16px;
}
.leave-member-totals table tbody tr[data-row-href] {
    cursor: pointer;
}

/* --- Final submissions -------------------------------------------------- */
.final-submission-note {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    border: 1px solid var(--border);
    font-size: 0.92rem;
    line-height: 1.5;
}
.final-submission-note ul {
    margin: 8px 0 0;
    padding-left: 1.2rem;
}

/* --- Settings email/SMS tab --------------------------------------------- */
.settings-channel-grid {
    display: grid;
    gap: 20px;
}
@media (min-width: 768px) {
    .settings-channel-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* --- My updates multi-project ------------------------------------------- */
.project-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.project-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--text);
}
.project-switcher a.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--primary);
}
.project-switcher .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}
.project-switcher .status-dot.done {
    background: var(--success);
}
.project-switcher .status-dot.pending {
    background: var(--warning);
}

/* ===== Redesign primitives (rd-*) ===================================== */
.is-hidden {
    display: none !important;
}
.rd-accent-primary {
    background: var(--primary-soft);
    color: var(--primary);
}
.rd-accent-success {
    background: var(--success-bg);
    color: var(--success-text);
}
.rd-accent-warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}
.rd-accent-info {
    background: var(--info-bg);
    color: var(--info-text);
}
.rd-accent-muted {
    background: var(--surface-2);
    color: var(--muted);
}

.rd-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
}
.rd-form-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.rd-rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 76px;
}

.rd-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: visible;
    box-shadow: var(--shadow);
}
.rd-section-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px 0;
}
.rd-section-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rd-section-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.rd-section-desc {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}
.rd-section-body {
    padding: 14px 18px 18px;
    overflow: visible;
}
.rd-section-body .form-grid-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
	margin-top: 6px;
}
.rd-section-body .form-grid-2col .combobox {
    min-width: 0;
}
.combobox-field {
    display: flex;
    flex-direction: column;
    /* gap: 6px;*/
    min-width: 0;
}
.combobox-field > label {
    margin-bottom: 0;
}
.rd-section-body .form-grid-2col > .combobox-field {
    margin-top: 0;
}
.pill-select-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin-top: 12px;
}
.pill-select-field > label {
    margin-bottom: 0;
}
.rd-role-field {
    margin-bottom: 12px;
}
.rd-role-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.rd-role-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}
.rd-role-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 8px 10px;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.rd-role-btn:hover {
    color: var(--text);
}
.rd-role-btn.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.rd-role-btn .icon {
    opacity: 0.65;
}
.rd-role-btn.is-active .icon {
    opacity: 1;
}
.rd-role-hint {
    margin: 8px 0 0;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.rd-section-body .form-grid,
.rd-section-body label {
    margin-bottom: 0;
}
.rd-section-body > label + label,
.rd-section-body > .combobox-field + label,
.rd-section-body > label + .combobox-field,
.rd-section-body > .combobox-field + .combobox-field {
    margin-top: 12px;
}

.rd-form-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 8px;
}

.rd-preview-card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rd-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--primary-soft);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}
.rd-preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: rd-pulse 2.4s ease-in-out infinite;
}
@keyframes rd-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}
.rd-preview-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--primary);
}
.rd-preview-body {
    padding: 18px 16px 16px;
}
.rd-preview-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.rd-preview-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--surface-2);
    border: 2px solid var(--border);
    color: var(--muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rd-preview-avatar.has-name {
    background: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    color: var(--primary-foreground);
}
.rd-preview-name {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    min-height: 1.4em;
}
.rd-preview-name.is-empty {
    font-weight: 400;
    font-size: 0.92rem;
    color: var(--muted);
    font-style: italic;
}
.rd-preview-desig {
    text-align: center;
    margin-bottom: 12px;
    min-height: 1.2em;
}
.rd-preview-desig-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
}
.rd-preview-desig-badge.is-hidden {
    visibility: hidden;
}
.rd-preview-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}
.rd-preview-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.rd-preview-row-icon {
    color: var(--muted);
    flex-shrink: 0;
    margin-top: 2px;
}
.rd-preview-key {
    font-size: 0.72rem;
    color: var(--muted);
    min-width: 52px;
    flex-shrink: 0;
    padding-top: 1px;
}
.rd-preview-val {
    font-size: 0.82rem;
    color: var(--text);
    flex: 1;
    word-break: break-word;
}
.rd-preview-val.is-empty {
    color: var(--muted);
    font-style: italic;
}
.rd-preview-val .badge {
    font-size: 0.68rem;
}

.rd-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.rd-summary-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.rd-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.rd-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}
.rd-summary-item.is-hidden {
    display: none;
}
.rd-summary-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rd-summary-text strong {
    color: var(--text);
    font-weight: 600;
}

.rd-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.rd-segment-btn {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.rd-segment-btn:hover {
    border-color: var(--hover-border);
    color: var(--text);
}
.rd-segment-btn.is-active {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
}
.rd-segment-panel.is-hidden {
    display: none;
}
.rd-hint-box {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.rd-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 16px;
    padding-left: 20px;
}
.rd-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 20px 14px 0;
    margin-right: 20px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}
.rd-meta-item:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}
.rd-meta-key {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.rd-meta-val {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.rd-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.rd-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.rd-stat-card.is-accent {
    border-color: var(--primary-border);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.rd-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.rd-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 4px 0 2px;
}
.rd-stat-sub {
    font-size: 0.75rem;
    color: var(--muted);
}

.rd-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.rd-filter-bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.rd-filter-bar-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.rd-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    width: 100%;
}
.rd-filter-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}
.rd-filter-top-grow {
    flex: 1 1 auto;
    min-width: 0;
}
.rd-filter-search-label {
    flex: 1 1 280px;
    min-width: min(100%, 220px);
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}
.rd-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 0 12px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.rd-filter-search-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--muted);
    opacity: 0.85;
}
.rd-filter-search input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 8px 0;
    border: none;
    background: transparent;
    box-shadow: none;
}
.rd-filter-search input:focus {
    outline: none;
    box-shadow: none;
}
.rd-filter-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.rd-filter-fields {
    margin: 0;
    align-items: end;
}
.rd-filter-form:not(:has(.rd-filter-fields > *)) .rd-filter-top {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.rd-filter-bar-foot {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.rd-filter-bar .form-grid {
    margin: 0;
}
.rd-filter-bar .notif-filters,
.rd-filter-bar .rd-filter-form {
    margin-bottom: 0;
    width: 100%;
}

.rd-review-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.rd-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rd-panel-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.rd-panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.rd-panel-sub {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}
.rd-panel-body {
    padding: 14px 16px 16px;
}

.rd-timeline {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.rd-timeline-head {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--border);
}
.rd-timeline-head h2 {
    margin: 0;
    font-size: 0.95rem;
}
.rd-timeline-body {
    padding: 8px 0;
}
.rd-timeline-entry {
    display: flex;
    gap: 0;
    padding: 0 18px;
}
.rd-timeline-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
    padding-top: 12px;
}
.rd-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--border);
    flex-shrink: 0;
}
.rd-timeline-dot.is-success {
    border-color: var(--success-text);
    background: var(--success-bg);
}
.rd-timeline-dot.is-info {
    border-color: var(--info-text);
    background: var(--info-bg);
}
.rd-timeline-line {
    width: 1px;
    flex: 1;
    min-height: 20px;
    background: var(--border);
    margin-top: 3px;
}
.rd-timeline-entry:last-child .rd-timeline-line {
    display: none;
}
.rd-timeline-content {
    flex: 1;
    padding: 8px 0 16px 8px;
    min-width: 0;
}
.rd-timeline-actor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
}
.rd-timeline-name {
    font-weight: 600;
}
.rd-timeline-action {
    color: var(--muted);
}
.rd-timeline-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}
.rd-timeline-note {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

/* Update view page (Design Concept/view-update.html structure) */
.rd-update-view {
    display: grid;
    gap: 0;
}
.page-head .rd-breadcrumb {
    margin-bottom: 4px;
}
.page-head .rd-breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

.rd-approval-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.rd-approval-banner.is-approved {
    border-color: color-mix(in srgb, var(--success-text) 28%, var(--border));
    background: var(--success-bg);
}
.rd-approval-banner.is-ack {
    border-color: color-mix(in srgb, var(--info-text) 28%, var(--border));
    background: var(--info-bg);
}
.rd-approval-banner.is-declined {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
    background: var(--error-bg);
}
.rd-approval-pill {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.rd-approval-by {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--muted);
}
.rd-approval-by .actor-chip .actor-name {
    color: var(--text);
    font-weight: 500;
}
.rd-approval-time {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
}

.rd-update-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rd-update-statement {
    padding: 28px 28px 22px;
    border-bottom: 1px solid var(--border);
}
.rd-update-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.rd-update-title {
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.02em;
}
.rd-update-card .rd-meta-strip.rd-update-meta {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    box-shadow: none;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.rd-meta-val.is-progress {
    color: var(--info-text);
}
.rd-meta-val.is-done {
    color: var(--success-text);
}
.rd-meta-val.is-link a {
    color: var(--info-text);
    text-decoration: none;
    font-weight: 500;
}
.rd-meta-val.is-link a:hover {
    text-decoration: underline;
}
.rd-meta-val.is-text {
    font-family: inherit;
}
.rd-update-blockers {
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
}
.rd-update-blockers-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
}
.rd-update-tags {
    padding: 16px 28px;
}
.rd-update-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rd-update-tags-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 2px;
}

.rd-update-view .rd-review-layout {
    margin-bottom: 20px;
}
.rd-update-view .rd-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.rd-update-view .rd-panel-count {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.rd-review-note-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
}
.rd-review-note-label .help {
    font-weight: 400;
}
.rd-review-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.rd-review-actions .btn {
    flex: 1 1 0;
}
.rd-review-actions .btn-primary {
    font-weight: 600;
}
.rd-review-decline {
    margin-top: 14px;
    border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border));
    border-radius: var(--radius-md);
    background: var(--error-bg);
    overflow: hidden;
}
.rd-review-decline-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}
.rd-review-decline-toggle::-webkit-details-marker {
    display: none;
}
.rd-review-decline-toggle::marker {
    content: "";
}
.rd-review-decline-toggle:hover {
    background: color-mix(in srgb, var(--danger) 8%, var(--error-bg));
}
.rd-review-decline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
    color: var(--error-text);
    flex-shrink: 0;
}
.rd-review-decline-copy {
    flex: 1;
    min-width: 0;
}
.rd-review-decline-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--error-text);
    line-height: 1.3;
}
.rd-review-decline-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.35;
}
.rd-review-decline-chevron {
    display: inline-flex;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.rd-review-decline[open] .rd-review-decline-chevron {
    transform: rotate(180deg);
}
.rd-review-decline[open] .rd-review-decline-toggle {
    border-bottom: 1px solid color-mix(in srgb, var(--danger) 22%, var(--border));
}
.rd-review-decline-body {
    padding: 14px;
    background: var(--surface);
}
.rd-comment-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 0 8px;
    text-align: center;
}
.rd-comment-empty-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.rd-comment-compose {
    margin-top: 14px;
    position: relative;
}
.rd-comment-compose input[type="text"] {
    width: 100%;
    padding-right: 44px;
}
.rd-comment-send {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}
.rd-comment-send:hover {
    background: var(--surface);
    color: var(--text);
}
.rd-update-view .comment-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 4px;
}
.rd-update-view .rd-timeline-avatar {
    flex-shrink: 0;
}
.rd-update-view .rd-timeline-time {
    margin-left: auto;
}

.rd-update-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rd-update-form-card .update-form {
    margin: 0;
}
.rd-update-form-statement {
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--border);
}
.rd-update-form-statement label {
    margin: 0;
}
.rd-update-form-statement .rd-update-label {
    margin-bottom: 10px;
}
.rd-update-form-statement textarea {
    min-height: 96px;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    resize: vertical;
}
.rd-update-form-statement textarea:focus {
    outline: none;
    box-shadow: none;
}
.rd-update-form-meta {
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
}
.rd-update-form-meta .form-grid {
    margin: 0;
    padding: 14px 0;
    gap: 12px 20px;
}
.rd-update-form-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rd-update-form-meta .meta-label,
.rd-update-form-meta .field-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.rd-update-form-extra {
    padding: 18px 28px 22px;
    display: grid;
    gap: 14px;
}
.rd-update-form-actions {
    padding: 0 28px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.rd-update-attachments {
    margin-bottom: 20px;
}

@media (max-width: 660px) {
    .rd-update-statement,
    .rd-update-blockers,
    .rd-update-tags,
    .rd-update-form-statement,
    .rd-update-form-extra {
        padding-left: 18px;
        padding-right: 18px;
    }
    .rd-update-card .rd-meta-strip.rd-update-meta {
        padding-left: 18px;
    }
    .rd-update-form-meta {
        padding-left: 18px;
        padding-right: 18px;
    }
    .rd-update-form-actions {
        padding-left: 18px;
        padding-right: 18px;
    }
    .rd-update-title {
        font-size: 1.25rem;
    }
    .rd-approval-time {
        width: 100%;
        margin-left: 0;
    }
}

.rd-directory {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.rd-directory-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: sticky;
    top: 76px;
}
.rd-directory-sidebar-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.rd-directory-source {
    margin-top: 10px;
}
.rd-directory-source label {
    display: block;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}
.rd-directory-source select {
    margin-top: 6px;
    width: 100%;
}
.list-section-head {
    margin: 24px 0 12px;
}
.card-inline-search {
    margin: -6px 0 14px;
}
.card-inline-search .rd-filter-search-label {
    margin: 0;
}
.rd-directory-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.rd-directory-new {
    width: 100%;
    text-align: left;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rd-directory-new:hover,
.rd-directory-new.is-active {
    background: var(--hover-bg);
}
.rd-directory-new-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
}
.rd-directory-item {
    width: 100%;
    text-align: left;
    font: inherit;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: block;
}
.rd-directory-item:last-child {
    border-bottom: none;
}
.rd-directory-item:hover,
.rd-directory-item.is-active {
    background: var(--hover-bg);
}
.rd-directory-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.rd-directory-item-meta {
    font-size: 0.75rem;
    color: var(--muted);
}
.rd-directory-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rd-directory-detail-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.rd-directory-detail-head h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.rd-directory-detail-body {
    padding: 18px;
}

.rd-split-editor {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.rd-template-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
}
.rd-template-list-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.rd-template-list-head h2 {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.rd-template-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.rd-template-filter {
    font: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
}
.rd-template-filter.is-active {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
}
.rd-template-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.rd-template-group-label {
    padding: 10px 14px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.rd-template-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}
.rd-template-item:hover {
    background: var(--hover-bg);
    text-decoration: none;
}
.rd-template-item.is-active {
    background: var(--primary-soft);
}
.rd-template-item-name {
    font-size: 0.88rem;
    font-weight: 600;
}
.rd-template-item-key {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: ui-monospace, monospace;
}
.rd-template-editor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: 420px;
    box-shadow: var(--shadow);
}
.rd-template-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
    min-height: 420px;
}

.rd-page-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rd-page-top h1 {
    margin: 0 0 4px;
}
.rd-page-top .page-description {
    margin: 0;
}
.rd-form-layout.container.narrow {
    max-width: none;
    margin: 0;
}
.rd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 6px;
}
.rd-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}
.rd-breadcrumb a:hover {
    color: var(--text);
}
.rd-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.rd-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.rd-tabs .tab-btn,
.rd-tabs button[data-tab] {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 9px 14px 10px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: -1px;
}
.rd-tabs .tab-btn.active,
.rd-tabs button[data-tab].active {
    color: var(--text);
    border-bottom-color: var(--primary);
}

.rd-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 16px;
    padding: 12px 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

@media (max-width: 900px) {
    .rd-form-layout,
    .rd-directory,
    .rd-split-editor,
    .rd-review-layout {
        grid-template-columns: 1fr;
    }
    .rd-rail,
    .rd-directory-sidebar {
        position: static;
    }
    .rd-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .rd-section-body .form-grid-2col {
        grid-template-columns: 1fr;
    }
    .rd-stat-row {
        grid-template-columns: 1fr;
    }
    .rd-meta-strip {
        flex-direction: column;
    }
    .rd-meta-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
        margin-right: 0;
        padding: 12px 16px;
    }
    .rd-meta-item:last-child {
        border-bottom: none;
    }
    .rd-filter-form {
        grid-template-columns: 1fr;
    }
    .rd-filter-top {
        flex-direction: column;
        align-items: stretch;
    }
    .rd-filter-top-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .rd-filter-top-actions .btn {
        flex: 1 1 auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .rd-preview-dot {
        animation: none;
    }
}
