/* ── Design tokens: dark (default) ───────────────────────── */
:root {
  /* Surface */
  --bg:       #1f1f1f;
  --surface:  #2d2d2d;
  --surface2: #3c3c3c;
  --surface3: #4a4a4a;

  /* Borders */
  --border:      #3c3c3c;
  --border-light: #444444;
  --cell-border: #505050;   /* rich grid cell lines — higher contrast than --border */

  /* Text */
  --text:       #e8eaed;
  --text-muted: #9aa0a6;
  --text-dim:   #bdc1c6;

  /* Brand / interactive */
  --blue:       #8ab4f8;   /* GCal blue, dark-mode adjusted */
  --blue-bg:    rgba(138,180,248,0.18);
  --today-ring: #8ab4f8;

  /* Cell variants */
  --weekend-bg: #272727;
  --invalid-bg: #111111;
  --hover-bg:   rgba(255,255,255,0.06);
  --today-num-bg:   #8ab4f8;
  --today-num-text: #1f1f1f;

  /* Density (compact view) */
  --density-1: rgba(138,180,248,0.12);
  --density-2: rgba(138,180,248,0.26);
  --density-3: rgba(138,180,248,0.44);
  --density-4: rgba(138,180,248,0.65);

  /* Misc */
  --radius:       4px;
  --radius-pill:  100px;
  --popup-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.4);
  --sidebar-w:    220px;
}

/* ── Light mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  :root {
    --bg:       #ffffff;
    --surface:  #f8f9fa;
    --surface2: #f1f3f4;
    --surface3: #e8eaed;

    --border:       #dadce0;
    --border-light: #e8eaed;
    --cell-border:  #dadce0;

    --text:       #3c4043;
    --text-muted: #80868b;
    --text-dim:   #5f6368;

    --blue:       #1a73e8;
    --blue-bg:    rgba(26,115,232,0.10);
    --today-ring: #1a73e8;

    --weekend-bg: rgba(0,0,0,0.025);
    --invalid-bg: rgba(0,0,0,0.035);
    --hover-bg:   rgba(0,0,0,0.04);
    --today-num-bg:   #1a73e8;
    --today-num-text: #ffffff;

    --density-1: rgba(26,115,232,0.09);
    --density-2: rgba(26,115,232,0.20);
    --density-3: rgba(26,115,232,0.36);
    --density-4: rgba(26,115,232,0.55);

    --popup-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.1);
  }
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ───────────────────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.topbar-title {
  font-weight: 400;
  font-size: 22px;
  color: var(--text-muted);
  letter-spacing: -0.2px;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

/* Year nav */
.year-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.year-nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.year-nav button:hover { background: var(--hover-bg); }
.year-nav button:disabled { opacity: 0.3; cursor: default; }

.year-display {
  font-size: 22px;
  font-weight: 400;
  min-width: 60px;
  text-align: center;
  letter-spacing: -0.3px;
}

/* Today / sync buttons */
.today-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.1s, box-shadow 0.1s;
}

.today-btn:hover {
  background: var(--hover-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.sync-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.1s;
}

.sync-btn:hover { background: var(--hover-bg); color: var(--text); }
.sync-btn:disabled { opacity: 0.4; cursor: default; }

.sync-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 1px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 2px;
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.view-btn:hover { background: var(--hover-bg); color: var(--text); }

.view-btn.active {
  background: var(--blue-bg);
  color: var(--blue);
}

/* Hamburger */
.hamburger {
  display: block;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.1s;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--hover-bg); }

/* User avatar */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--today-num-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

/* ── Main layout ──────────────────────────────────────────── */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-x: hidden;
}

#sidebar.collapsed {
  width: 0;
  border-right: none;
}

.sidebar-header {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.sidebar-controls {
  padding: 0 12px 8px;
  display: flex;
  gap: 6px;
}

.sidebar-footer {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Calendar items */
.cal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  margin-right: 8px;
  transition: background 0.1s;
}

.cal-item:hover { background: var(--hover-bg); }

.cal-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-radius: 4px;
}

.cal-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: opacity 0.15s, filter 0.15s;
}

.cal-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.cal-eye {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.cal-item:hover .cal-eye { opacity: 0.8; }
.cal-item input[type=checkbox] { display: none; }

/* Hidden calendar state */
.cal-item.hidden .cal-swatch  { opacity: 0.3; filter: grayscale(1); }
.cal-item.hidden .cal-name    { opacity: 0.45; text-decoration: line-through; text-decoration-color: var(--text-muted); }
.cal-item.hidden .cal-eye     { opacity: 0.6; }

/* ── Sidebar options / toggle ─────────────────────────────── */
.sidebar-section-header {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.sidebar-option {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  cursor: pointer;
  gap: 10px;
  user-select: none;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  margin-right: 8px;
  transition: background 0.1s;
}

.sidebar-option:hover { background: var(--hover-bg); }

.sidebar-option-label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.sidebar-toggle {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--surface3);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
  cursor: pointer;
}

.sidebar-toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sidebar-toggle.on {
  background: var(--blue);
}

.sidebar-toggle.on::after {
  transform: translateX(14px);
  background: #fff;
}

/* Segmented control (Detail level) */
.sidebar-option-row {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  gap: 10px;
}

.seg-control {
  display: flex;
  background: var(--surface2);
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
  margin-left: auto;
}

.seg-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.seg-btn:hover  { background: var(--hover-bg); color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--blue); font-weight: 500; }

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 9px;
}

/* ── Grid container ───────────────────────────────────────── */
#grid-container {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

/* ── Loading skeleton ─────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.loading-skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-row {
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    var(--surface) 25%,
    var(--surface2) 50%,
    var(--surface) 75%
  );
  background-size: 1200px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

/* ── Rich grid view ───────────────────────────────────────── */
.rich-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.rich-header-row {
  display: grid;
  grid-template-columns: 64px repeat(31, 1fr);
  column-gap: 1px;
  flex-shrink: 0;
  background: var(--cell-border);
  border-bottom: 1px solid var(--cell-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.rich-corner {
  background: var(--bg);
  box-shadow: 1px 0 0 0 var(--cell-border);
  z-index: 11;
  position: sticky;
  left: 0;
}

.rich-col-header {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 2px;
  background: var(--bg);
  letter-spacing: 0.02em;
  position: relative;
}

.rich-month-row {
  display: grid;
  grid-template-columns: 64px repeat(31, 1fr);
  column-gap: 1px;
  background: var(--cell-border);
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid var(--cell-border);
  position: relative;
}

/* Drag-to-resize handle — restricted to the 64px sticky month label column */
.rich-resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 6px;
  cursor: ns-resize;
  z-index: 5;
}

.rich-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.15s;
}

.rich-resize-handle:hover::after { opacity: 0.45; }

.rich-month-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px 8px 4px;
  box-shadow: 1px 0 0 0 var(--cell-border);
  background: var(--bg);
  position: sticky;
  left: 0;
  z-index: 9;
  pointer-events: none;
}

.rich-cell {
  background: var(--bg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 2px;
  transition: background 0.08s;
  min-width: 0;
}

.rich-cell:hover { background: var(--hover-bg); }

.rich-cell:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  z-index: 1;
}

.rich-cell.weekend { background: var(--weekend-bg); }
.rich-cell.weekend:hover { background: var(--hover-bg); }

.rich-cell.today { background: var(--blue-bg); }
.rich-cell.today:hover { background: color-mix(in srgb, var(--blue) 14%, transparent); }

.rich-cell.invalid {
  background: var(--invalid-bg);
  cursor: default;
  pointer-events: none;
}

/* Day number */
.rich-day-num {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 1px 2px 1px;
  height: 20px;
}

.rich-num {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1;
  user-select: none;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.rich-cell.today .rich-num {
  background: var(--today-num-bg);
  color: var(--today-num-text);
  font-weight: 500;
}

.rich-dow {
  font-size: 8px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  /* Hidden by default except on day 1 */
  display: none;
}

/* Always show on day 1 of each month */
.rich-cell[data-day="1"] .rich-dow { display: block; }

/* Show on all cells when option is enabled */
#grid-container.show-dow .rich-dow { display: block; }

/* Dots (level 0) */
.rich-dots {
  display: flex;
  gap: 2px;
  padding: 2px 1px;
  flex-wrap: wrap;
}

.rich-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Event pills */
.rich-event-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.rich-event-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--evt-color, var(--text-muted)) 22%, transparent);
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.35;
  cursor: pointer;
  transition: filter 0.08s;
}

.rich-event-pill:hover {
  filter: brightness(1.15);
}

/* Dot before time */
.rich-event-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--evt-color, var(--text-muted));
  flex-shrink: 0;
}

.rich-evt-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
}

.rich-evt-title {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.rich-overflow {
  color: var(--blue);
  padding: 0 4px;
  line-height: 1.35;
  cursor: pointer;
  font-size: 0.88em;
  font-weight: 500;
}

.rich-overflow:hover {
  text-decoration: underline;
}

/* ── Compact grid table ───────────────────────────────────── */
.linear-grid {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.col-header th,
th.col-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 2px;
  min-width: 28px;
  border-bottom: 1px solid var(--border);
  z-index: 3;
  letter-spacing: 0.02em;
}

.month-label {
  position: sticky;
  left: 0;
  background: var(--bg);
  font-weight: 500;
  font-size: 11px;
  text-align: right;
  padding: 0 8px;
  min-width: 48px;
  z-index: 2;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

thead .month-label.col-header { z-index: 4; }

.day-cell {
  min-width: 28px;
  height: 44px;
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  vertical-align: top;
  transition: background 0.08s;
  overflow: hidden;
}

.day-cell:hover { background: var(--hover-bg); }

.day-cell:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  z-index: 1;
}

.day-cell.weekend  { background: var(--weekend-bg); }
.day-cell.weekend:hover { background: var(--hover-bg); }

.day-cell.today {
  background: var(--blue-bg);
}

.day-cell.invalid {
  background: var(--invalid-bg);
  cursor: default;
  pointer-events: none;
}

/* Density */
.day-cell.d1 { background: var(--density-1); }
.day-cell.d2 { background: var(--density-2); }
.day-cell.d3 { background: var(--density-3); }
.day-cell.d4 { background: var(--density-4); }

.day-cell.weekend.d1 { background: var(--density-1); }
.day-cell.weekend.d2 { background: var(--density-2); }
.day-cell.weekend.d3 { background: var(--density-3); }
.day-cell.weekend.d4 { background: var(--density-4); }

.day-num {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1;
  user-select: none;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day-cell.today .day-num {
  background: var(--today-num-bg);
  color: var(--today-num-text);
  font-weight: 500;
}

.day-dow {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 8px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.5;
  line-height: 1;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  /* Hidden by default except on day 1 */
  display: none;
}

/* Always show on day 1 of each month */
.day-cell[data-day="1"] .day-dow { display: block; }

/* Show on all cells when option is enabled */
#grid-container.show-dow .day-dow { display: block; }

.dots {
  position: absolute;
  bottom: 3px;
  left: 3px;
  display: flex;
  gap: 2px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Popup ────────────────────────────────────────────────── */
#popup {
  position: fixed;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--popup-shadow);
  width: 300px;
  display: block;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

#popup.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.popup-header {
  padding: 14px 18px 10px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.1px;
}

.popup-events {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0 8px;
}

.popup-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.08s;
}

.popup-event:hover { background: var(--hover-bg); }

.popup-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.popup-event-time {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  flex-shrink: 0;
}

.popup-event-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popup-empty {
  padding: 16px 18px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 2;
}

.popup-footer {
  padding: 8px 18px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.popup-footer a {
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  transition: opacity 0.1s;
}

.popup-footer a:hover { opacity: 0.8; }

#popup a:focus-visible,
#popup button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Landing page ─────────────────────────────────────────── */
#landing {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.landing-preview {
  opacity: 0.2;
  pointer-events: none;
  margin: 0 auto 36px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre;
  max-width: 500px;
  overflow: hidden;
  user-select: none;
  display: table;
}

.landing-title {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  margin-top: 0;
}

.landing-subtitle {
  color: var(--text-muted);
  margin-bottom: 36px;
  text-align: center;
  line-height: 1.6;
  margin-top: 0;
  font-size: 14px;
}

.google-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue);
  color: var(--today-num-text);
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 28px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.google-btn:hover {
  opacity: 0.92;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.landing-fine-print {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Banners ──────────────────────────────────────────────── */
.mock-banner {
  background: #7c5800;
  color: #fef3c7;
  padding: 6px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.mock-banner a { color: #fef3c7; text-decoration: underline; }

/* ── Scrollbars ───────────────────────────────────────────── */
#grid-container::-webkit-scrollbar { width: 8px; height: 8px; }
#grid-container::-webkit-scrollbar-track { background: transparent; }
#grid-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: 2px solid var(--bg);
}
#grid-container::-webkit-scrollbar-thumb:hover { background: var(--surface3); }

#popup .popup-events::-webkit-scrollbar { width: 4px; }
#popup .popup-events::-webkit-scrollbar-track { background: transparent; }
#popup .popup-events::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  #topbar { height: 56px; }

  #sidebar {
    position: fixed;
    left: -240px;
    top: 56px;
    bottom: 0;
    z-index: 100;
    width: 240px;
    transition: left 0.2s ease;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
  }

  #sidebar.open { left: 0; }
  #sidebar.collapsed { width: 240px; left: -240px; }

  #grid-container { padding: 8px; }
  .landing-preview { display: none; }

  /* Mobile popup slides up from bottom — JS sets position/size inline */
  #popup { transform: translateY(20px) scale(0.98); }
  #popup.visible { transform: translateY(0) scale(1); }
}
