    /* --- Deck Header --- */
    .deck-header {
      display: flex;
      gap: 12px;
      align-items: center;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }
    .deck-header input {
      flex: 1;
      min-width: 200px;
      padding: 10px 14px;
      border: 1px solid var(--color-border);
      border-radius: var(--radius-sm);
      font-family: var(--font-body);
      font-size: 0.95rem;
      color: var(--color-text);
      background: var(--color-surface);
      outline: none;
    }
    .deck-header input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
    .deck-header input::placeholder { color: var(--color-text-muted); }

    /* --- Load Deck Dropdown --- */
    .deck-header select {
      padding: 10px 14px;
      border: 1px solid var(--color-border);
      border-radius: var(--radius-sm);
      font-family: var(--font-body);
      font-size: 0.85rem;
      color: var(--color-text);
      background: var(--color-surface);
      cursor: pointer;
      outline: none;
      min-width: 160px;
    }
    .deck-header select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }

    /* --- Card Rows Table --- */
    .cards-wrapper { overflow-x: auto; margin-bottom: 20px; }
    .cards-table {
      width: 100%;
      border-collapse: collapse;
    }
    .cards-table th {
      padding: 10px 12px;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-muted);
      text-align: left;
      border-bottom: 2px solid var(--color-border);
      white-space: nowrap;
    }
    .cards-table th:first-child { width: 40px; text-align: center; color: var(--color-text-muted); }
    .cards-table th:last-child { width: 48px; text-align: center; }
    .cards-table td {
      padding: 8px 6px;
      vertical-align: top;
    }
    .cards-table td:first-child {
      text-align: center;
      vertical-align: middle;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--color-text-muted);
      padding-left: 12px;
    }
    .cards-table tr { border-bottom: 1px solid var(--color-border-light); }
    .cards-table tr:hover { background: var(--color-bg); }

    .card-textarea {
      width: 100%;
      min-width: 120px;
      min-height: 60px;
      padding: 9px 12px;
      border: 1px solid var(--color-border);
      border-radius: var(--radius-sm);
      font-family: var(--font-body);
      font-size: 0.88rem;
      color: var(--color-text);
      background: var(--color-surface);
      outline: none;
      resize: vertical;
    }
    .card-textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
    .card-textarea::placeholder { color: var(--color-text-muted); }

    .card-remove {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--color-text-muted);
      cursor: pointer;
      transition: all 150ms ease;
      margin: 0 auto;
    }
    .card-remove:hover { background: #fef2f2; color: #ef4444; }

    /* --- Action Row --- */
    .action-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 28px;
    }

    /* --- Import/Export Row --- */
    .io-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 28px;
      padding: 16px 20px;
      background: var(--color-bg);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
    }
    .io-row .io-label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--color-text-muted);
      width: 100%;
      margin-bottom: 4px;
    }
    .import-input { display: none; }

    /* --- Study Mode --- */
    .study-view { display: none; }
    .study-view.active { display: block; }
    .editor-view.hidden { display: none; }

    .study-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
      flex-wrap: wrap;
      gap: 12px;
    }
    .study-header h2 {
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--color-text);
      margin: 0;
    }
    .study-controls {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    /* --- Progress Bar --- */
    .progress-section {
      margin-bottom: 24px;
    }
    .progress-label {
      display: flex;
      justify-content: space-between;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--color-text-muted);
      margin-bottom: 8px;
    }
    .progress-bar {
      width: 100%;
      height: 8px;
      background: var(--color-bg);
      border-radius: 100px;
      overflow: hidden;
      border: 1px solid var(--color-border);
    }
    .progress-fill {
      height: 100%;
      background: var(--color-primary);
      border-radius: 100px;
      transition: width 0.3s ease;
    }

    /* --- Flashcard 3D Flip --- */
    .flashcard-container {
      perspective: 1000px;
      margin-bottom: 28px;
    }
    .flashcard {
      width: 100%;
      min-height: 280px;
      position: relative;
      transition: transform 0.6s;
      transform-style: preserve-3d;
      cursor: pointer;
    }
    .flashcard.flipped {
      transform: rotateY(180deg);
    }
    .flashcard-face {
      position: absolute;
      width: 100%;
      height: 100%;
      min-height: 280px;
      backface-visibility: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 32px;
      border-radius: var(--radius-lg);
      font-size: 1.25rem;
      line-height: 1.6;
      text-align: center;
      word-break: break-word;
      box-sizing: border-box;
    }
    .flashcard-front {
      background: var(--color-surface);
      border: 2px solid var(--color-border);
      color: var(--color-text);
    }
    .flashcard-back {
      background: var(--color-primary-light);
      border: 2px solid var(--color-primary-subtle);
      color: var(--color-text);
      transform: rotateY(180deg);
    }
    .flashcard-face-label {
      position: absolute;
      top: 14px;
      left: 18px;
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--color-text-muted);
    }
    .flashcard-hint {
      position: absolute;
      bottom: 14px;
      font-size: 0.75rem;
      color: var(--color-text-muted);
    }

    /* --- Nav Buttons --- */
    .study-nav {
      display: flex;
      justify-content: center;
      gap: 16px;
      align-items: center;
    }
    .study-nav .btn {
      min-width: 120px;
    }
    .nav-counter {
      font-family: var(--font-mono);
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--color-text-muted);
    }

    /* --- Keyboard hint --- */
    .keyboard-hint {
      text-align: center;
      font-size: 0.78rem;
      color: var(--color-text-muted);
      margin-top: 20px;
    }
    .keyboard-hint kbd {
      display: inline-block;
      padding: 2px 7px;
      border: 1px solid var(--color-border);
      border-radius: 4px;
      background: var(--color-bg);
      font-family: var(--font-mono);
      font-size: 0.75rem;
    }

    /* --- Toast --- */
    .toast-msg {
      position: fixed;
      bottom: 24px;
      right: 24px;
      padding: 12px 20px;
      border-radius: var(--radius-sm);
      font-size: 0.85rem;
      font-weight: 600;
      color: white;
      background: var(--color-text);
      box-shadow: var(--shadow-lg);
      z-index: 999;
      opacity: 0;
      transform: translateY(12px);
      transition: all 250ms ease;
      pointer-events: none;
    }
    .toast-msg.show { opacity: 1; transform: translateY(0); }

    /* --- Responsive --- */
    @media (max-width: 768px) {
      .flashcard-face { font-size: 1.05rem; padding: 24px; min-height: 220px; }
      .flashcard { min-height: 220px; }
      .deck-header { flex-direction: column; }
      .deck-header select { width: 100%; }
    }
    @media (max-width: 480px) {
      .action-row { flex-direction: column; }
      .action-row .btn { width: 100%; }
      .io-row { flex-direction: column; }
      .io-row .btn { width: 100%; }
      .study-nav { flex-direction: row; }
      .study-nav .btn { min-width: 0; flex: 1; }
      .study-controls { width: 100%; }
      .study-controls .btn { flex: 1; }
    }
