:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5b6b7c;
  --line: #d7dde5;
  --brand: #1f3a5f;
  --brand-2: #2c5282;
  --accent: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.08);
  --radius: 14px;
  --font: "Vazirmatn", "Tahoma", sans-serif;
}

* { box-sizing: border-box; }
html { direction: rtl; }
html, body { max-width: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(31, 58, 95, 0.12), transparent 60%),
    radial-gradient(900px 400px at 0% 100%, rgba(15, 118, 110, 0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.nav-locked { overflow: hidden; touch-action: none; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* Mobile top bar — hidden on desktop */
.mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 0.65rem 0.9rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  background: linear-gradient(180deg, #132742 0%, #1f3a5f 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(20, 32, 51, 0.18);
}
.mobile-bar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
}
.mobile-bar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #fff;
  border-radius: 7px;
  padding: 2px;
}
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.app-shell.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.app-shell.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.app-shell.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(20, 32, 51, 0.45);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.sidebar {
  background: linear-gradient(180deg, #132742 0%, #1f3a5f 100%);
  color: #e8eef7;
  padding: 1.4rem 1rem;
  padding-bottom: max(1.4rem, env(safe-area-inset-bottom));
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.brand {
  margin: 0.2rem 0.4rem 1.4rem;
}
.brand-logos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}
.brand-text .brand-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.brand small {
  display: block;
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}
.nav a {
  display: block;
  color: #d7e2f2;
  padding: 0.75rem 0.85rem;
  min-height: 44px;
  border-radius: 10px;
  margin-bottom: 0.25rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
.nav a:hover { transform: translateX(-2px); }
.main {
  padding: 1.4rem 1.6rem 2.5rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}
.main > * {
  animation: fadeRise 0.22s ease both;
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.45rem; }
.muted { color: var(--muted); }

.flash-stack { margin-bottom: 1rem; display: grid; gap: 0.45rem; }
.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  animation: fadeRise 0.2s ease;
}
.flash.success { background: #ecfdf5; border-color: #a7f3d0; color: var(--ok); }
.flash.error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
a.kpi-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.kpi-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: #b7c4d6;
  box-shadow: 0 14px 34px rgba(20, 32, 51, 0.12);
}
.kpi .label { color: var(--muted); font-size: 0.85rem; }
.kpi .value { font-size: 1.6rem; font-weight: 800; margin-top: 0.35rem; }
.kpi .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.kpi.stale {
  background: #fef2f2;
  border-color: #fecaca;
}
.kpi.stale .value,
.kpi.stale .hint { color: var(--danger); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  overflow: visible;
  position: relative;
}
.panel h2 { margin: 0 0 0.8rem; font-size: 1.05rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  overflow: visible;
  align-items: flex-start;
  position: relative;
}
.filters .jalali-date-input,
.filters .jdp-wrap {
  width: 10.5rem;
  max-width: 100%;
  flex: 0 1 10.5rem;
  min-width: 0;
}
.filters input, .filters select, .filters button, .btn, .login-card input {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 42px;
}
.btn, .filters button {
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 0.55rem 0.95rem;
  min-height: 42px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover, .filters button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 58, 95, 0.22);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn.secondary { background: #415a77; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th, table.data td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
table.data td:last-child,
table.data th:last-child {
  white-space: normal;
}
table.data th { color: var(--muted); font-weight: 600; background: #f7f9fc; }
.thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #dbe3ee;
  display: inline-block;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e8eef7;
}
.badge.ok { background: #d1fae5; color: var(--ok); }
.badge.warn { background: #ffedd5; color: var(--warn); }
.badge.pending { background: #e2e8f0; color: var(--muted); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}
.gallery figure {
  margin: 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.gallery img { width: 100%; display: block; max-height: 260px; object-fit: cover; }
.gallery figcaption { padding: 0.5rem 0.7rem; font-size: 0.82rem; color: var(--muted); }
.pending-box {
  height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 8px, #e2e8f0 8px, #e2e8f0 16px);
}

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  animation: fadeRise 0.25s ease;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}
.login-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}
.login-card h1 { margin: 0 0 0.15rem; }
.login-card label { display: block; margin: 0.8rem 0 0.3rem; color: var(--muted); font-size: 0.9rem; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; margin-top: 1rem; }
.error { color: var(--danger); margin-top: 0.7rem; }

.season-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 50px rgba(20, 32, 51, 0.25);
}
.season-dialog::backdrop { background: rgba(20, 32, 51, 0.45); }
.season-dialog form { padding: 1.25rem 1.35rem 1.35rem; }
.season-dialog h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.season-dialog label { display: block; margin: 0.9rem 0 0.35rem; color: var(--muted); font-size: 0.9rem; }
.season-dialog input[type="password"] {
  width: 100%; font: inherit; padding: 0.55rem 0.7rem;
  border-radius: 10px; border: 1px solid var(--line);
}
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.chart-panel.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: hidden !important;
  contain: inline-size;
}
.chart-panel h2 {
  flex: 0 0 auto;
}
.chart-canvas-host {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 240px;
  flex: 0 0 auto;
  overflow: hidden;
}
.chart-canvas-host > canvas {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
.chart-panel--table {
  overflow: hidden !important;
}
.chart-panel--table .table-scroll {
  max-width: 100%;
}

/* Iranian plate badges (display) */
.plate-badge {
  display: inline-flex;
  align-items: stretch;
  direction: ltr;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  vertical-align: middle;
  max-width: 100%;
  line-height: 1;
  font-family: var(--font);
}
.plate-badge-strip {
  background: #003399;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 5px;
  font-weight: 700;
  line-height: 1.1;
  padding: 2px 3px;
  min-width: 18px;
  flex-shrink: 0;
}
.plate-badge-strip .flag {
  display: flex;
  flex-direction: column;
  width: 12px;
  height: 7px;
  margin-bottom: 2px;
  border: 1px solid rgba(255,255,255,.35);
}
.plate-badge-strip .flag span { flex: 1; }
.plate-badge-strip .flag .g { background: #239F40; }
.plate-badge-strip .flag .w { background: #fff; }
.plate-badge-strip .flag .r { background: #DA0000; }
.plate-badge-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.2rem 0.4rem;
  flex: 1;
  min-width: 0;
}
.plate-badge-body--full { padding: 0.35rem 0.55rem; }
.plate-badge-region {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e8eef7;
  border-right: 1px solid #111;
  padding: 0.15rem 0.35rem;
  min-width: 1.7rem;
  flex-shrink: 0;
}
.plate-badge .pb-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.plate-badge .pb-letter {
  font-weight: 800;
  color: #065f46;
  background: #e8f5ee;
  border: 1px solid #059669;
  border-radius: 3px;
  padding: 0.1rem 0.28rem;
}
.plate-badge .pb-iran {
  font-size: 0.45em;
  color: #1f3a5f;
  margin-bottom: 1px;
}
.plate-badge--sm {
  font-size: 0.78rem;
  border-width: 1.5px;
  border-radius: 5px;
}
.plate-badge--sm .plate-badge-strip { min-width: 14px; font-size: 4px; padding: 1px 2px; }
.plate-badge--sm .plate-badge-strip .flag { width: 9px; height: 5px; }
.plate-badge--sm .plate-badge-body { gap: 0.18rem; padding: 0.12rem 0.28rem; }
.plate-badge--sm .plate-badge-region { min-width: 1.35rem; padding: 0.1rem 0.22rem; }
.plate-badge--sm .pb-letter { padding: 0.05rem 0.18rem; font-size: 0.85em; }
.plate-badge--md { font-size: 0.95rem; }
.plate-badge--lg { font-size: 1.15rem; }
.plate-badge--raw {
  border-color: #64748b;
}
.plate-badge--raw .plate-badge-body--full .pb-num {
  font-size: 0.9em;
  font-weight: 700;
}
td .plate-badge { max-width: 220px; }
table.data td:has(.plate-badge) { white-space: normal; }
.topbar h1 .plate-badge { vertical-align: middle; margin-inline-start: 0.35rem; }

/* —— GitHub-style contribution calendar (RTL) —— */
.report-kpis .value { font-variant-numeric: tabular-nums; }
.contrib-panel { overflow: visible; }
.contrib-head h2 { margin-bottom: 0.25rem; }
.contrib-head .muted { margin: 0 0 1rem; }
.contrib-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.35rem;
  direction: rtl;
}
.contrib-graph {
  display: inline-block;
  min-width: min(100%, 720px);
  padding: 0.25rem 0.15rem 0.5rem;
}
.contrib-body {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.contrib-weekdays {
  display: grid;
  grid-template-rows: 1.1rem repeat(7, 11px);
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 11px;
  text-align: center;
  width: 1.1rem;
  flex-shrink: 0;
}
.contrib-weekdays span {
  height: 11px;
  visibility: hidden;
}
.contrib-weekdays span.month-spacer {
  height: 1.1rem;
  visibility: hidden;
}
.contrib-weekdays span.show { visibility: visible; }
.contrib-weeks {
  display: flex;
  flex-direction: row;
  gap: 3px;
  align-items: flex-start;
}
.contrib-week {
  display: grid;
  grid-template-rows: 1.1rem repeat(7, 11px);
  gap: 3px;
}
.contrib-month-slot {
  height: 1.1rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.1rem;
  white-space: nowrap;
  overflow: visible;
}
.contrib-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: block;
  box-sizing: border-box;
  border: 1px solid rgba(27, 31, 35, 0.06);
  background: #ebedf0;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.contrib-cell:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 1px #1f3a5f;
  z-index: 2;
  position: relative;
}
.contrib-cell.empty {
  background: transparent;
  border-color: transparent;
}
.contrib-cell.level-0 { background: #ebedf0; }
.contrib-cell.level-1 { background: #c6ddf7; }
.contrib-cell.level-2 { background: #7eb6e8; }
.contrib-cell.level-3 { background: #3d8fd1; }
.contrib-cell.level-4 { background: #1e6bb8; }
.contrib-cell.level-5 { background: #0B3A6E; }
.contrib-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.contrib-legend .contrib-cell {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.contrib-range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.contrib-range-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
button.contrib-cell {
  padding: 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.contrib-selectable .contrib-cell[data-date]:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 1px #1f3a5f;
  z-index: 2;
  position: relative;
}
.contrib-cell.in-range {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.55);
  position: relative;
  z-index: 1;
}
.contrib-cell.range-edge {
  box-shadow: 0 0 0 2px #0f766e;
  outline: 1px solid #fff;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .mobile-bar { display: flex; grid-column: 1; grid-row: 1; }

  .nav-backdrop {
    display: block;
  }
  .app-shell:not(.nav-open) .nav-backdrop { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: min(300px, 88vw);
    height: 100%;
    height: 100dvh;
    z-index: 1000;
    transform: translateX(110%);
    transition: transform 0.25s ease;
    box-shadow: -12px 0 40px rgba(20, 32, 51, 0.28);
    padding-top: max(1.2rem, env(safe-area-inset-top));
  }
  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    grid-column: 1;
    grid-row: 2;
    padding: 1rem 0.85rem 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .topbar h1 { font-size: 1.2rem; line-height: 1.35; }
  .topbar-actions {
    width: 100%;
  }
  .topbar-actions .btn,
  .topbar .btn {
    width: 100%;
    text-align: center;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .kpi {
    padding: 0.85rem 0.9rem;
  }
  .kpi .value { font-size: 1.35rem; }

  .panel {
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
  }

  .filters {
    gap: 0.5rem;
  }
  .filters > input,
  .filters > select,
  .filters > button,
  .filters > .btn,
  .filters > .jdp-wrap,
  .filters > .plate-input-ir,
  .filters .jalali-date-input {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .filters .jdp-wrap { flex-basis: 100%; }
  .filters input[style*="width"] {
    width: 100% !important;
  }

  .contrib-range-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .contrib-range-form {
    flex-wrap: wrap;
    width: 100%;
  }
  .contrib-range-form .btn,
  .contrib-range-form a.btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .table-scroll {
    margin-inline: -0.15rem;
    padding-bottom: 0.15rem;
  }
  .table-scroll table.data {
    min-width: 680px;
  }
  table.data th, table.data td {
    padding: 0.7rem 0.6rem;
    font-size: 0.88rem;
  }

  .charts-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .chart-panel.panel {
    padding: 0.75rem 0.8rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .chart-canvas-host {
    height: 190px;
    width: 100%;
    max-width: 100%;
  }
  .chart-canvas-host--tall {
    height: 220px;
  }
  .plate-badge--md { font-size: 0.82rem; }
  .plate-badge--sm { font-size: 0.72rem; }

  .contrib-graph { min-width: 0; }
  .contrib-week {
    grid-template-rows: 1.1rem repeat(7, 12px);
    gap: 3px;
  }
  .contrib-weekdays {
    grid-template-rows: 1.1rem repeat(7, 12px);
  }
  .contrib-cell,
  .contrib-legend .contrib-cell {
    width: 12px;
    height: 12px;
  }
  .contrib-selectable .contrib-cell[data-date] {
    /* easier tap targets without breaking the grid look */
    box-shadow: inset 0 0 0 0.5px rgba(27, 31, 35, 0.04);
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .season-dialog {
    width: calc(100% - 1.25rem);
    max-width: 420px;
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .dialog-actions .btn { width: 100%; }

  #heatmap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #heatmap table.data {
    min-width: 720px;
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi .value { font-size: 1.45rem; }
  .main { padding-inline: 0.7rem; }
  .table-scroll table.data { min-width: 620px; }
  .thumb {
    width: 64px;
    height: 44px;
  }
}

@media (hover: none) and (pointer: coarse) {
  a.kpi-link:hover,
  .btn:hover,
  .filters button:hover {
    transform: none;
    box-shadow: none;
  }
  a.contrib-cell:hover,
  .contrib-selectable .contrib-cell[data-date]:hover {
    transform: none;
  }
  .nav a:hover { transform: none; }
}
