 :root {
      --bg: #fbfbfa;
      --panel: #ffffff;
      --panel-2: #f4f4f2;
      --line: #e4e3df;
      --line-strong: #d3d2cc;
      --ink: #1c1c1a;
      --ink-dim: #6b6b64;
      --ink-faint: #9d9c95;
      --accent: #2f5eff;
      --accent-ink: #fff;
      --accent-soft: #eaeeff;
      --teal: #0ea88e;
      --teal-soft: #e3f7f2;
      --amber-soft: #fbf3de;
      --red: #d64545;
      --red-soft: #fbeaea;
      --radius: 12px;
      --disp: 'Space Grotesk', sans-serif;
      --body: 'IBM Plex Sans', sans-serif;
      --mono: 'IBM Plex Mono', monospace;
  }

  * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
  }

  body {
      background: var(--bg);
      color: var(--ink);
      font-family: var(--body);
  }

  .wrap {
      max-width: 860px;
      margin: 0 auto;
  }

  .hero {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 4px 4px 26px;
      border-bottom: 1px solid var(--line);
      margin-bottom: 30px;
  }

  .eyebrow {
      font-family: var(--mono);
      font-size: 11px;
      letter-spacing: 2.5px;
      color: var(--teal);
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 8px;
  }

  .eyebrow .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--teal);
  }

  h1 {
      font-family: var(--disp);
      font-weight: 700;
      font-size: clamp(30px, 5vw, 42px);
      letter-spacing: -0.5px;
  }

  .hero p {
      color: var(--ink-dim);
      font-size: 14.5px;
      max-width: 600px;
      margin-top: 6px;
      line-height: 1.55;
  }

  .engine-status {
      font-family: var(--mono);
      font-size: 11px;
      color: var(--ink-faint);
      margin-top: 14px;
      display: flex;
      align-items: center;
      gap: 7px;
  }

  .engine-status .pip {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--ink-faint);
  }

  .engine-status.ready .pip {
      background: var(--teal);
  }

  .engine-status.ready {
      color: var(--teal);
  }

  .engine-status.loading .pip {
      background: var(--accent);
      animation: pulse 1s infinite ease-in-out;
  }

  .engine-status.loading {
      color: var(--accent);
  }

  .engine-status.error .pip {
      background: var(--red);
  }

  .engine-status.error {
      color: var(--red);
  }

  @keyframes pulse {

      0%,
      100% {
          opacity: 1;
      }

      50% {
          opacity: .25;
      }
  }

  .dropzone {
      border: 1.5px dashed var(--line-strong);
      border-radius: var(--radius);
      padding: 60px 20px;
      text-align: center;
      cursor: pointer;
      background: var(--panel);
      transition: all .15s ease;
  }

  .dropzone:hover,
  .dropzone.drag {
      border-color: var(--accent);
      background: var(--accent-soft);
  }

  .dropzone .icon {
      width: 52px;
      height: 52px;
      margin: 0 auto 16px;
      border-radius: 50%;
      background: var(--accent-soft);
      color: var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
  }

  .dropzone .main {
      font-family: var(--disp);
      font-size: 18px;
      font-weight: 600;
  }

  .dropzone .sub {
      font-size: 12px;
      color: var(--ink-faint);
      margin-top: 8px;
      font-family: var(--mono);
  }

  #fileInput {
      display: none;
  }

  #uploadArea.hidden-big {
      display: none;
  }

  .top-actions {
      display: flex;
      justify-content: flex-end;
      margin-bottom: -6px;
      gap: 10px;
  }

  .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 22px 24px;
      margin-bottom: 18px;
      box-shadow: 0 1px 2px rgba(20, 20, 15, .03);
      display: none;
  }

  .card.visible {
      display: block;
  }

  .card h2 {
      font-family: var(--disp);
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 16px;
  }

  .analyzing-box {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: var(--mono);
      font-size: 12.5px;
      color: var(--ink-dim);
  }

  .analyzing-box .spin {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 2px solid var(--line-strong);
      border-top-color: var(--accent);
      animation: spin 0.8s linear infinite;
  }

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

  .report-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px 24px;
  }

  @media (max-width: 560px) {
      .report-grid {
          grid-template-columns: 1fr;
      }
  }

  .report-item .label {
      font-family: var(--mono);
      font-size: 10.5px;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--ink-faint);
      margin-bottom: 4px;
  }

  .report-item .value {
      font-family: var(--disp);
      font-size: 16px;
      font-weight: 600;
      word-break: break-word;
  }

  .report-item .value.muted {
      font-size: 13px;
      color: var(--ink-dim);
      font-weight: 500;
  }

  .loud-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 14px;
      margin-top: 4px;
  }

  .loud-item {
      background: var(--panel-2);
      border: 1px solid var(--line);
      border-radius: 9px;
      padding: 14px 16px;
      text-align: center;
  }

  .loud-item .label {
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--ink-faint);
      margin-bottom: 6px;
  }

  .loud-item .value {
      font-family: var(--disp);
      font-size: 20px;
      font-weight: 700;
      color: var(--accent);
  }

  .loud-item .value.warn {
      color: var(--red);
  }

  .wave-box,
  .spectrum-box {
      border: 1px solid var(--line);
      border-radius: 9px;
      background: var(--panel-2);
      margin-top: 10px;
  }

  canvas.viz-canvas {
      display: block;
      width: 100%;
      height: 110px;
  }

  .viz-label {
      font-family: var(--mono);
      font-size: 10.5px;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--ink-faint);
      margin: 20px 0 6px;
  }

  .band-labels {
      display: flex;
      justify-content: space-between;
      font-family: var(--mono);
      font-size: 9.5px;
      color: var(--ink-faint);
      margin-top: 4px;
  }

  audio {
      width: 100%;
      margin-top: 12px;
      height: 36px;
  }

  .btn {
      font-family: var(--mono);
      font-size: 12.5px;
      font-weight: 700;
      letter-spacing: .4px;
      padding: 11px 18px;
      border-radius: 8px;
      border: none;
      background: var(--accent);
      color: var(--accent-ink);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
  }

  .btn:hover {
      filter: brightness(1.07);
  }

  .btn.ghost {
      background: transparent;
      color: var(--ink-dim);
      border: 1px solid var(--line-strong);
  }

  .btn.ghost:hover {
      border-color: var(--accent);
      color: var(--accent);
  }

  .btn.remove-file:hover {
      border-color: var(--red);
      color: var(--red);
  }