    /* CSS Reset & Variable System */
    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --bg-main: #090d16;
      --bg-card: rgba(17, 24, 39, 0.8);
      --bg-card-border: rgba(255, 255, 255, 0.08);
      --bg-input: #0f172a;
      --primary: #6366f1;
      --primary-hover: #4f46e5;
      --danger: #ef4444;
      --danger-hover: #dc2626;
      --success: #10b981;
      --warning: #f59e0b;
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 16px;
      --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
      --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    body {
      background-color: var(--bg-main);
      color: var(--text-main);
      font-family: var(--font-family);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      line-height: 1.5;
      overflow-x: hidden;
    }

    /* SVG Icon System Helper */
    .icon {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: inline-block;
      vertical-align: middle;
    }

    /* Navigation Bar */
    header {
      background: rgba(15, 23, 42, 0.9);
      border-bottom: 1px solid var(--bg-card-border);
      padding: 0.85rem 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 40;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .brand-logo {
      width: 38px;
      height: 38px;
      background: linear-gradient(135deg, #6366f1, #10b981);
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
    }

    .brand-title {
      font-size: 1.1rem;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .brand-subtitle {
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    .badge-offline {
      background: rgba(16, 185, 129, 0.12);
      color: var(--success);
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 0.2rem 0.6rem;
      border-radius: 20px;
      font-size: 0.7rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .badge-shield { width: 14px; height: 14px; flex: 0 0 auto; }
    .badge-offline { background: rgba(99, 102, 241, 0.12); color: #a5b4fc; border-color: rgba(129, 140, 248, 0.34); white-space: nowrap; }
    .badge-offline .badge-shield { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

    /* Main Container */
    main {
      flex: 1;
      max-width: 1380px;
      width: 100%;
      margin: 0 auto;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    /* Layout Grid */
    .studio-grid {
      display: grid;
      grid-template-columns: 340px 1fr;
      gap: 1.5rem;
      align-items: start;
    }

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

    /* Glass Cards */
    .card {
      background: var(--bg-card);
      border: 1px solid var(--bg-card-border);
      border-radius: var(--radius-lg);
      padding: 1.25rem;
      box-shadow: var(--shadow-lg);
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--bg-card-border);
    }

    .card-title {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 0.5rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    /* Form Controls */
    .form-group {
      margin-bottom: 1rem;
    }

    .form-group:last-child {
      margin-bottom: 0;
    }

    label {
      display: block;
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-muted);
      margin-bottom: 0.4rem;
    }

    select, input[type="text"] {
      width: 100%;
      background: var(--bg-input);
      border: 1px solid var(--bg-card-border);
      color: var(--text-main);
      padding: 0.6rem 0.75rem;
      border-radius: var(--radius-md);
      font-size: 0.8rem;
      outline: none;
      transition: border-color 0.2s;
    }

    select:focus, input[type="text"]:focus {
      border-color: var(--primary);
    }

    /* Custom Toggle Switch */
    .toggle-control {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 38px;
      height: 22px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: var(--bg-input);
      border: 1px solid var(--bg-card-border);
      transition: .2s;
      border-radius: 20px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 14px;
      width: 14px;
      left: 3px;
      bottom: 3px;
      background-color: var(--text-muted);
      transition: .2s;
      border-radius: 50%;
    }

    input:checked + .slider {
      background-color: var(--primary);
      border-color: var(--primary);
    }

    input:checked + .slider:before {
      transform: translateX(16px);
      background-color: #fff;
    }

    /* Range Sliders */
    input[type="range"] {
      width: 100%;
      height: 5px;
      background: var(--bg-input);
      border-radius: 5px;
      outline: none;
      accent-color: var(--primary);
      cursor: pointer;
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 0.65rem 1.2rem;
      border-radius: var(--radius-md);
      font-size: 0.8rem;
      font-weight: 600;
      border: none;
      cursor: pointer;
      transition: all 0.2s ease;
      text-decoration: none;
    }

    .btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #fff;
      box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }

    .btn-primary:hover:not(:disabled) {
      opacity: 0.95;
      transform: translateY(-1px);
    }

    .btn-danger {
      background: linear-gradient(135deg, var(--danger), var(--danger-hover));
      color: #fff;
      box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

    .btn-danger:hover:not(:disabled) {
      opacity: 0.95;
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: var(--bg-input);
      color: var(--text-main);
      border: 1px solid var(--bg-card-border);
    }

    .btn-secondary:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.08);
    }

    .btn-block {
      width: 100%;
    }

    /* Audio Level Meter */
    .meter-container {
      background: var(--bg-input);
      padding: 0.6rem;
      border-radius: var(--radius-md);
      border: 1px solid var(--bg-card-border);
    }

    .meter-header {
      display: flex;
      justify-content: space-between;
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-bottom: 0.35rem;
    }

    .meter-bar-track {
      height: 6px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      overflow: hidden;
    }

    .meter-bar-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
      transition: width 0.05s ease;
    }

    /* Video Studio Workspace */
    .preview-container {
      position: relative;
      background: #000;
      border-radius: var(--radius-lg);
      border: 1px solid var(--bg-card-border);
      min-height: 480px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    canvas, video {
      max-width: 100%;
      max-height: 520px;
      border-radius: var(--radius-md);
      display: block;
    }

    /* Empty State Prompt */
    .empty-state {
      text-align: center;
      padding: 3rem 1.5rem;
      max-width: 420px;
    }

    .empty-icon {
      width: 64px;
      height: 64px;
      margin: 0 auto 1.25rem;
      background: rgba(99, 102, 241, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
    }

    .empty-title {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
    }

    .empty-desc {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-bottom: 1.5rem;
    }

    /* Recording Overlay HUD */
    .rec-hud {
      position: absolute;
      top: 1rem;
      right: 1rem;
      background: rgba(9, 13, 22, 0.85);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(239, 68, 68, 0.4);
      padding: 0.4rem 0.8rem;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      z-index: 10;
    }

    .rec-dot {
      width: 10px;
      height: 10px;
      background: var(--danger);
      border-radius: 50%;
      animation: blink 1s infinite;
    }

    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }

    .rec-timer {
      font-family: monospace;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--danger);
    }

    /* Action Control Bar */
    .controls-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1rem;
      margin-top: 1rem;
    }

    .action-group {
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }

    /* Post-Recording Trimmer Panel */
    .post-panel {
      margin-top: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .trimmer-box {
      background: var(--bg-input);
      padding: 1rem;
      border-radius: var(--radius-md);
      border: 1px solid var(--bg-card-border);
    }

    .trimmer-times {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
      font-family: monospace;
      color: var(--primary);
      margin-bottom: 0.5rem;
    }

    .meta-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 0.75rem;
    }

    .meta-item {
      background: var(--bg-input);
      padding: 0.75rem;
      border-radius: var(--radius-md);
      border: 1px solid var(--bg-card-border);
    }

    .meta-label {
      font-size: 0.65rem;
      color: var(--text-muted);
      text-transform: uppercase;
      margin-bottom: 0.2rem;
    }

    .meta-val {
      font-size: 0.85rem;
      font-weight: 600;
      font-family: monospace;
    }

    /* Toast Notification System */
    #toast-container {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      z-index: 100;
      pointer-events: none;
    }

    .toast {
      pointer-events: auto;
      background: #0f172a;
      border: 1px solid var(--bg-card-border);
      color: var(--text-main);
      padding: 0.75rem 1rem;
      border-radius: var(--radius-md);
      font-size: 0.8rem;
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: 0.6rem;
      animation: slideUp 0.25s ease forwards;
    }

    @keyframes slideUp {
      from { transform: translateY(100%); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }

    .hidden {
      display: none !important;
    }
