/* Real-control adaptations of Stageshow: graphite edge light, Hero grid's
   soft segmented thumb, in-place content reveal and close-up state changes. */
:root {
  --ground: #191c20;
  --panel: #282d33;
  --sidebar: #20252b;
  --line: #414850;
  --muted: #b0bac7;
  --ink: #f0f3f7;
  --field: #20252b;
  --lift: #30363d;
  --edge: rgba(255, 255, 255, 0.1);
  --shadow: 0 12px 28px -20px #000c;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  background: var(--ground);
  color: var(--ink);
}
html[data-theme="light"] {
  --ground: #eff1f4;
  --panel: #f5f7fa;
  --sidebar: #fafbfc;
  --line: #cbd2dc;
  --muted: #536175;
  --ink: #1c2736;
  --field: #f8fafc;
  --lift: #f0f3f7;
  --edge: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 28px -20px #25395755;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--ground);
  color: var(--ink);
}
body,
.main {
  background: var(--ground);
  color: var(--ink);
}
.sidebar,
.topbar {
  background: var(--sidebar);
  border-color: var(--line);
}
.card,
.stat,
.ticket-section,
.multi-picker,
.skeleton-card,
.skeleton-profile,
.skeleton-table,
.skeleton-calendar {
  background: var(--panel);
  border-color: var(--line);
  box-shadow:
    inset 0 1px 0 var(--edge),
    var(--shadow);
}
.card-header,
.card footer,
td,
th,
.ticket-row,
.audit-entry,
.toolbar,
.filter-tabs,
.preference-option {
  border-color: var(--line);
}
h1,
h2,
h3,
.stat-number,
.card-title,
.page-heading,
.nav a,
.brand-name,
label,
.breadcrumb strong,
.action-detail-fields dd,
table,
.person strong {
  color: var(--ink);
}
.muted,
.helper,
.stat-foot,
.stat-top,
.breadcrumb,
.person small,
.section-helper,
.chart-range,
.activity-when,
.footer,
th {
  color: var(--muted);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="color"]
  ),
textarea,
select,
.top-search,
.searchbox {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 0 1px 2px #00000008;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button,
.button,
.nav a {
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s,
    transform 0.12s;
}
button:not(:disabled):active,
.button:active {
  transform: translateY(1px) scale(0.985);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button[aria-busy="true"] {
  cursor: progress;
  position: relative;
}
button[aria-busy="true"]::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  animation: control-spin 0.65s linear infinite;
}
@keyframes control-spin {
  to {
    rotate: 360deg;
  }
}
.action-succeeded {
  box-shadow: 0 0 0 3px #28b88955;
}
.ghost,
.filter-tabs button,
.tabs button,
.calendar-layout a,
.action-category-tabs button,
.chart-legend button,
.account-menu button {
  background: var(--field);
  border-color: var(--line);
  color: var(--ink);
}
.ghost:hover:not(:disabled),
.nav a:hover,
.filter-tabs button:hover,
.tabs button:hover,
.account-menu button:hover,
.calendar-layout a:hover {
  background: var(--lift);
}
.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 86%, #fff);
}
.nav a.active,
.filter-tabs button.active,
.action-category-tabs [aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
dialog,
.account-menu,
.notification-menu,
.global-results,
.select-menu,
.custom-select-menu,
.picker-menu,
.popover,
.select-popover {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow:
    inset 0 1px 0 var(--edge),
    0 24px 72px #0006;
}
dialog::backdrop {
  background: #090c10a6;
  backdrop-filter: blur(4px);
}
select option {
  background: var(--panel);
  color: var(--ink);
}
:is(.select-option, [role="option"]):hover,
:is(.select-option, [role="option"])[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--ink);
}
.table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
}
tbody tr:hover,
.ticket-row:hover {
  background: var(--lift);
}
.message-embed,
.ticket-message-preview,
.inline-info,
.unavailable-state,
.notice {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}
.message-embed {
  box-shadow: inset 0 1px 0 var(--edge);
}
.discord-mention {
  background: color-mix(in srgb, #5865f2 22%, transparent);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}
.hero-sections {
  position: relative;
  isolation: isolate;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.hero-sections::before,
.segment-control::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: var(--tab-left, 4px);
  top: var(--tab-top, 4px);
  width: var(--tab-width, 0px);
  height: var(--tab-height, 32px);
  border-radius: 8px;
  background: var(--accent-soft);
  transition:
    left 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.2s;
  box-shadow: inset 0 1px 0 var(--edge);
}
.hero-sections a,
.hero-sections a.active {
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.hero-sections a.active {
  color: var(--accent);
}
.switch-option {
  position: relative;
  display: flex;
  align-items: center;
  column-gap: 12px;
}
.switch-option input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: block;
  position: relative;
  width: 42px !important;
  height: 26px !important;
  min-width: 42px;
  border: 0 !important;
  border-radius: 20px;
  background: #7b849366;
  cursor: pointer;
  box-shadow: inset 0 1px 2px #0001;
  transition: background 0.18s;
}
.switch-option input[type="checkbox"]::before {
  content: "";
  display: block;
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch-option input[type="checkbox"]:checked {
  background: var(--accent);
}
.switch-option input[type="checkbox"]:checked::before {
  transform: translateX(16px);
}
.switch-option .switch-state {
  grid-column: 2;
  display: block;
  color: var(--muted);
  font-weight: 400;
  min-height: 1.3em;
}
.switch-option > span small {
  display: block;
  color: var(--muted);
}
.has-field-error input,
.has-field-error textarea,
.has-field-error select {
  border-color: #e35c67 !important;
}
.field-error {
  display: block;
  color: light-dark(#b42334, #ffa4ac);
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0 12px;
}
[aria-invalid="true"] {
  outline-color: #e35c67;
}
.loading-to-content {
  display: grid !important;
  gap: 20px;
  max-width: 100%;
  animation: none !important;
}
.loading-to-content .skeleton-line {
  animation: none;
  background: var(--lift);
  position: relative;
  overflow: hidden;
}
.loading-to-content .skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--edge), transparent);
  animation: loading-sweep 1.6s ease-in-out infinite;
  translate: -100% 0;
}
@keyframes loading-sweep {
  to {
    translate: 100% 0;
  }
}
.content:not([aria-busy="true"]) > .card,
.content:not([aria-busy="true"]) > .stats,
.content:not([aria-busy="true"]) > .grid-2 {
  animation: none;
}
.chart-scrub-value {
  display: block;
  min-height: 32px;
  padding: 6px 12px;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.chart-scrub-line {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.chart-scrub-dot {
  stroke: var(--panel);
  stroke-width: 2;
  fill: var(--accent);
  pointer-events: none;
}
.activity-line-chart {
  cursor: crosshair;
  touch-action: pan-y;
}
.ticket-trend {
  cursor: crosshair;
  touch-action: pan-y;
  flex-wrap: wrap;
}
.ticket-trend > .chart-scrub-value {
  flex-basis: 100%;
  width: 100%;
}
.ticket-period.scrub-selected {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
  border-radius: 4px;
}
.placeholder-reference {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12px;
}
.placeholder-reference td {
  white-space: normal;
  min-width: 120px;
  overflow-wrap: anywhere;
}
.placeholder-reference td small {
  display: block;
  color: var(--muted);
  padding-top: 4px;
}
.mention-inserter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding-top: 14px;
}
.mention-inserter label {
  flex: 1;
  min-width: 180px;
}
.mention-inserter p {
  flex-basis: 100%;
}
.favicon-preview {
  object-fit: contain !important;
  background: repeating-conic-gradient(var(--field) 0 25%, var(--lift) 0 50%)
    0 /12px 12px;
}
.evidence-upload {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  margin: 8px 0;
  display: grid;
  gap: 8px;
}
.evidence-upload progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
.evidence-upload[data-state="ready"] {
  border-color: #29b87c;
}
.evidence-upload[data-state="error"] {
  border-color: #d95763;
}
.stat-detail-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  view-transition-name: stat-detail;
}
.stat-detail-dialog .stat-detail-list {
  max-height: 55dvh;
  overflow: auto;
}
.stat-detail-dialog .stat-detail-list article {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.mobile-menu-button,
.mobile-menu-close {
  display: none;
}
.navigation-backdrop {
  position: fixed;
  inset: 0;
  background: #080a0e99;
  backdrop-filter: blur(2px);
  z-index: 199;
  border: 0;
  padding: 0;
  border-radius: 0;
}
.navigation-backdrop[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  body {
    overflow-x: clip;
  }
  #app {
    display: block;
    min-width: 0;
  }
  .main {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(320px, calc(100vw - 44px));
    height: 100dvh;
    z-index: 200;
    transform: translateX(-102%);
    visibility: hidden;
    transition:
      transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0.24s;
    box-shadow: 8px 0 40px #0005;
    padding: 16px;
    overflow: hidden;
  }
  .sidebar.drawer-open {
    visibility: visible;
    transform: translateX(0);
  }
  .sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-bottom: 20px;
  }
  .sidebar .nav > a {
    display: flex;
  }
  .sidebar-foot {
    position: relative;
    margin-top: auto;
    width: 100%;
    padding-top: 12px;
  }
  .sidebar .brand {
    margin: 12px 0 22px;
  }
  .mobile-menu-button,
  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .mobile-menu-button {
    font-size: 22px;
    flex: none;
  }
  .mobile-menu-close {
    align-self: flex-end;
    gap: 12px;
  }
  body.navigation-open {
    position: fixed;
    left: 0;
    right: 0;
    overflow: hidden;
    width: 100%;
  }
  .topbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    min-height: 68px;
  }
  .breadcrumb {
    flex: 1;
    min-width: 0;
    font-size: 12px;
  }
  .top-tools {
    gap: 10px;
    min-width: 0;
    max-width: 100%;
  }
  .top-search {
    width: min(180px, 35vw);
  }
  .top-search input {
    min-width: 0;
    width: 100%;
  }
  .content {
    padding: 24px 16px;
    min-width: 0;
  }
  .content > * {
    max-width: 100%;
  }
  .page-heading {
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading p {
    font-size: 14px;
  }
  .stats,
  .workspace-stats,
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stat {
    padding: 16px;
    min-width: 0;
  }
  .stat-number {
    font-size: 28px;
    overflow-wrap: anywhere;
  }
  .stat-top {
    gap: 6px;
  }
  .stat-foot {
    font-size: 12px;
  }
  .grid-2,
  .charts-grid,
  .setup-fields,
  .message-editor-grid,
  .branding-fields,
  .trust-fields,
  .profile-grid,
  .calendar-form-grid,
  .permissions-columns,
  .embed-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0;
  }
  .card-header,
  .toolbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .admin-body {
    padding: 16px;
  }
  .button-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .button-row > * {
    max-width: 100%;
  }
  button,
  .button,
  .nav a,
  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 44px;
  }
  input,
  textarea,
  select {
    font-size: 16px;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }
  label:has(> :is(input[type="checkbox"], .native-check)),
  label:has(> input[type="radio"]) {
    min-height: 44px;
  }
  .table-wrap {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 640px;
  }
  .directory-table {
    min-width: 660px;
  }
  .table-wrap td,
  .table-wrap th {
    padding: 13px 12px;
  }
  .activity-table {
    min-width: 720px;
  }
  .member-actions-table {
    min-width: 900px;
  }
  .directory-toolbar,
  .directory-controls,
  .directory-footer,
  .filter-tabs {
    flex-wrap: wrap;
    gap: 10px;
  }
  .directory-toolbar > * {
    max-width: 100%;
  }
  .searchbox {
    width: 100%;
    min-width: 0;
  }
  .filter-tabs {
    overflow-x: auto;
  }
  .hero-sections {
    flex-wrap: nowrap;
    max-width: 100%;
  }
  dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding: 24px;
    border-radius: 14px;
  }
  dialog textarea {
    min-height: 110px;
  }
  dialog .button-row {
    position: sticky;
    bottom: -22px;
    background: var(--panel);
    padding: 14px 0;
    margin-bottom: 0;
  }
  .notification-menu,
  .global-results {
    position: fixed;
    top: 76px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    max-height: 70dvh;
  }
  .account-menu {
    left: 0;
    right: 0;
    width: auto;
    max-height: 65dvh;
    overflow: auto;
  }
  .account-theme {
    gap: 10px;
  }
  .profile-header {
    flex-wrap: wrap;
    gap: 16px;
    min-width: 0;
  }
  .profile-header h1 {
    font-size: 26px;
    overflow-wrap: anywhere;
  }
  .profile-header .avatar {
    flex: none;
  }
  .profile-meta,
  .profile-header > div {
    min-width: 0;
  }
  .profile-tabs {
    overflow-x: auto;
    max-width: 100%;
  }
  .calendar-toolbar,
  .calendar-controls {
    flex-wrap: wrap;
  }
  .calendar-time-scroll,
  .calendar-month-scroll {
    overflow-x: auto;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
  .calendar-month {
    min-width: 600px;
  }
  .calendar-time-grid,
  .time-grid-head {
    min-width: 600px;
  }
  .calendar-day {
    min-width: 0;
  }
  .ticket-period {
    min-width: 16px;
  }
  .arrival-heatmap {
    overflow: auto;
    max-width: 100%;
  }
  .ticket-trend {
    overflow-x: auto;
    min-width: 0;
  }
  .ticket-section {
    padding: 10px;
    overflow-wrap: anywhere;
  }
  .ticket-section summary {
    min-height: 44px;
  }
  .ticket-message-preview {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .message-embed {
    min-width: 0;
  }
  .multi-options {
    max-height: 50dvh;
    overflow: auto;
  }
  .notification-heading {
    gap: 12px;
  }
  .preference-option {
    align-items: start;
  }
  .preference-option > span {
    min-width: 0;
  }
  .switch-option {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .placeholder-reference {
    margin: 8px 0;
    padding: 10px;
  }
  .mention-inserter {
    align-items: stretch;
  }
  .mention-inserter > * {
    max-width: 100%;
  }
  .calendar-agenda-row,
  .ticket-row {
    gap: 10px;
    min-width: 0;
  }
  .row-main {
    min-width: 0;
  }
  .row-main strong {
    overflow-wrap: anywhere;
  }
  .stat-detail-dialog .stat-detail-list {
    max-height: 58dvh;
  }
  .footer {
    flex-wrap: wrap;
  }
}
@media (max-width: 430px) {
  .top-tools {
    width: 100%;
    justify-content: space-between;
  }
  .top-search {
    width: calc(100vw - 100px);
  }
  .stats,
  .workspace-stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .stat-number {
    font-size: 30px;
  }
  .calendar-month {
    min-width: 560px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .hero-sections::before {
    transition: none;
  }
}
.calendar-event-row {
  display: flex;
  align-items: start;
  min-width: 0;
}
.calendar-event-row .calendar-event {
  min-width: 0;
  flex: 1;
}
.notification-bell .icon {
  color: var(--muted);
}
@media (max-width: 900px) {
  .topbar {
    height: auto;
  }
  .breadcrumb {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .breadcrumb strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .calendar-scroll {
    overflow-x: auto;
  }
  .calendar-grid,
  .calendar-weekdays {
    min-width: 600px;
  }
}
html[data-theme]
  :is(
    .select-button,
    .select-options,
    .select-option,
    .time-select-menu,
    .time-picker,
    .notes-list,
    .note-item,
    .composer-section,
    .rule-target,
    .setup-validation
  ) {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme]
  :is(.select-option:hover, .select-option[aria-selected="true"]) {
  background: var(--accent-soft);
  color: var(--ink);
}
html[data-theme] :is(thead, th) {
  background: var(--field);
  color: var(--muted);
}
html[data-theme]
  :is(
    .admin-body,
    .table-footer,
    .notification-heading,
    .request-row,
    .role-heading,
    .member-badges
  ) {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.content:not([aria-busy="true"])
  > :not(.page-heading):not(.workspace-tabs):not(.footer) {
  animation: none !important;
}
.hero-sections button,
.hero-sections button.active,
.hero-sections button[aria-pressed="true"] {
  position: relative;
  background: transparent !important;
  color: var(--muted);
  border-color: transparent;
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.2s;
}
.hero-sections button.active,
.hero-sections button[aria-pressed="true"] {
  color: var(--accent);
}
.changing-state {
  position: relative;
  overflow: hidden;
}
.changing-state > span {
  display: block;
}
.changing-state > .outgoing-state {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.evidence-upload progress {
  transition:
    height 0.18s,
    opacity 0.18s,
    margin 0.18s;
  display: block;
  opacity: 1;
}
.evidence-upload[data-state="ready"] progress {
  height: 0;
  opacity: 0;
  margin: 0;
}
.evidence-upload {
  transition:
    border-color 0.18s,
    background 0.18s;
}
/* Shared surface, spacing and input rules: keep graphite and light themes coherent. */
:root {
  --series-staff: #91a8e8;
  --series-players: #53bbb6;
}
html[data-theme="light"] {
  --series-staff: #4b63ae;
  --series-players: #17817e;
}
html .notification-bell .icon {
  color: var(--muted);
}
html .notification-bell:hover .icon {
  color: var(--ink);
}
html .notification-badge {
  background: #d94355;
  color: white;
}
html .card .admin-body,
html .card .activity-line-chart,
html .card .action-chart,
html .card .donut-chart,
html .card .ticket-trend,
html .action-chart-body,
html .chart-body,
html .embed-library,
html .calendar-grid,
html .calendar-grid .calendar-day {
  background: var(--panel);
  color: var(--ink);
}
html .select-menu,
html .account-menu,
html .notification-menu,
html .notification-dropdown,
html .global-results,
html .multi-options,
html .picker-popover,
html dialog {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
html .select-menu [data-option]:hover,
html .select-menu .highlighted,
html .nav a:hover,
html tbody tr:hover {
  background: var(--lift);
  color: var(--ink);
}
html .select-menu [aria-selected="true"],
html .select-menu [data-option].selected {
  background: var(--accent-soft);
  color: var(--ink);
}
html .filter-tabs,
html .workspace-tabs,
html .action-category-tabs {
  background: var(--field);
  border-color: var(--line);
}
html .hero-sections {
  padding: 4px;
  gap: 4px;
  align-items: center;
  min-height: 42px;
  line-height: 1.3;
  max-width: 100%;
  overflow-x: auto;
}
html .hero-sections a,
html .hero-sections button {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 32px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  align-self: stretch;
  white-space: nowrap;
  border-radius: 8px;
}
html .hero-sections::before {
  border-radius: 8px;
  transform: none;
}
html label.switch-option:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  grid-template-columns: none;
  padding: 18px 0;
  text-align: left;
  width: 100%;
}
html .switch-option > .switch-copy {
  display: block;
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  color: var(--ink);
}
html .switch-copy > span {
  display: block;
}
.switch-copy strong {
  display: block;
}
.switch-copy small,
.switch-copy .helper {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
html .switch-option input[type="checkbox"] {
  flex: none;
  margin: 0;
  order: 2;
  align-self: center;
}
html .switch-state {
  display: none;
}
html
  :is(button, a, input, select, textarea, [tabindex]):focus:not(
    :focus-visible
  ) {
  outline: none;
  box-shadow: none;
}
html :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
html .admin-body,
html .setup-fields,
html .branding-fields {
  gap: 18px;
}
html label {
  line-height: 1.45;
}
html
  label:not(.switch-option):not(.check-label):not(.confirmation):not(
    .permission-option
  ):not(.calendar-check):not(
    :where(.top-search, .searchbox, .directory-footer label, .page-jump label)
  )
  > :is(input, textarea, .select-wrap, select) {
  margin-top: 7px;
}
html :is(.helper, .section-helper, .preview-caption) {
  line-height: 1.5;
  margin: 8px 0 16px;
}
html .card-header .helper {
  margin: 6px 0 0;
}
html :is(.setup-fields, .admin-body) > label {
  min-width: 0;
  margin-bottom: 3px;
}
html .admin-body > label + .helper {
  margin-top: -8px;
}
html :is(.permission-option, .preference-option) small {
  line-height: 1.5;
  margin-top: 6px;
}
html
  :is(
    .setup-validation,
    .profile-identifiers,
    .detail-fields,
    .ticket-section,
    .log-routing
  ) {
  line-height: 1.5;
}
html dialog > p {
  line-height: 1.55;
  margin: 10px 0 18px;
}
html dialog form > label {
  margin-bottom: 16px;
}
html .button-row {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
html .log-routing {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
html .log-routing summary {
  margin-bottom: 16px;
}
html .activity-line-chart {
  cursor: default;
  position: relative;
  touch-action: pan-y;
}
html .activity-line-chart svg {
  cursor: crosshair;
  touch-action: pan-y;
}
html .activity-series {
  stroke: var(--series-staff);
  fill: none;
}
html .activity-area,
html .activity-point {
  fill: var(--series-staff);
}
html .legend-staff {
  background: var(--series-staff);
}
html .legend-players {
  background: var(--series-players);
}
html .chart-scrub-line {
  stroke: var(--muted);
  stroke-width: 1;
  pointer-events: none;
}
html .chart-scrub-dot {
  fill: var(--series-staff);
  stroke: var(--panel);
  stroke-width: 2;
  pointer-events: none;
}
html .chart-scrub-head {
  display: grid;
  gap: 7px;
  padding: 0 12px 20px;
  text-align: left;
  min-height: 88px;
  color: var(--ink);
}
html .chart-scrub-head > div {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
html .chart-scrub-label {
  font-size: 13px;
  color: var(--muted);
}
html .chart-scrub-number {
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  position: relative;
}
html .chart-scrub-unit {
  font-size: 12px;
  color: var(--muted);
}
html .chart-scrub-head > .chart-scrub-summary {
  column-gap: 24px;
}
html .activity-scrub-value,
html .community-scrub-value {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
html .chart-scrub-summary .chart-scrub-number {
  flex: 0 0 auto;
}
html .chart-scrub-summary .chart-scrub-unit {
  min-width: 0;
  overflow-wrap: anywhere;
}
html .select-wrap:has(#activity-range) > .select-button {
  position: relative;
  justify-content: flex-start;
  padding: 7px 30px 7px 10px;
  height: 35px;
  min-height: 35px;
  box-sizing: border-box;
  line-height: 18px;
  gap: 0;
}
html .select-wrap:has(#activity-range) .selected-option,
html .select-wrap:has(#activity-range) .selected-option > span {
  flex: 1;
  justify-content: flex-start;
  align-items: center;
  line-height: 18px;
  text-align: left;
}
html .select-wrap:has(#activity-range) > .select-button > svg {
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  transform: translateY(-50%);
}
html .calendar-event-row {
  display: block;
}
.calendar-event-row .calendar-event {
  width: 100%;
}
html .time-entry > a {
  padding-left: 7px;
}
html .transcript-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.transcript-meta div {
  min-width: 140px;
}
.transcript-meta dt {
  color: var(--muted);
  font-size: 12px;
}
.transcript-meta dd {
  margin: 5px 0;
}
html .transcript-message {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.transcript-message header {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.transcript-message header span,
.transcript-message time {
  font-size: 12px;
  color: var(--muted);
}
.message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.transcript-message blockquote {
  border-left: 3px solid var(--accent);
  margin: 14px 0;
  padding: 12px;
  background: var(--field);
}
.attachment {
  display: block;
  margin: 12px 0;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 18px;
}
.restriction-actions .button-row {
  margin-top: 14px;
}
td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
@media (max-width: 600px) {
  html .hero-sections {
    min-height: 42px;
  }
  html .hero-sections a,
  html .hero-sections button {
    font-size: 13px;
    padding: 7px 10px;
  }
  html label.switch-option:has(> input[type="checkbox"]) {
    gap: 16px;
  }
  html .chart-scrub-head {
    padding-bottom: 14px;
    min-height: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chart-scrub-line,
  .chart-scrub-dot {
    transition: none;
  }
}
.log-event-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.log-event-groups > .helper,
.log-event-groups > label,
.log-event-groups > [role="status"] {
  grid-column: 1/-1;
}
.log-event-group {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  align-self: start;
}
.log-event-group summary {
  font-weight: 600;
}
.log-event-group .check-label {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px 20px;
  margin: 16px 0 20px;
}
html .permission-grid .check-label {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.protection-rule {
  padding: 0 0 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.protection-rule .switch-option {
  padding-bottom: 8px;
}
.protection-rule .setup-fields {
  margin-top: 14px;
}
.log-defaults {
  margin-bottom: 20px;
}
.select-search {
  width: calc(100% - 12px);
  margin: 6px;
  position: sticky;
  top: 0;
  background: var(--field);
  z-index: 1;
}
@media (max-width: 650px) {
  .log-event-groups {
    grid-template-columns: 1fr;
  }
}
html[data-theme] :is(.chart-with-tabs, .action-category-content) {
  background: var(--panel);
  color: var(--ink);
}
html[data-theme]
  :is(
    .notification-bell,
    .date,
    .select-button,
    .calendar-cell,
    .calendar-day,
    .ticket-period
  ) {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme] .notification-bell:hover:not(:disabled) {
  background: var(--lift);
}
html[data-theme] .setup-switches {
  background: transparent;
  margin: 20px 0;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
html[data-theme] .switch-copy {
  font-size: 13px;
  font-weight: 500;
}
html[data-theme] .switch-copy small {
  font-size: 12px;
  font-weight: 400;
}
html[data-theme] .setup-switches .switch-option {
  padding: 12px 0;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
html[data-theme] .log-event-group {
  padding: 14px 16px;
}
html[data-theme] .log-event-group summary {
  margin: 0;
}
html[data-theme] .log-event-group[open] summary {
  margin-bottom: 14px;
}
/* Searchable menus use the same option layout inside their accessible listbox. */
html[data-theme] .select-menu [data-option] {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 9px 11px;
  text-align: left;
  color: var(--ink);
  font-size: 13px;
}
html[data-theme] .select-menu [data-option][hidden] {
  display: none;
}
html[data-theme] .select-menu [data-option]:is(:hover, .highlighted) {
  background: var(--lift);
}
html[data-theme] .select-menu [data-option][aria-selected="true"] {
  background: var(--accent-soft);
}
/* Only multiselects need a selection-marker column. */
html[data-theme] .select-menu [aria-multiselectable="true"] [data-option] {
  padding-inline-end: 38px;
}
html[data-theme]
  :is(
    .note-form,
    .lift-detail,
    .leave-record .review-note,
    .leave-extensions > div,
    .moderation-target,
    .inspection-grid > div,
    .validation-details section,
    .format-toolbar,
    .embed-field-editor,
    .role-row,
    .role-heading,
    .quick-card .quick-actions
  ) {
  background: var(--field);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme] .quick-card .card-header {
  background: var(--panel);
}
html[data-theme] :is(.quick-button, .copy-id, .channel-chip) {
  background: var(--field);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme]
  :is(
    .quick-button:hover,
    .permission-option:hover,
    .nav-section-toggle:hover,
    .notification-item:hover,
    .select-button:hover,
    .donut-legend button:hover
  ) {
  background: var(--lift);
}
html[data-theme] .notification-item.unread {
  background: var(--accent-soft);
}

/* Twenty-item follow-up: shared field boundaries and readable choices. */
html[data-theme] .top-search,
html[data-theme] .searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  padding: 0 13px;
  height: 44px;
  box-sizing: border-box;
}
html .top-search input,
html .searchbox input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
}
/* Override the shared typed-input surface inside the single field boundary. */
html[data-theme] .top-search input:not([type="checkbox"]):not([type="radio"]),
html[data-theme] .searchbox input:not([type="checkbox"]):not([type="radio"]) {
  background: transparent;
  box-shadow: none;
}
html[data-theme] :is(.identifier code, .moderation-reason) {
  color: var(--ink);
}
html[data-theme] .identifier span {
  color: var(--muted);
}
html .top-search input:focus,
html .searchbox input:focus,
html .top-search input:focus-visible,
html .searchbox input:focus-visible {
  outline: none;
  box-shadow: none;
  border: 0;
}
html :is(.top-search, .searchbox):has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
html .top-search > .icon,
html .searchbox > .icon {
  position: static;
  flex: 0 0 18px;
  align-self: center;
  margin: 0;
}
html .notification-bell {
  width: 44px;
  height: 44px;
  min-height: 44px;
}
html :is(.save-status, .inline-error, [role="status"]):empty {
  display: none;
}
html .log-event-group .check-label {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 10px;
  margin: 14px 0;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}
html .log-event-group .check-label > input {
  flex: 0 0 auto;
  margin: 3px 0 0;
}
html .log-event-group .check-label > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
html .holiday-edit-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr) 44px;
  gap: 12px;
  align-items: end;
}
html .holiday-edit-row > button {
  height: 44px;
  width: 44px;
  margin: 0;
  align-self: end;
}
html .holiday-edit-row > label {
  min-width: 0;
  margin: 0;
}
html .action-chart-card > .card-header {
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
html .action-chart-card .action-category-tabs {
  flex: 0 0 auto;
  margin: 0;
}
html .action-chart-card .chart-with-tabs {
  display: contents;
}
html .restriction-actions {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}
html .restriction-actions .quick-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
html .restriction-actions .quick-title small {
  color: var(--muted);
  font-size: 11px;
  margin-left: 6px;
}
html .restriction-actions .button-row {
  justify-content: flex-start;
}
.restriction-type-mute .icon {
  color: #f1c40f;
}
.restriction-type-staff .icon {
  color: #ff861c;
}
.restriction-type-admin .icon {
  color: #f04b4f;
}
html .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
}
.logo-preview {
  object-fit: contain;
  max-width: 220px;
  max-height: 100px;
}
html #protection-form {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}
html #protection-form > fieldset {
  display: grid;
  gap: 18px;
  min-width: 0;
}
html .protection-rule fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.protection-fields {
  overflow: hidden;
}
.protection-fields[hidden] {
  display: none;
}
html .protection-rule > .helper {
  margin: 10px 0 14px;
}
html .native-rule-form > label + .helper,
html #protection-server + .helper {
  margin-top: 10px;
}
.option-kind {
  width: 18px;
  flex: 0 0 18px;
  color: var(--muted);
}
.select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.select-chip {
  font-size: 12px;
  min-height: 28px;
  padding: 4px 8px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.copy-fallback {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}
html button[aria-busy="true"] {
  cursor: progress;
}
.placeholder-inserted {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 5px;
}
.action-overlay-dialog {
  max-width: min(760px, calc(100vw - 32px));
}
/* Keep the shared mobile table rule from squeezing named action columns. */
html .table-wrap .member-actions-table {
  min-width: 1080px;
}
.restriction-server-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
@media (max-width: 520px) {
  html .holiday-edit-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  html .holiday-edit-row > label:first-child {
    grid-column: 1/-1;
  }
  html .action-chart-card > .card-header {
    align-items: flex-start;
  }
  html .restriction-actions {
    padding: 18px;
  }
  html .restriction-actions .quick-title {
    flex-wrap: wrap;
  }
  html .top-tools {
    align-items: center;
  }
}
html button[aria-busy="true"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html .protection-rule > .switch-option {
  font-size: 14px;
}
@media (max-width: 900px) {
  html .top-search input,
  html .searchbox input {
    font-size: 16px;
  }
}
html .card .admin-body > label + .helper {
  margin-top: 8px;
}
html #protection-form > button.primary {
  justify-self: start;
}

/* Fifteen-item polish: shared rows, controls and charts. */
html table.member-actions-table td,
html table.activity-table td {
  vertical-align: middle;
}
html .member-actions-table .log-actions {
  align-items: center;
}
html .action-overlay-dialog .button-row {
  align-items: center;
  gap: 12px;
}
html .action-overlay-dialog .history-controls,
html .action-overlay-dialog .history-controls button {
  margin: 0;
  align-self: center;
}
html .directory-footer,
html .directory-footer .directory-page-options,
html .directory-footer .pagination,
html .directory-footer .page-jump,
html .directory-footer .page-jump label,
html .directory-footer .directory-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
html .directory-footer {
  padding: 22px;
  flex-wrap: wrap;
  justify-content: space-between;
}
html .directory-footer .directory-page-options,
html .directory-footer .pagination {
  flex-wrap: wrap;
}
html .directory-footer .page-jump {
  flex-wrap: wrap;
}
html .directory-footer :is(button, input[type="number"]) {
  height: 38px;
  min-height: 38px;
  padding-block: 7px;
  line-height: 20px;
  margin: 0;
  box-sizing: border-box;
}
html .directory-footer .page-jump input {
  width: 58px;
  padding: 6px 7px;
}
html .directory-footer .directory-sort {
  flex-direction: row;
}
html .directory-footer .directory-sort .select-wrap {
  min-width: 78px;
}
html .top-search input {
  height: 24px;
  line-height: 24px;
  padding: 0;
  align-self: center;
  display: block;
}
html .top-search input::placeholder {
  line-height: inherit;
}
html .brand {
  gap: 12px;
}
html .brand-logo {
  width: 64px;
  height: 72px;
  object-fit: contain;
}
html button[aria-busy="true"] {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
html .loading-dot,
html button[aria-busy="true"]::after {
  display: inline-block;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  aspect-ratio: 1;
  flex: 0 0 16px;
  align-self: center;
  padding: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform-origin: center;
  rotate: none;
  scale: none;
  translate: none;
  animation: panel-spinner 0.7s linear infinite;
}
@keyframes panel-spinner {
  to {
    transform: rotate(360deg);
  }
}
html .ticket-trend {
  display: block;
  height: auto;
  min-width: 0;
  overflow: hidden;
  padding: 20px 20px 0;
}
html .ticket-trend .chart-scrub-head {
  height: 112px;
  min-height: 112px;
  padding: 0 0 12px;
  min-width: 0;
  overflow: hidden;
}
html .ticket-trend .chart-scrub-number {
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
html .ticket-trend .chart-scrub-head > div {
  display: block;
}
html .ticket-plot {
  display: flex;
  gap: 5px;
  height: 210px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 28px;
  align-items: stretch;
  overscroll-behavior-x: contain;
}
html .ticket-plot .ticket-period {
  min-width: 28px;
  flex: 1 0 28px;
}
html .ticket-period small {
  white-space: nowrap;
  font-size: 9px;
}
html .community-series {
  stroke: var(--series-community, #e9a45c);
}
html .community-area,
html .community-point {
  fill: var(--series-community, #e9a45c);
}
html .legend-community {
  background: var(--series-community, #e9a45c);
}
html .action-chart-card {
  display: flex;
  flex-direction: column;
}
html .action-chart-card .action-category-content {
  flex: 1;
  min-height: 0;
  display: flex;
}
html .action-chart-card .donut-chart {
  flex: 1;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
html .action-chart-card .donut-plot {
  width: min(100%, 250px);
  flex-shrink: 0;
}
html .action-chart-card .donut-total {
  font-size: 28px;
}
html .action-chart-card .donut-caption {
  font-size: 10px;
}
html .action-chart-card .donut-legend {
  gap: 5px 8px;
}
html .action-chart-card .donut-legend button {
  font-size: 11px;
}
html [data-save-log-events] {
  justify-self: start;
  width: auto;
}
/* Retain the existing stacked-card footprint. The tighter SVG view box makes
   the visible ring larger without requiring a taller mobile content area. */
@media (max-width: 1150px) {
  html .action-chart-card .action-category-content {
    min-height: 234px;
  }
  html .action-chart-card .donut-plot {
    width: 200px;
  }
  html .action-chart-card .donut-chart {
    gap: 20px;
  }
}
@media (max-width: 800px) {
  html .action-chart-card .action-category-content {
    min-height: 331px;
  }
  html .action-chart-card .donut-chart {
    gap: 4px;
  }
}
@media (max-width: 600px) {
  html .directory-footer {
    padding: 18px;
  }
  html .brand-logo {
    width: 60px;
    height: 68px;
  }
  html .action-chart-card .donut-legend {
    gap: 5px 8px;
    max-width: min(100%, 300px);
  }
  html .action-chart-card .donut-legend button {
    font-size: 10px;
    padding: 4px;
  }
  html .restriction-actions .quick-button {
    max-width: 100%;
  }
}
html .participant-name {
  font: inherit;
  font-weight: 600;
  padding: 2px 0;
  min-height: 32px;
  text-align: left;
  max-width: 100%;
}
html .participant-hover-card {
  position: fixed;
  z-index: 120;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
html .participant-hover-card[hidden] {
  display: none;
}
.participant-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.participant-card-identity > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.participant-card-identity .avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
.participant-card-identity small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 11px;
}
.participant-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.participant-card-actions .text-link {
  font-size: 12px;
}
html .participant-response .participant-name {
  flex: 0 1 auto;
  margin-right: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  width: auto;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.participant-card-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.participant-card-actions a .icon {
  width: 14px;
  height: 14px;
}
html .ticket-trend,
html .ticket-plot {
  touch-action: pan-x pan-y;
}
html .member-actions-table .action-staff > span:first-child {
  margin-top: 0;
}
html button[aria-busy="true"]:has(> svg:only-child) > svg {
  visibility: hidden;
}
html
  button[aria-busy="true"]:is(
    .icon-button-pending,
    :has(> svg:only-child)
  )::after {
  position: absolute;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  margin: 0;
}

/* Beta controls: stable state sizing, contextual navigation and calendar dates. */
html button.button-with-states {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  justify-items: stretch;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow: visible;
}
html button.button-with-states[hidden] {
  display: none;
}
html button.button-with-states[aria-busy="true"]::after {
  display: none;
  content: none;
}
.button-state-layer {
  grid-area: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  line-height: inherit;
}
.button-state-layer[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}
.button-state-label {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.button-spinner,
.button-success-icon {
  box-sizing: border-box;
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  align-self: center;
}
.button-spinner {
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform-origin: 8px 8px;
  animation: panel-spinner 0.7s linear infinite;
}
.button-state-layer[data-layer="reserve"] .button-spinner {
  animation: none;
}
.button-success-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html #setup-save-feedback:not(:empty) {
  margin: 22px 0 16px;
  line-height: 1.6;
}
html .setup-buttons {
  margin-top: 16px;
  gap: 10px;
  align-items: center;
}
.log-event-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px 20px;
  align-items: start;
  margin-top: 16px;
}
html .log-event-group .log-event-options > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  width: auto;
  min-width: 0;
  line-height: 1.5;
}
html .log-event-group .log-event-options > label input {
  align-self: flex-start;
  flex: 0 0 auto;
  margin: 3px 0 0;
}
.log-event-options > label span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.breadcrumb a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.breadcrumb strong {
  display: block;
  min-width: 0;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html .footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.footer-version {
  font: inherit;
  white-space: nowrap;
}
.stat-detail-dialog .quarter-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.quarter-total > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.quarter-total > strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.stat-detail-dialog:has(.quarter-total) .stat-detail-list {
  max-height: min(55dvh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
html .calendar-day.today {
  box-shadow: none;
}
html .calendar-day-number[aria-current="date"],
html .mini-month-grid > button[aria-current="date"] {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
}
html .calendar-day-number[aria-current="date"] {
  display: flex;
  width: max-content;
  margin-inline-start: auto;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 3px 7px;
}
html .time-grid-head > button.is-today {
  background: var(--accent-soft);
  color: var(--ink);
}
.today-label {
  display: inline-block;
  padding: 2px 6px;
  margin: 3px 4px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
}
html .mini-month-grid .has-events {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}
.mini-month-grid .has-events::before {
  content: "";
  position: absolute;
  bottom: 2px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.mini-month-grid .has-events[aria-current="date"]::before {
  background: #fff;
}
@media (max-width: 600px) {
  html .directory-footer :is(button, input[type="number"]) {
    height: 40px;
    min-height: 40px;
    padding-block: 8px;
  }
  .breadcrumb strong {
    max-width: 20ch;
  }
  .log-event-options {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .button-spinner {
    animation-duration: 1.4s;
  }
}

html .topbar .breadcrumb {
  max-width: none;
  min-width: 0;
  overflow: visible;
}
.breadcrumb ol {
  gap: 5px 8px;
}
.breadcrumb li {
  gap: 8px;
}
@media (max-width: 600px) {
  .topbar .breadcrumb {
    flex-basis: calc(100% - 70px);
  }
}

/* Button content is isolated from surrounding label/identifier span styles. */
html
  button.button-with-states
  :is(.button-state-layer, .button-state-label, .button-spinner) {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}
html button.button-with-states > .button-state-layer {
  display: flex;
}

/* Editor panels inherit their card; only the actual input surfaces are filled. */
html[data-theme] .rich-composer,
html[data-theme] .rich-composer .composer-section {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme] .rich-composer :is(h3, summary, label) {
  color: var(--ink);
}
html[data-theme] .rich-composer .format-toolbar {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme] .format-toolbar button {
  color: var(--ink);
}
html[data-theme] .format-toolbar button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
/* The wrapper must stay transparent; each rounded segment owns its own fill.
   Dropdowns remain in their existing portal and are never clipped here. */
html[data-theme] .time-picker,
html[data-theme] .time-picker > .select-wrap {
  background: transparent;
  overflow: visible;
}
html[data-theme] .time-picker > .select-wrap > .select-button {
  background: var(--field);
  border-radius: 8px;
}

.profile-actions {
  position: relative;
  flex: 0 0 auto;
  margin-inline-start: 8px;
}
html .profile-actions-trigger {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.profile-actions-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: 230px;
  max-width: calc(100vw - 32px);
  z-index: 70;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  box-shadow: var(--shadow);
}
.profile-actions-menu[hidden] {
  display: none;
}
html .profile-actions-menu button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  padding: 10px;
  font-size: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
}
html .profile-actions-menu button:hover {
  background: var(--accent-soft);
}
.associated-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.associated-account-row .associated-account {
  flex: 1;
  min-width: 0;
}
.member-merge-dialog p {
  color: var(--muted);
}
/* Keep review/confirmation in normal flow: the panel's generic sticky mobile
   footer otherwise covers the exact-ID field while it receives focus. */
.member-merge-dialog > .button-row {
  position: static;
}

.member-merge-dialog {
  width: min(660px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: 85dvh;
  overflow: auto;
}
.merge-search-results {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}
html button.merge-search-result {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  text-align: left;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
}
.merge-search-result span {
  color: var(--muted);
}
.merge-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.merge-profiles article {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  font-size: 12px;
}
.merge-profiles strong {
  overflow-wrap: anywhere;
}
.merge-profiles span {
  color: var(--muted);
}
.merge-consequence {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 12px;
}
@media (max-width: 600px) {
  .merge-profiles {
    grid-template-columns: 1fr;
  }
  .associated-account-row {
    flex-wrap: wrap;
  }
  .member-merge-dialog {
    padding: 20px;
    box-sizing: border-box;
  }
}

/* Explicit invitation variants in both themes; the legacy base badge is green. */
html .badge.red {
  color: #ff9aa5;
  background: #47262e;
  border-color: #76404c;
}
html[data-theme="light"] .badge.red {
  color: #9d2336;
  background: #fff0f2;
  border-color: #edb7c0;
}
html .page-heading:has(.profile-actions) {
  position: relative;
  padding-inline-end: 44px;
}
html .profile-actions {
  position: absolute;
  top: 5px;
  inset-inline-end: 0;
  margin: 0;
}
html .profile-actions-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
}
.profile-actions-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}
.profile-actions-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: block;
}
/* Reserve list scrollbars so a new scrollbar never changes text/mark columns. */
.pik-results,
.select-menu {
  scrollbar-gutter: stable;
}
.member-tool-dialog {
  width: min(780px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.dm-preset-list {
  padding: 12px 22px;
}
.dm-preset-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.dm-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  gap: 20px;
  align-items: start;
}
.dm-editor-layout > section:first-child {
  grid-column: 1/-1;
}
.dm-preview-card {
  position: sticky;
  top: 20px;
}
#dm-editor-form {
  display: grid;
  gap: 16px;
}
#dm-editor-form > .form-grid {
  gap: 16px;
}
html .dm-editor-row {
  display: grid;
  gap: 10px;
}
.member-tool-dialog form {
  display: grid;
  gap: 16px;
}
.member-dm-preview {
  padding: 18px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius, 10px);
  overflow-wrap: anywhere;
  margin: 16px 0;
}
html .member-dm-embed {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--embed-color, #0057e1);
  padding: 16px;
  border-radius: 6px;
  display: flow-root;
  background: var(--panel);
}
.member-dm-embed h3 {
  margin: 8px 0;
}
.dm-author,
.dm-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-author img,
.dm-footer img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.dm-thumbnail {
  float: right;
  width: 80px;
  max-height: 80px;
  object-fit: contain;
  margin-left: 10px;
}
.dm-image {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  margin-top: 12px;
}
.dm-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.dm-fields > div {
  grid-column: 1/-1;
}
.dm-fields > .dm-inline {
  grid-column: auto;
}
.dm-footer {
  margin-top: 12px;
}
.dm-url-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.dm-editor-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.trust-history-row {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.member-tool-dialog fieldset,
.dm-editor-layout fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  min-width: 0;
}
.member-tool-dialog [role="status"] {
  white-space: pre-line;
}
@media (max-width: 700px) {
  .dm-editor-layout {
    grid-template-columns: 1fr;
  }
  .dm-fields {
    grid-template-columns: 1fr;
  }
}
.time-entry[data-draggable-event] {
  cursor: grab;
  touch-action: none;
}
.time-entry[data-draggable-event] a {
  cursor: grab;
}
.time-entry.local-pending {
  outline: 1px dashed var(--accent, #0057e1);
  outline-offset: 1px;
}
.calendar-drag-ghost {
  opacity: 0.92;
  box-shadow: var(--shadow);
  cursor: grabbing;
}

@media (max-width: 1000px) {
  .dm-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .dm-preview-card {
    position: static;
  }
}

.profile-head > div:nth-child(2) {
  min-width: 0;
}
.profile-head h2 {
  overflow-wrap: anywhere;
}

.directory-name-cell .person {
  min-width: 0;
  max-width: 100%;
}
.directory-name-cell .person > span {
  min-width: 0;
}
.directory-name-cell .person small {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
