/* ==========================================================================
   OpenTelemetry SIG Meeting Notes — Style Sheet
   ========================================================================== */

/* --- Custom Properties (Light Theme) --- */
:root {
  --bg: #ffffff;
  --bg-secondary: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --accent: #0969da;
  --accent-fg: #ffffff;
  --accent-subtle: #ddf4ff;
  --border: #d1d9e0;
  --mark-bg: #fff8c5;
  --focus-ring: #0969da;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  --radius: 6px;
}

/* --- Dark Theme --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --fg: #e6edf3;
    --fg-muted: #9198a1;
    --accent: #58a6ff;
    --accent-fg: #ffffff;
    --accent-subtle: #121d2f;
    --border: #30363d;
    --mark-bg: #3a2f00;
    --focus-ring: #58a6ff;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --fg: #e6edf3;
  --fg-muted: #9198a1;
  --accent: #58a6ff;
  --accent-fg: #ffffff;
  --accent-subtle: #121d2f;
  --border: #30363d;
  --mark-bg: #3a2f00;
  --focus-ring: #58a6ff;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
    Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.5rem;
}

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.site-header h1 {
  margin: 0;
  line-height: 1;
}

.site-logo svg {
  display: block;
  height: 2rem;
  width: auto;
}

[data-theme="light"] .brand {
  color: #3d4c86;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
}

.header-icon-btn:hover {
  color: var(--fg);
  background: var(--bg);
  border-color: var(--border);
}

.header-icon-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

/* --- Main Layout --- */
.layout {
  display: flex;
  height: calc(100vh - 3.5rem);
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.controls {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.control-group {
  margin-bottom: 0.75rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Select (SIG Dropdown) --- */
#sig-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23656d76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
}

#sig-select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* --- Global Search Input --- */
#global-search-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#global-search-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--accent);
}

#global-search-input::placeholder {
  color: var(--fg-muted);
}

/* --- Global Search Results --- */
.global-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.global-results-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.global-results-progress {
  font-weight: 400;
  color: var(--fg-muted);
}

.global-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.global-result-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--fg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.1s ease, background-color 0.1s ease;
}

.global-result-btn:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.global-result-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  flex-wrap: wrap;
}

.result-sig-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
}

.result-meta {
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.result-snippet {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.5;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Search Input --- */
#search-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#search-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--accent);
}

#search-input::placeholder {
  color: var(--fg-muted);
}

/* --- Search Group Visibility --- */
.search-group[hidden] {
  display: none;
}

/* --- Date Navigation --- */
.date-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.date-nav[hidden] {
  display: none;
}

.date-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.date-list li {
  margin-bottom: 2px;
}

/* --- Date Buttons --- */
.date-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  transition: background-color 0.1s ease;
}

.date-btn:hover {
  background: var(--bg);
  border-color: var(--border);
}

.date-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.date-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  border-color: var(--accent);
}

.date-btn[aria-pressed="true"]:hover {
  opacity: 0.9;
}

/* --- Match Count Badge --- */
.match-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.date-btn[aria-pressed="true"] .match-badge {
  background: var(--accent-fg);
  color: var(--accent);
}

/* --- Loading Spinner (inline, for uncached date buttons) --- */
.btn-spinner {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* --- Transcript Panel --- */
.transcript-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  min-width: 0;
}

/* --- Transcript Header Card --- */
.transcript-header {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.transcript-header dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}

.transcript-header dt {
  font-weight: 600;
  color: var(--fg-muted);
  white-space: nowrap;
}

.transcript-header dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript-header dd a {
  color: var(--accent);
  text-decoration: none;
}

.transcript-header dd a:hover {
  text-decoration: underline;
}

/* --- Tab Bar --- */
.tab-bar {
  display: flex;
  gap: 0.125rem;
  margin-top: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 0.375rem 0.875rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.1s ease, border-color 0.1s ease;
}

.tab-btn:hover {
  color: var(--fg);
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* --- Summary Body --- */
.summary-body {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.summary-body h1 {
  font-size: 1.25rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.summary-body h2 {
  font-size: 1.0625rem;
  margin: 1rem 0 0.375rem;
  font-weight: 600;
}

.summary-body p {
  margin: 0.5rem 0;
}

.summary-body ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.summary-body li {
  margin-bottom: 0.25rem;
}

/* --- Meeting Notes Body --- */
.notes-body {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.notes-body h1 {
  font-size: 1.25rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.notes-body h2 {
  font-size: 1.0625rem;
  margin: 1rem 0 0.375rem;
  font-weight: 600;
}

.notes-body h3 {
  font-size: 1rem;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
}

.notes-body p {
  margin: 0.5rem 0;
}

.notes-body ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.notes-body li {
  margin-bottom: 0.25rem;
}

.notes-body a {
  color: var(--accent);
  text-decoration: none;
}

.notes-body a:hover {
  text-decoration: underline;
}

.summary-body a {
  color: var(--accent);
  text-decoration: none;
}

.summary-body a:hover {
  text-decoration: underline;
}

/* --- Transcript Body --- */
.transcript-body {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  word-break: break-word;
}

.transcript-line {
  margin: 0;
  padding: 0.125rem 0 0.125rem 0.5rem;
  border-left: 2px solid transparent;
}

.transcript-line:hover {
  background: var(--bg-secondary);
  border-left-color: var(--border);
}

.speaker-name {
  font-weight: 700;
}

.transcript-body .timestamp {
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

/* --- Highlight (Search Matches) --- */
mark {
  background: var(--mark-bg);
  color: inherit;
  padding: 0.0625rem 0.125rem;
  border-radius: 2px;
}

mark.current-match {
  background: var(--accent);
  color: var(--accent-fg);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* --- Search Match Navigation Bar --- */
.search-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.search-nav[hidden] {
  display: none;
}

.match-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.search-nav-buttons {
  display: flex;
  gap: 0.25rem;
}

.search-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.search-nav-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.search-nav-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.search-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- Date Navigation Wrapper (for mobile gradient) --- */
.date-nav-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.date-nav-wrapper[hidden] {
  display: none;
}

/* --- States --- */
.empty-state,
.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  text-align: center;
  padding: 2rem;
}

.empty-state .state-icon,
.error-state .state-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state .state-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.5rem;
}

.empty-state p,
.loading-state p,
.error-state p {
  margin: 0;
  max-width: 36ch;
  line-height: 1.6;
}

.empty-state .state-hint {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.empty-state .state-hint kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--border);
}

.error-state {
  color: #cf222e;
}

.error-state .state-icon {
  opacity: 0.7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .error-state {
    color: #f85149;
  }
}

:root[data-theme="dark"] .error-state {
  color: #f85149;
}

/* --- Retry Button --- */
.retry-btn {
  margin-top: 1rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.1s ease;
}

.retry-btn:hover {
  opacity: 0.9;
}

.retry-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.breadcrumb-sig {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

.breadcrumb-sig:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--border);
  font-size: 0.75rem;
}

.breadcrumb-date {
  font-weight: 500;
  color: var(--fg);
}

/* --- No Results in Date List --- */
.no-results-message {
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.no-results-message strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--fg);
}

/* --- Loading Spinner --- */
.loading-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Scroll-to-Top Button --- */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-top-btn[hidden] {
  display: none;
}

.scroll-top-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.scroll-top-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --- Sidebar Toggle (Mobile Only) --- */
.sidebar-toggle {
  display: none;
}

.sidebar-toggle[hidden] {
  display: none;
}

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Responsive: Mobile (max-width: 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .layout {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--fg);
    background: var(--bg-secondary);
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
  }

  .sidebar-toggle:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
  }

  .sidebar-toggle[hidden] {
    display: none;
  }

  .sidebar.collapsed {
    display: none;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }

  /* Date list scrolls horizontally on mobile with gradient fade hint */
  .date-nav-wrapper {
    position: relative;
  }

  .date-nav-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    background: linear-gradient(to right, transparent, var(--bg-secondary));
    pointer-events: none;
    z-index: 1;
  }

  .date-nav {
    overflow-y: visible;
    overflow-x: auto;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .date-list {
    display: flex;
    gap: 0.375rem;
    flex-wrap: nowrap;
    padding-right: 2rem;
  }

  .date-list li {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .date-btn {
    white-space: nowrap;
    padding: 0.5rem 1rem;
  }

  .transcript-panel {
    padding: 1rem;
  }

  .transcript-header dl {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }

  .transcript-header dt {
    margin-top: 0.375rem;
  }

  .transcript-header dt:first-child {
    margin-top: 0;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Date Range Row --- */
#date-range-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--fg-muted);
  background: var(--bg);
  user-select: none;
}
#date-range-row:hover { border-color: var(--accent); color: var(--fg); }
#date-range-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Calendar popup */
#calendar-popup {
  position: absolute;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 0.75rem;
  width: 230px;
  margin-top: 0.25rem;
}

/* Calendar header */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.cal-header button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1;
}
.cal-header button:hover { background: var(--bg-secondary); }
.cal-header button:disabled { color: var(--fg-muted); cursor: default; }

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.8rem;
}
.cal-grid .cal-weekday {
  font-size: 0.7rem;
  color: var(--fg-muted);
  padding: 0.2rem 0;
  font-weight: 600;
}
.cal-day {
  background: none;
  border: none;
  border-radius: var(--radius);
  padding: 0.25rem;
  cursor: pointer;
  color: var(--fg);
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day:hover:not(:disabled) { background: var(--bg-secondary); }
.cal-day--today { font-weight: 700; }
.cal-day--in-range { background: var(--accent-subtle); border-radius: 0; }
.cal-day--from,
.cal-day--to { background: var(--accent); color: var(--accent-fg); border-radius: var(--radius); }
.cal-day--pending { background: var(--accent); color: var(--accent-fg); border-radius: var(--radius); opacity: 0.7; }
.cal-day--disabled { color: var(--fg-muted); opacity: 0.4; cursor: default; }
.cal-day--empty { cursor: default; } /* padding cells for month alignment */

/* Calendar footer */
.cal-footer {
  margin-top: 0.5rem;
  text-align: right;
}
.cal-footer button {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--fg-muted);
}
.cal-footer button:hover { border-color: var(--accent); color: var(--accent); }
