/*
 * Echo Distribution — рабочий интерфейс кабинета.
 * Это отдельная система для авторизованной области: плотные данные, единые
 * controls и спокойные поверхности. Она намеренно не применяется к лендингу.
 */

.app-layout {
    --account-sidebar-width: 264px;
    --account-topbar-height: 72px;
    --account-page-padding: clamp(22px, 2.4vw, 40px);
    --account-content-max-width: 1600px;
    --account-grid-gutter: 20px;
    --workspace-radius: 12px;
    --workspace-radius-sm: 9px;
    --workspace-control-height: 42px;
    --workspace-row-height: 76px;
    background: var(--bg-primary);
}

.app-layout .sidebar {
    width: var(--account-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    box-shadow: none;
}

.app-layout .main-content { margin-left: var(--account-sidebar-width); }

.app-layout .sidebar-logo {
    min-height: var(--account-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.app-layout .sidebar-logo::after { display: none; }
.app-layout .sidebar-logo > div { justify-content: flex-start; width: 100%; min-width: 0; }
.app-layout .sidebar-logo img { display: block; height: 27px; max-width: 100%; width: auto; }

.app-layout .sidebar-nav { flex: 1 1 auto; min-height: 0; padding: 20px 12px 14px; overflow-y: auto; }
.app-layout .nav-section { margin: 0 0 22px; }
.app-layout .nav-section-title {
    padding: 0 12px;
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .08em;
}

.app-layout .nav-item {
    position: relative;
    min-height: 44px;
    gap: 11px;
    margin: 2px 0;
    padding: 10px 12px;
    color: var(--text-secondary);
    border: 0;
    border-radius: var(--workspace-radius-sm);
    font-size: 14.5px;
    font-weight: 540;
    transition: color 180ms ease, background 180ms ease;
}

.app-layout .nav-item::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    content: '';
}

.app-layout .nav-item :is(.app-icon, svg, i) {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: currentColor;
}

.app-layout .nav-item:hover {
    color: var(--text-primary);
    background: var(--surface-secondary);
}

.app-layout .nav-item.active {
    color: var(--text-primary);
    background: var(--surface-secondary);
    border: 0;
}

.app-layout .nav-item.active::before { background: var(--accent); }
.app-layout .nav-item.active :is(.app-icon, svg, i) { color: var(--accent); }
.nav-release__primary { position: relative; display: flex; align-items: stretch; }
.nav-release__primary .nav-release__link { flex: 1 1 auto; min-width: 0; padding-right: 44px; }
.nav-release__toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    display: grid;
    width: 40px;
    min-height: 44px;
    place-items: center;
    color: var(--text-muted);
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, transform 200ms ease;
}
.nav-release__toggle:hover { color: var(--text-primary); background: var(--surface-secondary); }
.nav-release__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-release.is-open .nav-release__toggle .app-icon { transform: rotate(180deg); }
.app-layout .nav-badge {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.workspace-nav-children { display: grid; gap: 2px; }
.nav-release__children {
    max-height: 0;
    overflow: hidden;
    margin: 0 0 0 42px;
    opacity: 0;
    pointer-events: none;
    transition: max-height 220ms ease, margin 220ms ease, opacity 180ms ease;
}
.nav-release.is-open .nav-release__children {
    max-height: 220px;
    margin: 3px 0 9px 42px;
    opacity: 1;
    pointer-events: auto;
}

.workspace-nav-children a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
    min-height: 34px;
    padding: 7px 9px;
    color: var(--text-secondary);
    border-radius: 7px;
    font-size: 13px;
    font-weight: 510;
    line-height: 1.2;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-nav-children a:hover { color: var(--text-primary); background: var(--surface-secondary); }
.workspace-nav-children a.active { color: var(--text-primary); background: var(--surface-secondary); }
.workspace-nav-children a.active span { color: var(--accent); }
.workspace-nav-children b { flex: 0 0 auto; color: var(--text-muted); font-size: 11px; font-weight: 600; }

.app-layout .sidebar-footer {
    display: grid;
    flex: 0 0 auto;
    gap: 8px;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-subtle);
}

.theme-segmented {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 3px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
.theme-segmented::before {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 4px);
    border-radius: 7px;
    background: var(--surface-elevated);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    content: '';
    transform: translateX(calc(100% + 2px));
    transition: transform 240ms ease;
}
html.theme-light .theme-segmented::before { transform: translateX(0); }
.theme-segmented:has([data-theme-choice="dark"].is-active)::before { transform: translateX(calc(100% + 2px)); }
.theme-segmented__option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 6px;
    color: var(--text-muted);
    border: 0;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 560;
    cursor: pointer;
    transition: color 200ms ease;
}
.theme-segmented__option.is-active { color: var(--text-primary); }
.theme-segmented__option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-segmented__option .app-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    vertical-align: 0;
}
.app-layout .nav-item > .app-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin: 0;
    vertical-align: 0;
}

.app-layout .topbar {
    height: var(--account-topbar-height);
    padding: 0 var(--account-page-padding);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.topbar-title-group,
.topbar-actions,
.topbar-user-trigger {
    display: flex;
    align-items: center;
}

.topbar-title-group { min-width: 0; gap: 10px; }
.topbar-page-title {
    display: none;
}

.topbar-actions { gap: 8px; }
.app-layout .topbar .btn {
    height: var(--workspace-control-height);
    min-height: var(--workspace-control-height);
    border-radius: var(--workspace-radius-sm);
    box-shadow: none;
}

.app-layout .topbar .btn-primary {
    color: #fff;
    background: var(--accent);
    border-color: transparent;
}

.app-layout .topbar .btn-primary:hover { background: var(--accent-hover); box-shadow: none; transform: translateY(-1px); }
.topbar-new-release { padding-inline: 15px !important; }
.topbar-new-release > span:first-child { font-size: 18px; font-weight: 400; line-height: 1; }

.app-layout .topbar .btn-icon {
    width: var(--workspace-control-height);
    padding: 0;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
}

.app-layout .topbar .btn-icon:hover { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-subtle); }

.topbar-user { position: relative; }
.topbar-user-trigger {
    height: var(--workspace-control-height);
    gap: 8px;
    padding: 3px 4px 3px 6px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
}

.topbar-user-trigger:hover,
.topbar-user.open .topbar-user-trigger { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-subtle); }
.topbar-user .user-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 650;
}
.topbar-user-name { max-width: 132px; overflow: hidden; font-size: 13px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user .app-icon { width: 15px; height: 15px; }
.topbar-user-menu { top: calc(100% + 8px); right: 0; bottom: auto !important; left: auto; min-width: 196px; margin: 0 !important; }

.app-layout .page-content {
    min-height: calc(100dvh - var(--account-topbar-height));
    padding: var(--account-page-padding);
    background: var(--bg-primary);
}

.app-layout .page-content > .max-w-full,
.app-layout .page-content > .content-container {
    width: 100%;
    max-width: var(--account-content-max-width);
    padding: 0;
    margin: 0;
}

/* Shared workspace primitives */
.workspace-page { width: 100%; max-width: var(--account-content-max-width); }
.workspace-header,
.workspace-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.workspace-header { margin: 0 0 22px; }
.workspace-header h1,
.workspace-header__title { margin: 0; color: var(--text-primary); font-size: clamp(26px, 2vw, 31px); font-weight: 680; letter-spacing: -.025em; line-height: 1.12; }
.workspace-header > div > p,
.workspace-header__subtitle { margin: 5px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }

.workspace-surface {
    overflow: hidden;
    background: var(--surface-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
    box-shadow: none;
}

.workspace-surface + .workspace-surface,
.workspace-grid + .workspace-surface,
.workspace-surface + .workspace-grid { margin-top: 18px; }

/* Grid gap already separates adjacent panels.  The generic stack margin above
   must not offset the second column and make paired dashboard panels uneven. */
.workspace-grid > .workspace-surface + .workspace-surface { margin-top: 0; }

.workspace-section-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-subtle); }
.workspace-section-title { margin: 0; color: var(--text-primary); font-size: 17px; font-weight: 620; letter-spacing: -.01em; }
.workspace-section-meta { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.workspace-section-link { color: var(--accent); font-size: 13px; font-weight: 560; text-decoration: none; }
.workspace-section-link:hover { color: var(--accent-hover); }
.workspace-grid { display: grid; gap: var(--account-grid-gutter); }
.workspace-grid--two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.workspace-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workspace-grid--main { grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr); }

.workspace-metrics {
    display: grid;
    grid-template-columns: repeat(var(--metric-count, 4), minmax(0, 1fr));
    background: var(--surface-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
}

.workspace-metric { min-width: 0; padding: 18px 20px; }
.workspace-metric + .workspace-metric { border-left: 1px solid var(--border-subtle); }
.workspace-metric > span,
.workspace-metric__label { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 540; }
.workspace-metric > strong,
.workspace-metric__value { display: block; margin-top: 7px; color: var(--text-primary); font-size: clamp(25px, 2.2vw, 33px); font-weight: 680; letter-spacing: -.035em; line-height: 1.05; }
.workspace-metric > small,
.workspace-metric__meta { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.workspace-metric--accent .workspace-metric__value { color: var(--accent); }

.workspace-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    padding: 0 0 2px;
    scrollbar-width: none;
}
.workspace-tabs::-webkit-scrollbar { display: none; }
.workspace-status-tabs,
.workspace-quick-links { margin: 0 0 14px; }
.workspace-quick-links { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.workspace-quick-links a { color: var(--text-secondary); font-size: 13px; font-weight: 550; text-decoration: none; }
.workspace-quick-links a:hover { color: var(--accent); }
.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 540;
    text-decoration: none;
    white-space: nowrap;
}
.workspace-tab:hover { color: var(--text-primary); background: var(--surface-secondary); }
.workspace-tab.is-active { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-subtle); }
.workspace-tab.is-active::after { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; content: ''; }
.workspace-tab__count { color: var(--text-muted); font-size: 11px; }

/* Status filters reserve identical space for their count and active marker.
   The marker is absolutely positioned so selecting a tab never moves digits. */
.workspace-status-tabs .workspace-tab {
    position: relative;
    padding-right: 28px;
}
.workspace-status-tabs .workspace-tab__count {
    min-width: 2ch;
    margin-left: auto;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.workspace-status-tabs .workspace-tab.is-active::after {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--surface-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
}
.workspace-toolbar form,
.workspace-toolbar__form { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; }
.workspace-search { position: relative; flex: 1 1 420px; min-width: 190px; }
.workspace-search .app-icon { position: absolute; top: 50%; left: 12px; width: 17px; height: 17px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
.workspace-search .form-input { height: var(--workspace-control-height); padding-left: 38px; }
.workspace-toolbar .form-input,
.workspace-toolbar select,
.workspace-toolbar .release-date-filter > div { height: var(--workspace-control-height); }

/* The release list is a compact toolbar.  The upload picker is intentionally
   taller elsewhere, so normalise only this context to the workspace control
   rhythm and anchor its utility controls to the same vertical centre. */
.app-layout .workspace-toolbar .release-datepicker__trigger {
    height: var(--workspace-control-height);
    min-height: var(--workspace-control-height);
    padding: 0 42px 0 14px;
    color: var(--text-secondary);
    border-radius: var(--workspace-radius-sm);
    font-size: 13.5px;
    line-height: 1;
}
.app-layout .workspace-toolbar .release-datepicker--range .release-datepicker__trigger { padding-right: 68px; }
.app-layout .workspace-toolbar .release-datepicker__value { color: inherit; font: inherit; line-height: 1; }
.app-layout .workspace-toolbar .release-datepicker__clear {
    right: 38px;
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
}
.app-layout .workspace-toolbar .release-datepicker__calendar-icon {
    right: 13px;
    width: 17px;
    height: 17px;
    color: var(--text-secondary);
}
.app-layout .workspace-toolbar .form-input::placeholder { color: var(--text-secondary); opacity: 1; }
.app-layout .workspace-toolbar .btn.btn-sm {
    min-height: var(--workspace-control-height);
    height: var(--workspace-control-height);
    padding-inline: 15px;
    color: var(--text-secondary);
    border-radius: var(--workspace-radius-sm);
    font-size: 13.5px;
}

.app-layout :is(.form-input, .form-select, select.form-input) {
    min-height: var(--workspace-control-height);
    color: var(--text-primary);
    background: var(--surface-secondary);
    border-color: var(--border-subtle);
    border-radius: var(--workspace-radius-sm);
    box-shadow: none;
    font-size: 13.5px;
}
.app-layout :is(.form-input, .form-select, select.form-input):hover { border-color: var(--border-strong); }
.app-layout :is(.form-input, .form-select, select.form-input):focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-subtle); }

.workspace-table-wrap { overflow-x: auto; }
.workspace-table { width: 100%; border-collapse: collapse; }
.workspace-table th {
    padding: 11px 16px;
    color: var(--text-muted);
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 11px;
    font-weight: 620;
    letter-spacing: .025em;
    text-align: left;
    white-space: nowrap;
}
.workspace-table td { padding: 12px 16px; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); font-size: 13px; vertical-align: middle; }
.workspace-table tbody tr:last-child td { border-bottom: 0; }
.workspace-table tbody tr:hover { background: var(--surface-secondary); }
.workspace-table .primary-cell { color: var(--text-primary); font-weight: 580; }
.workspace-table .secondary-cell { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }

.workspace-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 8px;
    color: var(--text-secondary);
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 590;
    line-height: 1;
    white-space: nowrap;
}
.workspace-status::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; content: ''; }
.workspace-status:has(.workspace-status__icon)::before { display: none; }
.workspace-status__icon { width: 14px; height: 14px; flex: 0 0 auto; }
.workspace-status--success { color: var(--success); background: var(--success-subtle); border-color: transparent; }
.workspace-status--warning { color: var(--warning); background: var(--warning-subtle); border-color: transparent; }
.workspace-status--info { color: var(--info); background: var(--info-subtle); border-color: transparent; }
.workspace-status--danger { color: var(--danger); background: var(--danger-subtle); border-color: transparent; }
.workspace-status--accent { color: var(--accent); background: var(--accent-subtle); border-color: transparent; }

.workspace-empty { padding: 42px 20px; color: var(--text-secondary); font-size: 14px; text-align: center; }
.workspace-empty .app-icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--text-muted); }
.release-create-action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; }
.release-create-action > .release-create-action__icon { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; color: currentColor; }
.workspace-empty .release-create-action { min-height: 44px; padding-inline: 16px; }

.workspace-status-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.workspace-status-summary__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 76px;
    padding: 13px 14px;
    color: var(--text-secondary);
    background: var(--surface-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.workspace-status-summary__item:hover { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-strong); }
.workspace-status-summary__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.workspace-status-summary__icon { width: 19px; height: 19px; flex: 0 0 auto; color: var(--text-muted); }
.workspace-status-summary__content { display: grid; min-width: 0; gap: 4px; }
.workspace-status-summary__content > span { overflow: hidden; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.workspace-status-summary__content > strong { color: var(--text-primary); font-size: 23px; font-weight: 670; letter-spacing: -.03em; line-height: 1; }
.workspace-status-summary__chevron { width: 14px; height: 14px; margin-left: auto; color: var(--text-muted); }
.workspace-status-summary__item--green .workspace-status-summary__icon { color: var(--success); }
.workspace-status-summary__item--orange .workspace-status-summary__icon { color: var(--warning); }
.workspace-status-summary__item--red .workspace-status-summary__icon { color: var(--danger); }
.workspace-status-summary__item--yellow .workspace-status-summary__icon { color: var(--accent); }
.workspace-status-summary__item--blue .workspace-status-summary__icon { color: var(--info); }

/* Releases: desktop table with a compact mobile data row. */
.release-data-list { overflow: visible; background: var(--surface-primary); border: 1px solid var(--border-subtle); border-radius: var(--workspace-radius); }
.release-data-header,
.release-data-row {
    display: grid;
    grid-template-columns: 60px minmax(160px, 2fr) minmax(142px, .95fr) minmax(128px, .85fr) minmax(160px, 1.15fr) minmax(92px, .8fr) minmax(88px, .8fr) 76px;
    gap: 28px;
    align-items: center;
}
.release-data-header { padding: 10px 16px; color: var(--text-muted); background: var(--surface-secondary); border-bottom: 1px solid var(--border-subtle); border-radius: var(--workspace-radius) var(--workspace-radius) 0 0; font-size: 11px; font-weight: 620; letter-spacing: .025em; }
.release-data-row { position: relative; min-height: var(--workspace-row-height); padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); transition: background var(--motion-fast) ease; }
.release-data-row:last-child { border-bottom: 0; border-radius: 0 0 var(--workspace-radius) var(--workspace-radius); }
.release-data-row:hover { z-index: 2; background: var(--surface-secondary); }
.release-data-row:focus-within { z-index: 2; }
.release-data-row--interactive { cursor: pointer; }
.release-data-row--interactive:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.release-data-cover { display: block; width: 52px; height: 52px; overflow: hidden; background: var(--surface-secondary); border-radius: 8px; object-fit: cover; }
.release-data-cover--empty { display: grid; place-items: center; color: var(--text-muted); }
.release-data-cover--empty .app-icon { width: 20px; height: 20px; }
.release-data-title { overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.release-data-artist,
.release-data-meta { display: block; overflow: hidden; margin-top: 3px; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.release-signature-warning {
    display: flex;
    grid-column: 2 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    justify-self: start;
    padding: 6px 8px 6px 11px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: var(--workspace-radius-sm);
}
.release-signature-warning__text {
    min-width: 0;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    white-space: nowrap;
}
.release-signature-warning__action {
    flex: 0 0 auto;
    justify-self: start;
    min-height: 30px;
    padding-inline: 13px;
    font-size: 12px;
    text-decoration: none;
}
.release-data-mobile-facts { display: none; }
.release-data-value { color: var(--text-secondary); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.release-data-value--money { color: var(--text-primary); font-weight: 580; }
.release-data-status { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.release-data-status .workspace-status { max-width: 100%; }
.release-moderation-tooltip {
    position: absolute;
    z-index: 12;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    width: min(340px, calc(100vw - 48px));
    gap: 4px;
    padding: 10px 12px;
    color: var(--text-secondary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--workspace-radius-sm);
    box-shadow: var(--shadow-floating);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease, visibility var(--motion-fast) ease;
    visibility: hidden;
}
.release-moderation-tooltip strong { color: var(--text-primary); font-size: 11px; font-weight: 620; }
.release-data-status:hover .release-moderation-tooltip,
.release-data-status:focus-within .release-moderation-tooltip { opacity: 1; transform: translateY(0); visibility: visible; }
.release-moderation-mobile { display: none; }
.release-row-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.release-row-action { display: inline-grid; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; place-items: center; }
.release-row-action .app-icon { width: 15px; height: 15px; margin: 0; vertical-align: 0; }
.release-pagination .btn-icon { width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; }
.release-pagination .btn-icon .app-icon { width: 18px; height: 18px; color: var(--text-secondary); margin: 0; vertical-align: 0; }
.release-data-actions { position: relative; display: grid; place-items: center; }
.release-data-actions > summary { display: grid; width: 30px; height: 30px; place-items: center; color: var(--text-secondary); border-radius: 7px; cursor: pointer; list-style: none; }
.release-data-actions > summary::-webkit-details-marker { display: none; }
.release-data-actions > summary:hover { color: var(--text-primary); background: var(--surface-elevated); }
.release-data-actions > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.release-data-actions > summary::after { content: '⋯'; font-size: 20px; line-height: 1; }
.release-data-actions > summary .app-icon { display: none; }
.release-data-actions-menu { position: absolute; top: 32px; right: 0; z-index: 4; display: grid; min-width: 144px; padding: 5px; background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: var(--shadow-floating); }
.release-data-actions-menu a { padding: 8px 9px; color: var(--text-secondary); border-radius: 6px; font-size: 12px; text-decoration: none; white-space: nowrap; }
.release-data-actions-menu a:hover { color: var(--text-primary); background: var(--surface-secondary); }

.workspace-list { display: grid; }
.workspace-list-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); }
.workspace-list-row:is(a) { color: inherit; text-decoration: none; }
.workspace-list-row:last-child { border-bottom: 0; }
.workspace-list-row:hover { background: var(--surface-secondary); }
.workspace-list-index,
.workspace-list-row__rank { width: 20px; color: var(--text-muted); font-size: 12px; text-align: right; }
.workspace-list-row > div:first-of-type,
.workspace-list-row__main { flex: 1 1 auto; min-width: 0; }
.workspace-list-row > div:first-of-type > strong,
.workspace-list-row__title { display: block; overflow: hidden; color: var(--text-primary); font-size: 13.5px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.workspace-list-row > div:first-of-type > small,
.workspace-list-row__meta { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.workspace-list-row time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.workspace-list-value,
.workspace-list-row__value { color: var(--text-primary); font-size: 13px; font-weight: 580; text-align: right; white-space: nowrap; }
.workspace-list-value > strong { display: block; }
.workspace-list-value > small,
.workspace-list-row__secondary { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; font-weight: 450; }

.workspace-progress { height: 4px; overflow: hidden; background: var(--surface-elevated); border-radius: 999px; }
.workspace-progress > :is(span, i) { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.workspace-chart { position: relative; height: 310px; padding: 12px 16px 16px; }
.workspace-chart canvas { width: 100% !important; height: 100% !important; }

.workspace-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; color: var(--text-secondary); background: var(--surface-secondary); border-left: 2px solid var(--accent); border-radius: 0 var(--workspace-radius-sm) var(--workspace-radius-sm) 0; font-size: 13px; line-height: 1.4; }

/* Status notice on the personal analytics page. It intentionally informs
   without competing with the metrics or looking like an error state. */
.analytics-development-notice { display:flex; align-items:flex-start; gap:12px; margin:-6px 0 20px; padding:14px 16px; color:var(--text-secondary); background:linear-gradient(110deg,rgba(209,0,96,.11),rgba(209,0,96,.035)); border:1px solid rgba(209,0,96,.24); border-radius:var(--workspace-radius-sm); box-shadow:0 8px 22px rgba(0,0,0,.08); }
.analytics-development-notice__icon { display:grid; flex:0 0 auto; width:34px; height:34px; place-items:center; color:#f3acd0; background:rgba(209,0,96,.16); border:1px solid rgba(209,0,96,.3); border-radius:10px; }
.analytics-development-notice__title { margin:0; color:var(--text-primary); font-size:14px; font-weight:650; line-height:1.35; }
.analytics-development-notice p { margin:3px 0 0; font-size:13px; line-height:1.45; }
html.theme-light .analytics-development-notice { background:linear-gradient(110deg,rgba(190,24,93,.08),rgba(190,24,93,.025)); border-color:rgba(190,24,93,.22); box-shadow:0 8px 22px rgba(24,24,27,.06); }
html.theme-light .analytics-development-notice__icon { color:#be185d; background:rgba(190,24,93,.1); border-color:rgba(190,24,93,.22); }

.finance-overview { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.finance-overview > div { padding: 20px; }
.finance-overview > div + div { border-left: 1px solid var(--border-subtle); }
.finance-overview__label { color: var(--text-secondary); font-size: 12px; }
.finance-overview__value { margin-top: 6px; color: var(--text-primary); font-size: clamp(29px, 3vw, 40px); font-weight: 690; letter-spacing: -.04em; line-height: 1.05; }
.finance-overview__help { margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.finance-overview__action { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }

.workspace-panel-list { padding: 0; }
.workspace-panel-list > * { border-bottom: 1px solid var(--border-subtle); }
.workspace-panel-list > *:last-child { border-bottom: 0; }

.app-layout .card,
.app-layout .table-container,
.app-layout .filter-bar {
    border-radius: var(--workspace-radius);
    box-shadow: none;
}
.app-layout .card { padding: 20px; }
.app-layout .track-card { padding: 16px; }
.app-layout .card:hover,
.app-layout .stat-card:hover { box-shadow: none; transform: none; }
.app-layout .stat-card {
    min-height: 0;
    padding: 18px;
    background: var(--surface-primary);
    border-color: var(--border-subtle);
}
/* A KPI is read through its value. Legacy dashboard templates no longer get
   a decorative icon tile until they are migrated to .workspace-metrics. */
.app-layout .stat-card .stat-icon { display: none !important; }
.app-layout .dashboard-subscription-card { border-radius: var(--workspace-radius) !important; box-shadow: none !important; }
.app-layout .echo-icon-badge,
.app-layout .icon-tile {
    width: auto !important;
    height: auto !important;
    min-width: 0;
    padding: 0 !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* The staff area uses the same shell and data primitives as the artist area.
   These adapters intentionally normalise legacy templates at their shared
   boundaries instead of adding a separate visual language for each role. */
.app-layout .admin-workspace-page { min-width: 0; }
.app-layout .admin-workspace-page .workspace-toolbar { margin-bottom: 18px; }
.app-layout .workspace-table-surface { overflow: hidden; }
.app-layout .workspace-table-surface > .overflow-x-auto { overflow-x: auto; }
.app-layout .admin-release-table { min-width: 920px; }
.app-layout .admin-release-table .badge { box-shadow: none; font-size: 11px; }
.workspace-icon-action {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: color var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.workspace-icon-action:hover { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-subtle); }
.workspace-icon-action--accent { color: var(--accent); }
.workspace-icon-action--danger { color: var(--danger); }
.workspace-icon-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-layout .page-header:not(.workspace-header) {
    display: block;
    margin: 0 0 22px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.app-layout .page-header > :is(.flex.items-center.justify-between, .flex.items-start.justify-between) {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
}
.app-layout .page-header--with-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.app-layout .page-header > :is(.flex.items-center.justify-between, .flex.items-start.justify-between) > .btn:not(.btn-sm),
.app-layout .page-header > :is(.flex.items-center.justify-between, .flex.items-start.justify-between) > :last-child > .btn:not(.btn-sm),
.app-layout .page-header--with-action > .btn:not(.btn-sm) {
    min-height: 40px;
    padding-inline: 14px;
    border-radius: var(--workspace-radius-sm);
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
}
.app-layout .page-header :is(.btn, .btn-sm) :is(svg, .app-icon) { width: 16px; height: 16px; }
.app-layout .page-header .page-title { color: var(--text-primary); font-size: clamp(26px, 2vw, 31px); font-weight: 680; letter-spacing: -.025em; line-height: 1.12; }
.app-layout .page-header .text-zinc-400 { color: var(--text-secondary) !important; font-size: 14px; }
.app-layout .upload-page-heading { align-items: flex-start; gap: 12px; }
.app-layout .upload-page-heading__icon {
    display: grid;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 4px;
    place-items: center;
    color: var(--accent);
}
.app-layout .upload-page-heading__icon :is(svg, .app-icon) { width: 22px; height: 22px; }
.app-layout .filter-bar.release-filter-surface { padding: 14px; background: var(--surface-primary); border: 1px solid var(--border-subtle); border-radius: var(--workspace-radius); box-shadow: none; }
.app-layout .filter-bar.release-filter-surface .release-filter-controls { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; }
.app-layout .filter-bar.release-filter-surface .release-filter-controls > .relative { flex: 1 1 260px; }
.app-layout .table-container { overflow: hidden; background: var(--surface-primary); border: 1px solid var(--border-subtle); }
.app-layout .table-container > .table { width: 100%; }
.app-layout .tickets-table { min-width: 860px; table-layout: auto; }
.app-layout .tickets-table :is(th, td):nth-child(4) { min-width: 118px; white-space: nowrap; }
.app-layout .tickets-table .ticket-status-badge { display: inline-flex; align-items: center; width: max-content; min-height: 28px; padding: 5px 9px; white-space: nowrap; line-height: 1; }

/* Notifications use the same compact list density as releases and documents. */
.app-layout .notifications-workspace {
    width: min(100%, 1040px);
    margin-inline: auto;
}
.app-layout .notifications-workspace__header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.app-layout .notifications-workspace__heading { min-width: 0; }
.app-layout .notifications-workspace__header .workspace-header__description { margin: 5px 0 0; }
.app-layout .notifications-workspace__mark-all-form { flex: 0 0 auto; }
.app-layout .notifications-workspace__mark-all { gap: 7px; white-space: nowrap; }
.app-layout .notifications-workspace__mark-all > .app-icon { width: 16px; height: 16px; }
.app-layout .notifications-workspace__list {
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
    background: var(--surface-primary);
}
.app-layout .notifications-workspace__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 84px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-primary);
    transition: background-color 180ms ease;
}
.app-layout .notifications-workspace__item:last-child { border-bottom: 0; }
.app-layout .notifications-workspace__item:hover { background: var(--surface-secondary); }
.app-layout .notifications-workspace__item.is-unread { background: color-mix(in srgb, var(--accent) 2.5%, var(--surface-primary)); }
.app-layout .notifications-workspace__item-main { display: flex; min-width: 0; gap: 14px; }
.app-layout .notifications-workspace__icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    color: var(--accent);
}
.app-layout .notifications-workspace__icon .app-icon { width: 19px; height: 19px; stroke-width: 2; }
.app-layout .notifications-workspace__content { min-width: 0; }
.app-layout .notifications-workspace__title {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
}
.app-layout .notifications-workspace__body {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.app-layout .notifications-workspace__time { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.3; }
.app-layout .notifications-workspace__item.is-read .notifications-workspace__title { color: var(--text-secondary); }
.app-layout .notifications-workspace__unread {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--accent);
}
@media (max-width: 480px) {
    .app-layout .notifications-workspace__mark-all { width: 36px; min-width: 36px; padding-inline: 0; justify-content: center; }
    .app-layout .notifications-workspace__mark-all-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .app-layout .notifications-workspace__item { min-height: 0; padding: 15px 16px; }
}

/* Review keeps its desktop summary + working column, but shares density,
   surfaces and control sizing with every other account workspace. */
.app-layout .moderation-workspace__panel { box-shadow: none !important; }
.app-layout .moderation-workspace__summary .moderation-workspace__panel { padding: 18px !important; }
.app-layout .moderation-workspace__content .moderation-workspace__panel { padding: 20px !important; }
.app-layout .moderation-workspace__summary .w-48.h-48 { width: 168px; height: 168px; border-radius: var(--workspace-radius); }
.app-layout .moderation-workspace__track-row { border-color: var(--border-subtle) !important; background: transparent !important; border-radius: var(--workspace-radius-sm) !important; }
.app-layout .moderation-workspace__track-row:hover { background: var(--surface-secondary) !important; }
.app-layout .moderation-workspace__codes .btn { width: auto; }

@media (max-width: 1180px) {
    .workspace-metrics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .workspace-status-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workspace-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .release-data-header,
    .release-data-row { grid-template-columns: 56px minmax(180px, 2fr) minmax(128px, .95fr) minmax(120px, .85fr) minmax(162px, 1.1fr) 76px; gap: 18px; }
    .release-data-header > :nth-child(6),
    .release-data-header > :nth-child(7),
    .release-data-streams,
    .release-data-money { display: none; }
}

@media (max-width: 1024px) {
    .app-layout .sidebar { width: min(280px, 82vw); }
    .app-layout .main-content { margin-left: 0; }
    .app-layout .sidebar-logo { min-height: 64px; padding-right: 64px; }
    .app-layout .sidebar-logo img { width: 100%; height: auto; max-height: 27px; object-fit: contain; object-position: left center; }
    .workspace-grid--main { grid-template-columns: 1fr; }
    .topbar-user-name { display: none; }
    .topbar-page-title { display: block; overflow: hidden; color: var(--text-primary); font-size: 16px; font-weight: 620; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
}

/* A six-column release row needs more than a tablet content area provides.
   Use the same compact, tappable summary before its columns could be clipped. */
@media (min-width: 761px) and (max-width: 900px) {
    .release-data-header { display: none; }
    .release-data-row {
        grid-template-columns: 50px minmax(0, 1fr) max-content 40px;
        min-height: 70px;
        gap: 10px;
        padding: 10px 12px;
    }
    .release-data-upc,
    .release-data-date,
    .release-data-streams,
    .release-data-money { display: none !important; }
    .release-data-cover { width: 48px; height: 48px; }
    .release-data-status,
    .release-data-action-cell { align-self: center; }
    .release-data-title { font-size: 13px; }
    .release-data-artist::after { content: ''; }
}

@media (max-width: 760px) {
    .app-layout { --account-page-padding: 16px; --account-topbar-height: 60px; }
    .app-layout .topbar { padding-inline: 14px; }
    .topbar-page-title { font-size: 15px; }
    .topbar-actions { gap: 5px; }
    .topbar-new-release { padding-inline: 10px !important; font-size: 12px !important; }
    .topbar-new-release > span:first-child { font-size: 16px; }
    .topbar-user-trigger { padding: 3px; }
    .topbar-user-trigger > .app-icon { display: none; }
    .app-layout .topbar .btn-icon { width: 38px; }
    .workspace-header { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
    .workspace-header__title { font-size: 26px; }
    .app-layout .card { padding: 16px; }
    .workspace-grid--two,
    .workspace-grid--three { grid-template-columns: 1fr; }
    .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace-status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .workspace-status-summary__item { min-height: 70px; padding: 12px; }
    .workspace-metric:nth-child(odd) { border-left: 0; }
    .workspace-metric:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
    .workspace-metric + .workspace-metric { border-left: 1px solid var(--border-subtle); }
    /* A final unpaired KPI is a full row, so the outer card border stays intact. */
    .workspace-metrics > .workspace-metric:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        border-left: 0;
    }
    .workspace-toolbar, .workspace-toolbar form, .workspace-toolbar__form { align-items: stretch; flex-wrap: wrap; }
    .workspace-search { flex-basis: 100%; }
    .workspace-toolbar .release-date-filter { flex: 1 1 170px; }
    .workspace-toolbar .btn { flex: 0 0 auto; }
    .workspace-quick-links { gap: 6px 13px; }
    /* Статусы релизов не должны уходить за правый край на телефоне.
       Это не обычные короткие tabs: названия длинные, поэтому используем
       устойчивую сетку, а не скрытую горизонтальную прокрутку. */
    .workspace-status-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 12px;
        overflow: visible;
    }
    .workspace-status-tabs .workspace-tab {
        justify-content: space-between;
        min-height: 42px;
        padding: 8px 10px;
        padding-right: 28px;
        line-height: 1.25;
        white-space: normal;
        background: var(--surface-secondary);
        border-color: var(--border-subtle);
    }
    .workspace-status-tabs .workspace-tab.is-active {
        color: var(--text-primary);
        background: var(--accent-subtle);
        border-color: var(--accent-border);
    }
    .release-data-header { display: none; }
    .release-data-row {
        grid-template-columns: 50px minmax(0, 1fr) max-content 40px;
        min-height: 70px;
        gap: 10px;
        padding: 10px 12px;
    }
    .release-data-upc,
    .release-data-date,
    .release-data-streams,
    .release-data-money { display: none !important; }
    .release-data-cover { width: 48px; height: 48px; }
    .release-data-status,
    .release-data-action-cell { align-self: center; }
    .release-data-title { font-size: 13px; }
    .release-data-artist::after { content: ''; }
    .workspace-chart { height: 250px; padding: 10px 10px 14px; }
    .finance-overview { grid-template-columns: 1fr; }
    .finance-overview > div + div { border-top: 1px solid var(--border-subtle); border-left: 0; }
    .workspace-table-wrap { margin-inline: -1px; }
    .workspace-table th, .workspace-table td { padding-inline: 12px; }
    .workspace-documents-table :is(th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3)) { display: none; }
    .app-layout .filter-bar.release-filter-surface .release-filter-controls { align-items: stretch; flex-wrap: wrap; }
    .app-layout .filter-bar.release-filter-surface .release-filter-controls > .relative { flex-basis: 100%; }
}

@media (max-width: 420px) {
    .topbar-new-release { width: 38px; padding: 0 !important; font-size: 0 !important; }
    .topbar-new-release > span:first-child { font-size: 19px; }
    .workspace-metric { padding: 16px; }
    .workspace-metric__value { font-size: 26px; }
    .workspace-status-summary { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .workspace-status-tabs { grid-template-columns: 1fr; }
}

/* На планшете шесть статусных вкладок также не должны превращаться
   в скрытую горизонтальную ленту. Три компактные колонки сохраняют
   все фильтры доступными без потери рабочего пространства. */
@media (min-width: 761px) and (max-width: 1180px) {
    .workspace-status-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 14px;
        overflow: visible;
    }
    .workspace-status-tabs .workspace-tab {
        justify-content: space-between;
        min-height: 42px;
        padding: 8px 10px;
        padding-right: 28px;
        line-height: 1.25;
        white-space: normal;
        background: var(--surface-secondary);
        border-color: var(--border-subtle);
    }
    .workspace-status-tabs .workspace-tab.is-active {
        color: var(--text-primary);
        background: var(--accent-subtle);
        border-color: var(--accent-border);
    }
}

/* Compact release rows remain actionable without relying on hover: the row
   itself opens the release, while editing and moderation feedback stay visible. */
@media (max-width: 900px) {
    .release-data-row {
        grid-template-columns: 50px minmax(0, 1fr) auto;
        align-items: start;
    }
    .release-data-cover-cell { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
    .release-data-main { grid-column: 2; grid-row: 1; min-width: 0; }
    .release-data-status { grid-column: 2; grid-row: 2; align-self: start; min-width: 0; }
    .release-data-action-cell { display: flex !important; grid-column: 3; grid-row: 1 / span 2; align-self: center; }
    .release-data-row--signature-needed .release-signature-warning {
        grid-column: 2 / -1;
        grid-row: 3;
        gap: 10px;
        margin-top: 2px;
    }
    .release-data-row--signature-needed .release-moderation-mobile { grid-row: 4; }
    .release-data-mobile-facts {
        display: flex;
        flex-wrap: wrap;
        gap: 3px 8px;
        margin-top: 5px;
        color: var(--text-muted);
        font-size: 11px;
        font-variant-numeric: tabular-nums;
        line-height: 1.35;
    }
    .release-data-mobile-facts > span { white-space: nowrap; }
    .release-row-actions .release-row-action:first-child { display: none; }
    .release-moderation-tooltip { display: none; }
    .release-moderation-mobile {
        display: grid;
        grid-column: 2 / -1;
        grid-row: 3;
        gap: 3px;
        margin: 2px 0 0;
        padding: 8px 10px;
        color: var(--text-secondary);
        background: var(--surface-secondary);
        border-left: 2px solid var(--accent);
        border-radius: 0 var(--workspace-radius-sm) var(--workspace-radius-sm) 0;
        font-size: 12px;
        line-height: 1.42;
    }
    .release-moderation-mobile strong { color: var(--text-primary); font-size: 11px; font-weight: 620; }
}

@media (max-width: 560px) {
    .release-signature-warning__text { white-space: normal; }
}

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

/* Staff uses the user-facing catalogue table and keeps its extra ownership
   columns. A narrow screen gets the same data as a compact card instead of
   silently dropping facts. */
.admin-release-data-scroll { overflow-x: auto; overflow-y: hidden; border-radius: var(--workspace-radius); }
.admin-release-data-list { min-width: 1240px; }
.admin-release-data-list .release-data-header,
.admin-release-data-list .admin-release-data-row {
    grid-template-columns: 56px minmax(150px, 1.35fr) minmax(150px, 1.2fr) minmax(132px, .96fr) minmax(116px, .9fr) minmax(184px, 1.3fr) minmax(128px, .95fr) 150px;
    gap: 20px;
}
.admin-release-data-list .release-data-header { padding-inline: 16px; }
.admin-release-data-list .admin-release-data-row { min-height: 76px; padding-inline: 16px; }
.admin-release-data-list .release-data-header > :nth-child(6),
.admin-release-data-list .release-data-header > :nth-child(7) { display: block; }
.admin-release-data-list .release-data-cover { width: 52px; height: 52px; }
.admin-release-data-list .release-data-title { display: block; max-width: 100%; }
.admin-release-data-list .admin-release-data-facts { display: contents; }
.admin-release-data-list .admin-release-data-user,
.admin-release-data-list .admin-release-data-moderator { min-width: 0; }
.admin-release-data-list .release-data-status { display: grid; align-content: center; gap: 5px; }
.admin-release-data-list .release-data-status .workspace-status {
    justify-self: start;
    min-height: 26px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 620;
}

.admin-release-data-list .admin-release-data-user-link {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.admin-release-data-list .admin-release-data-user-link:hover .release-data-title { color: var(--accent); }
.admin-release-data-list .admin-release-data-user-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.admin-release-data-list .release-row-actions { gap: 5px; }
.admin-release-data-list .release-row-action--danger { color: var(--danger); }
.admin-release-data-list .release-row-action--danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-subtle); }
.admin-release-data-list .workspace-status[data-moderation-comment] { cursor: help; }
.release-moderation-popover {
    position: fixed;
    z-index: 1000;
    box-sizing: border-box;
    display: grid;
    width: min(340px, calc(100vw - 28px));
    gap: 5px;
    padding: 12px 14px;
    color: var(--text-secondary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-left: 2px solid var(--accent);
    border-radius: var(--workspace-radius-sm);
    box-shadow: 0 18px 42px rgb(0 0 0 / 32%);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    visibility: hidden;
}
.release-moderation-popover.is-visible { opacity: 1; transform: translateY(0); visibility: visible; }
.release-moderation-popover__title { color: var(--text-primary); font-size: 12px; font-weight: 640; }
.release-moderation-popover__message { overflow-wrap: anywhere; }

/* The administrative catalogue has eight desktop columns.  Its containing
   workspace is narrower than the viewport because of the sidebar, so render
   the proven compact card layout before columns and action buttons collide. */
@media (max-width: 1500px) {
    .release-moderation-popover { display: none !important; }
    .admin-release-data-scroll { overflow: visible; }
    .admin-release-data-list { min-width: 0; }
    .admin-release-data-list .release-data-header { display: none; }
    .admin-release-data-list .admin-release-data-row {
        grid-template-columns: 50px minmax(0, 1fr) auto;
        gap: 6px 10px;
        min-height: 0;
        padding: 12px 12px 56px;
    }
    .admin-release-data-list .release-data-cover-cell { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
    .admin-release-data-list .release-data-main { grid-column: 2; grid-row: 1; min-width: 0; }
    .admin-release-data-list .release-data-status { grid-column: 3; grid-row: 1; align-self: start; justify-self: end; }
    .admin-release-data-list .release-data-action-cell {
        position: absolute;
        right: 12px;
        bottom: 12px;
        display: flex !important;
        grid-column: auto;
        grid-row: auto;
        width: auto;
        padding: 0;
        border: 0;
    }
    .admin-release-data-list .release-row-actions { justify-content: flex-end; }
    .admin-release-data-list .release-row-actions .release-row-action:first-child { display: inline-grid; }
    .admin-release-data-list .admin-release-data-user { grid-column: 2 / -1; grid-row: 2; display: grid; gap: 2px; min-width: 0; }
    .admin-release-data-list .admin-release-data-facts {
        display: flex;
        grid-column: 2 / -1;
        grid-row: 3;
        flex-wrap: wrap;
        gap: 4px 9px;
        color: var(--text-muted);
        font-size: 11px;
        font-variant-numeric: tabular-nums;
    }
    .admin-release-data-list :is(.release-data-upc, .release-data-date) { display: inline-flex !important; align-items: center; }
    .admin-release-data-list .admin-release-data-facts > span + span::before { margin-right: 9px; color: var(--border-strong); content: '·'; }
    .admin-release-data-list .admin-release-data-moderator { display: grid; grid-column: 2 / -1; grid-row: 4; gap: 2px; padding-top: 4px; border-top: 1px solid var(--border-subtle); }
    .admin-release-data-list .release-moderation-mobile { display: grid; grid-column: 2 / -1; grid-row: 5; min-width: 0; margin: 2px 0 0; }
}

/* Legal-document editor: use the same quiet cards, metadata and status chips
   as the rest of the administrative workspace. */
.legal-editor-card {
    padding: clamp(18px, 2.2vw, 26px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--workspace-radius);
    background: var(--surface-primary);
}
.legal-editor-card__header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.legal-editor-card__identity { display: flex; min-width: 0; align-items: center; gap: 12px; }
.legal-editor-card__icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--accent);
    border-radius: 12px;
    background: var(--accent-subtle);
}
.legal-editor-card__icon .app-icon { width: 20px; height: 20px; }
.legal-editor-card__title { margin: 0; color: var(--text-primary); font-size: 18px; font-weight: 650; line-height: 1.25; }
.legal-editor-card__meta { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.legal-editor-card__badge {
    display: inline-flex;
    min-height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-subtle);
    font-size: 12px;
    font-weight: 620;
    line-height: 1.2;
    white-space: nowrap;
}
.legal-editor-card__badge--policy { color: #a98cff; border-color: color-mix(in srgb, #a98cff 42%, var(--border-subtle)); background: color-mix(in srgb, #a98cff 12%, transparent); }
.legal-editor-card__textarea { display: block; width: 100%; min-height: 300px; resize: vertical; }
.legal-editor-card__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.legal-editor-card__footer .app-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.legal-editor-card__footer a { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-decoration: none; }
.legal-editor-card__footer a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 640px) {
    .legal-editor-card__header { align-items: flex-start; }
    .legal-editor-card__title { font-size: 16px; }
    .legal-editor-card__badge { min-height: 26px; padding-inline: 8px; font-size: 11px; }
    .legal-editor-card__textarea { min-height: 240px; }
}
