:root {
        --cream: #fff0d2;
        --green: #405c26;
        --brown: #805333;
        --ink: #302710;
        --card-border: #49351f;
        --image-border: #ffdc9c;
        --divider: #cda778;
        --yellow-status: #f4eba6;
        --yellow-border: #879044;
        --waiting-status: #eee8cd;
        --waiting-border: #70725a;
        --focus-ring: #1f6f3b;
        --page-width: 393px;
        --page-height: 852px;
      }

      * {
        box-sizing: border-box;
      }

      html {
        min-height: 100%;
        background: var(--cream);
        overscroll-behavior: none;
      }

      body {
        min-width: 0;
        min-height: 100dvh;
        margin: 0;
        overflow: hidden;
        overscroll-behavior: none;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--cream);
        color: var(--brown);
        font-family: "Nunito", system-ui, sans-serif;
      }

      button,
      a {
        font: inherit;
      }

      a {
        color: inherit;
      }

      .skip-link {
        position: fixed;
        z-index: 10;
        top: 8px;
        left: 8px;
        padding: 8px 12px;
        border-radius: 10px;
        background: var(--green);
        color: #fff;
        transform: translateY(-160%);
        transition: transform 180ms ease;
      }

      .skip-link:focus-visible {
        transform: translateY(0);
      }

      .app-shell {
        position: relative;
        width: min(100%, var(--page-width));
        min-height: min(var(--page-height), 100dvh);
        overflow: hidden;
        background: var(--cream);
      }

      body.is-loading .page:not([hidden]) {
        visibility: hidden;
      }

      .loading-screen {
        position: absolute;
        z-index: 4;
        inset: 0;
        min-height: min(var(--page-height), 100dvh);
        display: grid;
        place-content: center;
        justify-items: center;
        gap: 14px;
        background: var(--cream);
      }

      .loading-spinner {
        width: 44px;
        height: 44px;
        border: 4px solid rgb(64 92 38 / 20%);
        border-top-color: var(--green);
        border-radius: 50%;
        animation: spinner-rotate 780ms linear infinite;
      }

      .loading-label {
        margin: 0;
        color: var(--green);
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
      }

      @keyframes spinner-rotate {
        to {
          transform: rotate(360deg);
        }
      }

      .page {
        width: 100%;
        min-height: min(var(--page-height), 100dvh);
        padding: 16px 16px max(16px, env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
      }

      .site-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 12px 0;
        text-align: center;
      }

      .header-main {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: clamp(8px, 3.8vw, 15px);
        width: 100%;
      }

      .header-heart {
        width: clamp(50px, 17.8vw, 70px);
        height: auto;
        flex: 0 1 auto;
      }

      .site-title {
        margin: 0;
        color: var(--green);
        font-size: clamp(32px, 10vw, 38px);
        font-weight: 800;
        line-height: 1.08;
      }

      .site-subtitle {
        margin: 0;
        color: var(--brown);
        font-size: 16px;
        font-weight: 700;
        line-height: 1.25;
      }

      .calendar-list {
        display: grid;
        gap: 16px;
        margin: 0;
        padding: 0;
        list-style: none;
      }

      .calendar-card {
        display: grid;
        grid-template-columns: clamp(116px, 50%, 170px) minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        padding: 5px 12px 5px 5px;
        border: 1px solid var(--card-border);
        border-radius: 20px;
        background: rgb(255 255 255 / 12%);
        color: var(--brown);
        text-decoration: none;
        transition:
          transform 180ms ease,
          box-shadow 180ms ease,
          background-color 180ms ease;
      }

      .calendar-card:hover {
        background: rgb(255 255 255 / 24%);
        box-shadow: 0 8px 18px rgb(73 53 31 / 12%);
      }

      .calendar-card--disabled {
        cursor: default;
        opacity: 0.78;
      }

      .calendar-card--disabled:hover {
        background: rgb(255 255 255 / 12%);
        box-shadow: none;
      }

      .calendar-card:focus-visible {
        outline: 3px solid var(--focus-ring);
        outline-offset: 3px;
      }

      .calendar-card:active {
        transform: translateY(2px) scale(0.99);
        box-shadow: none;
      }

      .calendar-art {
        width: 100%;
        aspect-ratio: 17 / 15;
        align-self: end;
        border: 1px solid var(--image-border);
        border-radius: 15px;
        background-color: #d3d3d3;
        background-repeat: no-repeat;
        background-position: var(--product-position), center;
        background-size: var(--product-size), cover;
      }

      .calendar-art--hello-kitty {
        --product-position: 18.451px -13.43px;
        --product-size: 78.581% 118.745%;
        background-image:
          url("img/main-page/hello-kitty/image.webp"),
          url("img/main-page/hello-kitty/background.webp");
      }

      .calendar-art--payot {
        --product-position: 0.491px -38.805px;
        --product-size: 100% 151.111%;
        background-image:
          url("img/main-page/payot/image.webp"),
          url("img/main-page/payot/background.webp");
      }

      .calendar-art--kinder-mix {
        --product-position: 43.529px 11.583px;
        --product-size: 49.181% 83.934%;
        background-image:
          url("img/main-page/kinder-mix/image.webp"),
          url("img/main-page/kinder-mix/background.webp");
      }

      .calendar-copy {
        min-width: 0;
        min-height: 150px;
        padding: 8px 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
      }

      .calendar-status {
        max-width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 24px;
        padding: 1px 8px;
        border: 1px solid var(--yellow-border);
        border-radius: 15px;
        background: var(--yellow-status);
        color: var(--ink);
        font-size: clamp(11px, 3.2vw, 12.5px);
        font-weight: 800;
        line-height: 1.2;
        white-space: nowrap;
      }

      .calendar-status[data-state="waiting"] {
        border-color: var(--waiting-border);
        background: var(--waiting-status);
      }

      .calendar-title {
        align-self: stretch;
        margin: 0;
        color: var(--brown);
        font-size: clamp(20px, 6.1vw, 24px);
        font-weight: 800;
        line-height: 1.08;
        overflow-wrap: anywhere;
      }

      .calendar-progress {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
      }

      .calendar-divider {
        width: 100%;
        height: 1px;
        background: var(--divider);
      }

      .calendar-progress-label {
        margin: 0;
        color: var(--brown);
        font-size: clamp(15px, 4.3vw, 17px);
        font-weight: 700;
        line-height: 1.2;
      }

      .bottom-illustration {
        margin-top: auto;
        padding-top: 8px;
        display: flex;
        justify-content: center;
        align-items: flex-end;
      }

      .bottom-illustration img {
        display: block;
        width: min(100%, 369.24px);
        height: auto;
      }

      .detail-page {
        gap: 16px;
      }

      .detail-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
      }

      .back-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        border: 1px solid var(--card-border);
        border-radius: 14px;
        background: rgb(255 255 255 / 20%);
        color: var(--green);
        text-decoration: none;
        font-size: 24px;
        line-height: 1;
      }

      .back-link:focus-visible,
      .day-button:focus-visible {
        outline: 3px solid var(--focus-ring);
        outline-offset: 3px;
      }

      .detail-title {
        margin: 0;
        color: var(--green);
        font-size: clamp(25px, 8vw, 32px);
        font-weight: 800;
        line-height: 1.05;
      }

      .detail-summary {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.3;
      }

      .detail-status {
        margin: 0;
        color: var(--brown);
        font-size: 17px;
        font-weight: 700;
        line-height: 1.3;
      }

      .day-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
      }

      .day-button {
        min-width: 0;
        min-height: 48px;
        padding: 6px;
        border: 1px solid var(--card-border);
        border-radius: 12px;
        background: #fff8e9;
        color: var(--green);
        cursor: pointer;
        font-size: 18px;
        font-weight: 800;
        line-height: 1;
        transition:
          transform 180ms ease,
          background-color 180ms ease,
          color 180ms ease;
      }

      .day-button:hover {
        background: #f4eba6;
      }

      .day-button:active {
        transform: translateY(2px) scale(0.97);
      }

      .day-button[data-opened="true"] {
        background: var(--green);
        color: #fff8e9;
      }

      .day-button:disabled {
        cursor: not-allowed;
        opacity: 0.55;
      }

      .day-button:disabled:hover {
        background: #fff8e9;
      }

      .detail-note {
        margin: 0;
        color: var(--brown);
        font-size: 14px;
        line-height: 1.35;
      }

      .toast {
        position: fixed;
        z-index: 5;
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
        left: 16px;
        max-width: 361px;
        margin: auto;
        padding: 10px 14px;
        border: 1px solid var(--card-border);
        border-radius: 14px;
        background: var(--green);
        color: #fff;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.25;
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
        transition:
          opacity 180ms ease,
          transform 180ms ease;
      }

      .toast[data-visible="true"] {
        opacity: 1;
        transform: translateY(0);
      }

      [hidden] {
        display: none !important;
      }

      @media (max-height: 700px) {
        .page {
          padding-top: 16px;
        }

        .bottom-illustration {
          padding-top: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
          scroll-behavior: auto !important;
          transition-duration: 0.01ms !important;
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
        }

        .loading-spinner {
          animation: none;
        }
      }
