@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --stone-50: #faf9f7;
  --stone-100: #f0ebe3;
  --stone-200: #e4ddd3;
  --stone-400: #9a9288;
  --stone-500: #6b645c;
  --stone-600: #5c554d;
  --stone-800: #2c2825;
  --terracotta: #c45c3e;
  --terracotta-dark: #a84a30;
  --terracotta-soft: rgba(196, 92, 62, 0.12);
  --white: #ffffff;
  --danger-bg: #fce8e4;
  --danger-text: #9b3d28;
  --success-bg: #e8f3ec;
  --success-text: #2d6a4f;
  --warn-bg: #faf0e4;
  --warn-text: #8a5a20;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 24px rgba(44, 40, 37, 0.08), 0 1px 3px rgba(44, 40, 37, 0.04);
  --shadow-btn: 0 4px 14px rgba(196, 92, 62, 0.35);
  --font-body: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--stone-800);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(165deg, var(--stone-100) 0%, var(--stone-50) 45%, var(--white) 100%);
  background-attachment: fixed;
}

button, input, textarea { font: inherit; }
button { touch-action: manipulation; cursor: pointer; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { margin-bottom: 0; font-size: clamp(1.5rem, 5vw, 1.85rem); line-height: 1.15; }
h2 { margin-bottom: 8px; font-size: 1.25rem; }
p { margin-top: 0; }

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.app-shell.setup-shell {
  width: min(440px, 100%);
}

.setup-shell {
  width: min(440px, 100%);
  margin-inline: auto;
}

.setup-hero {
  text-align: center;
  margin-bottom: 28px;
  padding: 8px 8px 0;
}

.setup-hero .brand-logo {
  height: 36px;
  width: auto;
  margin-bottom: 20px;
}

.setup-hero h1 {
  font-size: clamp(1.85rem, 7vw, 2.2rem);
  font-weight: 700;
  margin: 0;
}

.setup-hero .lead {
  margin: 12px 0 0;
  color: var(--stone-600);
  font-size: 1.02rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.topbar, .section-heading, .counter-meta, .row, .action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar { margin-bottom: 18px; }

.eyebrow {
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-600);
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.setup-card { padding: 24px 22px 28px; }

label {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--stone-800);
}

.field-label {
  display: block;
  line-height: 1.3;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--stone-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--stone-50);
  color: var(--stone-800);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  accent-color: var(--terracotta);
  cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--terracotta);
  background: var(--white);
}

input:read-only { background: var(--stone-100); color: var(--stone-600); }

input::placeholder,
textarea::placeholder {
  color: var(--stone-500);
  opacity: 1;
}

.button, .icon-button {
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: background 0.12s ease, transform 0.08s ease;
}

.button { padding: 14px 16px; }
.button:active { transform: scale(0.98); }

.primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: var(--shadow-btn);
}

.primary:active { background: var(--terracotta-dark); }

.secondary {
  background: var(--stone-100);
  color: var(--stone-800);
}

.secondary:active { background: var(--stone-200); }

.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.full-width { width: 100%; margin-top: 16px; }

.icon-button {
  width: 44px;
  height: 44px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  color: var(--stone-800);
  font-size: 1.1rem;
}

.row > * { flex: 1; }
.hidden { display: none !important; }

.banner {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-weight: 600;
  font-size: 0.92rem;
}

.status-pill {
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.label {
  display: block;
  color: var(--stone-600);
  font-size: 0.82rem;
  font-weight: 700;
}

.counts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0 18px;
}

.count-block {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: var(--stone-100);
}

.count-block.primary-count {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: var(--shadow-btn);
}

.count-block.primary-count .label { color: rgba(255, 255, 255, 0.95); }

.count-value {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 14vw, 4rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.count-value.secondary {
  color: var(--stone-800);
  font-size: clamp(2rem, 10vw, 3rem);
}

.counter-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.counter-button {
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  transition: transform 0.08s ease;
}

.counter-button:active { transform: scale(0.96); }

.counter-button span {
  font-size: clamp(4rem, 18vw, 5.5rem);
  line-height: 0.7;
  font-weight: 300;
}

.counter-button small {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.entry-button {
  background: var(--terracotta);
  box-shadow: 0 16px 36px rgba(196, 92, 62, 0.35);
}

.exit-button {
  background: var(--stone-800);
  box-shadow: 0 16px 36px rgba(44, 40, 37, 0.2);
}

.exit-button.opacity-50,
.exit-button:disabled {
  opacity: 0.5;
}

.tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  background: var(--stone-100);
  border-radius: var(--radius-pill);
  padding: 5px;
}

.tab-bar.settings-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-left: 0;
  margin-right: 0;
  padding: 6px 10px;
}

.tab-bar.settings-tabs::-webkit-scrollbar {
  display: none;
}

.tab-bar.settings-tabs .tab-button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  white-space: nowrap;
  padding: 11px 16px;
}

.tab-button {
  flex: 1;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 11px 10px;
  background: transparent;
  color: var(--stone-600);
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 0;
}

.tab-button.active {
  background: var(--white);
  color: var(--stone-800);
  box-shadow: 0 2px 8px rgba(44, 40, 37, 0.08);
}

.tab-panel .lead,
.tab-panel > p:not(.help) {
  margin: 0 0 20px;
  color: var(--stone-600);
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.optional, .hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--stone-600);
}

.required {
  color: var(--terracotta);
  font-weight: 700;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo { flex-shrink: 0; height: 32px; width: auto; }

.app-header.topbar-b {
  margin-bottom: 18px;
}

.topbar-b .top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-logo-header {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.venue-band {
  text-align: center;
  padding: 18px 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--stone-100);
}

.venue-band .eyebrow {
  margin: 0 0 6px;
}

.venue-band h1 {
  font-size: clamp(1.65rem, 6vw, 2rem);
  margin: 0;
  line-height: 1.12;
  text-wrap: pretty;
}

.team-code-block {
  margin: 20px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--stone-50);
  border: 1.5px solid var(--stone-100);
}

.team-code-block .label {
  display: block;
  margin-bottom: 8px;
}

.team-code-block .help {
  margin: 8px 0 0;
  font-size: .85rem;
}

.team-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-code-row code,
#settingsTeamCodeDisplay,
#createdTeamCodeDisplay {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1.5px solid var(--stone-100);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--stone-800);
  user-select: all;
  overflow-x: auto;
}

.team-code-row .button {
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: .85rem;
}

.team-code-block.compact {
  margin-top: 12px;
  margin-bottom: 0;
}

.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.header-btn { padding: 10px 14px; font-size: 0.88rem; }

.interval-picker {
  display: flex;
  gap: 6px;
  margin: 1rem 0 16px;
  background: var(--stone-100);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
}

.interval-picker.scroll-snap {
  overflow-x: auto;
  flex-wrap: nowrap;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-inline: 10px;
}

.interval-picker.scroll-snap::-webkit-scrollbar {
  display: none;
}

.interval-button {
  flex: 1;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  background: transparent;
  color: var(--stone-600);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}

.interval-picker.scroll-snap .interval-button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: max-content;
}

.interval-button.active {
  background: var(--white);
  color: var(--stone-800);
  box-shadow: 0 1px 4px rgba(44, 40, 37, 0.1);
}

.action-row {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.action-row .button {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  font-size: 0.88rem;
}

.last-action {
  text-align: center;
  color: var(--stone-800);
  margin: 16px 0 0;
  min-height: 24px;
  font-size: 0.92rem;
}

.activity-log-wrap {
  margin: 16px 0 0;
}

.activity-log-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-600);
}

.activity-log {
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.last-team-activity {
  margin: 0 0 4px;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--stone-800);
  min-height: 1.45em;
}

.activity-log-label-spaced {
  margin-top: 18px;
}

.my-activity-list {
  border: 1.5px solid var(--stone-100);
  border-radius: var(--radius-md);
  background: var(--stone-50);
  max-height: 168px;
  overflow: auto;
}

.my-activity-list .activity-item {
  padding: 9px 12px;
}

.my-activity-list .activity-item time {
  margin-left: auto;
}

.report-tabs {
  margin-bottom: 12px;
}

#reportPage .tab-panel.hidden {
  display: none;
}

.report-chart-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stone-100);
}

.report-chart-wrap--after-summary {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.activity-log-list {
  display: flex;
  flex-direction: column;
  max-height: min(60vh, 520px);
  overflow: auto;
  border: 1px solid var(--stone-100);
  border-radius: var(--radius-md);
  background: var(--stone-50);
}

.chart-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-600);
}

.chart-canvas-wrap {
  position: relative;
  height: 220px;
}

.chart-canvas-wrap-tall {
  height: 280px;
}

.audit-report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow: auto;
}

.audit-report-item {
  padding: 12px 14px;
  border: 1.5px solid var(--stone-100);
  border-radius: var(--radius-md);
  background: var(--stone-50);
}

.audit-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.audit-report-head time {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--stone-600);
  font-variant-numeric: tabular-nums;
}

.audit-report-meta {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--stone-600);
}

.staff-report td.positive,
#staffReportTable td.positive { color: #2d6a4f; }
.staff-report td.negative,
#staffReportTable td.negative { color: var(--terracotta); }

.activity-empty {
  margin: 0;
  padding: 14px 12px;
  text-align: center;
  color: var(--stone-800);
  font-size: 0.9rem;
}

.activity-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stone-100);
  font-size: 0.88rem;
  color: var(--stone-800);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item strong {
  font-weight: 700;
  min-width: 2.2rem;
}

.activity-item strong.entry {
  color: var(--terracotta);
}

.activity-item strong.exit {
  color: var(--stone-800);
}

.activity-item time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--stone-600);
  font-size: 0.82rem;
}

.activity-item span {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-weight: 600;
}

.activity-status {
  margin: 8px 0 0;
  text-align: center;
  color: var(--stone-600);
  font-size: 0.85rem;
  font-weight: 600;
}

.activity-status.hidden {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.summary-grid > div {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--stone-100);
}

.summary-grid span {
  display: block;
  color: var(--stone-600);
  font-size: 0.75rem;
  font-weight: 600;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.staff-report {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stone-100);
}

.staff-report .panel-title {
  margin-bottom: 12px;
}

.staff-report td.positive { color: #2d6a4f; }
.staff-report td.negative { color: var(--terracotta); }

.table-wrap { overflow: auto; max-height: 440px; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--stone-100);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--white);
  font-size: 0.78rem;
  color: var(--stone-600);
  font-weight: 700;
}

td {
  color: var(--stone-800);
}

td:nth-child(2), th:nth-child(2) { text-align: center; }
td:last-child, th:last-child { text-align: right; }

.empty-state {
  padding: 34px 10px;
  text-align: center;
  color: var(--stone-800);
}

dialog {
  width: min(560px, calc(100% - 24px));
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 24px 64px rgba(44, 40, 37, 0.18);
}

dialog.settings-fullscreen {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
}

dialog::backdrop { background: rgba(44, 40, 37, 0.45); }

.dialog-card { padding: 22px 20px; }

.settings-dialog {
  min-height: 100dvh;
  max-height: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-header {
  padding: 18px 20px 12px;
  flex-shrink: 0;
}

.settings-body {
  flex: 1;
  overflow: auto;
  padding: 0 20px 20px;
  min-height: 0;
}

.settings-footer {
  flex-shrink: 0;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--stone-100);
  background: var(--white);
}

dialog.lock-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--stone-50);
}

dialog.lock-dialog::backdrop {
  background: var(--stone-50);
}

.lock-dialog-card {
  min-height: 100dvh;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0));
  box-shadow: none;
  background: transparent;
}

.field-error {
  margin: -4px 0 12px;
  color: var(--danger-text);
  font-size: 0.88rem;
  font-weight: 600;
}

.field-error.hidden {
  display: none;
}

input.input-error {
  border-color: var(--danger-text);
  background: #fff7f6;
}

.settings-dialog .tab-bar.settings-tabs {
  flex-shrink: 0;
  margin: 0 16px 16px;
  padding: 6px 10px;
  scroll-padding-inline: 10px;
}

.panel-title {
  margin: 24px 0 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.panel-title:first-child {
  margin-top: 0;
}

.inline-actions {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
}

.inline-actions .button {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  font-size: 0.88rem;
}

.code-input {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: all;
  margin-bottom: 10px;
}

.members-list .member-item,
.audit-list .audit-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--stone-100);
  font-size: 0.88rem;
}

.members-list .member-item strong {
  display: block;
  font-family: var(--font-display);
}

.members-list .member-item span,
.members-list .member-item small {
  display: block;
  color: var(--stone-600);
  font-size: 0.82rem;
  margin-top: 4px;
}

.members-list .role-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--stone-100);
  color: var(--stone-800);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.members-list .role-pill.pending {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.member-actions {
  margin-top: 10px;
  gap: 8px;
}

.member-actions .button {
  flex: 0 1 auto;
  padding: 10px 14px;
  font-size: 0.85rem;
}

.dialog-card h2 { margin-top: 0; }

.settings-dialog .tab-panel {
  min-width: 0;
}

#inviteLinkInput {
  overflow: hidden;
  text-overflow: ellipsis;
}

.confirm-dialog { text-align: center; }

.notice-dialog #noticeMessage {
  margin: 0 0 20px;
  white-space: pre-wrap;
}

#createdInviteLinkInput {
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}

.confirm-dialog p {
  margin: 0 0 20px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .button { flex: 1; min-width: 0; }

.help {
  color: var(--stone-600);
  font-size: 0.9rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.filter-window-row {
  --filter-control-h: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stone-100);
}

.filter-window-row.has-remove {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--filter-control-h);
}

.filter-window-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.filter-window-row label,
.filter-window-remove {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.filter-window-row label {
  margin: 0;
  font-size: 0.82rem;
}

.filter-window-spacer {
  visibility: hidden;
  user-select: none;
}

.filter-window-row input[type="time"] {
  box-sizing: border-box;
  height: var(--filter-control-h);
  min-width: 0;
  width: 100%;
  padding: 0 12px;
}

.filter-window-row .remove-window {
  box-sizing: border-box;
  width: var(--filter-control-h);
  height: var(--filter-control-h);
  min-width: var(--filter-control-h);
  padding: 0;
  border: 1.5px solid var(--stone-100);
  background: var(--stone-50);
  box-shadow: none;
  color: var(--stone-600);
  font-size: 1rem;
  line-height: 1;
}

.filter-window-row .remove-window:active {
  background: var(--stone-100);
  transform: scale(0.98);
}

.saved-filters { margin-top: 16px; }

.saved-filter-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--stone-100);
  margin-bottom: 10px;
}

.saved-filter-item strong { font-family: var(--font-display); }

.saved-filter-item span {
  display: block;
  color: var(--stone-600);
  font-size: 0.85rem;
  margin: 6px 0 10px;
}

.saved-filter-actions {
  margin: 0;
  gap: 8px;
}

.saved-filter-actions .button {
  flex: 0 1 auto;
  padding: 10px 14px;
  font-size: 0.85rem;
}

.audit-list { margin-top: 16px; max-height: 200px; overflow: auto; }

.audit-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--stone-100);
  font-size: 0.88rem;
}

.audit-item small { display: block; color: var(--stone-600); }

.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin: 12px 0;
}

.checkbox-row input[type="checkbox"] {
  box-sizing: border-box;
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  max-width: 1.125rem;
  flex: 0 0 1.125rem;
  margin: 3px 0 0;
  padding: 0;
  align-self: flex-start;
}

.checkbox-row .checkbox-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--stone-800);
  text-align: left;
  cursor: pointer;
}

.checkbox-row:has(input[type="checkbox"]:disabled) .checkbox-text {
  color: var(--stone-600);
  cursor: not-allowed;
}

button:disabled {
  cursor: not-allowed;
}

button.primary:disabled {
  background: var(--stone-200);
  color: var(--stone-800);
  box-shadow: none;
}

button.secondary:disabled {
  background: var(--stone-100);
  color: var(--stone-600);
}

.tab-button:disabled {
  color: var(--stone-600);
}

.report-card,
#reportPage .report-card { overflow: hidden; }

.report-card .section-heading {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

.report-card .section-heading > div { min-width: 0; }

.report-date-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.report-card .report-date-field input[type="date"],
#reportPage .report-date-field input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.report-card .report-date-field input[type="date"]::-webkit-date-and-time-value,
#reportPage .report-date-field input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

@media (max-width: 520px) {
  .summary-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .row > * { width: 100%; }
  .count-block { padding: 14px 8px; }
  .count-value { font-size: clamp(2rem, 11vw, 2.8rem); }
  .count-value.secondary { font-size: clamp(1.6rem, 9vw, 2.2rem); }
  .counter-button span { font-size: clamp(2.6rem, 14vw, 3.8rem); }
  .topbar-b .top-row { flex-wrap: wrap; }
  .header-actions { margin-left: auto; }
  .team-code-row { flex-direction: column; align-items: stretch; }
  .counter-button small { font-size: 0.82rem; margin-top: 8px; }
  .report-date-field input[type="date"] { font-size: 16px; padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .counter-button { transition: none; }
}
