:root {
      --bg: #f5f7fb;
      --card: #ffffff;
      --text: #172033;
      --muted: #64748b;
      --accent: #2563eb;
      --border: #e2e8f0;
    }
* {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
      color: var(--text);
      background: var(--bg);
    }

    .wrap {
      width: min(1120px, calc(100% - 32px));
      margin: 0 auto;
      padding: 48px 0;
    }

    /* Top page header */

    .page-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 24px;
      margin-bottom: 40px;
    }

    .page-title {
      min-width: 0;
    }

    h1 {
      margin: 0 0 8px;
      font-size: clamp(2.2rem, 6vw, 3.8rem);
      line-height: 1.05;
      letter-spacing: -0.04em;
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
      font-size: 1.05rem;
    }

    /* Google Meet button */
    .header-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }

    .meet-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      flex-shrink: 0;
      padding: 13px 18px;
      color: white;
      background: var(--accent);
      border-radius: 14px;
      text-decoration: none;
      font-weight: 700;
      box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
      transition:
        transform 0.18s ease,
        opacity 0.18s ease,
        box-shadow 0.18s ease;
    }

    .meet-button:hover,
    .meet-button:focus-visible {
      transform: translateY(-2px);
      opacity: 0.94;
      box-shadow: 0 12px 25px rgba(37, 99, 235, 0.24);
      outline: none;
    }

    /* Dashboard rows */

    .dashboard-row {
      margin-bottom: 38px;
    }

    .row-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 15px;
    }

    .row-heading h2 {
      margin: 0 0 5px;
      font-size: 1.45rem;
    }

    .row-heading p {
      margin: 0;
      color: var(--muted);
      line-height: 1.5;
    }

    .scroll-hint {
      flex-shrink: 0;
      margin: 0;
      color: var(--muted);
      font-size: 0.9rem;
    }

    /* Horizontal card scroller */

    .card-scroller {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(330px, 42%);
      gap: 18px;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 3px 3px 17px;
      scroll-snap-type: x mandatory;
      scrollbar-width: thin;
      scrollbar-color: var(--muted) var(--border);
      overscroll-behavior-inline: contain;
    }

    .card-scroller::-webkit-scrollbar {
      height: 10px;
    }

    .card-scroller::-webkit-scrollbar-track {
      background: var(--border);
      border-radius: 999px;
    }

    .card-scroller::-webkit-scrollbar-thumb {
      background: var(--muted);
      border-radius: 999px;
    }

    /* Workbook cards */

    .card {
      display: flex;
      flex-direction: column;
      min-height: 245px;
      padding: 24px;
      color: inherit;
      text-decoration: none;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 20px;
      scroll-snap-align: start;
      transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
    }

    .card:hover,
    .card:focus-visible {
      transform: translateY(-3px);
      border-color: var(--accent);
      box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
      outline: none;
    }

    .icon {
      display: grid;
      place-items: center;
      width: 48px;
      height: 48px;
      margin-bottom: 18px;
      border-radius: 14px;
      background: #eff6ff;
      font-size: 1.5rem;
    }

    .card h3 {
      margin: 0 0 8px;
      font-size: 1.2rem;
    }

    .description {
      margin: 0 0 20px;
      color: var(--muted);
      line-height: 1.58;
    }

    .open {
      margin-top: auto;
      color: var(--accent);
      font-weight: 700;
    }

    footer {
      margin-top: 8px;
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.5;
    }

    .site-content {
      display: block;
    }

    .hidden {
      display: none !important;
    }


    .user-chip {
      max-width: 210px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 10px 12px;
      border-radius: 999px;
      background: #eff6ff;
      color: var(--accent);
      font-size: 0.82rem;
      font-weight: 700;
    }

    /* Login Screen */

    .signin-screen {
      position: fixed;
      inset: 0;
      z-index: 9999;

      display: grid;
      place-items: center;

      padding: 24px;

      background: var(--bg);
    }

    .signin-card {
      width: min(430px, 100%);

      padding: 32px;

      background: var(--card);

      border: 1px solid var(--border);
      border-radius: 22px;

      text-align: center;
    }

    .signin-icon {
      display: grid;
      place-items: center;

      width: 56px;
      height: 56px;

      margin: 0 auto 18px;

      border-radius: 16px;

      background: #eff6ff;

      font-size: 1.7rem;
    }

    .signin-card h2 {
      margin: 0 0 8px;

      font-size: 1.7rem;
    }

    .signin-card p {
      margin: 0 0 22px;

      color: var(--muted);

      line-height: 1.5;
    }

    .google-signin-button {
      width: 100%;

      padding: 13px 18px;

      border: 0;
      border-radius: 12px;

      background: var(--accent);

      color: white;

      font: inherit;
      font-weight: 700;

      cursor: pointer;
    }

    .signin-error {
      min-height: 22px;

      margin-top: 12px !important;

      color: #b91c1c !important;

      font-size: 0.9rem;
    }

    .signout-button {
      padding: 12px 16px;

      border: 1px solid var(--border);
      border-radius: 12px;

      background: var(--card);

      color: var(--text);

      font: inherit;
      font-weight: 700;

      cursor: pointer;
    }

    /* Mobile layout */

    @media (max-width: 700px) {
      .header-actions {
        width: 100%;
        flex-direction: column;
      }

      .header-actions .meet-button {
        width: 100%;
      }

      .wrap {
        width: min(100% - 24px, 1120px);
        padding: 30px 0;
      }

      .page-header {
        flex-direction: column;
        margin-bottom: 34px;
      }

      .meet-button {
        width: 100%;
      }

      .row-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
      }

      .card-scroller {
        grid-auto-columns: 88%;
      }

      .card {
        min-height: 270px;
      }
    }

    @media (max-width: 420px) {
      .card-scroller {
        grid-auto-columns: 94%;
      }
    }
