:root{
      --bg: #ffffff;
      --surface: #f8f9fb;
      --card: #ffffff;
      --muted: #5f6368;
      --text: #202124;
      --primary: #1a73e8; /* google blue */
      --accent: #1e88e5;
      --success: #0f9d58;
      --border: rgba(60,64,67,0.12);
      --shadow: 0 6px 18px rgba(60,64,67,0.08);
      --radius: 10px;
    }
    [data-theme="dark"]{
      --bg: #0f1720;
      --surface: #0b1220;
      --card: #0f1726;
      --muted: #9aa0a6;
      --text: #e6eef8;
      --primary: #8ab4ff;
      --accent: #9cc4ff;
      --success: #7bd389;
      --border: rgba(255,255,255,0.06);
      --shadow: 0 8px 30px rgba(2,6,23,0.6);
    }

    /* Reset & base */
    *{box-sizing:border-box}
    html,body{height:100%}
    body{
      margin:0;
      font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
      background: linear-gradient(180deg,var(--surface),var(--bg));
      color:var(--text);
      padding:20px;
      -webkit-font-smoothing:antialiased;
      -moz-osx-font-smoothing:grayscale;
    }

    /* --- THEME COLOR FIX --- */
    /* By explicitly setting colors with variables, we ensure all elements update correctly */
    /* when the theme changes, avoiding issues with browser defaults or inheritance. */
    h1, h3, label, strong {
      color: var(--text);
    }
    p.lead, .small, .meta, .badge, .chip, .stat .small, ul {
      color: var(--muted);
    }
    input[type="checkbox"] {
      accent-color: var(--primary); /* FIX: Ensures checkbox color matches theme */
    }
    /* --- END FIX --- */

    /* Toggle / mode styles (replaces old theme button) */
    .mode {
      display:flex;
      align-items:center;
      gap:10px;
      position: relative;
    }
    .mode .fas { display:none; } /* optional if font-awesome not present */
    .theme-switch {
      display:inline-block;
      position:relative;
      width:46px;
      height:26px;
      vertical-align:middle;
    }
    .theme-switch input {
      opacity:0;
      width:0;
      height:0;
      position:absolute;
      left:0; top:0;
    }
    .toggle-circle {
      position:absolute;
      inset:0;
      background:var(--surface);
      border-radius:999px;
      border:1px solid var(--border);
      transition: background .25s ease, box-shadow .25s ease;
    }
    .toggle-circle::before {
      content: "";
      position:absolute;
      left:4px;
      top:4px;
      width:18px;
      height:18px;
      border-radius:50%;
      background:var(--card);
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
      transition: transform .25s ease;
    }
    .theme-switch input:checked + .toggle-circle {
      background: linear-gradient(90deg, var(--primary), var(--accent));
      border-color: rgba(0,0,0,0.06);
    }
    .theme-switch input:checked + .toggle-circle::before {
      transform: translateX(20px);
      background: white;
    }
    /* End toggle styles */

    /* MODIFIED: Removed max-width, margin, radius, shadow for full-screen layout */
    .app {
      max-width: none; /* Changed from 1200px */
      margin: 0;
      border-radius: 0;
      overflow: visible;
      box-shadow: none;
      background: transparent; /* Simpler background for full-screen */
      border: none;
    }

    header.top {
      display:flex;
      gap:16px;
      align-items:center;
      justify-content:space-between;
      padding:16px 24px;
      background:linear-gradient(90deg, rgba(26,115,232,0.06), transparent);
      border-bottom:1px solid var(--border);
    }
    .title {
      display:flex;
      gap:14px;
      align-items:center;
    }
    .logo {
      width:48px;height:38px;border-radius:10px;
      background:linear-gradient(135deg,var(--primary),var(--accent));
      display:flex;align-items:center;justify-content:center;color:white;font-weight:700;
      box-shadow: 0 6px 18px rgba(26,115,232,0.12);
    }
    h1{font-size:1.15rem;margin:0;padding:0}
    p.lead{margin:0;font-size:0.9rem}

    .header-actions {
      display:flex;
      align-items:center;
      gap:10px;
    }

    .badge {
      background:transparent;
      border:1px dashed var(--border);
      padding:6px 10px;
      border-radius:999px;
      font-size:0.85rem;
      display:inline-flex;
      gap:8px;
      align-items:center;
    }

    .primary-btn {
      background:var(--primary);
      color:white;
      padding:8px 12px;
      border-radius:8px;
      border:none;
      cursor:pointer;
      font-weight:500;
      box-shadow: 0 6px 18px rgba(26,115,232,0.12);
    }
    .ghost-btn {
      background:transparent;border:1px solid var(--border);
      padding:8px 12px;border-radius:8px;color:var(--text);cursor:pointer;
    }

    main {
      display:grid;
      grid-template-columns: 360px 1fr;
      gap:14px;
      padding:16px;
    }

    /* Sidebar */
    .sidebar {
      padding:14px;
      border-right:1px solid var(--border);
      background: var(--card);
      border-radius: var(--radius);
    }
    .stats {
      display:flex;flex-direction:column;gap:8px;margin-bottom:14px;
    }
    .stat {
      background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
      border-radius:8px;padding:10px;border:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;
    }
    .stat strong{font-size:1.05rem}
    .controls {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}

    .search {
      display:flex; gap:8px;margin-bottom:10px;
    }
    .search input{
      flex:1;padding:10px;border-radius:8px;border:1px solid var(--border);background:transparent;color:var(--text);
    }

    /* Checklist area */
    .content {
      padding:14px;
    }
    .controls-row {display:flex;gap:8px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
    .chip {padding:8px 10px;border-radius:10px;border:1px solid var(--border);background:transparent;font-size:0.9rem;}

    .categories {
      display:grid;
      grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
      gap:12px;
    }

    .category {
      border-radius:10px;
      padding:0;
      border:1px solid var(--border);
      background:var(--card);
      overflow:hidden;
      display:flex;
      flex-direction:column;
    }
    .cat-head {
      display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border);
      cursor:pointer;
    }
    .cat-head h3{margin:0;font-size:0.95rem}
    .progress-bar {
      width:150px;height:8px;border-radius:999px;
      background: var(--surface); /* FIX: Was rgba(0,0,0,0.06), invisible in dark mode */
      overflow:hidden;border:1px solid var(--border);
    }
    .progress-bar > i {
      display:block;height:100%;background:linear-gradient(90deg,var(--success),var(--primary));width:0%;
      transition:width .35s ease;
    }
    .cat-body {
      padding:8px 10px;max-height:420px;overflow:auto;transition:max-height .3s ease;
    }
    .collapsed .cat-body {max-height:0;padding:0 10px}
    .test-item {
      display:flex;align-items:flex-start;gap:10px;padding:8px;border-radius:8px;margin-bottom:6px;border:1px dashed var(--border);
      background:linear-gradient(180deg, transparent, rgba(0,0,0,0.01));
    }
    .test-item label{flex:1;cursor:pointer}
    .meta {font-size:0.78rem;margin-top:6px}

    footer {
      padding:14px 20px;border-top:1px solid var(--border);
      display:flex;justify-content:space-between;align-items:center;
    }

    /* Responsive */
    @media (max-width:980px){
      main{grid-template-columns:1fr;padding:12px}
      .sidebar{border-right:none;border-bottom:1px solid var(--border)}
      body{padding: 0;}
      header.top, main, footer {padding-left: 12px; padding-right: 12px;}
    }

    /* Modal styles */
    .modal-container {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .modal-content {
      background-color: var(--card);
      padding: 20px;
      border-radius: 10px;
      width: 400px;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border);
      padding-bottom: 10px;
      margin-bottom: 10px;
    }

    .close-btn {
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
    }

    .export-options {
      display: flex;
      justify-content: space-around;
      margin-top: 20px;
    }

    /* Description styles */
    .description {
      margin-top: 10px;
      padding: 10px;
      background-color: var(--surface);
      border-radius: 5px;
      font-size: 0.9rem;
    }
    
    .toggle-description {
        background: transparent;
        border: 1px solid var(--border);
        color: var(--text);
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
    }
    
