:root {
  --accent: #82C2BA;
  --accent-dark: #4fa59b;
  --accent-deep: #246b64;
  --accent-soft: #e9f7f5;
  --accent-very-soft: #f4fbfa;
  --bg: #f7faf9;
  --card: #ffffff;
  --text: #1d2d2b;
  --muted: #657875;
  --line: #dfecea;
  --danger: #b94a48;
  --danger-soft: #fff0ef;
  --warning: #8d6a18;
  --warning-soft: #fff7df;
  --shadow: 0 12px 28px rgba(28, 62, 57, 0.06);
  --shadow-soft: 0 8px 18px rgba(28, 62, 57, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --tracking-name-width: 150px;
  --tracking-session-width: 190px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  height: 100%;
  overscroll-behavior: none;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overscroll-behavior: none;
  width: 100%;
  overflow: hidden;
}

body.modal-open {
  overflow-x: hidden;
  overflow-y: hidden;
}

button,
input,
select,
textarea { font: inherit; }

button { border: 0; cursor: pointer; }

h1,
h2,
h3,
p { margin-top: 0; }

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
}

.app-shell > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 0;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 46px;
  padding: 0;
  text-align: left;
  color: var(--text);
  background: transparent;
}

.brand:hover {
  color: var(--text);
  background: transparent;
}

.brand-logo {
  width: 66px;
  height: 66px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: none;
}

.brand strong {
  display: block;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0.045em;
  font-weight: 850;
  color: #17302d;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
  line-height: 1.18;
}

.brand:hover strong { color: #17302d; }

.brand:hover span { color: var(--muted); }

.public-pairings .app-actions {
  display: none;
}

.public-pairings .nav-btn:not([data-tab="pairings"]) {
  display: none;
}

.share-link-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.app-version {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.app-version span:last-child,
.mobile-page-version span:last-child {
  font-style: italic;
  font-weight: 400;
}

.nav {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 720;
  transition: background 150ms ease, color 150ms ease;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.main {
  padding: 28px clamp(18px, 4vw, 46px) 48px;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-actions {
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 720;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid #d4ebe8;
}

.pill.muted {
  background: #eef3f2;
  color: var(--muted);
  border-color: var(--line);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(141, 106, 24, 0.16);
}

.pill.danger-pill {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(185, 74, 72, 0.2);
}

button.primary,
button.secondary,
a.secondary,
button.danger,
button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 730;
  text-decoration: none;
}

button.primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(77, 148, 141, 0.20);
}

button.primary:hover { background: #a5d3c9; }

button.secondary,
a.secondary {
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
}

button.secondary:hover,
a.secondary:hover {
  background: #f8fbfa;
  border-color: #cfe5e2;
}

button.ghost {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid #d4ebe8;
}

button.ghost:hover {
  background: var(--accent-soft);
}

button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(185, 74, 72, 0.14);
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card,
.block-card,
.dashboard-hero,
.mini-card,
.pairing-panel,
.session-col {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.card.compact {
  padding: 18px;
  border-radius: 12px;
  box-shadow: none;
  background: var(--accent-very-soft);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-header p,
.helper {
  color: var(--muted);
  margin-bottom: 0;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.dashboard-hero,
.overview-hero {
  padding: 22px;
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.overview-hero {
  grid-template-columns: 1fr auto;
  align-items: end;
  background:
    radial-gradient(circle at 12% 20%, rgba(130, 194, 186, 0.18), transparent 32%),
    rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.overview-hero h2 {
  margin: 4px 0 6px;
  font-size: 25px;
  line-height: 1.1;
}

.overview-hero p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-score {
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid #d4ebe8;
  border-radius: 14px;
  background: var(--accent-very-soft);
}

.overview-score strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.overview-score span {
  color: var(--accent-deep);
  font-weight: 730;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.78fr 0.78fr;
  gap: 16px;
}

.overview-panel {
  display: grid;
  gap: 14px;
}

.overview-panel.featured {
  min-height: 170px;
}

.overview-panel h3 {
  margin: 0;
}

.overview-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.timeline-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.timeline-item.next {
  background: var(--accent-soft);
  border-color: #cae5e1;
}

.timeline-item span {
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.timeline-item strong {
  color: var(--accent-deep);
  font-size: 12px;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf3f2;
}

.metric-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.metric-list span { color: var(--muted); }
.metric-list strong { font-size: 22px; }

.small-action {
  justify-self: start;
  min-width: 92px;
}

.hero-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hero-title h2 {
  margin-bottom: 5px;
  font-size: 22px;
  font-weight: 720;
}

.hero-title p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.hero-status {
  min-width: 220px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  color: var(--muted);
  border-bottom: 1px solid #edf3f2;
}

.status-line:last-child { border-bottom: 0; }
.status-line strong { color: var(--text); }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1fr;
  gap: 16px;
}

.kpi {
  display: grid;
  gap: 7px;
  min-height: 112px;
}

.kpi.featured {
  background: linear-gradient(135deg, var(--accent-soft), #ffffff);
}

.kpi strong {
  font-size: 31px;
  letter-spacing: -0.035em;
  line-height: 1;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi .helper {
  font-size: 13px;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 20px;
}

.dashboard-body.refreshed {
  align-items: start;
}

.pairing-panel {
  padding: 20px;
}

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

.panel-head h2 {
  margin-bottom: 4px;
  font-weight: 720;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

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

.session-col {
  padding: 14px;
  box-shadow: none;
  border-radius: 12px;
}

.session-col h3 {
  margin: 0 0 2px;
  color: var(--accent-deep);
  font-size: 15px;
}

.session-col .session-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.group-pill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  margin-bottom: 8px;
}

.group-pill.trio {
  background: var(--accent-soft);
  border-color: #d4ebe8;
}

.side-stack {
  display: grid;
  gap: 20px;
}

.mini-card {
  padding: 18px;
}

.mini-card h3 {
  margin-bottom: 12px;
}

.simple-list {
  display: grid;
  gap: 10px;
}

.simple-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #edf3f2;
}

.simple-row:last-child { border-bottom: 0; }
.simple-row span { color: var(--muted); }
.simple-row strong { color: var(--text); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

#participant-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 12px;
}

#participant-form .field:nth-child(4) {
  grid-column: span 1;
}

#participant-form .field,
#participant-form button {
  min-width: 0;
}

#participant-form button {
  width: 100%;
  align-self: end;
  justify-self: stretch;
  white-space: nowrap;
}

.form-grid.sessions { grid-template-columns: 220px 220px max-content; }

#session-date,
#session-title {
  display: block;
  box-sizing: border-box;
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
}

#session-date {
  -webkit-appearance: none;
  appearance: none;
}

.field { display: grid; gap: 6px; }

label {
  font-size: 12px;
  font-weight: 730;
  color: #4a5b59;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: white;
  color: var(--text);
  outline: none;
  min-height: 40px;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(130, 193, 186, 0.22);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: white;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fbfdfd;
}

tr:last-child td { border-bottom: 0; }

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

button.icon-btn {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0;
  border-radius: 9px;
  flex: 0 0 34px;
}

button.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
}

.save-participant,
.save-animators {
  color: var(--accent-deep);
  border-color: #b8ddd8;
}

.delete-participant,
.delete-session,
.delete-animators {
  color: var(--danger);
  border-color: #f0c2bf;
}

.edit-session {
  color: var(--text);
  border-color: var(--text);
  background: #fff;
}

.edit-session:hover {
  color: #000;
  border-color: #000;
  background: #fff;
}

.mini-icon-btn {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 9px;
}

.mini-icon-btn svg {
  width: 17px;
  height: 17px;
}

.edit-inline {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.edit-inline:hover {
  color: #000;
  background: transparent;
}

.edit-inline svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke-width: 1.9;
}

.compact-submit {
  width: 150px;
  min-width: 150px;
}

.participant-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.participant-kpis span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #d4ebe8;
  background: var(--accent-very-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 680;
}

.participant-kpis strong {
  font-size: 17px;
  color: var(--text);
}

.participant-toolbar {
  max-width: 700px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 280px 140px 220px;
  gap: 14px;
}

.participants-table td {
  padding: 7px 10px;
}

.participants-table input,
.participants-table select {
  min-height: 34px;
  padding: 7px 9px;
}

.participants-table {
  min-width: 1220px;
}

.participants-scroll {
  max-height: 52vh;
  overflow: auto;
}

.participants-table th:first-child,
.participants-table td:first-child {
  width: 44px;
  text-align: center;
}

.participants-table input[type="checkbox"] {
  appearance: none;
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  border: 1.5px solid #b7cbc8;
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.participants-table input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.participants-table input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.select-all-heading {
  cursor: pointer;
  user-select: none;
}

.dirty-row {
  background: #fbfffe;
  box-shadow: inset 3px 0 0 var(--accent);
}

.table-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.table-bottom-actions.align-right {
  justify-content: flex-end;
}

.archive-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.archive-panel > summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  list-style: none;
}

.archive-panel > summary::-webkit-details-marker {
  display: none;
}

.archive-panel > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  color: var(--accent-deep);
  transition: transform 0.18s ease;
}

.archive-panel[open] > summary::before {
  transform: rotate(90deg);
}

.archive-panel[open] {
  padding-bottom: 12px;
}

.archive-panel .blocks,
.archive-panel .archive-scroll {
  margin: 0 12px;
}

.archive-scroll {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sessions-page {
  display: grid;
  gap: 18px;
}

.session-entry-card {
  background:
    linear-gradient(135deg, rgba(130, 194, 186, 0.14), rgba(255, 255, 255, 0.92)),
    #fff;
}

.participant-entry-card {
  background:
    linear-gradient(135deg, rgba(130, 194, 186, 0.14), rgba(255, 255, 255, 0.92)),
    #fff;
}

.sessions-grid {
  align-items: start;
}

.sessions-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.sessions-scroll {
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
}

.sessions-scroll thead th,
.participants-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.sessions-table th,
.sessions-table td {
  padding: 8px 10px;
}

.sessions-table th:first-child,
.sessions-table td:first-child {
  width: 44px;
  text-align: center;
}

.sessions-table input[type="checkbox"] {
  appearance: none;
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  border: 1.5px solid #b7cbc8;
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-items: center;
}

.sessions-table input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.sessions-table input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.selected-row {
  background: var(--accent-very-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.session-date-cell strong,
.session-date-cell span,
.tracking-table .participant-heading strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.session-type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 760;
}

.session-type-pill.exchange {
  background: #fff2df;
  color: #9a651b;
  border: 1px solid #f3d9aa;
}

.session-block-card {
  background: linear-gradient(180deg, #fff, var(--accent-very-soft));
}

.session-chip {
  display: grid;
  gap: 2px;
  align-items: center;
  border-radius: 12px;
  padding: 9px 11px;
}

.session-chip strong {
  color: var(--accent-deep);
  font-size: 13px;
}

.session-chip small {
  color: var(--muted);
  font-size: 11px;
}

.pairings-page {
  display: grid;
  gap: 18px;
}

.pairings-intro {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(130, 194, 186, 0.16), rgba(255, 255, 255, 0.94)),
    #fff;
  box-shadow: var(--shadow);
}

.pairing-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pairing-rules article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #d4ebe8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.pairing-rules strong {
  color: var(--accent-deep);
  font-size: 14px;
}

.pairing-rules span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 730;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.status.stopped {
  background: #eeeeee;
  color: #707070;
}

.blocks {
  display: grid;
  gap: 14px;
}

.block-card {
  border-radius: 14px;
  padding: 16px;
}

.block-card h3 { margin-bottom: 8px; }

.pairing-block {
  box-shadow: none;
}

.pairing-block.archived {
  background: rgba(255, 255, 255, 0.72);
}

.pairing-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  list-style: none;
}

.pairing-block-head::-webkit-details-marker {
  display: none;
}

.pairing-block-head::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 25px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
}

.pairing-block[open] .pairing-block-head::before {
  transform: rotate(90deg);
}

.pairing-block-head > div {
  flex: 1;
}

.pairing-badges {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pairing-block-head h3 {
  margin: 0 0 8px;
}

.pairing-block-content {
  padding-left: 34px;
}

.date-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.date-chip {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--muted);
  background: #fbfdfd;
}

.group-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.group-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid #d4ebe8;
}

.group-item strong { color: var(--accent-deep); }

.pairing-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pairing-list li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.pairing-list li:last-child {
  border-bottom: 0;
}

.pairing-list strong {
  color: var(--accent-deep);
  font-size: 13px;
}

.pairing-list span {
  color: var(--text);
  font-size: 14px;
}

.pairing-adjustments {
  margin-top: 12px;
}

.pairing-adjustments > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.session-adjustments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.session-adjustment {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.session-adjustment h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
}

.adjustment-list {
  display: grid;
  gap: 6px;
}

.adjustment-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid #edf3f2;
}

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

.adjustment-row strong {
  color: var(--accent-deep);
  font-size: 12px;
}

.adjustment-row span {
  font-size: 13px;
}

.adjustment-row em {
  color: var(--warning);
  font-size: 12px;
  font-style: normal;
  font-weight: 730;
}

.adjustment-absences {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.animators-table {
  min-width: 640px;
}

.animators-table td {
  padding: 8px 10px;
}

.animators-table select {
  width: 50%;
  min-width: 190px;
}

.animators-table select {
  width: min(260px, 100%);
}

.mobile-nav,
.mobile-page-version {
  display: none;
}

.warning-box {
  border: 1px solid rgba(141, 106, 24, 0.2);
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  margin-top: 12px;
}

.message {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 730;
  border: 1px solid #d4ebe8;
}

.message.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(185, 74, 72, 0.14);
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 12px;
  font-weight: 900;
}

.check-list { display: grid; gap: 10px; }

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-dark);
}

.tracking-toolbar {
  max-width: 328px;
  display: grid;
  grid-template-columns: minmax(0, 280px) 40px;
  gap: 8px;
  align-items: end;
  margin-bottom: 18px;
}

.reason-settings-btn {
  align-self: end;
  margin-bottom: 0;
}

button.reason-settings-btn {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
}

.tracking-table-wrap {
  max-height: 70vh;
}

.tracking-table {
  min-width: max-content;
  table-layout: fixed;
}

.tracking-name-col {
  width: var(--tracking-name-width);
}

.tracking-session-col {
  width: 190px;
}

.tracking-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.tracking-table .participant-heading {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: var(--tracking-name-width);
  background: #fbfdfd;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text);
}

.tracking-date {
  display: block;
  color: var(--text);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.tracking-session-heading {
  vertical-align: top;
}

.tracking-summary {
  display: block;
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.tracking-unjustified {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.absence-cell {
  min-width: 190px;
}

.reason-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.reason-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfd;
}

.reason-item span {
  color: var(--text);
  font-size: 13px;
}

.reason-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact-btn {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}

.absence-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.absence-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  color: var(--text);
  font-weight: 400;
}

.absence-check input {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1.5px solid #b7cbc8;
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
}

.absence-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.absence-check input:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.absence-check span {
  font-weight: 400;
}

.absence-check.unjustified-absence span {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 42, 39, 0.26);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(28, 62, 57, 0.18);
}

.modal-card h3 {
  margin-bottom: 0;
  font-size: 22px;
}

.modal-error {
  margin: -2px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(185, 74, 72, 0.24);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.modal-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.modal-check input {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1.5px solid #b7cbc8;
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
}

.modal-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.modal-check input:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.modal-actions {
  justify-content: flex-end;
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.compact-list { margin-top: 12px; }

.group-item.temporary {
  background: var(--warning-soft);
  border-color: rgba(141, 106, 24, 0.18);
}

.group-item.temporary strong { color: var(--warning); }

code {
  display: inline-block;
  background: #eef3f2;
  color: #3c5653;
  padding: 4px 8px;
  border-radius: 8px;
}

@media (max-width: 1160px) {
  .kpi-grid,
  .overview-grid,
  .dashboard-body,
  .session-columns {
    grid-template-columns: 1fr;
  }

  .overview-timeline,
  .pairing-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body {
    padding-bottom: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    justify-content: center;
  }

  .brand {
    min-height: 58px;
    margin-bottom: 0;
    gap: 10px;
    align-items: center;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    flex: 0 0 52px;
  }

  .brand strong {
    font-size: 25px;
    letter-spacing: 0.04em;
  }

  .brand span {
    font-size: 13px;
    line-height: 1.18;
  }

  .sidebar .nav,
  .sidebar .app-version {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 40px rgba(28, 62, 57, 0.14);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-btn {
    min-height: 44px;
    padding: 7px 4px;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 780;
  }

  .mobile-nav-btn.active {
    background: var(--accent-soft);
    color: var(--accent-deep);
  }

  .mobile-settings-menu {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(220px, calc(100vw - 28px));
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(28, 62, 57, 0.16);
  }

  .mobile-settings-menu[hidden] { display: none; }

  .mobile-settings-menu button {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    font-weight: 720;
  }

  .mobile-settings-menu button:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
  }

  .mobile-page-version {
    display: block;
    margin-top: 24px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-align: center;
  }

  .mobile-page-version span {
    display: block;
  }

  .top-actions { justify-content: flex-start; }

  .hero-head {
    flex-direction: column;
  }

  .hero-status {
    min-width: 0;
    width: 100%;
  }

  .grid.two,
  .grid.three,
  .form-grid,
  .form-grid.sessions,
  #participant-form {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px 14px 110px;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100vw;
    height: 100%;
    min-height: 0;
  }

  .card,
  .tab-panel,
  .field,
  input,
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
  }

  .participant-toolbar {
    max-width: none;
    grid-template-columns: 1fr;
  }

  .tracking-toolbar {
    max-width: none;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .participant-kpis {
    justify-content: flex-start;
  }

  .compact-submit {
    width: 100%;
  }

  .overview-hero,
  .overview-timeline,
  .pairing-rules {
    grid-template-columns: 1fr;
  }

  table { min-width: 700px; }

  .animators-wrap {
    overflow-x: hidden;
  }

  .animators-table {
    min-width: 0;
    width: 100%;
  }

  .animators-table thead {
    display: none;
  }

  .animators-table,
  .animators-table tbody,
  .animators-table tr,
  .animators-table td {
    display: block;
  }

  .animators-table tr {
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdfd;
    box-shadow: var(--shadow-soft);
  }

  .animators-table td {
    padding: 7px 0;
    border: 0;
  }

  .animators-table .session-date-cell span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 750;
  }

  .animators-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .animators-table select {
    width: 100%;
    min-width: 0;
  }

  .sessions-table {
    min-width: 0;
    width: 100%;
  }

  .form-grid.sessions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .form-grid.sessions .field,
  .form-grid.sessions .compact-submit {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
  }

  .form-grid.sessions .field {
    overflow: hidden;
  }

  .form-grid.sessions input[type="date"],
  .form-grid.sessions select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
    max-inline-size: 100%;
  }

  .form-grid.sessions input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
  }

  .session-entry-card,
  .sessions-grid,
  .sessions-page {
    min-width: 0;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-bottom-actions {
    align-items: stretch;
  }

  .table-bottom-actions .row-actions,
  .table-bottom-actions button {
    width: 100%;
  }

  .table-bottom-actions .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
