/* Gacha Tracker - dark theme, purple accents - format per spec image */
:root {
  /* Shift base theme from dark blue → dark purple */
  --bg: #170f24;
  --bg-elevated: #241638;
  --bg-panel: #1b1230;
  --text: #e8e8f0;
  --text-muted: #a0a0b8;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-active: #6d28d9;
  --border: #34264d;
  --success: #34d399;
  --radius: 8px;
  --radius-sm: 6px;
  /* Task-type colors for pies and calendar */
  --pie-dailies: #87ceeb;
  --pie-weeklies: #20b2aa;
  --pie-endgame: #50c878;
  --pie-missed: #ff7f50;
}

/* Text size */
html[data-text-size="small"] {
  font-size: 14px;
}
html[data-text-size="medium"],
html:not([data-text-size]) {
  font-size: 16px;
}
html[data-text-size="large"] {
  font-size: 18px;
}

/* Compact mode */
html[data-compact="true"] .sidebar,
html[data-compact="true"] .main-content {
  padding: 0.5rem;
}
html[data-compact="true"] .data-section-label,
html[data-compact="true"] h3,
html[data-compact="true"] h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* Theme overrides (default is purple above) */
[data-theme="purple"] {
  /* Same as :root - explicit for when applied via JS */
  --bg: #170f24;
  --bg-elevated: #241638;
  --bg-panel: #1b1230;
  --text: #e8e8f0;
  --text-muted: #a0a0b8;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-active: #6d28d9;
  --border: #34264d;
}

[data-theme="blue"] {
  --bg: #0f1729;
  --bg-elevated: #1e293b;
  --bg-panel: #0f1729;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-active: #2563eb;
  --border: #334155;
}

[data-theme="green"] {
  --bg: #0f1f14;
  --bg-elevated: #1a2e1f;
  --bg-panel: #13261a;
  --text: #dcfce7;
  --text-muted: #86efac;
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-active: #16a34a;
  --border: #166534;
}

[data-theme="rose"] {
  --bg: #1f0f14;
  --bg-elevated: #2e1a20;
  --bg-panel: #26131a;
  --text: #ffe4e6;
  --text-muted: #fda4af;
  --accent: #f43f5e;
  --accent-hover: #fb7185;
  --accent-active: #e11d48;
  --border: #4c0519;
}

[data-theme="amber"] {
  --bg: #1f180f;
  --bg-elevated: #2e251a;
  --bg-panel: #261a13;
  --text: #fef3c7;
  --text-muted: #fcd34d;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-active: #d97706;
  --border: #451a03;
}

[data-theme="teal"] {
  --bg: #0f1f1f;
  --bg-elevated: #1a2e2e;
  --bg-panel: #132626;
  --text: #ccfbf1;
  --text-muted: #5eead4;
  --accent: #0d9488;
  --accent-hover: #14b8a6;
  --accent-active: #0f766e;
  --border: #134e4a;
}

[data-theme="aqua"] {
  --bg: #0f1a1f;
  --bg-elevated: #1a252e;
  --bg-panel: #132026;
  --text: #cffafe;
  --text-muted: #67e8f9;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-active: #0891b2;
  --border: #164e63;
}

[data-theme="grayscale"] {
  --bg: #0f0f0f;
  --bg-elevated: #1a1a1a;
  --bg-panel: #141414;
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --accent: #737373;
  --accent-hover: #a3a3a3;
  --accent-active: #525252;
  --border: #262626;
}

/* Presets from color palette (image) */
[data-theme="red"] {
  --bg: #1f0f0f;
  --bg-elevated: #2e1a1a;
  --bg-panel: #261313;
  --text: #fecaca;
  --text-muted: #f87171;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --accent-active: #b91c1c;
  --border: #7f1d1d;
}

[data-theme="orange"] {
  --bg: #1f140f;
  --bg-elevated: #2e1f1a;
  --bg-panel: #261a13;
  --text: #fed7aa;
  --text-muted: #fb923c;
  --accent: #ea580c;
  --accent-hover: #f97316;
  --accent-active: #c2410c;
  --border: #7c2d12;
}

[data-theme="yellow"] {
  --bg: #1f1a0f;
  --bg-elevated: #2e251a;
  --bg-panel: #261f13;
  --text: #fef08a;
  --text-muted: #facc15;
  --accent: #ca8a04;
  --accent-hover: #eab308;
  --accent-active: #a16207;
  --border: #713f12;
}

[data-theme="pink"] {
  --bg: #1f0f18;
  --bg-elevated: #2e1a24;
  --bg-panel: #26131c;
  --text: #fbcfe8;
  --text-muted: #f472b6;
  --accent: #db2777;
  --accent-hover: #ec4899;
  --accent-active: #be185d;
  --border: #831843;
}

[data-theme="indigo"] {
  --bg: #0f0f1f;
  --bg-elevated: #1a1a2e;
  --bg-panel: #131326;
  --text: #c7d2fe;
  --text-muted: #818cf8;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-active: #4338ca;
  --border: #312e81;
}

[data-theme="violet"] {
  --bg: #140f1f;
  --bg-elevated: #1f1a2e;
  --bg-panel: #1a1326;
  --text: #ddd6fe;
  --text-muted: #a78bfa;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-active: #6d28d9;
  --border: #4c1d95;
}

[data-theme="brown"] {
  --bg: #1f1814;
  --bg-elevated: #2e221a;
  --bg-panel: #261c13;
  --text: #f5e6d3;
  --text-muted: #d4a574;
  --accent: #a16207;
  --accent-hover: #b45309;
  --accent-active: #854d0e;
  --border: #78350f;
}

[data-theme="gray"] {
  --bg: #171717;
  --bg-elevated: #262626;
  --bg-panel: #1c1c1c;
  --text: #d4d4d4;
  --text-muted: #a3a3a3;
  --accent: #6b7280;
  --accent-hover: #9ca3af;
  --accent-active: #4b5563;
  --border: #404040;
}

[data-theme="black"] {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-panel: #0f0f0f;
  --text: #fafafa;
  --text-muted: #a1a1a1;
  --accent: #404040;
  --accent-hover: #525252;
  --accent-active: #262626;
  --border: #171717;
}

[data-theme="white"] {
  --bg: #fafafa;
  --bg-elevated: #f5f5f5;
  --bg-panel: #ffffff;
  --text: #171717;
  --text-muted: #737373;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-active: #2563eb;
  --border: #e5e5e5;
}

/* Custom theme - variables applied via JS */
[data-theme="custom"] {
  /* No defaults - all set by JS */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Left sidebar */
.sidebar-left {
  width: 220px;
  min-width: 220px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-brand .title {
  margin: 0 1rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s;
}

.sidebar-brand .title:hover {
  color: var(--accent);
}

.sidebar-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.2rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.sidebar-nav .sidebar-label {
  align-self: flex-start;
}

.sidebar-nav .tab {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .tab:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.15);
}

.sidebar-nav .tab.active {
  color: var(--text);
  background: var(--accent);
  font-weight: 600;
}

.sidebar-sub-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 1.25rem;
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}

.sidebar-sub-nav .tab-sub {
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 400;
}

.sidebar-sub-nav .tab-sub.active {
  background: rgba(124, 58, 237, 0.35);
}

.sidebar-data-wrap,
.sidebar-games-wrap {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-data-list,
.sidebar-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0.5rem;
}

.sidebar-data-item,
.sidebar-game-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-data-item:hover,
.sidebar-game-item:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.12);
}

.sidebar-data-item.active,
.sidebar-game-item.active {
  color: var(--text);
  background: rgba(124, 58, 237, 0.25);
}

.sidebar-game-item.add-game {
  color: var(--accent);
  font-weight: 500;
}

.sidebar-data-item.sidebar-drag-source,
.sidebar-game-item.sidebar-drag-source {
  opacity: 0.6;
}

.sidebar-data-item.sidebar-drag-over,
.sidebar-game-item.sidebar-drag-over {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main content */
.content {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-bar-actions .btn {
  text-decoration: none;
}

.top-bar-actions .btn:hover {
  text-decoration: none;
}

.top-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.5rem;
  box-sizing: border-box;
}

.top-bar-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.top-bar-icon-kofi {
  width: 1.728rem;
  height: 1.728rem;
}

.breadcrumb-sep {
  margin: 0 0.35rem;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

.content-card {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 300px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.panel-desc {
  margin: 0;
  font-size: 0.9rem;
}

.panel-desc-note {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.panel-separator {
  height: 2px;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  margin: 0.6rem 0 0.75rem;
}

/* About page sections */
.panel-about-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.about-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.about-feature-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.about-feature-list li {
  margin-bottom: 0.5rem;
}

.about-feature-list li:last-child {
  margin-bottom: 0;
}

.about-feature-list-compact li {
  margin-bottom: 0.35rem;
}

.about-presets {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-time-intro {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.about-time-hint {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-section-note {
  border-left: 3px solid var(--accent);
}

.about-section-note .about-section-title {
  color: var(--text);
}

.about-section-note p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.panel-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-format-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Extracurricular: icon at right end of title, description wraps around it */
.extracurricular-header-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.games-extracurricular-section-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.extracurricular-task-game-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.extracurricular-task-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.panel-header-extracurricular .panel-format-toggle-float {
  float: right;
  margin: 0 0 0.5rem 0.75rem;
}
.panel-header-extracurricular h2 {
  margin-top: 0;
}
.panel-header-extracurricular .panel-desc {
  overflow: hidden;
}
.panel-header-extracurricular .panel-separator {
  clear: both;
}

.format-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.format-btn:hover {
  border-color: var(--accent);
}

.format-btn.active {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #fff;
}

.format-btn-list {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='4' cy='4' r='1.5' fill='%23fff'/%3E%3Ccircle cx='4' cy='8' r='1.5' fill='%23fff'/%3E%3Ccircle cx='4' cy='12' r='1.5' fill='%23fff'/%3E%3Cline x1='7' y1='4' x2='12' y2='4' stroke='%23fff' stroke-width='1.2'/%3E%3Cline x1='7' y1='8' x2='12' y2='8' stroke='%23fff' stroke-width='1.2'/%3E%3Cline x1='7' y1='12' x2='12' y2='12' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.4rem;
}

.format-btn-grid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='6' y='1' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='11' y='1' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='1' y='6' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='6' y='6' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='11' y='6' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='1' y='11' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='6' y='11' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3Crect x='11' y='11' width='4' height='4' rx='0.5' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.4rem;
}

/* Task grid (4 per row) */
.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-grid .task-item {
  min-width: 0;
}

.task-grid-game-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

@media (max-width: 1200px) {
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .task-grid {
    grid-template-columns: 1fr;
  }
}

.home-summary {
  margin-top: 0.5rem;
}

.home-welcome {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-size: 0.95rem;
  color: var(--text);
}

/* Home: Today's progress – DWE bars side by side, full width */
.home-dwe-progress {
  width: 100%;
  margin-bottom: 1.5rem;
}

.home-dwe-bars {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
}

.home-dwe-bar-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.home-dwe-bar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.home-dwe-bar-track {
  height: 1.5rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.home-dwe-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: calc(var(--radius-sm) - 1px);
  transition: width 0.2s ease;
}

/* Home: Checklist – 3 sections (Dailies, Weeklies, Endgame), grid per section */
.home-dwe-checklist-wrap {
  width: 100%;
  margin-top: 1.5rem;
}

.home-checklist-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.home-checklist-heading .home-welcome {
  margin: 0;
}

.home-checklist-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: help;
  flex-shrink: 0;
}

.home-checklist-info-icon:hover {
  color: var(--accent);
}

.home-checklist-info-icon svg {
  width: 1rem;
  height: 1rem;
}

.home-dwe-checklist-section {
  margin-top: 1rem;
}

.home-dwe-checklist-section:first-of-type {
  margin-top: 0.5rem;
}

.home-dwe-checklist-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.home-dwe-checklist-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
}

/* Home checklist: single row, horizontal scroll */
.home-dwe-checklist-scroll .task-grid {
  display: grid;
  grid-template-columns: none;
  grid-template-rows: 1fr;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 220px);
  gap: 0.5rem;
  padding: 0.5rem;
  width: max-content;
  min-width: 100%;
}

.home-dwe-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
}

.home-dwe-checklist-item:hover {
  background: var(--bg-elevated);
}

.home-dwe-checklist-item.done .home-dwe-checklist-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.home-dwe-checklist-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.home-dwe-checklist-item-extracurricular {
  flex-direction: column;
  align-items: flex-start;
}

.home-dwe-checklist-item-extracurricular .home-extracurricular-info {
  margin-left: 0;
}

.home-dwe-checklist-item-extracurricular input[type="checkbox"],
.home-dwe-checklist-item-extracurricular .task-checkbox,
#extracurricularContent .task-checkbox,
.games-extracurricular-section .task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 2px solid var(--border);
  border-radius: 4px;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Fill when done, outline when off (no check mark) - matches site toggle style */
.task-item.home-dwe-checklist-item-extracurricular.done .task-checkbox,
#extracurricularContent .task-item.done .task-checkbox,
.games-extracurricular-section .task-item.done .task-checkbox {
  background: var(--success) !important;
  background-image: none !important;
  border-color: var(--success);
}

.home-dwe-checklist-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-extracurricular-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Task lists */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.task-item.done {
  opacity: 0.85;
}

.task-item.done .task-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.task-top .task-label {
  flex: 1;
  min-width: 0;
}

.task-potential {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.task-subrows {
  display: grid;
  gap: 0.4rem;
  padding-left: 0.1rem;
}

.task-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.task-subrow .left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.task-subrow strong {
  color: var(--text-muted);
  font-weight: 700;
}

.task-subrow input[type="number"] {
  width: 7rem;
}

.task-remaining {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.task-edit-btn {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
}

.task-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-label {
  flex: 1;
  font-size: 0.95rem;
  cursor: pointer;
}

.task-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Game sections (weeklies / endgame) */
.game-sections-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.game-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}

.game-section-title {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.game-section .task-list {
  padding: 0.5rem;
}

/* Endgame currency row */
.endgame-currency-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.endgame-currency-row label {
  color: var(--text-muted);
}

.endgame-currency-row input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.endgame-currency-row input[type="number"] {
  width: 6rem;
}

.endgame-currency-row input[type="text"] {
  width: 14rem;
  min-width: 10rem;
}

.currency-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  font-size: 0.9em;
  color: var(--text-muted);
  cursor: help;
}

.currency-info-icon:hover {
  color: var(--accent);
}

.pulls-calc-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pulls-calc-wrap input.pulls-calc-input {
  width: 8rem;
}

.pulls-calc-result {
  font-weight: 600;
  color: var(--accent);
}

.endgame-potential {
  color: var(--text-muted);
  font-weight: 500;
}

/* Right sidebar */
.sidebar-right {
  width: 180px;
  min-width: 180px;
  padding: 1rem;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
}

.sidebar-right-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-right .sidebar-label {
  padding-left: 0;
}

.sidebar-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-right-header .sidebar-label {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-right-header .icon-btn {
  flex-shrink: 0;
}

.date-bar-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-time {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.sidebar-timezone {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sidebar-countdown {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-dst-dates {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.sidebar-reset-compare {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-add {
  background: var(--accent);
  color: white;
}

.btn-add:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
  background: #b91c1c;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Attendance: table + pies */
.attendance-table-wrap {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.attendance-toggle-col {
  width: 4.5rem;
  text-align: center;
}

.attendance-toggle-cell {
  text-align: center;
  vertical-align: middle;
}

/* Attendance table toggle: square, fill when on, outline when off - matches site theme */
.attendance-pie-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  border: 2px solid var(--pie-weeklies);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.attendance-pie-toggle:hover {
  border-color: var(--accent);
}

.attendance-pie-toggle:checked {
  background: var(--pie-weeklies);
  border-color: var(--pie-weeklies);
}

.attendance-pie-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.attendance-table th,
.attendance-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.attendance-table th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  color: var(--text-muted);
}

.attendance-table .attendance-total-row td {
  font-weight: 700;
  color: var(--text);
  background: rgba(124, 58, 237, 0.14);
}

/* Progress bar behind data (very low opacity for clarity) */
.attendance-table td.attendance-cell {
  position: relative;
  overflow: hidden;
}

.attendance-cell-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0.12;
  pointer-events: none;
}

.attendance-cell-text {
  position: relative;
  z-index: 1;
}

.pie-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Attendance weekly calendar */
.attendance-calendar-section {
  margin-top: 2rem;
}

.attendance-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.attendance-calendar-header .data-section-label {
  margin: 0;
}

.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .attendance-calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .attendance-calendar-grid {
    grid-template-columns: 1fr;
  }
}

.attendance-calendar-day {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.attendance-calendar-tooltip {
  color: var(--text);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  white-space: normal;
  min-width: 280px;
  max-width: 520px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 10;
}

.attendance-calendar-day:hover .attendance-calendar-tooltip {
  opacity: 1;
  visibility: visible;
}

.attendance-tooltip-item.attendance-tooltip-dailies { color: var(--pie-dailies); }
.attendance-tooltip-item.attendance-tooltip-weeklies { color: var(--pie-weeklies); }
.attendance-tooltip-item.attendance-tooltip-endgame { color: var(--pie-endgame); }

.attendance-calendar-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.attendance-calendar-day.future {
  border-style: dashed;
}

.attendance-calendar-day-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.attendance-calendar-summary {
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.attendance-calendar-edit {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

/* Attendance History calendar */
.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.history-header .data-section-label {
  margin: 0;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-month-label {
  font-weight: 600;
  color: var(--text);
  min-width: 10rem;
  text-align: center;
}

.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-height: 200px;
}

.history-calendar-weekday {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.35rem 0;
  text-align: center;
}

.history-calendar-day {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-height: 5.5rem;
}

.history-calendar-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.history-calendar-day-edit {
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.history-calendar-day-other-month {
  opacity: 0.5;
}

.history-calendar-day-future {
  border-style: dashed;
}

.history-calendar-day-other-month .history-calendar-day-num {
  color: var(--text-muted);
}

.history-calendar-day-today .history-calendar-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.25rem;
  border-radius: 50%;
  background: var(--pie-missed);
  color: var(--bg);
  font-weight: 700;
}

.history-calendar-day-num {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.history-dwe-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  position: relative;
}

.history-dwe-bar-wrap:last-child {
  margin-bottom: 0;
}

.history-dwe-label {
  font-size: 0.75rem;
  width: 1.25em;
  flex-shrink: 0;
  font-weight: 600;
}

.history-dwe-bar-wrap-dailies .history-dwe-label { color: var(--pie-dailies); }
.history-dwe-bar-wrap-weeklies .history-dwe-label { color: var(--pie-weeklies); }
.history-dwe-bar-wrap-endgame .history-dwe-label { color: var(--pie-endgame); }

.history-dwe-bar {
  flex: 1;
  min-width: 0;
  height: 1.25rem;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.history-dwe-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.15s;
}

.history-dwe-fraction {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 0 1px var(--bg), 0 0 2px var(--bg);
  pointer-events: none;
}

.history-dwe-bar-d .history-dwe-fill { background: var(--pie-dailies); }
.history-dwe-bar-w .history-dwe-fill { background: var(--pie-weeklies); }
.history-dwe-bar-e .history-dwe-fill { background: var(--pie-endgame); }

/* History calendar: hover tooltip per D/W/E bar */
.history-dwe-tooltip {
  color: var(--text);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.35rem);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 10;
}

.history-dwe-bar-wrap:hover .history-dwe-tooltip {
  opacity: 1;
  visibility: visible;
}

.history-dwe-tooltip-item.attendance-tooltip-dailies { color: var(--pie-dailies); }
.history-dwe-tooltip-item.attendance-tooltip-weeklies { color: var(--pie-weeklies); }
.history-dwe-tooltip-item.attendance-tooltip-endgame { color: var(--pie-endgame); }

/* History calendar scroll wrapper - enables horizontal scroll on narrow viewports */
.history-calendar-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Calendar day edit modal */
.calendar-day-modal-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 50vh;
  overflow-y: auto;
  min-width: max-content;
}

.calendar-day-modal-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.calendar-day-modal-task input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
  width: 1.1em;
  height: 1.1em;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.calendar-day-modal-task input[type="checkbox"]:checked {
  border-color: transparent;
  background: var(--pie-dailies);
}

.calendar-day-modal-task-weeklies input[type="checkbox"]:checked {
  background: var(--pie-weeklies);
}

.calendar-day-modal-task-endgame input[type="checkbox"]:checked {
  background: var(--pie-endgame);
}

.calendar-day-modal-task span {
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-day-modal-task-daily span,
.calendar-day-modal-task-dailies span {
  color: var(--pie-dailies);
}

.calendar-day-modal-task-weekly span,
.calendar-day-modal-task-weeklies span {
  color: var(--pie-weeklies);
}

.calendar-day-modal-task-endgame span {
  color: var(--pie-endgame);
}

.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.pie-box {
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pie-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  background: conic-gradient(var(--pie-done, var(--success)) 0deg var(--pct, 0deg), var(--border) var(--pct, 0deg) 360deg);
}

.pie-box-dailies .pie-chart {
  background: conic-gradient(var(--pie-dailies) 0deg var(--pct, 0deg), var(--border) var(--pct, 0deg) 360deg);
}

.pie-box-weeklies .pie-chart {
  background: conic-gradient(var(--pie-weeklies) 0deg var(--pct, 0deg), var(--border) var(--pct, 0deg) 360deg);
}

.pie-box-endgame .pie-chart {
  background: conic-gradient(var(--pie-endgame) 0deg var(--pct, 0deg), var(--border) var(--pct, 0deg) 360deg);
}

.pie-box-dailies .pie-legend-item.completed::before { background: var(--pie-dailies); }
.pie-box-weeklies .pie-legend-item.completed::before { background: var(--pie-weeklies); }
.pie-box-endgame .pie-legend-item.completed::before { background: var(--pie-endgame); }

.pie-legend {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pie-legend-split {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pie-box .pie-legend {
  text-align: center;
}

.pie-legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--text-muted));
}

.pie-legend-item.completed::before {
  background: var(--success);
}

.pie-legend-item.skipped::before {
  background: var(--border);
}

.pie-chart-empty {
  background: var(--border) !important;
}

.pie-chart-multi {
  background: var(--border);
}

/* Data view - per-game pie charts */
.data-game-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.data-excl-toggle-wrap {
  margin-bottom: 1rem;
}

.data-excl-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 36rem;
}

/* Fill when on, outline when off (no check mark) */
.data-excl-toggle input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.2em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
}

.data-excl-toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.data-excl-toggle input[type="checkbox"]:hover {
  border-color: var(--accent);
}

.data-excl-toggle input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.data-excl-text {
  line-height: 1.4;
}

.data-pie-row,
.data-pie-section {
  margin-bottom: 1.5rem;
}

.data-section-label {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-pie-section.data-has-table-pies .data-section-label {
  margin-bottom: 0.5rem;
}

.data-pie-section .pie-row {
  margin-top: 0;
}

.data-summary-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.data-summary-table th,
.data-summary-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.data-summary-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

.data-summary-table td {
  color: var(--text);
}

.data-summary-table .data-summary-total td {
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  background: rgba(124, 58, 237, 0.08);
}

/* Data: progress bar in Earned cells (earned/potential), low opacity */
.data-summary-table td.data-earned-cell {
  position: relative;
  overflow: hidden;
}

.data-summary-table .data-cell-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0.12;
  pointer-events: none;
}

.data-summary-table tr.data-row-dailies .data-cell-bar { background: var(--pie-dailies); }
.data-summary-table tr.data-row-weeklies .data-cell-bar { background: var(--pie-weeklies); }
.data-summary-table tr.data-row-endgame .data-cell-bar { background: var(--pie-endgame); }

.data-summary-table .data-cell-text {
  position: relative;
  z-index: 1;
}

.data-summary-table .data-toggle-col {
  width: 4.5rem;
  text-align: center;
}

.data-summary-table .data-toggle-cell {
  text-align: center;
  vertical-align: middle;
}

.data-summary-table .data-pie-toggle {
  cursor: pointer;
  width: 1.1em;
  height: 1.1em;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.data-summary-table .data-pie-toggle:checked {
  border-color: transparent;
  background: var(--accent);
}

.data-tables-section {
  width: 100%;
}

.data-table-wrap {
  width: 100%;
  max-width: 400px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-tables-section .data-tables-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.data-tables-section .data-tables-header .data-section-label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.data-tables-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-tables-row .data-summary-table {
  flex: 1;
  min-width: 260px;
}

.data-tables-row .data-summary-table thead th {
  padding-top: 0;
}

.data-pies-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.data-pies-row .pie-box {
  flex: 1;
  min-width: 200px;
  max-width: none;
  padding-top: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0 1rem;
}

.data-pies-row .pie-box h3 {
  grid-column: 1 / -1;
}

.data-pies-row .pie-box .pie-chart {
  grid-column: 1;
  grid-row: 2;
}

.data-pies-row .pie-box .pie-legend {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  text-align: left;
}

.data-pies-row .pie-box .pie-legend-split {
  align-items: flex-start;
}

.data-table-pies-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table-pies-row .data-summary-table {
  flex-shrink: 0;
}

.data-table-pies-row .pie-box {
  flex-shrink: 0;
  padding-top: 0;
}

.data-table-pies-row .data-summary-table thead th {
  padding-top: 0;
}

.data-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Games tab */
.games-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.games-title-row .games-selected-title {
  margin: 0;
}

.games-selected-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.games-delete-btn {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.games-delete-btn:hover {
  color: #e74c3c;
}

.games-clear-data-btn {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.games-clear-data-btn:hover {
  color: #e74c3c;
}

.games-content {
  margin-top: 1rem;
}

.games-changer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.games-changer-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 140px;
}

.games-changer-row input[type="number"] {
  flex: 1;
  max-width: 120px;
}

.games-sync-row {
  margin-top: 0.35rem;
}

.games-earned-inputs,
.endgame-earned-per-completion {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.games-earned-inputs input,
.endgame-earned-per-completion input {
  width: 4rem;
  min-width: 3rem;
}

.games-earned-per-completion {
  flex: 1;
  min-width: 0;
}

.task-item-with-changer {
  padding-bottom: 0.75rem;
}

.task-item-with-changer .task-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-item-with-changer .task-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.task-item-with-changer .games-task-potential,
.task-item-with-changer .games-task-reset {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.games-endgame-date-start,
.games-weekly-date-start {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.25);
  color: var(--text);
  flex-shrink: 0;
}

.games-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.games-sub-tab {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.games-sub-tab:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.2);
}

.games-sub-tab.active {
  background: var(--accent);
  color: white;
}

.games-sub-tab.active:hover {
  background: var(--accent-hover);
}

/* Forms */
input[type="text"],
input[type="number"],
input[type="time"],
input[type="date"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-dialog {
  position: relative;
  width: min(760px, calc(100vw - 2rem));
  margin: 8vh auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.modal-dialog.modal-dialog-sm {
  width: min(560px, calc(100vw - 2rem));
}

.endgame-complete-past-wrap {
  margin-bottom: 0.5rem;
}

.endgame-complete-past-list {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding: 0;
  list-style: disc;
  color: var(--text-muted, var(--border));
  font-size: 0.9em;
  line-height: 1.45;
}

.modal-dialog.modal-dialog-calendar {
  width: max-content;
  max-width: calc(100vw - 2rem);
  min-width: 320px;
}

.modal-dialog-earnings {
  min-width: 360px;
  max-width: 520px;
}

/* Settings modal with sidebar */
.modal-dialog-settings {
  width: min(600px, calc(100vw - 2rem));
  max-height: calc(100vh - 16vh);
  display: flex;
  flex-direction: column;
}

.settings-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.settings-sidebar {
  width: 160px;
  min-width: 160px;
  padding: 1rem 0;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-nav-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.settings-nav-item.active,
.settings-nav-item[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--accent);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.settings-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.settings-row {
  margin-bottom: 1rem;
}

.settings-row .settings-label {
  margin-bottom: 0.35rem;
}

.settings-row .settings-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.account-status {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.account-status.account-signed-in {
  color: var(--success);
}

.account-placeholder-note {
  margin-bottom: 1rem;
}

.account-placeholder-note p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.account-placeholder-note p:last-child {
  margin-bottom: 0;
}

.account-login-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 140px;
  height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-account:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 100, 100, 200), 0.15);
}

.btn-google {
  background: #fff;
  color: #333;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-facebook {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
}

.btn-facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
}

.btn-twitter {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn-twitter:hover {
  background: #333;
  border-color: #333;
}

.account-btn-icon {
  font-weight: 700;
  font-size: 1rem;
}

.settings-select,
.settings-number-input {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-width: 140px;
}

.settings-number-input {
  width: 4rem;
}

.settings-file-input {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.settings-skip-time-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.settings-skip-time-wrap .settings-skip-hours-input {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.settings-row-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-row-toggle .settings-label {
  margin-bottom: 0;
  flex: 1;
}

.settings-toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 2.5rem;
  height: 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.settings-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.25rem - 4px);
  height: calc(1.25rem - 4px);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.settings-toggle:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.settings-toggle:checked::before {
  transform: translateX(1rem);
  background: var(--bg);
}

.settings-color-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.settings-tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-tab-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.settings-tab-btn.active,
.settings-tab-btn[aria-selected="true"] {
  color: var(--text);
  background: var(--accent);
  border-color: var(--accent);
}

.settings-color-panel {
  display: none;
}

.settings-color-panel.active {
  display: block;
}

#settings-color-custom {
  position: relative;
}

.settings-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  grid-template-rows: repeat(4, 100px);
  gap: 0.25rem;
}

.settings-theme-option {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.settings-theme-option .settings-theme-swatch {
  width: 70%;
  height: 70%;
  min-width: 18px;
  min-height: 18px;
  max-width: 28px;
  max-height: 28px;
  flex-shrink: 0;
}

.settings-theme-option .settings-theme-name {
  display: block;
  font-size: 0.55rem;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.settings-custom-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.settings-custom-layers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-custom-layer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-custom-layer label {
  flex: 0 0 140px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.settings-custom-layer .settings-layer-swatch {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.settings-custom-layer .settings-layer-swatch:hover {
  border-color: var(--accent);
}

/* Saved custom presets */
.settings-custom-presets-row {
  margin-bottom: 1rem;
}

.settings-saved-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.settings-saved-preset {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.settings-saved-preset:hover,
.settings-saved-preset.selected {
  border-color: var(--accent);
}

.settings-saved-preset-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.settings-saved-preset .settings-saved-preset-name {
  display: none;
}

.settings-save-delete-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn-danger-sm {
  color: #f87171;
}

.btn-danger-sm:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* Color wheel picker (in modal) */
.settings-color-picker-modal {
  padding: 0;
}

.settings-color-picker-modal .settings-picker-header {
  display: none;
}

#colorWheelModal,
#savePresetModal,
#deletePresetModal {
  z-index: 1000;
}

#clearDataModal {
  z-index: 1001;
}

#clearGameDataModal {
  z-index: 1001;
}

.modal-dialog-color-wheel {
  width: min(320px, calc(100vw - 2rem));
}

.modal-dialog-color-wheel .modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settings-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.settings-color-wheel-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 0.75rem;
}

.settings-color-wheel {
  display: block;
  border-radius: 50%;
  cursor: crosshair;
}

.settings-wheel-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.settings-hue-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.settings-hue-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 4rem;
}

.settings-hue-slider {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #000, #fff);
  border-radius: 4px;
}

.settings-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.settings-theme-group {
  margin-bottom: 1rem;
}

.settings-theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.settings-theme-option:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.settings-theme-option.active,
.settings-theme-option[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.settings-theme-swatch {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.settings-theme-purple { background: #7c3aed; }
.settings-theme-blue { background: #3b82f6; }
.settings-theme-green { background: #22c55e; }
.settings-theme-rose { background: #f43f5e; }
.settings-theme-amber { background: #f59e0b; }
.settings-theme-teal { background: #0d9488; }
.settings-theme-aqua { background: #06b6d4; }
.settings-theme-grayscale { background: #737373; }
.settings-theme-red { background: #dc2626; }
.settings-theme-orange { background: #ea580c; }
.settings-theme-yellow { background: #ca8a04; }
.settings-theme-pink { background: #db2777; }
.settings-theme-indigo { background: #4f46e5; }
.settings-theme-violet { background: #7c3aed; }
.settings-theme-brown { background: #a16207; }
.settings-theme-gray { background: #6b7280; }
.settings-theme-black { background: #404040; }
.settings-theme-white { background: #fafafa; border: 1px solid #d4d4d4; }

.earnings-modal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

.earnings-modal-item {
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.earnings-modal-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.earnings-modal-date-display {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.earnings-modal-date-edit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.earnings-modal-date-edit input[type="date"] {
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
}

.earnings-modal-earn-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.earnings-modal-earn-row label {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 4rem;
}

.earnings-modal-earn-row input {
  width: 6rem;
}

.earnings-modal-empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.earnings-modal-skipped-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.earnings-modal-skipped-heading {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.earnings-modal-skipped-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.earnings-modal-skipped-item {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Timestamps page */
.timestamps-bar-graph {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  min-height: 120px;
  align-items: end;
  padding: 0.5rem 0;
}

.timestamps-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.timestamps-bar {
  width: 100%;
  min-height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.timestamps-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.timestamps-hour-stacked .timestamps-hour-stack {
  align-items: stretch;
  justify-content: flex-start; /* bars start from bottom; flex-start = bottom in column-reverse */
}

.timestamps-bar-segment {
  flex-shrink: 0;
}

.timestamps-hour-stacked {
  position: relative;
}

.timestamps-hour-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 10;
}

.timestamps-hour-stacked:hover .timestamps-hour-tooltip {
  opacity: 1;
  visibility: visible;
}

.timestamps-table th,
.timestamps-table td {
  padding: 0.5rem 0.75rem;
}

.timestamps-game-selector label {
  cursor: pointer;
  user-select: none;
}

.timestamps-game-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.timestamps-game-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.timestamps-game-pill.filled,
.timestamps-game-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.timestamps-game-pill.filled:hover,
.timestamps-game-pill[aria-pressed="true"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.timestamps-weeklies-bar-graph {
  grid-template-columns: repeat(7, 1fr);
}

.timestamps-line-graph {
  margin-bottom: 1.5rem;
}

.timestamps-line-graph svg {
  overflow: visible;
}

.timestamps-endgame-pill {
  font-size: 0.85rem;
}

.timestamps-weeklies-bar-graph .timestamps-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timestamps-weeklies-bar-graph .timestamps-bar-col .timestamps-bar {
  width: 100%;
  min-height: 4px;
}

.timestamps-bar-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.clear-time-trends-games {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.time-trends-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.time-trends-detail-list-item {
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.time-trends-detail-list-item:last-child {
  border-bottom: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.25rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Task menu grid (match app theme) */
.task-menu-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.task-menu-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.7rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.task-menu-cell:nth-child(7n) {
  border-right: none;
}

.task-menu-cell.span-2 {
  grid-column: span 2;
}

.task-menu-cell.span-5 {
  grid-column: span 5;
}

.task-menu-cell.span-7 {
  grid-column: span 7;
  border-right: none;
}

.task-menu-control-with-note,
.task-menu-control-with-desc {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.task-menu-note,
.task-menu-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.endgame-currency-row-with-note .endgame-currency-row-inner,
.endgame-currency-row-with-desc .endgame-currency-row-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.endgame-currency-note,
.endgame-currency-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-menu-name {
  justify-content: stretch;
  padding: 0.55rem;
}

.task-menu-name input {
  width: 100%;
}

.task-menu-label {
  justify-content: space-between;
  gap: 0.75rem;
  padding-inline: 0.85rem;
}

.task-menu-label input[type="number"] {
  width: 4.5rem;
}

.task-menu-control {
  justify-content: flex-start;
  padding-inline: 0.85rem;
}

.task-menu-control input[type="time"] {
  width: 9.5rem;
}

.task-menu-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

/* Daylight saving toggle: fill when on, outline when off (no check mark) */
.dst-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 2.5rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.dst-toggle:hover {
  border-color: var(--accent);
}

.dst-toggle:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.dst-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.day-cell {
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.day-cell:hover {
  background: rgba(124, 58, 237, 0.12);
}

.day-cell.active {
  background: rgba(124, 58, 237, 0.22);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.toggle-cell {
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}

.toggle-cell:hover {
  background: rgba(124, 58, 237, 0.12);
}

.toggle-cell.active {
  background: rgba(124, 58, 237, 0.22);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.task-menu-extra {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.task-menu-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
}

.task-menu-extra-row label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.task-menu-extra-row input {
  width: 10rem;
}

.task-time-remaining-value {
  font-weight: 600;
  color: var(--text);
}

.task-time-remaining-input {
  width: 10rem;
}

.task-time-remaining-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.task-time-remaining-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Game add options */
.game-add-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.game-add-option {
  text-align: left;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s ease;
  display: grid;
  gap: 0.25rem;
}

.game-add-option:hover {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.12);
}

.game-add-option:active {
  transform: translateY(1px);
}

.game-add-option.active {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.2);
}

.game-add-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.game-add-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
}

.form-row label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.extracurricular-add-row {
  margin-bottom: 1rem;
}

/* Extracurricular task modal: TBD checkbox = fill (no checkmark), description & select = dark theme */
#extracurricularTaskModal #extracurricularTaskEndDateTBD {
  width: 1.1em;
  height: 1.1em;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  vertical-align: middle;
}

#extracurricularTaskModal #extracurricularTaskEndDateTBD:checked {
  border-color: transparent;
  background: var(--accent);
}

#extracurricularTaskModal #extracurricularTaskDescription,
#extracurricularTaskModal #extracurricularTaskGame {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

#extracurricularTaskModal #extracurricularTaskDescription {
  resize: vertical;
  min-height: 4rem;
}

#extracurricularTaskModal #extracurricularTaskGame option {
  background: var(--bg-panel);
  color: var(--text);
}
