/* ═══ Light theme inspired by StarterTab + Claude ═══ */

:root {
  --st-bg: #FAFAF8;
  --st-surface: #ffffff;
  --st-surface-hover: #fefefe;
  --st-sidebar: #F5F3EF;
  --st-border: rgba(0,0,0,0.07);
  --st-text: #2D2B28;
  --st-text-muted: #9B9590;
  --st-radius: 24px;
  --st-radius-sm: 16px;
  --st-shadow: 0 1px 8px rgba(0,0,0,0.04);
  --st-shadow-hover: 0 6px 20px rgba(0,0,0,0.08);
  --st-orange: #F26522;
  --st-amber: #E8A84C;
  --st-terracotta: #C4573A;
  --st-coral: #E07050;
  --st-sage: #8BAA7F;
  --st-slate: #6B8A9E;
  --st-spotify: #1DB954;
  --st-navbar-h: 47px;
  --st-grid-gap: 16px;
}

/* ── Base ── */
body.st-body {
  background: var(--st-bg) !important;
  color: var(--st-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

/* ── Navbar ── */
.st-navbar {
  background: var(--st-bg) !important;
  border-bottom: 1px solid var(--st-border);
  padding: 0.4rem 0.75rem;
}
.st-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--st-text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  touch-action: manipulation;
}
.st-nav-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--st-text);
}

/* ── Sidebar ── */
.st-sidebar {
  background: var(--st-sidebar);
  border-right: 1px solid var(--st-border);
  position: fixed;
  top: var(--st-navbar-h);
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 0;
  overflow: hidden;
  max-width: 190px;
  width: 190px;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}
.st-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.st-sidebar .nav-link {
  color: var(--st-text-muted);
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  border-radius: 0 12px 12px 0;
  margin-right: 0.75rem;
  /* Only transition color — `transition: all` causes layout shifts on mount
     because padding/margin/font-weight get animated too. */
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.st-sidebar .nav-link:hover,
.st-sidebar .nav-link.active {
  color: var(--st-text);
  background: transparent;
}
.st-sidebar .nav-link.active {
  font-weight: 600;
}
/* Dot wrapper — the only element that gets the grey highlight on hover/active */
.sidebar-dot-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s;
}
.st-sidebar .nav-link:hover .sidebar-dot-wrap,
.st-sidebar .nav-link.active .sidebar-dot-wrap,
.mini-dot-row:hover .sidebar-dot-wrap,
.mini-dot-row.mini-dot-active .sidebar-dot-wrap {
  background: rgba(0,0,0,0.08);
}
.sidebar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Sidebar minimize: .st-sidebar-full and .st-sidebar-mini-content are
   mutually exclusive flex children of .st-sidebar that take all available
   space above the shared profile footer. Neither one animates during
   toggle — only the outer .st-sidebar width transitions. */
.st-sidebar-full {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.st-sidebar-mini-content {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

/* Minimized state */
.st-sidebar.st-sidebar-mini {
  width: 52px !important;
  min-width: 52px;
  flex: 0 0 52px !important;
  padding: 0;
}
.st-sidebar.st-sidebar-mini .st-sidebar-full {
  display: none;
}
.st-sidebar.st-sidebar-mini .st-sidebar-mini-content {
  display: flex;
}

/* Mini dots: flex:0 so they sit at the top of the mini rail without
   stretching and creating empty grey space above the profile. */
.mini-dots {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  padding-top: 0.5rem;
}
.mini-dot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(0.875rem * 1.5 + 2 * 0.55rem);
  text-decoration: none;
  touch-action: manipulation;
}
.mini-dot-row,
.mini-dot-row:hover,
.mini-dot-row.mini-dot-active {
  background: transparent;
}

/* In mini mode the sidebar has overflow:hidden and is only 52px wide, so the
   absolute-positioned menu gets clipped. Render it via position:fixed so it
   escapes the sidebar's overflow context and anchors to the viewport. */
.st-sidebar.st-sidebar-mini .sidebar-profile-menu {
  position: fixed;
  left: 56px;
  right: auto;
  bottom: 12px;
  width: 220px;
  z-index: 1100;
}

/* ── Sidebar profile footer ──
   Direct child of .st-sidebar so it's the SAME DOM node in both modes and
   never gets unmounted/remounted during toggle. The avatar stays left-
   anchored in both modes — in mini mode the name/chevron are hidden, but
   the avatar's left offset is unchanged. */
.sidebar-profile {
  border-top: 1px solid var(--st-border);
  padding: 0.5rem 0.75rem;
  position: relative;
  flex: 0 0 auto;
}
.st-sidebar.st-sidebar-mini .sidebar-profile {
  padding: 0.5rem 0.25rem;
}
.st-sidebar.st-sidebar-mini .sidebar-profile-name,
.st-sidebar.st-sidebar-mini .sidebar-profile-chevron {
  display: none;
}
.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.5rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  color: var(--st-text);
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  touch-action: manipulation;
}
.sidebar-profile-btn:hover {
  background: rgba(0,0,0,0.04);
}
.sidebar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-profile-name {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
}
.sidebar-profile-chevron {
  width: 16px;
  height: 16px;
  color: var(--st-text-muted);
  transition: transform 0.2s;
}
.sidebar-profile-btn[aria-expanded="true"] .sidebar-profile-chevron {
  transform: rotate(180deg);
}

.sidebar-profile-menu {
  position: absolute;
  bottom: 60px;
  left: 0.75rem;
  right: 0.75rem;
  background: var(--st-surface);
  border-radius: var(--st-radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--st-border);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.sidebar-profile-menu.show {
  display: block;
}
.sidebar-profile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  color: var(--st-text);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-profile-menu-item:hover {
  background: rgba(0,0,0,0.03);
}
.sidebar-profile-menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--st-text-muted);
  flex-shrink: 0;
}
.sidebar-profile-menu-divider {
  height: 1px;
  background: var(--st-border);
  margin: 0;
}
.sidebar-profile-menu-item.text-danger {
  color: #C0392B;
}
.sidebar-profile-menu-item.text-danger svg {
  color: #C0392B;
}

/* ── Tiles / Cards ── */
.st-tile {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  border: 1px solid var(--st-border);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: visible;
}
.st-tile > .card-header:first-child {
  border-radius: var(--st-radius) var(--st-radius) 0 0;
}
.st-tile > .card-body:last-child {
  border-radius: 0 0 var(--st-radius) var(--st-radius);
}
.st-tile > .card-body:only-child {
  border-radius: var(--st-radius);
}
.st-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--st-shadow-hover);
}
.st-tile .card-body {
  padding: 1.25rem;
}
.st-tile .card-header {
  background: transparent;
  border-bottom: 1px solid var(--st-border);
  padding: 1rem 1.25rem;
}
.st-tile .card-title {
  color: var(--st-text);
  font-weight: 600;
  font-size: 0.9rem;
}
.st-tile .text-muted,
.st-tile .small.text-muted {
  color: var(--st-text-muted) !important;
}

/* Colored tile variants */
.st-tile-orange { background: var(--st-orange); }
.st-tile-amber { background: var(--st-amber); }
.st-tile-terracotta { background: var(--st-terracotta); }
.st-tile-coral { background: var(--st-coral); }
.st-tile-sage { background: var(--st-sage); }
.st-tile-slate { background: var(--st-slate); }
.st-tile-spotify { background: var(--st-spotify); }

.st-tile-orange,
.st-tile-amber,
.st-tile-terracotta,
.st-tile-coral,
.st-tile-sage,
.st-tile-slate,
.st-tile-spotify {
  color: #fff;
  border: none;
}
.st-tile-orange .text-muted,
.st-tile-amber .text-muted,
.st-tile-terracotta .text-muted,
.st-tile-coral .text-muted,
.st-tile-sage .text-muted,
.st-tile-slate .text-muted,
.st-tile-spotify .text-muted {
  color: rgba(255,255,255,0.75) !important;
}
.st-tile-orange a,
.st-tile-amber a,
.st-tile-terracotta a,
.st-tile-coral a,
.st-tile-sage a,
.st-tile-slate a,
.st-tile-spotify a {
  color: #fff;
}

/* ── Dashboard link tiles ── */
.st-link-tile {
  text-decoration: none;
  display: block;
}
.st-link-tile .st-tile {
  cursor: pointer;
}
.st-link-tile .tile-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.st-link-tile .tile-label {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}
.st-link-tile .tile-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
}

/* ── Stat cards ── */
.st-stat {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  border: 1px solid var(--st-border);
  box-shadow: var(--st-shadow);
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.st-stat .stat-value {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--st-text);
}
.st-stat .stat-label {
  font-size: 0.7rem;
  color: var(--st-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Section headers ── */
.st-section-title {
  color: var(--st-text);
  font-weight: 600;
  font-size: 1.1rem;
}

/* ── Section toggle pills ── */
.st-toggle-group .btn {
  border-color: var(--st-border);
  color: var(--st-text-muted);
  font-size: 0.8rem;
  border-radius: 24px !important;
  padding: 0.3rem 0.85rem;
  margin-left: 4px;
  background: var(--st-surface);
}
.st-toggle-group .btn.active,
.st-toggle-group .btn:hover {
  background: var(--st-orange);
  color: #fff;
  border-color: var(--st-orange);
}

/* ── Tables ── */
.st-tile .table {
  color: var(--st-text);
  margin-bottom: 0;
}
.st-tile .table thead th {
  background: rgba(0,0,0,0.015);
  color: var(--st-text-muted);
  border-bottom-color: var(--st-border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.st-tile .table td {
  border-bottom-color: var(--st-border);
  font-size: 0.85rem;
}
.st-tile .table-hover tbody tr:hover {
  background: rgba(0,0,0,0.015);
  color: var(--st-text);
}
.st-tile .table-light {
  --bs-table-bg: rgba(0,0,0,0.015);
  --bs-table-color: var(--st-text-muted);
}

/* ── Filter pills ── */
.st-filter-btn {
  border-radius: 24px;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  transition: all 0.15s;
  border: 1px solid var(--st-border);
  color: var(--st-text-muted);
  background: var(--st-surface);
}
.st-filter-btn:hover {
  background: rgba(0,0,0,0.02);
  color: var(--st-text);
}
.st-filter-btn.active {
  color: #fff;
}
.st-filter-btn[data-type="all"].active  { background: #6c757d; border-color: #6c757d; }
.st-filter-btn[data-type="Run"].active  { background: #dc3545; border-color: #dc3545; }
.st-filter-btn[data-type="Ride"].active { background: #0d6efd; border-color: #0d6efd; }
.st-filter-btn[data-type="Swim"].active { background: #20c997; border-color: #20c997; }
.st-filter-btn[data-type="Walk"].active { background: #fd7e14; border-color: #fd7e14; }
.st-filter-btn[data-type="Hike"].active { background: #198754; border-color: #198754; }
.st-filter-btn[data-type="Running"].active  { background: #dc3545; border-color: #dc3545; }
.st-filter-btn[data-type="Cycling"].active { background: #0d6efd; border-color: #0d6efd; }
.st-filter-btn[data-type="Walking"].active { background: #fd7e14; border-color: #fd7e14; }
.st-filter-btn[data-type="Hiking"].active  { background: #198754; border-color: #198754; }

/* ── Map container ── */
.st-map-container {
  border-radius: var(--st-radius);
  overflow: hidden;
  border: 1px solid var(--st-border);
  box-shadow: var(--st-shadow);
}
.st-map-detail {
  background: var(--st-surface);
  border-left: 1px solid var(--st-border);
}
.st-detail-stat {
  background: var(--st-bg);
  border-radius: var(--st-radius-sm);
  padding: 0.5rem;
  text-align: center;
}
.st-detail-stat .fw-bold {
  color: var(--st-text);
}
.st-detail-stat .text-muted {
  color: var(--st-text-muted) !important;
}

/* ── Buttons ── */
.st-btn-primary {
  background: var(--st-orange);
  border: none;
  color: #fff;
  border-radius: 14px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.st-btn-primary:hover {
  background: #d4551a;
  color: #fff;
}
.st-btn-outline {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  color: var(--st-text-muted);
  border-radius: 14px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.st-btn-outline:hover {
  background: var(--st-bg);
  color: var(--st-text);
  border-color: rgba(0,0,0,0.12);
}
.st-btn-danger {
  background: transparent;
  border: 1px solid rgba(192,57,43,0.2);
  color: #C0392B;
  border-radius: 14px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}
.st-btn-danger:hover {
  background: rgba(192,57,43,0.04);
  color: #a33125;
}

/* ── Form controls ── */
.st-body .form-control,
.st-body .form-select {
  background: var(--st-surface);
  border-color: var(--st-border);
  color: var(--st-text);
  border-radius: var(--st-radius-sm);
}
.st-body .form-control:focus,
.st-body .form-select:focus {
  background: var(--st-surface);
  border-color: var(--st-orange);
  color: var(--st-text);
  box-shadow: 0 0 0 3px rgba(242,101,34,0.1);
}
.st-body .form-label {
  color: var(--st-text-muted);
  font-size: 0.85rem;
}
.st-body .input-group-text {
  background: var(--st-bg);
  border-color: var(--st-border);
  color: var(--st-text-muted);
}

/* ── Modals ── */
.st-body .modal-content {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
}
.st-body .modal-header {
  border-bottom-color: var(--st-border);
}
.st-body .modal-footer {
  border-top-color: var(--st-border);
}
.st-body .modal-title {
  color: var(--st-text);
}

/* ── Alerts ── */
.st-body .alert-danger {
  background: rgba(192,57,43,0.05);
  border-color: rgba(192,57,43,0.12);
  color: #C0392B;
  border-radius: var(--st-radius-sm);
}
.st-body .alert-success {
  background: rgba(127,169,126,0.08);
  border-color: rgba(127,169,126,0.15);
  color: var(--st-sage);
  border-radius: var(--st-radius-sm);
}

/* ── Badges ── */
.st-body .badge.bg-primary {
  background: var(--st-orange) !important;
}
.st-body .badge.rounded-pill {
  font-weight: 500;
}

/* ── Scrollbar ── */
.st-body ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.st-body ::-webkit-scrollbar-track {
  background: transparent;
}
.st-body ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
}
.st-body ::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.15);
}

/* Inset tile scrollbars 4px from right edge */
.st-tile .todo-list,
.st-tile .widget-body,
.st-tile .gramps-widget-body,
.st-tile .spotify-widget-body,
.st-tile .ct-output {
  margin-right: 4px;
}

/* ── bg-body-tertiary override ── */
.st-body .bg-body-tertiary {
  background-color: var(--st-bg) !important;
}

/* ── Map popup overrides ── */
.activity-hover-popup .mapboxgl-popup-content,
.health-hover-popup .mapboxgl-popup-content {
  background: rgba(255, 255, 255, 0.97);
  color: var(--st-text);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid var(--st-border);
}
.activity-hover-popup .mapboxgl-popup-tip,
.health-hover-popup .mapboxgl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.97);
}

/* ── Main content area ── */
.st-main {
  padding: 1.5rem;
  overflow-x: hidden;
  box-sizing: border-box;
  margin-left: 190px !important;
  max-width: calc(100% - 190px) !important;
  flex: 0 0 calc(100% - 190px) !important;
  width: calc(100% - 190px) !important;
}
.st-main-mini {
  margin-left: 52px !important;
  max-width: calc(100% - 52px) !important;
  flex: 0 0 calc(100% - 52px) !important;
  width: calc(100% - 52px) !important;
}
@media (min-width: 992px) {
  .st-main {
    padding: 2rem 2.5rem;
  }
}

/* ── Card header tweaks ── */
.st-tile .card-header.bg-white {
  background: transparent !important;
}

/* ── List group ── */
.st-body .list-group-item {
  background: transparent;
  border-color: var(--st-border);
  color: var(--st-text);
}
.st-body .list-group-item:hover {
  background: rgba(0,0,0,0.015);
}

/* ── Border/HR overrides ── */
.st-body hr {
  border-color: var(--st-border);
  opacity: 1;
}
.st-body .border,
.st-body .border-start,
.st-body .border-top,
.st-body .border-bottom,
.st-body .border-end {
  border-color: var(--st-border) !important;
}

/* ══════════════════════════════════════════════
   Claude-style home / login page
   ══════════════════════════════════════════════ */
.st-login {
  background: var(--st-bg) !important;
  color: var(--st-text);
}
.st-login .form-signin {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--st-shadow);
  border: 1px solid var(--st-border);
}
.st-login h1 {
  color: var(--st-text);
}
.st-login .form-floating label {
  color: var(--st-text-muted);
}
.st-login .form-control {
  background: var(--st-bg);
  border-color: var(--st-border);
  color: var(--st-text);
  border-radius: var(--st-radius-sm);
}
.st-login .form-control:focus {
  background: var(--st-surface);
  border-color: var(--st-orange);
  box-shadow: 0 0 0 3px rgba(242,101,34,0.1);
  color: var(--st-text);
}
.st-login .btn-dark {
  background: var(--st-orange);
  border-color: var(--st-orange);
  border-radius: 14px;
}
.st-login .btn-dark:hover {
  background: #d4551a;
}

/* ── Claude-style dashboard ── */
.claude-home {
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}
.claude-greeting {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--st-text);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
@media (min-width: 768px) {
  .claude-greeting {
    font-size: 3rem;
  }
}

/* ── Search bar ── */
.claude-search {
  margin-bottom: 2.5rem;
}
.claude-search-box {
  display: flex;
  align-items: center;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  padding: 0.65rem 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.claude-search-box:focus-within {
  border-color: rgba(0,0,0,0.15);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.claude-search-input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  color: var(--st-text);
  padding: 0.5rem 0;
}
.claude-search-input::placeholder {
  color: var(--st-text-muted);
}

/* ── Spotify tile ── */
.spotify-tile {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  border: 1px solid var(--st-border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.spotify-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--st-shadow-hover);
}
.spotify-now-playing {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.spotify-album-art {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.spotify-track-info {
  overflow: hidden;
  flex: 1;
}
.spotify-track-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-artist {
  font-size: 0.8rem;
  color: var(--st-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--st-spotify);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.spotify-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.spotify-bars span {
  display: block;
  width: 3px;
  background: var(--st-spotify);
  border-radius: 1px;
  animation: spotifyBounce 1.2s ease-in-out infinite;
}
.spotify-bars span:nth-child(1) { height: 6px; animation-delay: 0s; }
.spotify-bars span:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.spotify-bars span:nth-child(3) { height: 4px; animation-delay: 0.4s; }
.spotify-bars span:nth-child(4) { height: 8px; animation-delay: 0.6s; }
@keyframes spotifyBounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
.spotify-idle .spotify-bars span {
  animation: none;
  height: 4px;
}
.spotify-recent {
  border-top: 1px solid var(--st-border);
  padding: 0.5rem 1.25rem;
}
.spotify-recent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}
.spotify-recent-art {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.spotify-recent-info {
  overflow: hidden;
  flex: 1;
}
.spotify-recent-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-recent-artist {
  font-size: 0.7rem;
  color: var(--st-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  color: var(--st-spotify);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.spotify-connect-btn:hover {
  color: #1aa34a;
}

/* ── Sortable table headers ── */
.st-tile th.sortable {
  cursor: pointer;
}
.st-tile th.sortable:hover {
  color: var(--st-text);
}

/* ══════════════════════════════════════════════
   Editable Tiles
   ══════════════════════════════════════════════ */

/* Tile wrapper for positioning delete button */
.tile-wrapper {
  position: relative;
}

/* Wiggle animation in edit mode */
.tile-wrapper.tile-editing {
  animation: tileWiggle 0.3s ease-in-out infinite alternate;
}
.tile-wrapper.tile-editing:nth-child(2n) {
  animation-delay: 0.05s;
  animation-direction: alternate-reverse;
}
.tile-wrapper.tile-editing:nth-child(3n) {
  animation-delay: 0.12s;
}
.tile-wrapper.tile-editing .st-tile {
  transform: none;
  box-shadow: var(--st-shadow);
}
.tile-wrapper.tile-editing .st-tile:hover {
  transform: none;
}

@keyframes tileWiggle {
  0%   { transform: rotate(-0.8deg); }
  100% { transform: rotate(0.8deg); }
}

/* iOS-style "..." tile menu bubble */
.tile-menu-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 15;
  animation: none !important;
}
.tile-menu-btn {
  width: 32px;
  height: 22px;
  border-radius: 12px;
  border: none;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s;
}
.tile-menu-btn:hover {
  background: rgba(0,0,0,0.5);
}
/* On surface (white) tiles */
.st-tile:not([class*="st-tile-"]) .tile-menu-wrap .tile-menu-btn,
.tile-wrapper:not(.tile-editing) .tile-menu-btn {
  background: rgba(0,0,0,0.08);
  color: var(--st-text-muted);
}
.tile-wrapper .st-tile:not([class*="st-tile-orange"]):not([class*="st-tile-amber"]):not([class*="st-tile-terracotta"]):not([class*="st-tile-coral"]):not([class*="st-tile-sage"]):not([class*="st-tile-slate"]) .tile-menu-wrap .tile-menu-btn {
  background: rgba(0,0,0,0.06);
  color: var(--st-text-muted);
}
.tile-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--st-surface);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid var(--st-border);
  overflow: hidden;
  min-width: 130px;
  z-index: 20;
}
.tile-menu-dropdown.show {
  display: block;
}
.tile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: var(--st-text);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.tile-menu-item:hover {
  background: rgba(0,0,0,0.03);
}
.tile-menu-item svg {
  flex-shrink: 0;
  color: var(--st-text-muted);
}
.tile-menu-danger {
  color: #C0392B;
}
.tile-menu-danger svg {
  color: #C0392B;
}

/* ── Tile color dot (inline, replaces emoji icon) ── */
.tile-dot-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.tile-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.tile-dot:hover {
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
/* Link tiles: dot replaces the emoji, needs to be larger to fill the space */
.tile-icon .tile-dot-inline {
  margin-right: 0;
}
.tile-icon .tile-dot {
  width: 14px;
  height: 14px;
}
/* Dot color picker popover */
.tile-dot-picker {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--st-surface);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid var(--st-border);
  padding: 6px;
  gap: 4px;
  flex-wrap: wrap;
  width: 112px;
  z-index: 30;
}
.tile-dot-picker.show {
  display: flex;
}
.tile-dot-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.tile-dot-swatch:hover {
  transform: scale(1.15);
}
.tile-dot-swatch.active {
  border-color: var(--st-text);
}

/* Add tile button */
.tile-add-btn {
  cursor: pointer;
  border: 2px dashed rgba(0,0,0,0.12);
  background: transparent;
  color: var(--st-text-muted);
  width: 100%;
}
.tile-add-btn:hover {
  border-color: rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.015);
  transform: none;
  box-shadow: none;
}
.tile-add-btn .tile-icon {
  font-size: 2rem;
  filter: none;
}
.tile-add-btn .tile-label {
  color: var(--st-text-muted);
}

/* Color picker in modal */
.tile-color-opt {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.15s;
}
.tile-color-opt:hover {
  transform: scale(1.1);
}
.tile-color-opt.active {
  border-color: var(--st-text);
}

/* ── Grid with spans ── */
.claude-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 120px;
  grid-auto-flow: dense;
  gap: 16px;
}
@media (max-width: 767px) {
  .claude-tiles {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  /* Force every tile full-width on mobile, regardless of data-col/data-row */
  .claude-tiles .tile-wrapper,
  .claude-tiles .tile-wrapper[data-col="1"],
  .claude-tiles .tile-wrapper[data-col="2"],
  .claude-tiles .tile-wrapper[data-col="3"] {
    grid-column: 1 / -1 !important;
  }
  .claude-tiles .tile-wrapper[data-row="2"],
  .claude-tiles .tile-wrapper[data-row="3"] {
    grid-row: auto !important;
  }
  .claude-tiles .tile-wrapper,
  .claude-tiles .tile-wrapper .st-tile,
  .claude-tiles .tile-wrapper .st-link-tile,
  .claude-tiles .tile-wrapper .st-link-tile .st-tile {
    width: 100%;
    height: auto;
    min-height: 160px;
  }

  /* Mobile: sidebar mini = hidden, expanded = full-screen overlay */
  #sidebarMenu.st-sidebar {
    position: fixed;
    top: var(--st-navbar-h);
    bottom: 0;
    left: 0;
    z-index: 1050;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    flex: 0 0 100vw !important;
    transform: translateX(0);
    transition: transform 0.25s ease;
  }
  html.sidebar-is-mini #sidebarMenu.st-sidebar,
  #sidebarMenu.st-sidebar.st-sidebar-mini {
    transform: translateX(-100%);
  }
  html.sidebar-is-mini #sidebarMenu .st-sidebar-full,
  #sidebarMenu.st-sidebar.st-sidebar-mini .st-sidebar-full { display: flex; }
  html.sidebar-is-mini #sidebarMenu .st-sidebar-mini-content,
  #sidebarMenu.st-sidebar.st-sidebar-mini .st-sidebar-mini-content { display: none; }

  /* Mobile: main content full-width, centered horizontally */
  html .st-main,
  html.sidebar-is-mini .st-main,
  .st-main.st-main-mini {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    padding: 1rem;
  }
  .st-main > .claude-home,
  .st-main > .container-fluid,
  .st-main > :first-child {
    margin-left: auto;
    margin-right: auto;
    padding-right: 0;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .claude-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile-wrapper[data-col="3"] { grid-column: span 2; }
}
.tile-wrapper {
  overflow: visible;
  min-width: 0;
  min-height: 0;
  position: relative;
  max-width: 100%;
}
.tile-wrapper[data-col="2"] { grid-column: span 2; }
.tile-wrapper[data-col="3"] { grid-column: span 3; }
.tile-wrapper[data-row="2"] { grid-row: span 2; }
.tile-wrapper[data-row="3"] { grid-row: span 3; }
.tile-wrapper .st-tile,
.tile-wrapper .st-link-tile {
  height: 100%;
  overflow: visible;
}
.tile-wrapper .st-link-tile .st-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Resize handle ── */
.tile-resize-handle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  cursor: nwse-resize;
  z-index: 5;
  display: none;
  transition: background 0.12s, transform 0.12s;
}
.tile-editing .tile-resize-handle {
  display: block;
}
.tile-resize-handle:hover {
  background: rgba(0,0,0,0.4);
  transform: scale(1.3);
}

/* ── Todo tile ── */
.todo-tile-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1rem 0 1rem 1.25rem;
  text-align: left;
}
.todo-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-right: 1.25rem;
}
.todo-tile-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text);
}
.todo-tile-count {
  font-size: 0.7rem;
  color: var(--st-text-muted);
}
.todo-action-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--st-text-muted);
  transition: background 0.12s;
  display: flex;
  align-items: center;
}
.todo-action-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--st-orange);
}
.todo-filter-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--st-border);
  padding-bottom: 0.4rem;
}
.todo-filter-tab {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--st-text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  transition: all 0.12s;
}
.todo-filter-tab:hover {
  background: rgba(0,0,0,0.03);
}
.todo-filter-tab.active {
  background: rgba(242,101,34,0.08);
  color: var(--st-orange);
  font-weight: 600;
}
.todo-filter-count {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-left: 1px;
}
.todo-item-empty {
  font-size: 0.8rem;
  color: var(--st-text-muted);
  text-align: center;
  padding: 1rem 0;
  list-style: none;
}
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 1.25rem;
  min-height: 0;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--st-border);
}
.todo-item:last-child {
  border-bottom: none;
}
.todo-item input[type="checkbox"] {
  accent-color: var(--st-orange);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.todo-item.done .todo-item-text {
  text-decoration: line-through;
  color: var(--st-text-muted);
}
.todo-item-delete {
  border: none;
  background: none;
  color: var(--st-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.todo-item:hover .todo-item-delete {
  opacity: 1;
}
.todo-item-delete:hover {
  color: #C0392B;
}
.todo-edit-input {
  border: none;
  outline: none;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.82rem;
  color: var(--st-text);
  flex: 1;
  min-width: 0;
}
.todo-edit-input:focus {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 0 0 2px rgba(242,101,34,0.15);
}
.todo-item-text {
  font-size: 0.82rem;
  color: var(--st-text);
  flex: 1;
  cursor: text;
}
.todo-add-form {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
  padding-right: 1.25rem;
  border-top: 1px solid var(--st-border);
  flex-shrink: 0;
}
.todo-add-input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 0.82rem;
  color: var(--st-text);
  padding: 0.25rem 0;
}
.todo-add-input::placeholder {
  color: var(--st-text-muted);
}

/* ── Claude Terminal tile ── */
.claude-terminal-tile {
  padding: 0 !important;
  overflow: hidden;
  background: #1a1b26 !important;
  border: 1px solid #2a2b3d !important;
}
.ct-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace;
  font-size: 0.78rem;
  color: #c0caf5;
}
.ct-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #16161e;
  border-bottom: 1px solid #2a2b3d;
  flex-shrink: 0;
}
.ct-dots {
  display: flex;
  gap: 5px;
}
.ct-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ct-dot-r { background: #f7768e; }
.ct-dot-y { background: #e0af68; }
.ct-dot-g { background: #9ece6a; }
.ct-title {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: #565f89;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.ct-clear-btn {
  border: none;
  background: none;
  color: #565f89;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.ct-clear-btn:hover {
  color: #f7768e;
}
.ct-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  min-height: 0;
  scroll-behavior: smooth;
}
.ct-output::-webkit-scrollbar {
  width: 4px;
}
.ct-output::-webkit-scrollbar-track {
  background: transparent;
}
.ct-output::-webkit-scrollbar-thumb {
  background: #2a2b3d;
  border-radius: 2px;
}
.ct-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
  opacity: 0.7;
}
.ct-welcome-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.ct-welcome-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #7aa2f7;
}
.ct-welcome-sub {
  font-size: 0.72rem;
  color: #565f89;
}
.ct-msg {
  margin-bottom: 8px;
  line-height: 1.5;
  word-wrap: break-word;
}
.ct-msg-user {
  color: #7aa2f7;
}
.ct-msg-user .ct-prompt {
  color: #bb9af7;
  font-weight: 700;
  margin-right: 2px;
}
.ct-msg-assistant {
  color: #c0caf5;
  padding-left: 0;
  border-left: 2px solid #2a2b3d;
  padding-left: 8px;
  margin-left: 2px;
}
.ct-msg-error {
  color: #f7768e;
  border-left-color: #f7768e;
}
.ct-code {
  background: #16161e;
  border: 1px solid #2a2b3d;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow-x: auto;
  font-size: 0.74rem;
  line-height: 1.5;
}
.ct-code code {
  color: #a9b1d6;
  font-family: inherit;
}
.ct-inline-code {
  background: #24283b;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.76rem;
  color: #ff9e64;
}
.ct-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #2a2b3d;
  background: #16161e;
  flex-shrink: 0;
}
.ct-input-row .ct-prompt {
  color: #bb9af7;
  font-weight: 700;
  font-size: 0.85rem;
}
.ct-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #c0caf5;
  font-family: inherit;
  font-size: 0.78rem;
  caret-color: #7aa2f7;
}
.ct-input::placeholder {
  color: #3b3d57;
}
.ct-input:disabled {
  opacity: 0.5;
}
.ct-spinner {
  display: flex;
  align-items: center;
}
.ct-spinner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7aa2f7;
  animation: ct-pulse 1s ease-in-out infinite;
}
@keyframes ct-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ── Premade tile picker ── */
.premade-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.premade-tile-option {
  border: 2px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  background: var(--st-surface);
}
.premade-tile-option:hover {
  border-color: var(--st-orange);
  transform: scale(1.02);
}
.premade-tile-option.selected {
  border-color: var(--st-orange);
  background: rgba(242,101,34,0.04);
}
.premade-tile-option .tile-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.premade-tile-option .tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--st-text);
}

/* ── Drag and drop ── */
.tile-wrapper.tile-dragging {
  opacity: 0.3;
  transform: scale(0.95);
}
.tile-wrapper.tile-dragover {
  outline: 2px dashed var(--st-orange);
  outline-offset: 4px;
  border-radius: var(--st-radius);
  background: rgba(242,101,34,0.04);
}
.tile-wrapper.tile-dragover > * {
  pointer-events: none;
}
.tile-wrapper[draggable="true"] {
  cursor: grab;
}
.tile-wrapper[draggable="true"]:active {
  cursor: grabbing;
}

/* ── Scrollbar at right edge ── */
.st-main {
  overflow-y: auto;
  max-height: calc(100vh - var(--st-navbar-h));
  padding-right: 0 !important;
}
.st-main > .claude-home,
.st-main > .container-fluid,
.st-main > :first-child {
  padding-right: 1.5rem;
}
@media (min-width: 768px) {
  .st-main > .claude-home,
  .st-main > .container-fluid,
  .st-main > :first-child {
    padding-right: 2.5rem;
  }
}

/* ── Generic widget tile ── */
.widget-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 1rem 0 1rem 1.25rem;
  text-align: left;
}
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding-right: 1.25rem;
}
.widget-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text);
}
.widget-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 1.25rem;
}
.widget-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--st-border);
  text-decoration: none;
  transition: background 0.1s;
  border-radius: 6px;
}
.widget-row:last-child { border-bottom: none; }
.widget-row:hover { background: rgba(0,0,0,0.02); }
.widget-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.widget-row-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.widget-row-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-row-meta {
  font-size: 0.65rem;
  color: var(--st-text-muted);
}
.widget-row-date {
  font-size: 0.65rem;
  color: var(--st-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Gramps widget tile ── */
.gramps-widget-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 1rem 0 1rem 1.25rem;
  text-align: left;
}
.gramps-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding-right: 1.25rem;
}
.gramps-widget-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text);
}
.gramps-widget-link {
  color: var(--st-text-muted);
  transition: color 0.12s;
}
.gramps-widget-link:hover {
  color: var(--st-orange);
}
.gramps-widget-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 1.25rem;
}
.gramps-event-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--st-border);
}
.gramps-event-row:last-child {
  border-bottom: none;
}
a.gramps-event-link {
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.1s;
}
a.gramps-event-link:hover {
  background: rgba(0,0,0,0.02);
}
.gramps-event-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.gramps-event-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.gramps-event-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gramps-event-meta {
  font-size: 0.65rem;
  color: var(--st-text-muted);
}
.gramps-event-when {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--st-orange);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Spotify widget tile ── */
.spotify-widget-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1rem 0 1rem 1.25rem;
  text-align: left;
}
.spotify-widget-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  padding-right: 1.25rem;
}
.spotify-widget-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text);
}
.spotify-widget-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 1.25rem;
}
.spotify-np {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.spotify-np-art {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.spotify-np-info {
  overflow: hidden;
  flex: 1;
}
.spotify-np-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: #1DB954;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.spotify-idle .spotify-np-status {
  color: var(--st-text-muted);
}
.spotify-np-track {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-np-artist {
  font-size: 0.75rem;
  color: var(--st-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-np-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #1DB954 !important;
  text-decoration: none;
  font-weight: 500;
}
.spotify-np-link:hover {
  text-decoration: underline;
}
.spotify-recent-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.1s;
}
.spotify-recent-row:hover {
  background: rgba(0,0,0,0.02);
}
.spotify-recent-row-art {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.spotify-recent-row-info {
  overflow: hidden;
  flex: 1;
}
.spotify-recent-row-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-recent-row-artist {
  font-size: 0.68rem;
  color: var(--st-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-connect-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  color: #1DB954;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}
.spotify-connect-prompt:hover {
  color: #1aa34a;
}

/* ── Countdown tile ── */
.countdown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--st-border);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  list-style: none;
}
.countdown-row:last-child { border-bottom: none; }
.countdown-row:hover { background: rgba(0,0,0,0.02); }
.countdown-row:hover .countdown-delete { opacity: 1; }
.countdown-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.countdown-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.countdown-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.countdown-date {
  font-size: 0.65rem;
  color: var(--st-text-muted);
}
.countdown-days {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--st-text);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.countdown-days.countdown-soon  { color: var(--st-orange); }
.countdown-days.countdown-today { color: var(--st-terracotta); }
.countdown-days.countdown-past  { color: var(--st-text-muted); font-weight: 500; }
.countdown-delete {
  opacity: 0;
  transition: opacity 0.15s;
}
/* Countdown add popover */
.countdown-add-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--st-surface);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--st-border);
  padding: 0.75rem;
  width: 220px;
  z-index: 30;
}
.countdown-pop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 26px;
  text-align: center;
  font-size: 1.1rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  outline: none;
  cursor: text;
  flex-shrink: 0;
}
.countdown-pop-icon:focus {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 0 0 2px rgba(242,101,34,0.15);
}

/* Contenteditable icon editor — triggers native emoji picker on macOS/iOS */
.countdown-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 24px;
  text-align: center;
  font-size: 1.1rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  outline: none;
  cursor: text;
  flex-shrink: 0;
}
.countdown-edit-icon:focus {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 0 0 2px rgba(242,101,34,0.15);
}
.countdown-edit-name,
.countdown-edit-date {
  flex: 1;
  min-width: 0;
}

/* ── Activity map tile ── */
.activity-map-tile {
  padding: 0 !important;
  overflow: hidden;
}
.activity-map-tile .widget-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.activity-map-canvas {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--st-bg);
}
.activity-map-canvas .mapboxgl-canvas {
  border-radius: 0 0 var(--st-radius) var(--st-radius);
}

/* ── Todo copy button ── */
.todo-copy-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--st-text-muted);
  transition: background 0.12s;
}
.todo-copy-btn:hover {
  background: rgba(0,0,0,0.05);
}
