:root {
      box-sizing: border-box;
      padding-top: env(safe-area-inset-top, 0px);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      --bg: #94edff;
      --text: #000000;
      --muted: #64748b;
      --line: #e2e8f0;
      --card: #ffffff60;
      --class-bg: #dbeafe;
      --class-bd: #2563eb;
      --class-fg: #1e3a8a;
      --job-bg: #dcfce7;
      --job-bd: #16a34a;
      --job-fg: #14532d;
      --meal-bg: #fef9c3;
      --meal-bd: #ca8a04;
      --meal-fg: #713f12;
      --flex-bg: #ede9fe;
      --flex-bd: #7c3aed;
      --flex-fg: #4c1d95;
      --free-bg: #ccfbf1;
      --free-bd: #0d9488;
      --free-fg: #134e4a;
      --base-bg: #f1f5f9;
      --base-bd: #94a3b8;
      --base-fg: #334155;
      --club-bg: #fee2e2;
      --club-bd: #b91c1c;
      --club-fg: #450a0a;
      --appt-bg: #fdf2f8;
      --appt-bd: #ec4899;
      --appt-fg: #831843;
      --studio-bg: #dbeafe;
      --studio-bd: #2563eb;
      --studio-fg: #1e3a8a;
    }

    body.dark {
      --bg: #240038;
      --text: #ffffff;
      --muted: #94a3b8;
      --line: #263248;
      --card: #a78aff60;
      --class-bg: #1e2f5c;
      --class-bd: #60a5fa;
      --class-fg: #dbeafe;
      --job-bg: #14401f;
      --job-bd: #4ade80;
      --job-fg: #dcfce7;
      --meal-bg: #46390c;
      --meal-bd: #facc15;
      --meal-fg: #fef9c3;
      --flex-bg: #2e2358;
      --flex-bd: #a78bfa;
      --flex-fg: #ede9fe;
      --free-bg: #0f3b38;
      --free-bd: #2dd4bf;
      --free-fg: #ccfbf1;
      --base-bg: #1f2937;
      --base-bd: #64748b;
      --base-fg: #e2e8f0;
      --club-bg: #4b0d1f;
      --club-bd: #f87171;
      --club-fg: #fee2e2;
      --appt-bg: #4b1232;
      --appt-bd: #f472b6;
      --appt-fg: #fdf2f8;
      --studio-bg: #1e3a8a;
      --studio-bd: #60a5fa;
      --studio-fg: #dbeafe;
    }

    html {
      scroll-padding-top: env(safe-area-inset-top, 0px)
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: 'Lato', sans-serif;
      padding: 20px 14px 32px
    }

    main {
      max-width: 1100px;
      margin: 0 auto
    }

    h1 {
      font-size: 1.5rem;
      margin: 0 0 4px
    }

    .sub {
      color: var(--text);
      font-size: 1rem;
      font-weight: 700;
      padding-top: 16px;
      margin: 0 0 14px;
      text-align: center
    }

    .legend {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-bottom: 14px
    }

    .chip {
      font-size: .78rem;
      padding: 3px 10px;
      border-radius: 99px;
      border-left: 4px solid;
      font-weight: 600
    }

    .wrap {
      overflow-x: auto;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 5px
    }

    .mobile-schedule {
      display: none
    }

    .mobile-days {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 5px;
      margin-bottom: 14px
    }

    .mobile-days button {
      box-sizing: border-box;
      width: 100%;
      min-height: 44px;
      margin: 0;
      padding: 8px 2px;
      border: 1px solid var(--line);
      border-radius: 4px;
      background: var(--card);
      color: var(--text);
      font-size: .82rem;
      font-weight: 700
    }

    .mobile-days button[aria-selected="true"] {
      border-color: #7c3aed;
      background: #ede9fe;
      color: #4c1d95
    }

    .mobile-days button.is-current {
      box-shadow: inset 0 -3px #7c3aed
    }

    .hd.is-current {
      border-bottom: 4px solid #53baff;
      background: var(--card);
      color: var(--text);
      font-weight: 800
    }

    body.dark .mobile-days button[aria-selected="true"] {
      border-color: #a78bfa;
      background: #2e2358;
      color: #ede9fe
    }

    body.dark .mobile-days button.is-current {
      box-shadow: inset 0 -3px #a78bfa
    }

    body.dark .hd.is-current {
      border-bottom-color: #a78bfa;
      background: #2e2358;
      color: #ede9fe
    }

    .mobile-day-heading {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin: 0 0 10px
    }

    .mobile-day-heading h2 {
      margin: 0
    }

    .mobile-day-heading span {
      color: var(--muted);
      font-size: .82rem
    }

    .mobile-events {
      display: grid;
      gap: 8px
    }

    .mobile-event {
      display: grid;
      grid-template-columns: 78px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 54px;
      padding: 9px 10px;
      border-left: 4px solid var(--event-border);
      border-radius: 4px;
      background: var(--event-bg);
      color: var(--event-fg)
    }

    .mobile-event-time {
      font-size: .78rem;
      font-weight: 700;
      line-height: 1.35
    }

    .mobile-event-name {
      display: block;
      font-size: .95rem;
      line-height: 1.3
    }

    .mobile-event-category {
      display: block;
      margin-top: 2px;
      font-size: .75rem;
      opacity: .8
    }

    .grid {
      display: grid;
      grid-template-columns: 52px repeat(7, minmax(104px, 1fr));
      min-width: 820px
    }

    .hd {
      position: sticky;
      top: 0;
      text-align: center;
      font-weight: 700;
      font-size: .85rem;
      padding: 10px 4px;
      border-bottom: 1px solid var(--line);
      background: var(--card)
    }

    .times {
      position: relative
    }

    .times span {
      position: absolute;
      right: 6px;
      font-size: .68rem;
      color: var(--muted);
      transform: translateY(-50%)
    }

    .times span:first-child {
      transform: translateY(0)
    }

    .col {
      position: relative;
      border-left: 1px solid var(--line);
      background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 48px)
    }

    .ev {
      position: absolute;
      left: 3px;
      right: 3px;
      border-left: 4px solid;
      border-radius: 6px;
      padding: 3px 6px;
      font-size: .72rem;
      line-height: 1.25;
      overflow: hidden;
      box-sizing: border-box
    }

    .ev b {
      display: block;
      font-size: .76rem
    }

    .ev i {
      font-style: normal;
      opacity: .8;
      font-size: .66rem
    }

    .note {
      color: var(--muted);
      font-size: .82rem;
      margin-top: 12px
    }

    @media (max-width: 600px) {
      body {
        padding: 16px 10px 24px
      }

      h1 {
        margin: 32px 38px 8px;
        font-size: clamp(1rem, 5vw, 1.25rem)
      }

      .sub {
        line-height: 1.5
      }

      .legend {
        gap: 6px
      }

      .chip {
        font-size: .72rem;
        padding: 3px 8px
      }

      .wrap {
        display: none
      }

      .mobile-schedule {
        display: block
      }
    }
