@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   Variables
   ============================================================ */

:root {
    --accent:       #b1cda2;
    --accent-dark:  #85b073;
    --accent-dim:   rgba(177, 205, 162, 0.16);
    --blue:         #7bbde0;
    --red:          #d97070;
    --orange:       #d49a6a;

    /* Light */
    --bg:           #f0f2f5;
    --surface:      #ffffff;
    --surface-2:    #e8ebef;
    --border:       rgba(60, 80, 110, 0.10);
    --text:         #1a2233;
    --text-muted:   #5a6b80;
    --radius:       14px;
    --radius-sm:    9px;
    --shadow-card:  0 1px 6px rgba(20, 40, 70, 0.08), 0 0 0 1px rgba(60, 80, 110, 0.06);
    --shadow-hover: 0 4px 18px rgba(20, 40, 70, 0.13), 0 0 0 1px rgba(60, 80, 110, 0.09);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #1e2530;
        --surface:      #262f3c;
        --surface-2:    #2f3a49;
        --border:       rgba(120, 160, 200, 0.10);
        --text:         #cad3de;
        --text-muted:   #637080;
        --shadow-card:  0 2px 14px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(120, 160, 200, 0.07);
        --shadow-hover: 0 6px 22px rgba(0, 0, 0, 0.44), 0 0 0 1px rgba(177, 205, 162, 0.18);
    }
}

/* ============================================================
   Base
   ============================================================ */

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    body {
        background:
            radial-gradient(ellipse 90% 55% at 50% -5%, rgba(50, 100, 170, 0.10) 0%, transparent 65%),
            var(--bg);
    }
}

#app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Header
   ============================================================ */

.ws-header {
    background: rgba(240, 242, 245, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (prefers-color-scheme: dark) {
    .ws-header { background: rgba(30, 37, 48, 0.88); }
}

.ws-header-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 7px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.ws-header-back:hover { background: var(--accent-dim); color: var(--accent-dark); }

.ws-header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* ============================================================
   Main content
   ============================================================ */

.ws-main {
    flex: 1;
    padding: 20px 16px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   Buttons
   ============================================================ */

.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.12s, transform 0.1s, box-shadow 0.15s;
}

.ws-btn:active { transform: scale(0.97); }
.ws-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ws-btn-primary {
    background: var(--accent-dark);
    color: #fff;
    box-shadow: 0 2px 10px rgba(133, 176, 115, 0.30);
}
.ws-btn-primary:hover:not(:disabled) {
    background: var(--accent);
    color: #1a2233;
    box-shadow: 0 3px 14px rgba(133, 176, 115, 0.40);
}

.ws-btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.ws-btn-secondary:hover { background: var(--surface-2); }

.ws-btn-full { width: 100%; }
.ws-btn-sm   { padding: 7px 14px; font-size: 13px; }

/* ============================================================
   Home grid
   ============================================================ */

.ws-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.ws-module-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 16px 24px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    user-select: none;
    box-shadow: var(--shadow-card);
}

.ws-module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.ws-module-card:active { transform: scale(0.97); box-shadow: var(--shadow-card); }

.ws-module-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.15s;
}
.ws-module-icon svg { width: 28px; height: 28px; display: block; }
.ws-module-card:hover .ws-module-icon { color: var(--accent-dark); }

.ws-module-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* ============================================================
   Utility
   ============================================================ */

.ws-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

/* ============================================================
   Lang Hub
   ============================================================ */

/* Import screen */

.lh-import-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 24px 0;
}

.lh-import-icon  { font-size: 44px; line-height: 1; }
.lh-import-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.lh-import-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.65; max-width: 320px; }

.lh-import-steps {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    text-align: left;
    width: 100%;
    max-width: 340px;
    box-shadow: var(--shadow-card);
}

.lh-import-steps ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Tab bar */

.lh-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.lh-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.lh-tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }
.lh-tab-btn:hover:not(.active) { color: var(--text); }

.lh-tab-content { display: flex; flex-direction: column; }

/* Setup screen */

.lh-setup         { display: flex; flex-direction: column; gap: 20px; }
.lh-setup-title   { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.lh-setup-sub     { font-size: 14px; color: var(--text-muted); }
.lh-option-label  { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.07em; }
.lh-option-row    { display: flex; gap: 8px; flex-wrap: wrap; }

.lh-option-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.lh-option-btn.active             { border-color: var(--accent-dark); background: var(--accent-dim); color: var(--accent-dark); }
.lh-option-btn:hover:not(.active) { border-color: rgba(133, 176, 115, 0.40); }

/* Card screen */

.lh-card { display: flex; flex-direction: column; gap: 14px; }

.lh-progress  { display: flex; flex-direction: column; gap: 4px; }
.lh-prog-text { font-size: 12px; color: var(--text-muted); }
.lh-prog-bar  { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.lh-prog-fill { height: 100%; background: var(--accent-dark); border-radius: 2px; transition: width 0.35s; }

.lh-front {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.lh-word { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.lh-pos  { font-size: 13px; color: var(--text-muted); }

.lh-badge         { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.lh-badge-german  { background: rgba(212, 154, 106, 0.18); color: #b07a48; }
.lh-badge-korean  { background: rgba(217, 112, 112, 0.15); color: var(--red); }

@media (prefers-color-scheme: dark) {
    .lh-badge-german { color: #d49a6a; }
    .lh-badge-korean { color: var(--red); }
}

/* Canvas */

.lh-canvas-wrap { display: flex; flex-direction: column; gap: 8px; }

.lh-canvas {
    width: 100%;
    height: 140px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    touch-action: none;
    cursor: crosshair;
    display: block;
}

/* Type input */

.lh-type-wrap { display: flex; flex-direction: column; gap: 8px; }

.lh-type-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lh-type-input:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(177, 205, 162, 0.20);
}
.lh-type-input:disabled { opacity: 0.5; }

/* Comparison */

.lh-comparison {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.lh-cmp-correct { background: rgba(133, 176, 115, 0.14); color: var(--accent-dark); }
.lh-cmp-wrong   { background: rgba(217, 112, 112, 0.13); color: var(--red); }

/* Back / answer */

.lh-back {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-card);
}

.lh-definition { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.lh-example    { font-size: 14px; color: var(--text-muted); font-style: italic; }
.lh-mnemonic   { font-size: 13px; color: var(--text-muted); }
.lh-label      { font-weight: 500; }

/* Ratings */

.lh-ratings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.lh-rating-btn {
    padding: 11px 4px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.1s, transform 0.1s, box-shadow 0.12s;
}
.lh-rating-btn:active { transform: scale(0.95); }

.lh-rating-again { background: rgba(217, 112, 112, 0.15); color: var(--red); }
.lh-rating-hard  { background: rgba(212, 154, 106, 0.15); color: var(--orange); }
.lh-rating-good  { background: rgba(133, 176, 115, 0.15); color: var(--accent-dark); }
.lh-rating-easy  { background: rgba(123, 189, 224, 0.15); color: var(--blue); }

.lh-rating-again:hover { box-shadow: 0 2px 10px rgba(217, 112, 112, 0.22); }
.lh-rating-hard:hover  { box-shadow: 0 2px 10px rgba(212, 154, 106, 0.22); }
.lh-rating-good:hover  { box-shadow: 0 2px 10px rgba(133, 176, 115, 0.22); }
.lh-rating-easy:hover  { box-shadow: 0 2px 10px rgba(123, 189, 224, 0.22); }

/* Summary screen */

.lh-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 0;
    text-align: center;
}

.lh-summary-icon    { font-size: 44px; line-height: 1; }
.lh-summary-title   { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.lh-summary-count   { font-size: 15px; color: var(--text-muted); }
.lh-summary-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* Grammar reference */

.lh-grammar-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.lh-grammar-search { margin-top: 4px; }

.lh-grammar-list { display: flex; flex-direction: column; gap: 8px; }

.lh-grammar-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s;
}
.lh-grammar-card:hover { box-shadow: var(--shadow-hover); }

.lh-grammar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lh-grammar-title    { font-size: 15px; font-weight: 600; }
.lh-grammar-category { font-size: 12px; color: var(--text-muted); }

.lh-grammar-pattern {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
    font-size: 13px;
    background: var(--surface-2);
    border-radius: 7px;
    padding: 8px 12px;
    color: var(--accent-dark);
}

.lh-grammar-explanation { font-size: 14px; line-height: 1.65; }

.lh-grammar-examples {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid var(--border);
    padding-left: 12px;
}

.lh-grammar-example { font-size: 13px; color: var(--text-muted); font-style: italic; }

.lh-grammar-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.65;
}

/* ============================================================
   Knowledge Hub
   ============================================================ */

.kh-ws-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s;
}

.kh-ws-select:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(177, 205, 162, 0.18);
}

.kh-reload-btn { align-self: flex-start; margin-bottom: 4px; }

.kh-ws-source-row { font-size: 13px; color: var(--text-muted); }

.kh-ws-link { color: var(--accent-dark); text-decoration: none; }
.kh-ws-link:hover { text-decoration: underline; }

.kh-ws-notes {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    border-left: 2px solid var(--border);
    padding-left: 10px;
}

.kh-ws-related { font-size: 13px; color: var(--text-muted); }

.kh-ws-chip {
    display: inline-block;
    background: var(--surface-2);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.kh-ws-chip:hover { background: var(--accent-dim); color: var(--accent-dark); }

.kh-ws-tags { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   AO3 Tracker
   ============================================================ */

.ao3-pending-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(212, 154, 106, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--orange);
    margin-bottom: 12px;
}

.ao3-work-card {
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.ao3-work-card:hover { box-shadow: var(--shadow-hover); }
.ao3-work-card:active { transform: scale(0.98); }

.ao3-tier-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent-dim);
    color: var(--accent-dark);
}

.ao3-scores-row { display: flex; gap: 8px; flex-wrap: wrap; }

.ao3-score-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 12px;
}

.ao3-score-label { color: var(--text-muted); }
.ao3-score-value { font-weight: 600; }

.ao3-field-wrap  { display: flex; flex-direction: column; gap: 8px; }
.ao3-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }

.ao3-score-btns  { display: grid; gap: 6px; }
.ao3-int-row     { grid-template-columns: repeat(5, 1fr); }
.ao3-frac-row    { grid-template-columns: repeat(4, 1fr); margin-top: 2px; }

.ao3-score-btn {
    padding: 11px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
}

.ao3-score-btn:hover:not(.active):not(:disabled) {
    border-color: rgba(133, 176, 115, 0.45);
    color: var(--accent-dark);
}
.ao3-score-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent-dark);
    color: var(--accent-dark);
}
.ao3-score-btn:active  { transform: scale(0.94); }
.ao3-score-btn:disabled { opacity: 0.22; cursor: not-allowed; transform: none; }

.ao3-score-btn-frac { font-size: 13px; padding: 8px 4px; }

.ao3-notes-area {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ao3-notes-area:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(177, 205, 162, 0.18);
}

/* ============================================================
   Auth
   ============================================================ */

.ws-auth-error {
    color: var(--red);
    font-size: 14px;
    text-align: center;
}

.ws-header-lock {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 7px;
    margin-left: auto;
    transition: background 0.15s, color 0.15s;
}
.ws-header-lock:hover { background: var(--accent-dim); color: var(--accent-dark); }

/* ============================================================
   Vault Stats
   ============================================================ */

.ws-stats-page-card { cursor: pointer; transition: box-shadow 0.15s; }
.ws-stats-page-card:hover { box-shadow: var(--shadow-hover); }
.ws-stats-page-card:active { transform: scale(0.98); }

.ws-stats-page-sub  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.ws-stats-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ws-stats-page-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

.ws-stats-page-content { display: flex; flex-direction: column; gap: 18px; }

.ws-stats-block { display: flex; flex-direction: column; }

.ws-stats-chart-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

.ws-chart-wrap { width: 100%; }

/* Stat card */

.ws-stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.ws-stat-value { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ws-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.07em; }

/* Ranking */

.ws-ranking { display: flex; flex-direction: column; gap: 8px; }

.ws-ranking-row {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ws-ranking-pos   { color: var(--text-muted); font-size: 12px; text-align: right; }
.ws-ranking-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ws-ranking-bar {
    display: block;
    height: 5px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.ws-ranking-bar-fill { display: block; height: 100%; border-radius: 3px; }

.ws-ranking-count { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ============================================================
   Password modal
   ============================================================ */

.ws-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

@media (min-height: 500px) {
    .ws-modal-overlay { align-items: center; }
}

.ws-modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);
}

.ws-modal-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.ws-modal-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.ws-modal-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ============================================================
   Tracker sync settings (home screen)
   ============================================================ */

.ws-tracker-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-card);
}

.ws-tracker-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.ws-tracker-row .lh-type-input { flex: 1; font-size: 13px; }

.ws-tracker-status {
    font-size: 12px;
    color: var(--text-muted);
}
.ws-tracker-ok  { color: var(--accent-dark); }
.ws-tracker-err { color: var(--red); }

/* ============================================================
   Tracker modules (tasks / research / media)
   ============================================================ */

.tk-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

/* Horizontal scrollable category tab bar */
.tk-cat-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-bottom: 4px;
    scrollbar-width: none;
}
.tk-cat-bar::-webkit-scrollbar { display: none; }

.tk-cat-btn {
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.tk-cat-btn.active {
    color: var(--accent-dark);
    border-color: var(--accent-dark);
    background: var(--accent-dim);
}
.tk-cat-btn:hover:not(.active) {
    color: var(--text);
    border-color: rgba(133, 176, 115, 0.35);
}

/* Item list */
.tk-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.tk-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 4px;
    border-bottom: 1px solid var(--border);
}
.tk-item:last-child { border-bottom: none; }

.tk-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1.5px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tk-check:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dim);
}

.tk-item-body { flex: 1; min-width: 0; }

.tk-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.tk-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.tk-item-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-dark);
    text-decoration: none;
    line-height: 1.4;
}
.tk-item-link:hover { text-decoration: underline; }

.tk-empty {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.tk-add-btn {
    margin-top: 16px;
    width: 100%;
}

/* Add form */
.tk-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tk-form-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.tk-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: -6px;
}

.tk-field-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: -6px;
}

/* Category / priority pills */
.tk-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tk-pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.tk-pill.active {
    color: var(--accent-dark);
    border-color: var(--accent-dark);
    background: var(--accent-dim);
}
.tk-pill:hover:not(.active) {
    color: var(--text);
    border-color: rgba(133, 176, 115, 0.35);
}

.tk-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.tk-btn-row .ws-btn { flex: 1; }
