html, body {
      height: 100%;
      margin: 0;
      background: #000;
      color: #eee;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }
    .stage {
      position: fixed;
      inset: 0;
      overflow: hidden;
    }
    .stage::before {
      content: "";
      position: absolute;
      inset: 0;
      background: center/cover no-repeat url("assets/audience_loop.gif");
      filter: brightness(0.75);
    }

    .banner {
      position: fixed;
      top: calc(env(safe-area-inset-top, 0px) + 0.6rem);
      left: 50%;
      transform: translateX(-50%);
      background: rgba(20, 20, 20, 0.4);
      backdrop-filter: blur(6px);
      border: none;
      border-radius: 12px;
      padding: .5rem 1rem;
      font-size: 1.9rem;
      color: #ffd24d;
      font-family: "Quicksand", "SF Pro Text", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
      font-weight: 600;
      letter-spacing: .2px;
      user-select: none;
      z-index: 10;
      text-transform: none;
    }

    .demo-store-cta {
      position: fixed;
      top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
      right: 1rem;
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.35rem 0.5rem 0.35rem 0.75rem;
      border-radius: 999px;
      background: rgba(16, 16, 16, 0.65);
      border: 1px solid rgba(255,255,255,0.18);
      color: #ffd24d;
      z-index: 15;
      font-size: 0.85rem;
      letter-spacing: 0.02em;
    }

    .demo-store-cta span {
      white-space: nowrap;
    }

    .demo-store-cta img {
      height: 36px;
    }

    .demo-mobile-warning {
      display: none;
      position: fixed;
      top: calc(env(safe-area-inset-top, 0px) + 3.6rem);
      left: 50%;
      transform: translateX(-50%);
      background: rgba(16, 16, 16, 0.75);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 999px;
      padding: 0.4rem 0.85rem;
      color: #ffd24d;
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      text-align: center;
      z-index: 12;
      max-width: calc(100% - 2rem);
    }

    @media (max-width: 680px) {
      .banner {
        font-size: 1.45rem;
        padding: 0.4rem 0.65rem;
      }

      .demo-mobile-warning {
        display: block;
      }
    }

    .panel {
      position: fixed;
      left: 1rem;
      bottom: calc(env(safe-area-inset-bottom, 0px) + 0.8rem);
      right: 1rem;
      max-width: 720px;
      margin: 0 auto;
      background: rgba(20,20,20,0.75);
      backdrop-filter: blur(6px);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      padding: .75rem 1rem;
      transition: transform .2s ease, opacity .2s ease;
    }
    .panel.collapsed {
      transform: translateY(calc(100% - 3.25rem));
      opacity: .95;
    }
    .panel-header { display: flex; align-items: center; gap: .75rem; }
    .panel-title { font-weight: 700; letter-spacing: .2px; }
    .spacer { flex: 1; }

    .toggle {
      background: transparent;
      color: #eee;
      border: 1px solid rgba(255,255,255,0.25);
      padding: .35rem .65rem;
      border-radius: 10px;
      cursor: pointer;
      user-select: none;
      transition: background .15s ease, border-color .15s ease;
    }
    .toggle:hover,
    .toggle:focus-visible { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.45); }
    .toggle:active { background: rgba(255,255,255,0.15); }

    .row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
    .rows { margin-top: .5rem; }
    .row + .row { margin-top: .75rem; }

    .btn {
      background: #3a7f3a;
      color: #101;
      border: none;
      padding: .6rem 1rem;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 600;
      transition: transform .04s ease, filter .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
      box-shadow: 0 2px 0 rgba(0,0,0,0.35);
      touch-action: manipulation;
    }
    .btn:hover { filter: brightness(1.05); }
    .btn:active { transform: translateY(1px); }
    .btn.secondary { background: #333; color: #eee; }
    .btn.active { background: #7bd07b; color: #101; }
    .btn.inactive { background: #444; color: #bbb; }
    .btn.pulse { animation: pulse 1s infinite; }
    @keyframes pulse { 0%{filter:brightness(1)} 50%{filter:brightness(1.25)} 100%{filter:brightness(1)} }


    fieldset {
      flex: 1 1 280px;
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 10px;
      padding: .5rem .75rem;
      min-width: 0;
      width: 100%;
      max-width: 100%;
    }
    legend { padding: 0 .35rem; font-size: .9rem; opacity: .9; }
    label { display: inline-flex; align-items: center; gap: .4rem; margin-right: .75rem; min-width: 0; }
    input[type="range"] { width: 100%; max-width: 100%; }
    .note { font-size: .9rem; opacity: .8; }

    .panel-body {
      overflow: hidden;
      transition: grid-template-rows .2s ease, opacity .2s ease;
      display: grid;
      grid-template-rows: 1fr;
    }
    .panel.collapsed .panel-body { grid-template-rows: 0fr; opacity: .0; }
    .panel-inner { min-height: 0; }

    .about-panel {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 90%;
      max-width: 600px;
      background: rgba(20,20,20,0.85);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      padding: 1rem 1.5rem;
      box-shadow: 0 4px 12px rgba(0,0,0,0.5);
      color: #eee;
      display: none;
      flex-direction: column;
      max-height: 80vh;
      overflow: auto;
      z-index: 20;
      font-size: 0.759rem;
    }

    .code-panel {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 90%;
      max-width: 420px;
      background: rgba(20,20,20,0.9);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      padding: 1rem 1.25rem;
      box-shadow: 0 4px 12px rgba(0,0,0,0.5);
      color: #eee;
      display: none;
      flex-direction: column;
      max-height: 80vh;
      overflow: auto;
      z-index: 30;
      font-size: 0.9rem;
    }
    .code-panel input {
      margin-left: 0.4rem;
    }
    

    .limit-modal {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 90%;
      max-width: 600px;
      background: rgba(20,20,20,0.9);
      backdrop-filter: blur(10px);
      border: 2px solid rgba(123,208,123,0.3);
      border-radius: 12px;
      padding: 1.5rem 2rem;
      box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 40px rgba(123,208,123,0.15);
      color: #eee;
      display: none;
      flex-direction: column;
      max-height: 85vh;
      overflow: auto;
      z-index: 25;
      font-size: 0.95rem;
    }

    .limit-modal h2 {
      margin-top: 0;
      color: #ffd24d;
      text-align: center;
      font-size: 1.5rem;
    }

    .limit-modal ul {
      margin: 0.75rem 0;
      padding-left: 1.25rem;
      line-height: 1.6;
    }

    .limit-modal li {
      margin: 0.5rem 0;
    }

    .limit-modal strong {
      color: #fff;
    }

    .limit-modal #closeLimit {
      margin-top: 1rem;
      align-self: center;
      background: #7bd07b;
      color: #101;
      font-weight: 600;
      padding: 0.6rem 1.5rem;
    }

    .limit-modal #closeLimit:hover {
      background: #9fe39f;
    }

    .status {
      margin-top: .5rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
      font-size: .85rem;
      background: rgba(0,0,0,0.35);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 8px;
      padding: .5rem .6rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ok { color: #9fe39f; }
    .warn { color: #ffd27a; }
    .err { color: #ff9f9f; }
    .panel.collapsed .status { display: none; }

    .about-link { color: #7af; text-decoration: none; }

    .limit-cta {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.6rem;
      margin-top: 1rem;
    }

    .limit-cta img {
      height: 44px;
    }

    .limit-note {
      margin: 0;
      opacity: 0.85;
    }

    .app-store-support img {
      height: 40px;
    }

    .app-store-support {
      display: inline-flex;
      align-items: center;
    }


    /* iPhone SE (2nd/3rd gen) and similarly small phones */
    @media (max-width: 375px) and (max-height: 667px) {
      .banner {
        max-width: 100vw;
        white-space: normal;      /* allow wrap */
        text-align: center;
        padding: .3rem .6rem;
        line-height: 1.05;
        font-size: clamp(1.1rem, 6.8vw, 2.1rem);
      }

      .panel {
        padding: .55rem .65rem;
        border-radius: 10px;
      }

      .btn, .toggle {
        padding: .48rem .7rem;
        border-radius: 9px;
        font-size: .95rem;
      }

      legend { font-size: .85rem; }
      .note  { font-size: .85rem; }

      /* keep the collapsed header a bit taller so the toggle is tappable */
      .panel.collapsed { transform: translateY(calc(100% - 3.6rem)); }
    }

    @media (max-width: 720px) {
      .demo-store-cta {
        padding: 0.3rem 0.45rem;
        gap: 0.4rem;
        font-size: 0.8rem;
      }

      .demo-store-cta img {
        height: 32px;
      }
    }

    @media (max-width: 520px) {
      .demo-store-cta span {
        display: none;
      }
    }

    /* Support page */
    .support-shell {
      position: relative;
      z-index: 5;
      max-width: 880px;
      margin: 0 auto;
      padding: calc(env(safe-area-inset-top, 0px) + 6rem) 1rem 3rem;
    }

    .support-card {
      background: rgba(20,20,20,0.82);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 14px;
      padding: 1.25rem 1.5rem;
      margin-bottom: 1rem;
      box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    }

    .support-kicker {
      font-size: 0.85rem;
      letter-spacing: 0.12rem;
      text-transform: uppercase;
      color: #7bd07b;
      margin: 0 0 0.35rem;
    }

    .support-title {
      margin: 0 0 0.5rem;
      font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    }

    .support-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.6rem;
      margin: 0.9rem 0 0.75rem;
      align-items: center;
    }

    .support-email {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
      font-size: 0.95rem;
      color: #9fe39f;
    }

    .support-sub {
      margin: 0.35rem 0 0;
      font-size: 0.95rem;
      opacity: 0.85;
    }

    .support-list {
      margin: 0.6rem 0 0;
      padding-left: 1.2rem;
      line-height: 1.6;
    }

    .support-card a {
      color: #7af;
      text-decoration: none;
    }

    .support-card a:hover {
      text-decoration: underline;
    }

    .faq details {
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 10px;
      padding: 0.7rem 0.9rem;
      background: rgba(0,0,0,0.35);
    }

    .faq details + details {
      margin-top: 0.6rem;
    }

    .faq summary {
      cursor: pointer;
      font-weight: 600;
    }

    .faq details[open] {
      background: rgba(0,0,0,0.5);
    }

    .faq p {
      margin: 0.5rem 0 0;
      opacity: 0.9;
      line-height: 1.5;
    }
