/* Reset & base */
    *, *::before, *::after {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
      background: linear-gradient(135deg, #d9e9f8 0%, #f0f5fa 100%);
      color: #1c1c1e;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      padding: 2rem 1rem;
      animation: pageFadeScale 0.35s ease forwards;
      opacity: 0;
      transform: scale(0.98);
    }
    @keyframes pageFadeScale {
      to {
        opacity: 1;
        transform: scale(1);
      }
    }
    .container {
      max-width: 480px;
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }
    h1 {
      font-weight: 700;
      font-size: 1.875rem;
      text-align: center;
      color: #0a84ff;
      text-shadow: 0 0 6px rgba(10, 132, 255, 0.3);
      margin: 0 0 1rem 0;
      user-select: none;
    }

    /* Glassmorphic card base */
    .glass-card {
      background: rgba(255 255 255 / 0.25);
      border-radius: 20px;
      box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.1),
        0 0 0 1px rgba(255 255 255 / 0.18);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255 255 255 / 0.3);
      padding: 1.25rem 1.5rem;
      color: #1c1c1e;
      user-select: none;
      opacity: 0;
      transform: translateY(15px);
      animation: fadeSlideUp 0.3s ease forwards;
    }
    @keyframes fadeSlideUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Form styling */
    form.glass-card {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }
    label {
      font-weight: 600;
      font-size: 0.9rem;
      color: #1c1c1ecc;
      margin-bottom: 0.25rem;
      user-select: text;
    }
    input[type="number"] {
      width: 100%;
      padding: 0.6rem 1rem;
      font-size: 1rem;
      border-radius: 14px;
      border: 1.5px solid rgba(255 255 255 / 0.6);
      background: rgba(255 255 255 / 0.35);
      box-shadow:
        inset 0 0 8px rgba(255 255 255 / 0.7),
        0 0 8px rgba(10, 132, 255, 0.15);
      color: #1c1c1e;
      outline-offset: 2px;
      transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
      -webkit-appearance: none;
      -moz-appearance: textfield;
    }
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    input[type="number"]:focus {
      background: rgba(255 255 255 / 0.6);
      border-color: #0a84ff;
      box-shadow:
        inset 0 0 14px rgba(10, 132, 255, 0.6),
        0 0 14px rgba(10, 132, 255, 0.5);
      color: #0a84ff;
      transition: box-shadow 0.3s ease, background-color 0.3s ease;
    }

    /* Buttons */
    button {
      cursor: pointer;
      font-weight: 700;
      font-size: 1.1rem;
      padding: 0.75rem 0;
      border-radius: 24px;
      border: none;
      background: linear-gradient(135deg, rgba(10,132,255,0.7), rgba(0,122,255,0.9));
      color: white;
      box-shadow:
        0 8px 20px rgba(10, 132, 255, 0.4);
      transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.15s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      will-change: transform, box-shadow, background;
    }
    button:hover,
    button:focus-visible {
      background: linear-gradient(135deg, rgba(10,132,255,0.9), rgba(0,122,255,1));
      box-shadow:
        0 12px 30px rgba(10, 132, 255, 0.6);
      outline: none;
    }
    button:active {
      animation: buttonPress 0.2s ease forwards;
    }
    @keyframes buttonPress {
      0% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(10, 132, 255, 0.6);
      }
      50% {
        transform: scale(0.92);
        box-shadow: 0 6px 15px rgba(10, 132, 255, 0.3);
      }
      100% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(10, 132, 255, 0.6);
      }
    }
    button:disabled {
      background: rgba(10,132,255,0.3);
      box-shadow: none;
      cursor: default;
      color: #cbd5e1;
      transform: none;
    }

    /* Result container */
    #result {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
    .table-display {
      background: rgba(255 255 255 / 0.3);
      border-radius: 20px;
      padding: 1rem 1.25rem;
      box-shadow:
        0 4px 16px rgba(31, 38, 135, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255 255 255 / 0.25);
      color: #1c1c1e;
      font-weight: 600;
      font-size: 1rem;
      user-select: text;
      opacity: 0;
      transform: translateY(15px);
      animation: fadeSlideUp 0.3s ease forwards;
      animation-delay: var(--delay, 0s);
    }
    .table-display h3 {
      margin: 0 0 0.25rem 0;
      font-weight: 700;
      color: #0a84ff;
      text-shadow: 0 0 4px rgba(10, 132, 255, 0.3);
    }
    .table-display p {
      margin: 0;
      font-weight: 600;
      color: #1c1c1edd;
    }

    /* History */
    #history {
      background: rgba(255 255 255 / 0.25);
      border-radius: 20px;
      padding: 1rem 1.25rem;
      box-shadow:
        0 4px 16px rgba(31, 38, 135, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255 255 255 / 0.25);
      color: #1c1c1e;
      user-select: none;
      opacity: 0;
      transform: translateY(15px);
      animation: fadeSlideUp 0.3s ease forwards;
      animation-delay: 0.15s;
    }
    #history h2 {
      margin-top: 0;
      margin-bottom: 1rem;
      font-weight: 700;
      color: #0a84ff;
      text-shadow: 0 0 4px rgba(10, 132, 255, 0.3);
      user-select: text;
    }
    #historyList {
      max-height: 220px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      user-select: text;
    }
    .history-item {
      background: rgba(255 255 255 / 0.35);
      border-radius: 14px;
      padding: 0.75rem 1rem;
      box-shadow:
        0 2px 8px rgba(31, 38, 135, 0.08);
      border: 1px solid rgba(255 255 255 / 0.3);
      font-size: 0.9rem;
      color: #1c1c1edd;
      line-height: 1.3;
      opacity: 0;
      transform: translateY(10px);
      animation: fadeSlideUp 0.25s ease forwards;
      animation-fill-mode: forwards;
    }
    /* Stagger animation for history items */
    .history-item:nth-child(1) { animation-delay: 0.1s; }
    .history-item:nth-child(2) { animation-delay: 0.2s; }
    .history-item:nth-child(3) { animation-delay: 0.3s; }
    .history-item:nth-child(4) { animation-delay: 0.4s; }
    .history-item:nth-child(5) { animation-delay: 0.5s; }
    .history-item:nth-child(6) { animation-delay: 0.6s; }
    .history-item:nth-child(7) { animation-delay: 0.7s; }
    .history-item:nth-child(8) { animation-delay: 0.8s; }
    .history-item:nth-child(9) { animation-delay: 0.9s; }
    .history-item:nth-child(10) { animation-delay: 1s; }

    #clearHistory {
      margin-top: 1rem;
      width: 100%;
      background: linear-gradient(135deg, rgba(255, 69, 58, 0.7), rgba(255, 59, 48, 0.9));
      box-shadow:
        0 8px 20px rgba(255, 59, 48, 0.4);
      transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.15s ease;
      user-select: none;
      will-change: transform, box-shadow, background;
    }
    #clearHistory:hover,
    #clearHistory:focus-visible {
      background: linear-gradient(135deg, rgba(255, 69, 58, 0.9), rgba(255, 59, 48, 1));
      box-shadow:
        0 12px 30px rgba(255, 59, 48, 0.6);
      outline: none;
    }
    #clearHistory:active {
      animation: buttonPressRed 0.2s ease forwards;
    }
    @keyframes buttonPressRed {
      0% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(255, 59, 48, 0.6);
      }
      50% {
        transform: scale(0.92);
        box-shadow: 0 6px 15px rgba(255, 59, 48, 0.3);
      }
      100% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(255, 59, 48, 0.6);
      }
    }

    /* Export area */
    .export-area {
      background: rgba(255 255 255 / 0.25);
      border-radius: 20px;
      padding: 1rem 1.25rem;
      box-shadow:
        0 4px 16px rgba(31, 38, 135, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255 255 255 / 0.25);
      color: #1c1c1e;
      user-select: none;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      opacity: 0;
      transform: translateY(15px);
      animation: fadeSlideUp 0.3s ease forwards;
      animation-delay: 0.3s;
    }
    .export-area h2 {
      margin: 0;
      font-weight: 700;
      color: #0a84ff;
      text-shadow: 0 0 4px rgba(10, 132, 255, 0.3);
      user-select: text;
    }
    .export-area button {
      width: fit-content;
      padding: 0.5rem 1.25rem;
      font-weight: 600;
      font-size: 1rem;
      border-radius: 20px;
      border: none;
      box-shadow:
        0 6px 18px rgba(10, 132, 255, 0.3);
      transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.15s ease;
      user-select: none;
      margin-right: 0.75rem;
      display: inline-block;
      will-change: transform, box-shadow, background;
    }
    #exportCSV {
      background: linear-gradient(135deg, rgba(52, 199, 89, 0.7), rgba(48, 209, 88, 0.9));
      color: white;
    }
    #exportCSV:hover,
    #exportCSV:focus-visible {
      background: linear-gradient(135deg, rgba(52, 199, 89, 0.9), rgba(48, 209, 88, 1));
      box-shadow:
        0 10px 28px rgba(48, 209, 88, 0.6);
      outline: none;
    }
    #exportCSV:active {
      animation: buttonPressGreen 0.2s ease forwards;
    }
    @keyframes buttonPressGreen {
      0% {
        transform: scale(1);
        box-shadow: 0 10px 28px rgba(48, 209, 88, 0.6);
      }
      50% {
        transform: scale(0.92);
        box-shadow: 0 6px 15px rgba(48, 209, 88, 0.3);
      }
      100% {
        transform: scale(1);
        box-shadow: 0 10px 28px rgba(48, 209, 88, 0.6);
      }
    }
    #exportPDF {
      background: linear-gradient(135deg, rgba(255, 204, 0, 0.7), rgba(255, 214, 10, 0.9));
      color: #1c1c1e;
      cursor: not-allowed;
      opacity: 0.6;
      box-shadow: none;
      margin-right: 0;
    }
    #exportText {
      width: 100%;
      height: 140px;
      border-radius: 16px;
      border: 1.5px solid rgba(255 255 255 / 0.4);
      background: rgba(255 255 255 / 0.3);
      box-shadow:
        inset 0 0 10px rgba(255 255 255 / 0.7);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      padding: 0.75rem 1rem;
      font-family: monospace, monospace;
      font-size: 0.9rem;
      color: #1c1c1e;
      resize: none;
      user-select: text;
      transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
    }
    #exportText:focus {
      background: rgba(255 255 255 / 0.5);
      border-color: #0a84ff;
      outline: none;
      box-shadow:
        inset 0 0 14px rgba(10, 132, 255, 0.5);
      color: #0a84ff;
    }

    /* Chart */
    #chart {
      margin-top: 1rem;
      user-select: none;
      opacity: 0;
      transform: translateY(15px);
      animation: fadeSlideUp 0.3s ease forwards;
      animation-delay: 0.45s;
    }
    #chart h2 {
      font-weight: 700;
      color: #0a84ff;
      text-shadow: 0 0 4px rgba(10, 132, 255, 0.3);
      margin-bottom: 0.75rem;
      user-select: text;
    }
    .chart-container {
      background: rgba(255 255 255 / 0.25);
      border-radius: 20px;
      box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.1);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255 255 255 / 0.3);
      padding: 1.5rem 2rem;
      color: #1c1c1e;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
    .chart-bar-container {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .chart-bar {
      height: 40px;
      background: linear-gradient(90deg, rgba(10, 132, 255, 0.7), rgba(0, 122, 255, 0.9)); /* Soft blue for indoor */
      border-radius: 20px;
      box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 1rem;
      font-weight: 600;
      color: white;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .chart-bar.outdoor {
      background: linear-gradient(90deg, rgba(52, 199, 89, 0.7), rgba(48, 209, 88, 0.9)); /* Soft green for outdoor */
      box-shadow: 0 4px 12px rgba(48, 209, 88, 0.4);
    }
    .chart-bar:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(10, 132, 255, 0.6);
    }
    .chart-bar.outdoor:hover {
      box-shadow: 0 6px 16px rgba(48, 209, 88, 0.6);
    }
    .chart-summary {
      text-align: center;
      font-weight: 700;
      color: #1c1c1e;
      margin-top: 0.5rem;
    }

    /* Responsive */
    @media (max-width: 520px) {
      .container {
        max-width: 100%;
      }
      h1 {
        font-size: 1.5rem;
      }
      button {
        font-size: 1rem;
      }
      .table-display {
        font-size: 0.95rem;
      }
      #historyList {
        max-height: 160px;
      }
      .history-item {
        font-size: 0.85rem;
      }
      #exportText {
        height: 120px;
        font-size: 0.85rem;
      }
      .chart-container {
        padding: 1rem 1.5rem;
      }
      .chart-bar {
        height: 35px;
        padding: 0 0.5rem;
        font-size: 0.9rem;
      }
    }