      :root {
        --bg1: #0f172a;
        --bg2: #1e293b;
        --panel: rgba(15, 23, 42, 0.75);
        --text: #e2e8f0;
        --muted: #94a3b8;
        --good: #10b981;
        --warn: #f59e0b;
        --bad: #ef4444;
        --accent: #38bdf8;
        --accent2: #a78bfa;
      }

      :root[data-theme="light"] {
        --bg1: #f8fafc;
        --bg2: #e2e8f0;
        --panel: rgba(248, 250, 252, 0.85);
        --text: #0f172a;
        --muted: #475569;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        font-family:
          Inter,
          ui-sans-serif,
          system-ui,
          -apple-system,
          "Segoe UI",
          sans-serif;
        color: var(--text);
        background: var(--bg1);
      }

      .app {
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        background: var(--panel);
        overflow: hidden;
        position: relative;
      }

      .header {
        padding: 22px;
        padding-right: 118px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
      }

      h1 {
        margin: 0 0 6px;
        font-size: clamp(1.3rem, 2.5vw, 1.8rem);
        letter-spacing: 0.2px;
      }

      .brand {
        display: inline-flex;
        align-items: center;
        gap: 10px;
      }

      .brand-logo {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        border: 1px solid rgba(148, 163, 184, 0.28);
      }

      .subtitle {
        margin: 0;
        color: var(--muted);
        font-size: 0.95rem;
      }

      .row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
      }

      .content {
        padding: 18px 22px 22px;
        display: grid;
        gap: 14px;
      }

      .status {
        font-size: 0.92rem;
        color: var(--muted);
        margin-top: 6px;
        min-height: 1.2em;
      }

      button {
        border: 0;
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 0.95rem;
        font-weight: 600;
        color: white;
        background: linear-gradient(90deg, var(--accent), var(--accent2));
        cursor: pointer;
        transition:
          transform 0.06s ease,
          filter 0.15s ease;
      }

      button:hover {
        filter: brightness(1.08);
      }
      button:active {
        transform: translateY(1px);
      }
      button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      .btn-secondary {
        background: rgba(51, 65, 85, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.28);
      }

      .btn-danger {
        background: rgba(127, 29, 29, 0.9);
        border: 1px solid rgba(239, 68, 68, 0.45);
      }

      .menu-toggle {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 999px;
        font-size: 1rem;
        display: grid;
        place-items: center;
        z-index: 3;
      }

      .theme-toggle {
        right: 58px;
      }

      .menu-popup {
        position: absolute;
        top: 58px;
        right: 14px;
        width: min(320px, calc(100% - 28px));
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 12px;
        background: rgba(2, 6, 23, 0.95);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
        padding: 12px;
        z-index: 4;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .menu-popup[hidden] {
        display: none;
      }

      .menu-popup button {
        padding: 14px 18px;
      }

      .toast {
        position: fixed;
        top: 12px;
        left: 50%;
        transform: translate(-50%, -16px);
        padding: 6px 10px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.32);
        background: rgba(2, 6, 23, 0.95);
        color: var(--text);
        font-size: 0.85rem;
        opacity: 0;
        pointer-events: none;
        transition:
          opacity 0.2s ease,
          transform 0.2s ease;
        z-index: 20;
      }

      .toast.show {
        opacity: 1;
        transform: translate(-50%, 0);
      }

      .github-link {
        position: fixed;
        right: 14px;
        bottom: 14px;
        color: var(--text);
        display: inline-flex;
        z-index: 10;
      }

      .github-link svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
      }

      textarea {
        width: 100%;
        min-height: min(56vh, 460px);
        resize: vertical;
        border: 1px solid rgba(148, 163, 184, 0.25);
        border-radius: 12px;
        background: rgba(2, 6, 23, 0.7);
        color: var(--text);
        padding: 14px;
        font:
          500 0.98rem/1.45 ui-monospace,
          SFMono-Regular,
          Menlo,
          Monaco,
          Consolas,
          "Liberation Mono",
          "Courier New",
          monospace;
        outline: none;
      }

      textarea:focus {
        border-color: rgba(56, 189, 248, 0.7);
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
      }

      .history {
        border: 1px solid rgba(148, 163, 184, 0.25);
        border-radius: 12px;
        background: rgba(2, 6, 23, 0.5);
        padding: 12px;
      }

      .history h2 {
        margin: 0 0 10px;
        font-size: 0.95rem;
        color: var(--muted);
      }

      .history ul {
        margin: 0;
        padding-left: 18px;
        display: grid;
        gap: 10px;
      }

      .history time {
        display: block;
        font-size: 0.8rem;
        color: var(--muted);
        margin-top: 4px;
      }

      .history li {
        display: grid;
        gap: 6px;
      }

      .history-row {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .history .history-select {
        flex: 1;
        text-align: left;
        min-width: 0;
      }

      .history .history-delete {
        flex-shrink: 0;
        padding: 6px 10px;
        font-size: 1rem;
        line-height: 1;
      }

      #recordBtn,
      #copyBtn {
        padding: 31px 14px;
      }

      @media (max-width: 600px) {
        .header,
        .content {
          padding: 14px;
        }
        button {
          width: 100%;
        }
        .menu-toggle {
          width: 38px !important;
        }
        .row {
          width: 100%;
        }
        .row > * {
          flex: 1 1 100%;
        }
        .history-row button {
          width: auto;
        }
      }
