  :root {
    --bg: #1A1A1E;
    --surface: #232328;
    --surface2: #2C2C32;
    --border: #3E3E46;
    --text: #F0F0F2;
    --text-muted: #B0B0B8;
    --text-dim: #6E6E78;
    --accent: #B0B0B8;
    --accent-soft: #B0B0B820;
    --green: #50C878;
    --red: #F06060;
    --blue: #60A0E8;
    --purple: #9878D8;
  }

  :root.light {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface2: #F4F4F5;
    --border: #E0E0E2;
    --text: #1A1A1E;
    --text-muted: #5A5A62;
    --text-dim: #9A9AA0;
    --accent: #4A4A52;
    --accent-soft: #4A4A5212;
    --green: #1A9E50;
    --red: #E03838;
    --blue: #2868D0;
    --purple: #7040C8;
  }

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

  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: background 0.2s, color 0.2s;
  }

  /* Layout */
  .app { display: flex; min-height: 100vh; }

  .sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    top: 0; left: 0;
    z-index: 10;
    overflow: hidden;
  }

  .sidebar-scroll-btn { display: none; }

  .sidebar-nav-wrap {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 8px 0;
  }
  .sidebar-nav-wrap::-webkit-scrollbar { display: none; }

  .logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .logo-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
  }

  .logo-sub {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 4px;
  }

  nav { padding: 0 10px; }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    margin-bottom: 1px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
  }

  .nav-item:hover { background: var(--surface2); color: var(--text); }
  .nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

  .nav-item-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 1px;
  }
  .nav-item-row .nav-item { margin-bottom: 0; }

  .nav-cat-study-btn {
    flex-shrink: 0;
    width: 24px;
    height: 30px;
    border: none;
    background: none;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .nav-cat-study-btn:hover { background: var(--surface2); color: var(--purple); }

  .nav-item .icon { display: none; }

  .nav-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 10px;
  }

  /* Zwijane kolekcje */
  .nav-collections-header {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    margin-bottom: 1px;
  }
  .nav-collections-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    border: none;
    background: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
  }
  .nav-collections-toggle:hover { background: var(--surface2); color: var(--text); }
  .nav-collections-arrow {
    font-size: 9px;
    color: var(--text-dim);
    transition: transform 0.2s;
    display: inline-block;
  }
  .nav-collections-arrow.open { transform: rotate(90deg); }
  .nav-collections-body { overflow: hidden; transition: max-height 0.25s ease; }
  .nav-collections-body.collapsed { max-height: 0 !important; }

  .nav-cat-study-btn {
    flex-shrink: 0;
    width: 28px;
    height: 30px;
    border: none;
    background: none;
    color: var(--text-dim);
    font-size: 11px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .nav-cat-study-btn:hover { background: var(--surface2); color: var(--purple); font-size: 13px; }

  /* Stopka sidebara */
  .sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .sidebar-footer-top {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .sidebar-nick {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .sidebar-footer-link {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
  }
  .sidebar-footer-link:hover { color: var(--accent); }
  .sidebar-footer-sep { color: var(--border); font-size: 11px; }

  .nav-section { display: none; }

  .nav-item-cat {
    padding-left: 14px !important;
    font-size: 13px;
    font-weight: 400;
  }
  .nav-item-cat::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.15s;
  }
  .nav-item-cat:hover::before { background: var(--text-muted); }
  .nav-item-cat.active::before { background: var(--accent); }

  /* Stats badges in sidebar */
  .badge {
    margin-left: auto;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
  }

  .badge.urgent { background: #9878D822; color: var(--purple); }

  /* Main content */
  .main {
    margin-left: 220px;
    flex: 1;
    padding: 48px;
    max-width: 900px;
  }

  /* Page header */
  .page-header {
    margin-bottom: 40px;
  }

  .page-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.1;
  }

  .page-title em {
    font-style: normal;
    color: var(--accent);
  }

  .page-subtitle {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  /* Cards */
  .card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
  }

  /* Stats grid */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
  }

  .stat-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .stat-card[onclick] { cursor: pointer; }

  .stat-card[onclick]:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  }

  .stat-card[onclick]:hover .stat-cta {
    opacity: 1;
    transform: translateY(0);
  }

  .stat-number {
    font-family: 'Inter', sans-serif;
    font-size: 38px;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
  }

  .stat-label {
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 6px;
  }

  .stat-cta {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
    color: var(--accent);
  }

  .stat-card.urgent .stat-number { color: var(--purple); }
  .stat-card.urgent .stat-cta { color: var(--purple); }
  .stat-card.difficult .stat-number { color: var(--red); }
  .stat-card.difficult .stat-cta { color: var(--red); }
  .stat-card.good .stat-number { color: var(--green); }
  .stat-card.good .stat-cta { color: var(--green); }

  /* Category pills */
  .category-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }

  .pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
  }

  .pill:hover { border-color: var(--accent); color: var(--accent); }
  .pill.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

  /* Word list */
  .word-list { display: flex; flex-direction: column; gap: 8px; }

  .word-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    align-items: center;
    gap: 16px;
    transition: border-color 0.15s;
  }

  .word-item:hover { border-color: var(--border); }
  .word-item.difficult { border-left: 2px solid var(--red); }
  .word-item.new { border-left: 2px solid var(--blue); }

  .word-term {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
  }

  .word-translation { color: var(--text-muted); font-size: 12px; cursor: pointer; }
  .word-translation:hover { color: var(--text); text-decoration: underline dotted; }

  .word-context {
    font-size: 11px;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 4px;
    grid-column: 1 / -1;
    display: none;
  }

  .word-item:hover .word-context { display: block; }

  .word-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

  .word-category {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
  }
  .word-category:hover { background: var(--accent-soft); color: var(--accent); }
  .word-category-input {
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 4px; border: 1.5px solid var(--accent);
    background: var(--surface2); color: var(--text); width: 130px;
    font-family: 'Inter', sans-serif; outline: none;
  }

  .word-due {
    font-size: 12px;
    color: var(--text-dim);
  }

  .word-due.today { color: var(--accent); }
  .word-due.overdue { color: var(--red); }

  .btn-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.15s;
  }

  .btn-delete:hover { background: #c96e6e22; color: var(--red); }

  /* Add word form */
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-group.full { grid-column: 1 / -1; }

  label {
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  input, select, textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
  }

  input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  select option { background: var(--surface2); }
  textarea { resize: vertical; min-height: 70px; }

  .btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    transition: all 0.15s;
  }

  .btn-primary {
    background: var(--accent);
    color: var(--bg);
  }

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

  .btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
  }

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

  /* Study / Flashcard view */
  .study-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
  }

  .study-header {
    margin-bottom: 16px;
  }
  .study-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  .study-counter {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
  }
  .study-badge-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
  }
  .study-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--surface2);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 12px;
  }
  .study-progress-fill {
    height: 100%;
    border-radius: 5px;
    background: var(--accent);
    transition: width 0.4s ease;
  }
  .study-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 8px;
  }

  .flashcard {
    width: 100%;
    max-width: 680px;
    min-height: 180px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

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

  .flashcard-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 28px;
    border-right: 1px solid var(--border);
    text-align: center;
  }

  .flashcard-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 28px;
    text-align: center;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.3s ease;
  }

  .flashcard.revealed .flashcard-right {
    opacity: 1;
    transform: translateX(0);
  }

  .flashcard-right .flashcard-hint-right {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
  }

  .flashcard-category {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
  }

  .flashcard-hint {
    display: none;
  }

  .flashcard-term {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 32px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    transition: all 0.2s;
  }

  .flashcard-translation {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 8px;
  }

  .flashcard-context {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    max-width: 300px;
    line-height: 1.5;
  }

  .btn-speak {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
  }
  .btn-speak:hover { border-color: var(--accent); color: var(--accent); }
  #btn-speak-term { margin-top: 10px; font-size: 14px; padding: 2px 8px; }
  #btn-speak-context { margin-top: 8px; opacity: 0; pointer-events: none; }
  .flashcard.revealed #btn-speak-context { opacity: 1; pointer-events: all; }

  /* Active writing mode */


  .rating-row {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .rating-row.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }

  .rating-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    transition: all 0.15s;
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .rating-btn .emoji { font-size: 18px; }
  .rating-btn:hover { transform: translateY(-2px); }
  .rating-btn.hard:hover { border-color: var(--red); color: var(--red); background: #c96e6e11; }
  .rating-btn.ok:hover { border-color: var(--blue); color: var(--blue); background: #6e9bc911; }
  .rating-btn.easy:hover { border-color: var(--green); color: var(--green); background: #6dbd8a11; }

  .study-done {
    text-align: center;
    padding: 48px;
  }

  .study-done-title {
    font-family: 'Inter', sans-serif;
    font-size: 40px;
    font-weight: 300;
    color: var(--accent);
    margin-bottom: 12px;
  }

  /* Empty states */
  .empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
  }

  .empty-title {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-dim);
  }

  /* Loading */
  .loading { color: var(--text-dim); font-size: 12px; padding: 48px; text-align: center; }

  /* Reminder bubble */
  .reminder-bubble {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: 1.5px solid var(--purple);
    border-radius: 14px;
    padding: 16px 20px;
    max-width: 300px;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
  }
  .reminder-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: bubbleShake 0.5s ease 0.5s;
  }
  @keyframes bubbleShake {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    15% { transform: translateY(0) scale(1) rotate(-1.5deg); }
    30% { transform: translateY(0) scale(1) rotate(1.5deg); }
    45% { transform: translateY(0) scale(1) rotate(-1deg); }
    60% { transform: translateY(0) scale(1) rotate(1deg); }
    75% { transform: translateY(0) scale(1) rotate(-0.5deg); }
  }
  .reminder-bubble-icon { font-size: 20px; margin-bottom: 6px; }
  .reminder-bubble-text { font-size: 13px; color: var(--text); line-height: 1.5; font-weight: 500; }
  .reminder-bubble-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
  .reminder-bubble-close {
    position: absolute; top: 8px; right: 10px; background: none; border: none;
    color: var(--text-dim); cursor: pointer; font-size: 14px; padding: 2px 6px;
    border-radius: 4px; transition: all 0.15s;
  }
  .reminder-bubble-close:hover { background: var(--surface2); color: var(--text); }
  .reminder-bubble-bar {
    width: 100%; height: 4px; background: var(--surface2); border-radius: 4px;
    margin-top: 10px; overflow: hidden;
  }
  .reminder-bubble-fill {
    height: 100%; border-radius: 4px; transition: width 0.4s ease;
  }

  /* Toast */
  .toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--surface2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s;
    z-index: 100;
  }

  .toast.show { opacity: 1; transform: translateY(0); }

  /* Grammar constructions */
  .grammar-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .grammar-item:hover { border-color: var(--purple); }
  .grammar-item.unchecked { opacity: 0.4; }
  .grammar-check {
    width: 22px; height: 22px; border-radius: 4px; border: 1.5px solid var(--border);
    background: none; cursor: pointer; font-size: 13px; color: transparent;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
    transition: all 0.15s;
  }
  .grammar-check.checked { background: var(--purple); border-color: var(--purple); color: #fff; }
  .grammar-tag { font-size: 11px; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: 0.08em; }
  .grammar-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; color: var(--text); margin-top: 2px; }
  .grammar-quote { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 6px; border-left: 2px solid var(--purple); padding-left: 10px; }

  .grammar-lesson-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 16px; }
  .grammar-pattern-chip {
    display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
    margin: 3px; border: 1px solid;
  }
  .grammar-exercise {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 8px;
  }
  .grammar-exercise input {
    background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 5px 8px;
    color: var(--text); font-family: 'DM Mono', monospace; font-size: 12px;
  }
  .grammar-exercise .answer { color: var(--green); font-size: 12px; margin-top: 6px; display: none; }
  .grammar-exercise .answer.visible { display: block; }
  .grammar-opt-btn {
    padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); background: none;
    color: var(--text-muted); font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace;
    transition: all 0.15s;
  }
  .grammar-opt-btn:hover { border-color: var(--purple); color: var(--purple); }
  .grammar-opt-btn.correct { background: #6dbd8a22; border-color: var(--green); color: var(--green); }
  .grammar-opt-btn.wrong { background: #c96e6e22; border-color: var(--red); color: var(--red); }

  /* Mini target bar */
  #mini-target-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
  }
  #mini-target-label { white-space: nowrap; }
  .mini-target-track {
    flex: 1;
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
  }
  .mini-target-fill {
    height: 100%;
    background: var(--blue, #60a5fa);
    border-radius: 3px;
    transition: width 0.4s ease, background 0.3s;
    width: 0%;
  }
  #mini-target-done {
    color: var(--green);
    font-weight: 600;
    white-space: nowrap;
  }

  /* Session bar */
  #session-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--purple);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    animation: fadeSlideUp 0.3s ease;
  }
  #session-bar-text { flex: 1; font-weight: 500; }
  .session-bar-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
  }
  .session-bar-btn:hover { background: rgba(255,255,255,0.35); }
  .session-bar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
  }
  .session-bar-close:hover { color: #fff; }

  /* Scroll buttons */
  #scroll-btns {
    position: fixed;
    right: 20px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 200;
  }
  .scroll-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .scroll-btn:hover { background: var(--surface2); color: var(--accent); border-color: var(--accent); }
  @media (max-width: 768px) {
    #scroll-btns { right: 12px; bottom: 16px; }
    .scroll-btn { width: 34px; height: 34px; font-size: 12px; }
  }

  /* Grammar Map */
  .grammar-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
  .grammar-tab {
    padding: 10px 24px; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
    color: var(--text-muted); background: none; border: none; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s;
  }
  .grammar-tab:hover { color: var(--text); }
  .grammar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .grammar-tab-content { }

  .gm-dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
  .gm-stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px; text-align: center;
  }
  .gm-stat-num { font-size: 28px; font-weight: 300; display: block; line-height: 1; }
  .gm-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; display: block; }
  .gm-c-gray { color: var(--text-dim); }
  .gm-c-yellow { color: #f59e0b; }
  .gm-c-blue { color: #60a5fa; }
  .gm-c-green { color: var(--green); }

  .gm-progress-bar { width: 100%; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
  .gm-progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.4s ease; width: 0%; }
  .gm-progress-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; margin-bottom: 28px; }

  .gm-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 600;
    color: var(--text); margin: 28px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  }

  .gm-timeline-wrap { overflow-x: auto; margin-bottom: 8px; }
  .gm-timeline-svg { width: 100%; min-width: 600px; height: auto; }
  .gm-node-text { font-family: 'Inter', sans-serif; font-size: 12px; fill: var(--text); }
  .gm-axis-label { font-family: 'Inter', sans-serif; font-size: 10px; fill: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
  .gm-hint { font-family: 'Inter', sans-serif; font-size: 9px; fill: var(--text-dim); }
  .gm-dot { fill: var(--text-dim); transition: fill 0.2s; }
  .gm-dot.s-new { fill: var(--text-dim); }
  .gm-dot.s-progress { fill: #f59e0b; }
  .gm-dot.s-review { fill: #60a5fa; }
  .gm-dot.s-mastered { fill: var(--green); }
  .gm-node:hover rect { stroke: var(--accent); }

  .gm-cond-grid { display: flex; flex-direction: column; gap: 0; }
  .gm-cond-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .gm-cond-node {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px;
    padding: 12px 16px; cursor: pointer; transition: all 0.15s; min-width: 120px; text-align: center;
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--text); position: relative;
  }
  .gm-cond-node:hover { border-color: var(--accent); transform: translateY(-2px); }
  .gm-cond-node circle { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); margin-right: 6px; vertical-align: middle; }
  .gm-cond-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-weight: 400; }
  .gm-cond-arrow { color: var(--text-dim); font-size: 16px; }

  .gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
  .gm-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px;
    padding: 14px 16px; cursor: pointer; transition: all 0.15s;
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--text);
  }
  .gm-card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .gm-dot-inline {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-dim); margin-right: 8px; vertical-align: middle; transition: background 0.2s;
  }
  .gm-dot-inline.s-new { background: var(--text-dim); }
  .gm-dot-inline.s-progress { background: #f59e0b; }
  .gm-dot-inline.s-review { background: #60a5fa; }
  .gm-dot-inline.s-mastered { background: var(--green); }

  /* Status button pod każdym node na mapie */
  .gm-status-btn {
    display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px;
    border: 1px solid var(--border); background: none; color: var(--text-dim);
    cursor: pointer; margin-top: 6px; font-family: 'Inter', sans-serif; transition: all 0.15s;
  }
  .gm-status-btn:hover { border-color: var(--accent); color: var(--accent); }

  @media (max-width: 768px) {
    .gm-dashboard { grid-template-columns: repeat(2, 1fr); }
    .gm-cond-row { flex-direction: column; align-items: stretch; }
    .gm-cond-arrow { transform: rotate(90deg); text-align: center; }
    .gm-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* Book material — poziome zakładki */
  .book-chapter-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
  }
  .book-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .book-tab {
    padding: 8px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .book-tab:hover { color: var(--text); }
  .book-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .book-tab-content { display: none; }
  .book-tab-content.active { display: block; }

  /* Materials / Lessons */
  .mat-intro { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
  .mat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 20px; overflow: hidden;
  }
  .mat-card-head {
    padding: 20px 24px; cursor: pointer; display: flex; align-items: flex-start; gap: 16px;
    transition: background 0.15s;
  }
  .mat-card-head:hover { background: var(--surface2); }
  .mat-card-thumb {
    width: 120px; height: 68px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
    background: var(--surface2);
  }
  .mat-card-info { flex: 1; min-width: 0; }
  .mat-card-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 600;
    color: var(--text); line-height: 1.3; margin-bottom: 4px;
  }
  .mat-card-author { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
  .mat-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
  .mat-tag {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
    font-family: 'Inter', sans-serif; letter-spacing: 0.05em;
    background: var(--accent-soft); color: var(--accent);
  }
  .mat-tag-c1 { background: #f59e0b22; color: #f59e0b; }
  .mat-card-arrow {
    font-size: 12px; color: var(--text-dim); transition: transform 0.2s; flex-shrink: 0; margin-top: 4px;
  }
  .mat-card.open .mat-card-arrow { transform: rotate(90deg); }
  .mat-card-body { display: none; padding: 0 24px 24px; }
  .mat-card.open .mat-card-body { display: block; }

  .mat-tabs {
    display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border);
  }
  .mat-tab {
    padding: 10px 20px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
    color: var(--text-muted); background: none; border: none; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s;
  }
  .mat-tab:hover { color: var(--text); }
  .mat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .mat-part { display: none; }
  .mat-part.active { display: block; }

  .mat-video-wrap {
    position: relative; width: 100%; padding-bottom: 56.25%; margin-bottom: 20px;
    border-radius: 8px; overflow: hidden; background: #000;
  }
  .mat-video-wrap iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
  }

  .mat-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 600;
    color: var(--text); margin: 24px 0 12px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .mat-section-title:first-child { margin-top: 0; }

  .mat-phrase {
    padding: 10px 14px; margin-bottom: 6px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    display: flex; align-items: flex-start; gap: 10px;
  }
  .mat-phrase-content { flex: 1; min-width: 0; }
  .mat-phrase-en {
    font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px;
  }
  .mat-phrase-pl { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
  .mat-phrase-ctx {
    font-size: 12px; font-style: italic; color: var(--text-dim); line-height: 1.5;
    border-left: 2px solid var(--border); padding-left: 8px; margin-top: 4px;
  }
  .mat-add-btn {
    flex-shrink: 0; padding: 4px 10px; border-radius: 5px; border: 1px solid var(--border);
    background: none; color: var(--text-muted); font-size: 11px; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.15s; white-space: nowrap;
  }
  .mat-add-btn:hover { border-color: var(--green); color: var(--green); }
  .mat-add-btn.added { border-color: var(--green); color: var(--green); pointer-events: none; }

  .mat-shadow-item {
    padding: 12px 14px; margin-bottom: 6px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    font-size: 13px; font-style: italic; color: var(--text); line-height: 1.6;
  }
  .mat-shadow-item .btn-speak { margin-left: 8px; opacity: 1; pointer-events: all; }

  .mat-grammar-item {
    padding: 12px 14px; margin-bottom: 6px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
  }
  .mat-grammar-label {
    font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 4px;
  }
  .mat-grammar-ex {
    font-size: 13px; font-style: italic; color: var(--text); line-height: 1.5; margin-bottom: 4px;
  }
  .mat-grammar-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

  /* Grammar Compendium */
  .gc-intro { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
  .gc-accordion { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
  .gc-accordion-head {
    width: 100%; background: none; border: none; padding: 16px 20px; cursor: pointer;
    display: flex; align-items: center; gap: 12px; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 19px; color: var(--text); text-align: left; transition: background 0.15s;
  }
  .gc-accordion-head:hover { background: var(--surface2); }
  .gc-accordion-head .gc-arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
  .gc-accordion.open .gc-arrow { transform: rotate(90deg); }
  .gc-accordion-head .gc-level { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; font-family: 'Inter', sans-serif; letter-spacing: 0.05em; margin-left: auto; flex-shrink: 0; }
  .gc-level-b1 { background: #3b82f622; color: #60a5fa; }
  .gc-level-b2 { background: #a78bfa22; color: #a78bfa; }
  .gc-level-c1 { background: #f59e0b22; color: #f59e0b; }
  .gc-accordion-body { display: none; padding: 0 20px 20px 20px; }
  .gc-accordion.open .gc-accordion-body { display: block; }
  .gc-rule { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 16px; }
  .gc-rule strong { color: var(--accent); }
  .gc-pattern {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0;
    padding: 14px 16px; background: var(--surface2); border-radius: 8px; border: 1px solid var(--border);
  }
  .gc-chip {
    display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600;
    font-family: 'DM Mono', monospace; border: 1px solid;
  }
  .gc-chip-subj { background: #3b82f622; border-color: #3b82f655; color: #60a5fa; }
  .gc-chip-verb { background: #6dbd8a22; border-color: #6dbd8a55; color: #6dbd8a; }
  .gc-chip-aux { background: #a78bfa22; border-color: #a78bfa55; color: #a78bfa; }
  .gc-chip-obj { background: #f59e0b22; border-color: #f59e0b55; color: #f59e0b; }
  .gc-chip-time { background: #c96e6e22; border-color: #c96e6e55; color: #c96e6e; }
  .gc-chip-plus { color: var(--text-muted); font-size: 14px; font-weight: 400; border: none; background: none; padding: 0 2px; }
  .gc-examples { margin: 12px 0 16px 0; }
  .gc-ex {
    font-size: 13px; color: var(--text); padding: 8px 12px; border-left: 3px solid var(--accent);
    margin-bottom: 6px; background: var(--surface2); border-radius: 0 6px 6px 0; line-height: 1.5;
  }
  .gc-ex em { color: var(--text-muted); font-size: 12px; }
  .gc-ex b { color: var(--accent); font-weight: 600; }
  .gc-exercises-title { font-size: 12px; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
  .gc-exercise {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px; margin-bottom: 8px;
  }
  .gc-exercise-q { font-size: 13px; color: var(--text); margin-bottom: 8px; line-height: 1.5; }
  .gc-exercise-opts { display: flex; flex-wrap: wrap; gap: 6px; }
  .gc-opt-btn {
    padding: 5px 12px; border-radius: 5px; border: 1px solid var(--border); background: none;
    color: var(--text-muted); font-size: 12px; cursor: pointer; font-family: 'DM Mono', monospace;
    transition: all 0.15s;
  }
  .gc-opt-btn:hover { border-color: var(--purple); color: var(--purple); }
  .gc-opt-btn.gc-correct { background: #6dbd8a22; border-color: var(--green); color: var(--green); pointer-events: none; }
  .gc-opt-btn.gc-wrong { background: #c96e6e22; border-color: var(--red); color: var(--red); pointer-events: none; }
  .gc-opt-btn.gc-disabled { pointer-events: none; opacity: 0.5; }
  .gc-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 20px 0 10px 0; }
  .gc-neg-q { font-size: 12px; color: var(--text-muted); margin-top: 8px; padding: 8px 12px; background: var(--surface); border-radius: 6px; border-left: 3px solid var(--purple); }

  /* Hidden */
  .hidden { display: none !important; }


  /* Theme toggle w stopce */
  .theme-toggle { display: none; }

  .btn-theme {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    transition: color 0.15s;
  }
  .btn-theme:hover { color: var(--accent); }

  .user-badge { display: none; }


  /* ─── Mobile ─────────────────────────────────────────────── */
  .hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    transition: all 0.15s;
  }

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

  .hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all 0.2s;
  }

  .overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  .overlay.visible { opacity: 1; pointer-events: all; }

  @media (max-width: 768px) {
    .hamburger { display: flex; }

    .sidebar {
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      z-index: 150;
    }

    .sidebar.open { transform: translateX(0); }

    .overlay { display: block; }

    .main {
      margin-left: 0;
      padding: 24px 16px;
      padding-top: 64px;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .form-grid { grid-template-columns: 1fr; }

    .word-item { grid-template-columns: 1fr auto; }

    .word-translation { grid-column: 1; }

    .flashcard { padding: 0; flex-direction: column; min-height: 200px; }
    .flashcard-left { border-right: none; border-bottom: none; padding: 28px 20px; flex: 1; }
    .flashcard-right {
      padding: 0 20px 24px;
      opacity: 0;
      transform: none;
      max-height: 0;
      overflow: hidden;
      transition: opacity 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
      border-top: 1px solid var(--border);
    }
    .flashcard.revealed .flashcard-right {
      opacity: 1;
      transform: none;
      max-height: 300px;
      padding: 20px 20px 24px;
    }

    .flashcard-term { font-size: 28px; }
  }


  @media (max-width: 768px) {
    #dashboard-due-section > div:first-child {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
  }


  @media (max-width: 768px) {
    .logo {
      padding-left: 72px;
    }
  }


  @media (max-width: 768px) {
    .nav-item {
      color: var(--text);
      font-size: 16px;
    }
    .nav-section {
      color: var(--text-muted);
      font-size: 12px;
    }
    .logo-title {
      font-size: 24px;
    }
    .logo-sub {
      font-size: 12px;
    }
  }


  .direction-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
  }

  .direction-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.05em;
  }

  .direction-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
  }

  .direction-btn:not(.active):hover {
    border-color: var(--accent);
    color: var(--accent);
  }





  /* Login screen */
  .login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg);
  }

  .login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
  }

  .login-box .logo-title {
    font-size: 32px;
    margin-bottom: 4px;
  }

  .login-box .logo-sub {
    margin-bottom: 32px;
  }

  .login-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
  }

  .login-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
    margin-bottom: 16px;
  }

  .login-input:focus { border-color: var(--accent); }

  .login-input::placeholder { color: var(--text-dim); }

  .login-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 12px;
    line-height: 1.5;
  }

  /* Settings section */
  .settings-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }

  .btn-danger {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid var(--red);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: none;
    color: var(--red);
    transition: all 0.15s;
  }

  .btn-danger:hover { background: #c96e6e22; }

  .user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 16px;
  }

  .user-badge strong {
    color: var(--accent);
    font-weight: 500;
  }





  /* ─── Animations & Transitions ─────────────────────────── */
  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
  }

  .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  }

  .stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .word-item {
    animation: fadeSlideUp 0.3s ease both;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .word-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }

  .nav-item {
    transition: all 0.15s ease;
  }

  .pill {
    transition: all 0.2s ease;
  }

  .pill:hover {
    transform: translateY(-1px);
  }

  .btn {
    transition: all 0.2s ease;
  }

  .btn:active {
    transform: scale(0.97);
  }

  /* Flashcard 3D flip */
  .flashcard {
    transition: transform 0.5s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    transform-style: preserve-3d;
  }

  .flashcard.revealed {
    animation: pulse 0.3s ease;
  }

  .flashcard:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  }

  /* Rating buttons animation */
  .rating-btn {
    transition: all 0.2s ease;
  }

  .rating-btn:active {
    transform: scale(0.93);
  }

  /* Page transitions */
  [id^="page-"] {
    animation: fadeIn 0.2s ease;
  }

  /* Staggered list animation */
  .word-item:nth-child(1) { animation-delay: 0.02s; }
  .word-item:nth-child(2) { animation-delay: 0.04s; }
  .word-item:nth-child(3) { animation-delay: 0.06s; }
  .word-item:nth-child(4) { animation-delay: 0.08s; }
  .word-item:nth-child(5) { animation-delay: 0.10s; }
  .word-item:nth-child(6) { animation-delay: 0.12s; }
  .word-item:nth-child(7) { animation-delay: 0.14s; }
  .word-item:nth-child(8) { animation-delay: 0.16s; }
  .word-item:nth-child(9) { animation-delay: 0.18s; }
  .word-item:nth-child(10) { animation-delay: 0.20s; }

  /* Toast animation */
  .toast {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* Login screen animation */
  .login-box {
    animation: fadeSlideUp 0.5s ease;
  }




  /* ─── Colorful Accents ─────────────────────────────────── */

  /* Stat cards - each gets its own vivid color */
  .stat-card:nth-child(1) { border-top: 3px solid var(--red); }
  .stat-card:nth-child(1) .stat-number { color: var(--red); }
  .stat-card:nth-child(2) { border-top: 3px solid var(--blue); }
  .stat-card:nth-child(2) .stat-number { color: var(--blue); }
  .stat-card:nth-child(3) { border-top: 3px solid var(--purple); }
  .stat-card:nth-child(3) .stat-number { color: var(--purple); }
  .stat-card:nth-child(4) { border-top: 3px solid var(--green); }
  .stat-card:nth-child(4) .stat-number { color: var(--green); }

  /* Badge colors */
  .badge { background: var(--accent-soft); color: var(--accent); }
  .badge.urgent { background: #D4917F30; color: var(--red); }

  /* Active nav accent line */
  .nav-item.active {
    border-left: 3px solid var(--accent);
    padding-left: 9px;
  }

  /* Pill active state more vivid */
  .pill.active {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
    font-weight: 500;
  }

  /* Word category colored tags */
  .word-category {
    font-weight: 500;
  }

  /* Word item left border by status */
  .word-item.difficult { border-left: 3px solid var(--red); }
  .word-item.new { border-left: 3px solid var(--blue); }

  /* Rating buttons vivid colors */
  .rating-btn.hard { border-color: var(--red); color: var(--red); }
  .rating-btn.hard:hover { background: #D4917F20; transform: translateY(-3px); }
  .rating-btn.ok { border-color: var(--accent); color: var(--accent); }
  .rating-btn.ok:hover { background: #C9975E20; transform: translateY(-3px); }
  .rating-btn.easy { border-color: var(--green); color: var(--green); }
  .rating-btn.easy:hover { background: #8FBB9320; transform: translateY(-3px); }

  /* Primary button gradient-like warmth */
  .btn-primary {
    background: var(--accent);
    color: #FFF;
    border: none;
    font-weight: 500;
  }

  .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }

  /* Flashcard accent border on hover */
  .flashcard:hover {
    border-color: var(--accent);
  }

  /* Login button warm */
  .login-box .btn-primary {
    background: var(--accent);
  }

  /* Logo accent */
  .logo-title { color: var(--accent); }
  .logo-sub { color: var(--text-muted); letter-spacing: 0.2em; }

  /* Theme toggle icon color */
  .btn-theme:hover { border-color: var(--accent); color: var(--accent); }

  /* Toast colored border */
  .toast { border-color: var(--accent); color: var(--accent); }

  /* Danger button */
  .btn-danger { border-color: var(--red); color: var(--red); }
  .btn-danger:hover { background: #D4917F15; }

  /* Links in about page */
  #page-about a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  #page-about a:hover { color: var(--green); }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent); }
