/* Shared app contracts: back buttons, primary actions and list tables. */
.settings-menu { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.settings-menu > li + li { border-top: 1px solid var(--color-border); }
.settings-menu-link { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); width: 100%; box-sizing: border-box; padding: var(--sp-4); border: 0; background: var(--color-surface); color: var(--color-text-strong); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.settings-menu-link > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.settings-menu-link strong { font-size: var(--text-sm); }
.settings-menu-description { display: block; margin-top: var(--sp-1); color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; }
.settings-menu-link > span:last-child { color: var(--color-text-muted); }
.settings-menu-link:hover { background: var(--color-surface-alt); }
.settings-menu-link:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.app-compact-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.app-compact-list > li { padding: var(--sp-4); }
.app-compact-list > li + li { border-top: 1px solid var(--color-border); }
.app-compact-list-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.app-compact-list-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: var(--text-sm); }
.app-compact-list-heading .badge { flex-shrink: 0; }
.app-compact-list-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); margin-left: auto; max-width: 100%; }
.app-compact-list-details { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin-top: var(--sp-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.app-compact-list-details time { white-space: nowrap; }
.app-search { display: flex; flex: 1; position: relative; align-items: center; min-width: 0; }
.app-search-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-search .input { box-sizing: border-box; width: 100%; min-width: 0; padding-right: var(--sp-12); }
.app-search .btn, .app-search-icon { position: absolute; right: 0; display: flex; align-items: center; justify-content: center; flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; padding: 0; color: var(--color-text-muted); }
.app-search-icon { pointer-events: none; }
.app-segmented { display:inline-grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:0; padding:var(--sp-1); border:1px solid var(--color-border); border-radius:var(--r-pill); background:var(--color-surface-alt); width:fit-content; max-width:100%; justify-self:start; align-self:start; box-sizing:border-box; }
.app-segmented > a { display:flex; align-items:center; justify-content:center; min-height:44px; padding:0 var(--sp-5); border:0; border-radius:var(--r-pill); color:var(--color-text-muted); font-size:var(--text-sm); font-weight:var(--fw-semi); text-decoration:none; }
.app-segmented > a[aria-current=page] { color:var(--color-surface); background:var(--color-brand); }
.app-segmented > a:focus-visible { outline:2px solid var(--color-brand-text); outline-offset:2px; }
.app-info-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; padding:0; border:0; background:transparent; color:var(--color-brand-text); cursor:pointer; }
.app-info-button > svg { display:block; width:24px; height:24px; flex-shrink:0; }
.app-info-surface { fill:var(--color-brand-bg); }
.app-info-button:hover .app-info-surface, .app-info-button:focus-visible .app-info-surface { fill:var(--blue-100); }
.app-info-button:focus-visible { outline:2px solid var(--color-brand); outline-offset:2px; border-radius:var(--r-sm); }
.app-info-popover { position:fixed; inset:0; margin:auto; width:min(420px, calc(100vw - 32px)); max-height:calc(100dvh - 48px); box-sizing:border-box; overflow:auto; padding:var(--sp-5); color:var(--color-text); }
.app-info-popover h2 { font-size:var(--text-lg); margin:0 0 var(--sp-3); }
.app-info-popover p { margin:0 0 var(--sp-4); }

.admin-shell .admin-main :is(.btn-primary, .app-save),
.app-shell :is(.btn-primary, .app-save) {
  display: flex; width: fit-content; max-width: 100%;
  margin-inline-start: auto; justify-self: end; align-self: end;
}
.app-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.app-actions .app-back { margin: 0; }
.admin-shell .admin-main :is(.app-actions, .wp-form-footer) > :is(.btn-primary, .app-save),
.app-shell :is(.app-actions, .wp-form-footer) > :is(.btn-primary, .app-save) { margin-inline-start:0; }
.app-table-card { overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.app-table th, .app-table td { text-align: left; padding: var(--sp-4); vertical-align: top; overflow-wrap: anywhere; }
.app-table th { font-size: var(--text-xs); color: var(--color-text-muted); background: var(--color-surface-alt); }
.app-table tbody tr { border-top: 1px solid var(--color-border); }
.app-table td { font-size: var(--text-sm); }
.app-table p { margin: var(--sp-2) 0 0; color: var(--color-text-muted); }
.app-table .badge { height: auto; min-height: 1.375rem; white-space: normal; }
.app-table .input, .app-table .select { box-sizing: border-box; min-width: 0; }
@media (max-width: 600px) {
  .app-table th, .app-table td { padding: var(--sp-3) var(--sp-1); }
  .app-table th { font-size: .6875rem; }
  .app-table td { font-size: var(--text-xs); }
  .app-table time { white-space: nowrap; }
}

/* Shared immediate-setting switch: no surrounding button surface. */
.app-switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; box-shadow: none; color: var(--color-text); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.app-switch::before { content: ""; display: block; width: 44px; height: 24px; flex: 0 0 44px; border-radius: 999px; background: var(--color-text-muted); transition: background-color .15s ease; }
.app-switch::after { content: ""; position: absolute; left: 3px; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--color-surface); transform: translateY(-50%); transition: transform .15s ease; }
.app-switch[aria-checked="true"]::before { background: var(--color-brand); }
.app-switch[aria-checked="true"]::after { transform: translate(20px, -50%); }
.app-switch:focus-visible { outline: none; }
.app-switch:focus-visible::before { box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-brand); }
.app-switch:disabled { opacity: .55; cursor: not-allowed; }
.app-switch[aria-busy="true"] { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .app-switch::before, .app-switch::after { transition: none; } }
