/* ============================================================================
   Settings Module
   ============================================================================ */

.st-page {
    padding: 0;
    min-height: calc(100vh - var(--app-header-height));
}

.st-toolbar {
    justify-content: space-between;
    margin-bottom: 0;
}

.st-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.st-body {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    margin: 24px 24px 24px;
}

/* The Settings sub-nav is a Section Rail (.nv-rail nv-rail--plain); only
   its width comes from the module. */
#st-nav .nv-rail-item {
    width: 100%;
}

.st-main {
    min-width: 0;
}

.st-section {
    min-width: 0;
}

.st-panel {
    background: var(--surface-chrome);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    min-width: 0;
}

.st-profile-panel,
.st-preferences-panel {
    max-width: 880px;
}

.st-audit-panel {
    max-width: 1100px;
}

.st-panel-head {
    margin-bottom: 16px;
}

.st-panel-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.st-user-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ua-status-filter {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    background: var(--surface-recess);
}

.ua-status-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.ua-status-filter-btn:hover {
    color: var(--text-primary);
}

.ua-status-filter-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.ua-filter-count {
    color: var(--text-tertiary);
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
}

.ua-status-filter-btn.active .ua-filter-count {
    color: var(--accent);
}

.st-panel h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1;
    text-transform: uppercase;
}

.st-editor-head h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.st-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

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

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

.st-field span,
.st-kicker,
.st-editor-section-title {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.st-input,
.st-select,
.st-search {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-field);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.st-select {
    cursor: pointer;
}

.st-input:focus,
.st-select:focus,
.st-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.st-input:disabled {
    color: var(--text-secondary);
    opacity: 0.7;
    cursor: not-allowed;
}

.st-search {
    max-width: 220px;
}

.st-profile-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.st-preference-block {
    padding-top: 16px;
    margin-top: 18px;
    border-top: 1px solid var(--ink-line);
}

.st-sidebar-pref-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-sidebar-pref-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-field);
    cursor: grab;
    transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.st-sidebar-pref-row:hover {
    border-color: var(--accent);
}

.st-sidebar-pref-row.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.st-sidebar-drag-handle {
    width: 14px;
    height: 24px;
    border-radius: var(--radius-sm);
    background-image: radial-gradient(circle, var(--text-tertiary) 1.4px, transparent 1.6px);
    background-size: 6px 6px;
    background-position: 1px 1px;
    opacity: 0.7;
    pointer-events: none;
}

.st-sidebar-visible {
    margin: 0;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
}

.st-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.st-pill,
.st-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.st-pill {
    background: var(--surface-field);
    color: var(--text-secondary);
    border: 1px solid var(--ink-line-strong);
}

.st-read-chip.on {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
}

.st-status.active {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.st-status.inactive {
    background: color-mix(in srgb, var(--status-injured) 14%, transparent);
    color: var(--status-injured);
}

.st-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.st-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.st-users-panel,
.st-editor-panel {
    min-width: 0;
}

.st-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 210px);
    border-radius: var(--radius-sm);
}

.st-users-panel .st-table-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--ink-line);
    background: var(--surface-recess);
}

.st-user-table td,
.st-audit-table td {
    color: var(--text-primary);
}

.st-audit-wrap {
    border: 1px solid var(--ink-line);
    background: var(--surface-recess);
}

.st-audit-table {
    table-layout: fixed;
    min-width: 860px;
}

.st-audit-table th:nth-child(1),
.st-audit-table td:nth-child(1) {
    width: 13%;
}

.st-audit-table th:nth-child(2),
.st-audit-table td:nth-child(2) {
    width: 22%;
}

.st-audit-table th:nth-child(3),
.st-audit-table td:nth-child(3) {
    width: 25%;
}

.st-audit-table th:nth-child(4),
.st-audit-table td:nth-child(4) {
    width: 17%;
}

.st-audit-table th:nth-child(5),
.st-audit-table td:nth-child(5) {
    width: 23%;
}

.st-audit-table td {
    color: var(--text-secondary);
    white-space: normal;
}

.st-audit-time {
    color: var(--text-tertiary) !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.st-audit-target,
.st-audit-actor {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-audit-target {
    color: var(--text-primary);
}

.st-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.st-action-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: var(--radius-pill);
    background: var(--text-tertiary);
}

.st-action-create .st-action-dot {
    background: var(--success);
}

.st-action-perm .st-action-dot {
    background: var(--accent-teal);
}

.st-action-profile .st-action-dot {
    background: var(--accent);
}

.st-action-pref .st-action-dot,
.st-action-life .st-action-dot {
    background: var(--status-modified);
}

.st-change-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.st-change-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.st-change-more {
    background: var(--accent-soft);
    color: var(--accent);
}

.st-user-table {
    table-layout: fixed;
}

.st-user-table th:nth-child(1),
.st-user-table td:nth-child(1) {
    width: 34%;
}

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

.st-user-table th:nth-child(3),
.st-user-table td:nth-child(3) {
    width: 17%;
}

.st-user-table th:nth-child(4),
.st-user-table td:nth-child(4) {
    width: 22%;
}

.st-user-table th:nth-child(5),
.st-user-table td:nth-child(5) {
    width: 14%;
}

.ua-table thead th {
    padding: 10px 12px;
}

.ua-table td {
    padding: 9px 12px;
}

.st-user-row {
    cursor: pointer;
}

.st-user-row.selected {
    outline: none;
}

.ua-table tbody tr.selected td {
    background: var(--accent-soft);
}

.ua-table tbody tr.selected td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.st-user-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.st-user-cell div {
    min-width: 0;
}

.st-user-cell strong,
.st-user-cell div > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-user-cell strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.st-user-cell div > span {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.st-user-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.4px;
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
}

.st-user-chip.small {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 0.62rem;
}

.ua-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ua-role-viewer {
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    color: var(--text-secondary);
}

.ua-role-editor {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent);
}

.ua-role-admin {
    background: color-mix(in srgb, var(--accent-teal) 13%, transparent);
    border-color: color-mix(in srgb, var(--accent-teal) 24%, transparent);
    color: var(--accent-teal);
}

.ua-ws-pips {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.ua-pip,
.ua-plus-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    border-radius: var(--radius-pill);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.ua-pip {
    min-width: 28px;
    padding: 3px 7px;
    background: var(--accent-soft);
    color: var(--accent);
}

.ua-pip-admin {
    background: color-mix(in srgb, var(--accent-teal) 13%, transparent);
    color: var(--accent-teal);
}

.ua-pip-muted {
    min-width: 0;
    border: 1px dashed var(--ink-line);
    background: transparent;
    color: var(--text-tertiary);
}

.ua-teams-td {
    white-space: normal;
}

.ua-teams-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: normal;
}

.ua-teams-muted {
    color: var(--text-tertiary);
}

.ua-team-label {
    word-break: normal;
    overflow-wrap: normal;
}

.ua-plus-chip {
    padding: 3px 7px;
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    color: var(--text-secondary);
    font-weight: 700;
}

.ua-status-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.ua-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 22px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ua-status-active {
    color: var(--text-secondary);
}

.ua-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: var(--radius-pill);
    background: var(--success);
}

.ua-status-exception {
    padding: 3px 10px;
}

.ua-status-invited {
    background: color-mix(in srgb, var(--status-modified) 13%, transparent);
    color: var(--status-modified);
}

.ua-status-suspended {
    background: color-mix(in srgb, var(--status-injured) 13%, transparent);
    color: var(--status-injured);
}

.ua-drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: color-mix(in srgb, var(--surface-field) 74%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.ua-drawer-scrim.show {
    opacity: 1;
    pointer-events: auto;
}

.ua-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 910;
    display: flex;
    flex-direction: column;
    width: 480px;
    max-width: 92vw;
    background: var(--surface-chrome);
    border-left: 1px solid var(--ink-line);
    box-shadow: var(--shadow-modal);
    transform: translateX(100%);
    transition: transform 0.24s;
}

.ua-drawer.show {
    transform: translateX(0);
}

.ua-drawer-head {
    flex: 0 0 auto;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--ink-line);
}

.ua-drawer-top {
    display: flex;
    align-items: center;
    gap: 13px;
}

.ua-drawer-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.ua-drawer-avatar.admin {
    background: var(--accent);
    color: var(--text-inverse);
}

.ua-drawer-id {
    min-width: 0;
    flex: 1;
}

.ua-drawer-id h3,
.ua-drawer-id span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ua-drawer-id h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.18;
    text-transform: none;
}

.ua-drawer-id span {
    display: block;
    margin-top: 4px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.ua-drawer-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
}

.ua-drawer-icon-btn:hover {
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    color: var(--text-primary);
}

.ua-drawer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.ua-drawer-menu-wrap {
    position: relative;
    margin-left: auto;
}

.ua-drawer-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 2;
    display: none;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-overlay);
    box-shadow: var(--shadow-md);
}

.ua-drawer-menu.show {
    display: block;
}

.ua-drawer-menu button {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.ua-drawer-menu button:hover {
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    color: var(--text-primary);
}

.ua-drawer-menu button:disabled {
    color: var(--text-disabled);
    cursor: not-allowed;
}

.ua-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 22px 24px;
}

.ua-drawer-section {
    padding: 20px 0 4px;
}

.ua-drawer-section + .ua-drawer-section {
    border-top: 1px solid var(--ink-line);
}

.ua-drawer-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ua-section-hint {
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.ua-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ua-field-wide {
    grid-column: 1 / -1;
}

.ua-drawer .st-input,
.ua-drawer .st-select {
    border-radius: var(--radius-md);
}

.ua-drawer .st-input[readonly] {
    color: var(--text-tertiary);
}

.ua-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ua-preset {
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-field);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.ua-preset:hover {
    border-color: var(--text-tertiary);
}

.ua-preset.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.ua-preset-desc {
    min-height: 20px;
    margin-top: 10px;
    color: var(--text-tertiary);
    font-size: 0.74rem;
    line-height: 1.45;
}

.ua-role-field {
    margin-top: 12px;
}

.ua-field-hint {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

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

.ua-chip-tog {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface-field);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.ua-chip-tog:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.ua-chip-tog.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.ua-team-group {
    margin-bottom: 14px;
}

.ua-team-group:last-child {
    margin-bottom: 0;
}

.ua-team-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ua-team-group-head span {
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.ua-team-group-head button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.ua-team-group-head button:hover {
    color: var(--accent-hover);
}

.ua-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
    padding: 14px 22px;
    border-top: 1px solid var(--ink-line);
    background: var(--surface-chrome);
}

.ua-drawer-foot-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ua-drawer-error {
    margin-bottom: 0;
}

.ua-drawer .hidden {
    display: none;
}

.ua-dirty {
    margin-right: auto;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
}

.ua-dirty.on {
    color: var(--accent);
}

.st-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ink-line);
    margin-bottom: 16px;
}

.st-editor-section {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--ink-line);
}

.st-editor-section:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.st-editor-section-title {
    margin-bottom: 10px;
}

.st-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.st-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 7px 9px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-field);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.st-check input {
    accent-color: var(--accent);
}

.st-check:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text-primary);
}

.st-sidebar-pref-row:has(.st-sidebar-visible input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.st-sidebar-visible,
.st-sidebar-visible:has(input:checked) {
    border-color: transparent;
    background: transparent;
    color: var(--text-primary);
}

.st-team-list {
    margin-top: 16px;
}

.st-empty-cell,
.st-empty-block,
.st-muted {
    color: var(--text-tertiary);
}

.st-empty-cell {
    text-align: center;
    padding: 24px 10px !important;
}

.st-empty-block {
    padding: 24px 0;
}

.st-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    padding: 32px 0;
}

.st-loading .spinner {
    width: 24px;
    height: 24px;
    margin: 0;
}

.st-success-scrim {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: color-mix(in srgb, var(--surface-field) 70%, transparent);
}

.st-success-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1210;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    width: min(420px, calc(100vw - 40px));
    padding: 20px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    box-shadow: var(--shadow-modal);
    transform: translate(-50%, -50%);
}

.st-success-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--success) 18%, transparent);
    color: var(--success);
}

.st-success-mark svg {
    width: 22px;
    height: 22px;
}

.st-success-copy {
    min-width: 0;
}

.st-success-copy h3 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
}

.st-success-copy p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.45;
}

.st-success-dialog .btn {
    grid-column: 2;
    justify-self: end;
    margin-top: 4px;
}

.ct-panel {
    max-width: 1280px;
    padding: 0;
    overflow: hidden;
}

.ct {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 160px);
}

.ct-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex: none;
    padding: 24px 32px 18px;
}

.ct-bar h2 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1;
    text-transform: uppercase;
}

.ct-bar .sub {
    margin-top: 7px;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
}

.ct-bar .spacer {
    flex: 1;
}

.ct-bar .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ct-error {
    margin: 0 32px 14px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--status-injured) 35%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--status-injured) 10%, transparent);
    color: var(--status-injured);
    font-size: 0.8rem;
    font-weight: 700;
}

.ct-body {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    border-top: 1px solid var(--ink-line);
}

.ct-list {
    overflow-y: auto;
    padding: 16px 14px 24px;
    border-right: 1px solid var(--ink-line);
    background: var(--surface-recess);
}

.ct-item {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 13px 14px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ct-item:hover {
    border-color: color-mix(in srgb, var(--text-primary) 18%, var(--ink-line));
}

.ct-item.on {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.ct-item-name {
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
}

.ct-item.on .ct-item-name {
    color: var(--accent);
}

.ct-item-meta {
    margin-top: 4px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ct-item-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ct-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    color: var(--text-secondary);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ct-badge.custom {
    background: var(--accent-soft);
    color: var(--accent);
}

.ct-badge.pub {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.ct-badge.draft {
    background: color-mix(in srgb, var(--status-modified) 13%, transparent);
    color: var(--status-modified);
}

.ct-detail {
    min-width: 0;
    overflow-y: auto;
}

.ct-dwrap {
    max-width: 1080px;
    padding: 24px 32px 60px;
}

.ct-dhead {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ink-line);
}

.ct-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-tertiary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: uppercase;
}

.ct-eyebrow svg,
.ct-foot svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.ct-dhead h2 {
    margin: 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.36rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    text-transform: none;
}

.ct-eyebrow + h2 {
    margin-top: 8px;
}

.ct-dmeta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ct-dmeta .dot {
    color: var(--text-tertiary);
}

.ct-dactions {
    display: flex;
    gap: 9px;
    flex: none;
    margin-left: auto;
}

.ct-dactions .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ct-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px 22px;
    padding: 22px 0;
    border-bottom: 1px solid var(--ink-line);
}

.ct-meta .full {
    grid-column: 1 / -1;
}

.ct-metaitem label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-tertiary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ct-metaitem span,
.ct-edit-controls span,
.ct-edit-row-foot span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-tertiary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ct-readval {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 13px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    background: var(--surface-recess);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
}

.ct-readval.mono {
    color: var(--text-secondary);
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.78rem;
}

.ct-readval.desc {
    display: block;
    min-height: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ct-meta-edit .st-input,
.ct-meta-edit .st-select,
.ct-edit-controls .st-select,
.ct-edit-row-foot .st-input {
    border-radius: var(--radius-md);
}

.ct-key-input[readonly] {
    color: var(--text-secondary);
}

.ct-crits {
    padding-top: 22px;
}

.ct-crits-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ct-crits-head .sec-label {
    flex: none;
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1;
    text-transform: uppercase;
}

.ct-line {
    flex: 1;
    height: 1px;
    background: var(--ink-line);
}

.ct-tot {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ct-phase {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    background: var(--surface-recess);
}

.ct-phase-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--surface-raised);
}

.ct-phase-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.ct-phase-name {
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
}

.ct-phase-intent {
    margin-top: 2px;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
}

.ct-phase-count {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ct-phase-count.empty {
    color: var(--text-tertiary);
    font-style: italic;
}

.ct-phase-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

.ct-edit-row {
    padding: 12px;
    border-bottom: 1px solid var(--ink-line);
    background: var(--surface-raised);
}

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

.ct-edit-controls {
    display: grid;
    grid-template-columns: 92px minmax(160px, 1fr) minmax(180px, 1.1fr) minmax(120px, 0.7fr) 110px;
    gap: 10px;
}

.ct-edit-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 11px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.ct-edit-preview strong {
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.35;
}

.ct-edit-preview span {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
}

.ct-edit-preview em {
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
}

.ct-edit-row-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 10px;
}

.ct-crit {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
}

.ct-crit:hover {
    background: color-mix(in srgb, var(--text-primary) 2%, transparent);
}

.ct-crit-num {
    width: 18px;
    flex: none;
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.ct-crit-text {
    flex: 1;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.35;
}

.ct-crit-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.ct-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 10px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.ct-tag.cat {
    color: var(--text-secondary);
}

.ct-tag.req {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
}

.ct-tag.opt {
    color: var(--text-tertiary);
}

.ct-blank {
    padding: 44px 24px;
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-md);
    background: var(--surface-recess);
    text-align: center;
}

.ct-blank .bi {
    width: 40px;
    height: 40px;
    margin: 0 auto 14px;
    color: var(--ink-line);
}

.ct-blank .bi svg {
    width: 100%;
    height: 100%;
}

.ct-blank .bt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

.ct-blank .bs {
    max-width: 360px;
    margin: 7px auto 0;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.5;
}

.ct-blank .btn {
    margin-top: 18px;
}

.ct-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

@media (max-width: 1180px) {
    .st-admin-layout {
        grid-template-columns: 1fr;
    }

    .st-table-wrap {
        max-height: 420px;
    }

    .ct-body,
    .ct-meta,
    .ct-edit-controls,
    .ct-edit-row-foot {
        grid-template-columns: 1fr;
    }

    .ct-list {
        border-right: 0;
        border-bottom: 1px solid var(--ink-line);
    }
}

@media (max-width: 760px) {
    .st-body {
        grid-template-columns: 1fr;
        margin: 16px;
    }

    #st-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #st-nav .nv-rail-item {
        width: auto;
        flex: 1 1 140px;
        justify-content: center;
    }

    .st-form-grid-2,
    .st-profile-meta,
    .st-check-grid,
    .ua-form-grid,
    .ua-preset-grid {
        grid-template-columns: 1fr;
    }

    .st-panel-head-row,
    .st-editor-head,
    .ct-bar,
    .ct-dhead,
    .ct-crits-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .ct-dactions {
        margin-left: 0;
    }

    .ct-crit {
        align-items: flex-start;
        flex-direction: column;
    }

    .ct-crit-tags {
        flex-wrap: wrap;
    }

    .st-search {
        max-width: none;
    }
}

/* ── Daily Board task types ── */

.tt-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.st-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--status-injured) 35%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--status-injured) 10%, transparent);
    color: var(--status-injured);
    font-size: 0.8rem;
    font-weight: 700;
}

.tt-editor {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-recess);
}

.tt-editor-head {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.tt-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.tt-editor-grid label {
    display: block;
    min-width: 0;
}

.tt-editor-grid label > span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-tertiary);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.tt-editor-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.tt-editor-foot .st-muted {
    margin-right: auto;
}

.tt-label {
    display: block;
    color: var(--text-primary);
    font-weight: 650;
}

.tt-key {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
}

.tt-row-off td {
    opacity: 0.55;
}

.tt-actions {
    text-align: right;
    white-space: nowrap;
}
