/* ===== Playful, Duolingo-inspired ===== */
:root {
    --brand: #0092c9;
    --brand-dark: #007aab;
    --brand-light: #e0f3fb;
    --brand-50: #f0f9ff;
    --brand-glow: rgba(0, 146, 201, 0.12);
    --green: #22c55e;
    --green-light: #f0fdf4;
    --green-bright: #4ade80;
    --amber: #fbbf24;
    --amber-light: #fef9c3;
    --purple: #8b5cf6;
    --purple-light: #f3e8ff;
    --text: #18181b;
    --text-2: #3f3f46;
    --text-muted: #71717a;
    --bg: #ffffff;
    --white: #fff;
    --border: #e4e4e7;
    --border-light: #f0f0f2;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-brand: 0 4px 14px rgba(0,146,201,0.15);
    --r: 12px;
    --r-sm: 8px;
    --r-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header-h: 56px;
    --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Header — clean white bar ===== */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.app-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 100%;
    max-width: 100%; margin: 0 auto;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 4px; }
.header-title { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.02em; }
.group-name { color: var(--text); }

.app-main { min-height: 100vh; padding: 24px 20px; max-width: 640px; margin: 0 auto; }
.app-main.with-header { padding-top: calc(var(--header-h) + 20px); }

/* ===== Hamburger ===== */
.menu-toggle {
    background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; border-radius: var(--r-sm);
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.menu-toggle:hover { background: var(--border-light); }
.menu-toggle span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 1px; }

/* ===== Side Menu ===== */
.side-menu {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--white);
    z-index: 200; transform: translateX(100%);
    transition: transform 0.2s ease;
    overflow-y: auto; border-left: 1px solid var(--border);
}
.side-menu.open { transform: translateX(0); }

.menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 199; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }

.menu-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.menu-header-top { display: flex; justify-content: space-between; align-items: flex-start; }
.menu-group-form { margin-top: 12px; }
.menu-group-select { width: 100%; padding: 6px 10px; font-size: 13px; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--white); font-family: var(--font); cursor: pointer; }
.menu-group-select:focus { outline: none; border-color: var(--brand); }
.menu-user-name { font-weight: 700; font-size: 15px; }
.menu-user-email { color: var(--text-muted); font-size: 13px; margin-top: 1px; }
.menu-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.menu-close:hover { background: var(--border-light); color: var(--text); }
@media (min-width: 1024px) { .menu-close { display: none; } }

.menu-items { list-style: none; padding: 8px; }

.menu-items li a, .menu-items li button.menu-group-btn, .menu-items li button.menu-link-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; color: var(--text-2); font-size: 14px; font-weight: 500;
    text-align: left; background: none; border: none; border-radius: var(--r-sm);
    cursor: pointer; text-decoration: none; font-family: var(--font); transition: all 0.1s;
}
.menu-items li a:hover, .menu-items li button.menu-group-btn:hover, .menu-items li button.menu-link-btn:hover { background: var(--border-light); color: var(--text); text-decoration: none; }
.menu-items li a.menu-active { background: var(--brand-light, #e0f2fe); color: var(--brand); font-weight: 600; }
.menu-items li a.menu-active svg { color: var(--brand); }
.menu-items li a svg { flex-shrink: 0; color: var(--text-muted); }
.menu-items li a:hover svg { color: var(--text-2); }

.menu-group-btn.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.menu-badge { background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
.menu-divider { height: 1px; background: var(--border-light); margin: 4px 8px; }
.menu-section-title { padding: 12px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }

/* ===== Notification Icon ===== */
.notif-icon { position: relative; color: var(--text-muted); display: flex; align-items: center; padding: 6px; border-radius: var(--r-sm); }
.notif-icon:hover { color: var(--text); background: var(--border-light); }
.notif-badge { position: absolute; top: 0; right: 0; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--white); }

/* ===== Auth ===== */
.auth-page { background: var(--bg); }
.auth-page .app-main { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-container { width: 100%; max-width: 380px; }
.auth-logo { text-align: center; margin-bottom: 40px; }
.auth-logo h1 { font-size: 24px; color: var(--brand); font-weight: 800; letter-spacing: -0.03em; }
.auth-subtitle { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.auth-form { background: var(--white); padding: 32px; border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.auth-links { display: flex; justify-content: space-between; margin-top: 20px; font-size: 14px; }
.auth-message { background: var(--white); padding: 40px 28px; border-radius: var(--r-lg); box-shadow: var(--shadow-md); text-align: center; }
.auth-icon { margin-bottom: 16px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="search"], .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 15px; font-family: var(--font); color: var(--text); background: var(--white); transition: all 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.form-static { padding: 10px 0; color: var(--text-muted); }
.form-check { display: flex; flex-direction: column; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; font-size: 14px; font-weight: 600; font-family: var(--font);
    border: none; border-radius: var(--r-sm); cursor: pointer; transition: all 0.15s; text-decoration: none; line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; color: #fff; box-shadow: var(--shadow-brand); }
.btn-outline { background: var(--white); color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-50); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 10px; }
.btn-ghost:hover { background: var(--border-light); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Flash ===== */
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; animation: flashIn 0.2s; }
.flash-success { background: var(--green-light); color: #166534; }
.flash-error { background: var(--danger-light); color: #991b1b; }
.flash-info { background: var(--brand-light); color: var(--brand-dark); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }

/* ===== Cards ===== */
.card { background: var(--white); border-radius: var(--r); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.card-body { padding: 20px; }

/* ========================================
   DASHBOARD
   ======================================== */

/* Progress Card with Ring */
.progress-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    margin-bottom: 24px;
}

.progress-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.progress-ring-svg {
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--brand);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.02em;
}

.progress-info { flex: 1; }

.progress-headline {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.progress-bar-inline .progress-bar-bg {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inline .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Filters — pill tabs */
.filters {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--border-light);
    border-radius: 999px;
    background: var(--white);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

.filter-btn.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,146,201,0.25);
}

.filter-btn:hover:not(.active) {
    border-color: var(--border);
    color: var(--text);
}

/* Module sections */
.module-section {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1.5px solid var(--border-light);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.module-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    border: none;
    padding: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: -0.01em;
}

.module-progress {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-50);
    padding: 2px 10px;
    border-radius: 999px;
}

.module-bar {
    margin-bottom: 8px;
}

.module-bar-bg {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.module-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Tasks — inline layout */
.task-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.task-item:last-child { border-bottom: none; }

.task-row-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-info-inline { flex: 1; min-width: 0; }

.task-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    line-height: 1.3;
}

.task-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 1px;
}

.task-chips-inline {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.task-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Chips — chunky, interactive, fun */
.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    border: 2px solid;
}

.chip-pending {
    background: var(--white);
    color: var(--text-2);
    border-color: var(--border);
}

.chip-pending:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,146,201,0.15);
    text-decoration: none;
}

.chip-done {
    background: var(--green-light);
    color: #16a34a;
    border-color: #86efac;
}

.chip-done:hover { text-decoration: none; }

.chip-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.chip-done .chip-icon { color: var(--green); }

.chip-text { flex: 1; }

.chip-arrow {
    font-size: 18px;
    color: var(--text-muted);
    opacity: 0.4;
    transition: all 0.15s;
    flex-shrink: 0;
}

.chip:hover .chip-arrow { opacity: 1; transform: translateX(2px); }
.chip-done .chip-arrow { color: #16a34a; }

.chip-comment-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--brand-light);
    color: var(--brand);
    padding: 2px 7px;
    border-radius: 999px;
}

/* Mini chips for dashboard */
.chip-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    color: var(--text-2);
    background: var(--white);
    white-space: nowrap;
    transition: all 0.15s;
}

.chip-mini:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}

.chip-mini--done {
    border-color: #86efac;
    color: #16a34a;
    background: var(--green-light);
}
.chip-mini--done::before {
    content: '✓ ';
    font-weight: 700;
}

.chip-mini--done:hover {
    border-color: var(--green);
    color: #16a34a;
}

/* Onboarding hint */
.onboarding-hint {
    padding: 12px 16px;
    background: var(--brand-50);
    border: 1.5px solid var(--brand-light);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.5;
}

.onboarding-hint strong {
    color: var(--brand);
}

.chip-mini .chip-comment-count {
    font-size: 10px;
    padding: 1px 5px;
}

/* ========================================
   TASK VIEW
   ======================================== */

.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 14px; color: var(--text-muted); font-weight: 500; margin-bottom: 12px;
}
.back-link:hover { color: var(--brand); }

.tv-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.entry-view-page { max-width: 720px; margin: 0 auto; }

.tv-title {
    font-size: 24px; font-weight: 800; letter-spacing: -0.03em;
    color: var(--text); margin-bottom: 8px; line-height: 1.2;
}

.tv-meta {
    display: flex; align-items: center; gap: 8px; margin-bottom: 0;
}

.tv-variant {
    display: inline-block; padding: 2px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tv-variant--self { background: var(--brand-light); color: var(--brand); }
.tv-variant--other { background: var(--purple-light); color: var(--purple); }
.tv-variant--ongoing { background: var(--green-light); color: #15803d; }

.tv-module-name { font-size: 13px; color: var(--text-muted); }

.tv-desc {
    font-size: 14px; color: var(--text-muted); margin-top: 10px;
    font-style: italic;
}

/* Sections */
.tv-section {
    margin-bottom: 32px;
}

.tv-section-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}

.tv-section-title {
    font-size: 18px; font-weight: 700;
    color: var(--text); margin: 0;
    letter-spacing: -0.01em;
}

.tv-section-count {
    font-size: 12px; font-weight: 700;
    background: var(--border-light); color: var(--text-muted);
    padding: 2px 8px; border-radius: 999px;
}

.tv-empty {
    text-align: center; padding: 40px 28px;
    background: linear-gradient(135deg, var(--white) 0%, rgba(224, 243, 251, 0.3) 100%);
    border-radius: 14px;
    border: 1.5px dashed var(--brand-light);
}
.tv-empty p { color: var(--text-muted); margin-bottom: 12px; font-size: 14px; }

/* Entries */

.entry-content { font-size: 15px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; word-wrap: break-word; }
.entry-deleted { color: var(--text-muted); font-style: italic; }
.btn-delete-comment { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 2px 0; margin-top: 2px; }
.btn-delete-comment:hover { color: var(--danger, #dc2626); text-decoration: underline; }

/* Comment toggle + form */
.feed-actions-row { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.comment-toggle-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.comment-toggle-btn:hover { border-color: var(--brand); color: var(--brand); }
.comment-toggle-btn svg { flex-shrink: 0; }
.feed-comment-form {
    padding: 8px 0 12px;
}
.feed-comment-form textarea { font-size: 13px; }
.feed-comment-form .comment-form-actions .btn { border: 1.5px solid var(--brand); color: var(--brand); }
.feed-comment-form .comment-form-actions .btn:hover { background: var(--brand); color: #fff; }

/* Watch */
.watch-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 999px;
    background: var(--white); color: var(--text-muted); font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.watch-btn:hover { border-color: var(--brand); color: var(--brand); }
.watch-btn.watching { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Top-right actions — součást meta řádku, zarovnané vpravo */
.entry-actions-topright {
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0; margin-left: auto;
}
.entry-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0;
    border: 1.5px solid var(--border); border-radius: 999px;
    background: var(--white); color: var(--text-muted);
    cursor: pointer; font-family: var(--font); transition: all 0.15s;
    text-decoration: none;
}
.entry-icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.entry-share-btn.copied { background: var(--brand); border-color: var(--brand); color: #fff; }
.entry-share-icon { display: inline-flex; align-items: center; }
.entry-share-icon--done { display: none; }
.entry-share-btn.copied .entry-share-icon--default { display: none; }
.entry-share-btn.copied .entry-share-icon--done { display: inline-flex; }

.entry-delete-form { display: contents; }
.entry-delete-btn-icon:hover { border-color: var(--danger); color: var(--danger); }
.feed-mark-insufficient {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border: 1.5px solid var(--border); border-radius: 999px;
    background: var(--white); color: var(--text-muted); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.feed-mark-insufficient:hover { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.feed-approve-inline { display: flex; justify-content: flex-end; gap: 6px; padding: 4px 16px 8px; }
.approve-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.approve-toggle:hover { border-color: #16a34a; color: #16a34a; }
.approve-toggle.approved { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.feature-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.feature-toggle:hover { border-color: #d97706; color: #d97706; }
.feature-toggle.featured { background: #fef3c7; border-color: #d97706; color: #92400e; }
.feature-toggle-comment { padding: 2px 8px; font-size: 11px; vertical-align: middle; }
.comment-bottom-row, .entry-bottom-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.comment-bottom-row .reactions-row, .entry-bottom-row .reactions-row { margin-top: 0; }
.feed-featured-badge { display: inline-flex; align-items: center; gap: 3px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.03em; vertical-align: middle; margin-left: 4px; text-transform: uppercase; }
.feed-featured-badge svg { display: block; }

/* Entry footer / comment form */
.entry-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }

.comment-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.comment-form textarea {
    flex: 1 1 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 16px; font-family: var(--font); resize: none; min-height: 36px; max-height: 120px; color: var(--text); box-sizing: border-box;
}
.comment-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.comment-form-actions { display: flex; gap: 4px; align-items: center; margin-left: auto; }

.comment-audio-btn {
    width: 34px; height: 34px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: var(--white); color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.comment-audio-btn:hover { border-color: var(--brand); color: var(--brand); }
.comment-audio-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ===== Entry Form ===== */
.entry-form textarea {
    width: 100%; min-height: 200px; padding: 16px; border: 1.5px solid var(--border);
    border-radius: var(--r); font-size: 16px; font-family: var(--font);
    resize: vertical; line-height: 1.7; color: var(--text);
}
.entry-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.entry-actions { display: flex; gap: 12px; margin-top: 16px; align-items: center; }
.autosave-status { font-size: 13px; color: var(--text-muted); }

.recording-zone {
    display: flex; align-items: center; gap: 12px; margin-top: 16px;
    padding: 14px 18px; background: var(--white); border: 1.5px dashed var(--border); border-radius: var(--r);
}

.audio-btn {
    display: flex; align-items: center; gap: 8px; padding: 10px 20px;
    border-radius: var(--r-sm); border: 1.5px solid var(--brand); background: var(--white);
    color: var(--brand); cursor: pointer; font-family: var(--font); font-size: 14px; font-weight: 600; transition: all 0.15s;
}
.audio-btn:hover { background: var(--brand); color: #fff; }
.audio-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.5s infinite; }
.audio-btn-label { pointer-events: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }

.recording-indicator { display: none; align-items: center; gap: 8px; font-size: 14px; color: var(--danger); font-weight: 600; }
.recording-indicator.active { display: flex; }
.recording-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; animation: blink 1s infinite; }
.recording-stop { padding: 5px 14px; border: 1.5px solid var(--danger); border-radius: var(--r-sm); background: none; color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== Notifications ===== */
.notif-list { list-style: none; }
.notif-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-light); text-decoration: none; color: var(--text); transition: background 0.1s; }
.notif-item:hover { text-decoration: none; }
.notif-item.unread { font-weight: 500; }
.notif-item.unread::before { content: ''; width: 6px; height: 6px; background: var(--brand); border-radius: 50%; flex-shrink: 0; margin-top: 7px; }
.notif-icon-type { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--brand); }
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 14px; line-height: 1.5; }
.notif-text strong { font-weight: 700; }
.notif-preview { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.notif-empty-icon { font-size: 48px; margin-bottom: 12px; }
.notif-floating { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 10px 24px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-md); cursor: pointer; z-index: 90; text-decoration: none; display: none; }
.notif-floating.visible { display: block; }

/* ===== Feed (Novinky) ===== */
.feed-section { margin-bottom: 28px; margin-top: 32px; }
.feed-section:first-child { margin-top: 0; }
.feed-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.feed-section-title { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin: 0; }
.feed-section-title svg { color: var(--text-muted); }
.feed-section-badge { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-light); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.feed-section-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.feed-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 14px; background: var(--white); border: 1.5px dashed var(--border); border-radius: var(--r); }
.feed-item { display: flex; gap: 12px; padding: 14px 16px; background: var(--white); border: 1.5px solid var(--border-light); border-radius: var(--r); margin-bottom: 12px; text-decoration: none; color: var(--text); transition: all 0.15s; }
.feed-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); text-decoration: none; }
.feed-item--unread { border-left: 3px solid var(--brand); background: var(--brand-50); }
.feed-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
.feed-item-body { flex: 1; min-width: 0; }
.feed-item-head { font-size: 14px; line-height: 1.4; }
.feed-item-head strong { color: var(--text); }
.feed-item-context { color: var(--text-muted); font-size: 13px; }
.feed-item-preview { font-size: 14px; color: var(--text-2); margin-top: 4px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.feed-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.feed-manual { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--amber-light); border-radius: var(--r); margin-bottom: 16px; font-size: 14px; }
.feed-manual-icon { color: var(--amber); flex-shrink: 0; }
.feed-manual-text { flex: 1; }
.feed-manual-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.feed-manual-dismiss { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.feed-manual-dismiss:hover { background: rgba(0,0,0,0.08); color: var(--text); }

/* Feed thread (comment group per entry) */
.feed-thread { background: var(--white); border: 1.5px solid var(--border-light); border-radius: var(--r); margin-bottom: 20px; overflow: hidden; scroll-margin-top: calc(var(--header-h) + 12px); }
.feed-thread--unread { border-color: var(--border-light); }
.feed-mark-read-wrap { display: flex; justify-content: flex-end; padding: 4px 16px 16px; }
.feed-mark-read {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border: 1.5px solid var(--brand); border-radius: 999px;
    background: var(--white); color: var(--brand); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.feed-mark-read:hover { background: var(--brand); color: #fff; }
.feed-mark-read:hover svg { color: #fff; }
.feed-mark-read svg { color: var(--brand); }

.feed-thread-entry-wrap { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px; }
.watch-btn--desktop { }
.watch-btn--mobile { display: none; }
.feed-thread-entry { display: block; flex: 1; min-width: 0; color: var(--text); }

.feed-thread-entry-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.feed-thread-entry-meta strong { color: var(--text); }

.feed-thread-entry-text { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-bottom: 4px; }

.feed-more { color: var(--brand); font-weight: 600; cursor: pointer; font-size: 13px; }
.feed-more:hover { color: var(--brand-dark); text-decoration: underline; }

.feed-thread-comments { padding: 4px 16px 8px; margin-left: 20px; }

.feed-group-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 12px; text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.feed-group-divider::before, .feed-group-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.feed-group-divider::before { max-width: 24px; }
.feed-group-divider-text { white-space: nowrap; }
.feed-group-divider:hover { color: var(--brand); }
.feed-group-divider:hover .feed-group-divider-text { text-decoration: underline; }

.feed-skipped-wrap { margin-bottom: 4px; }
.feed-skipped-expand { display: block; width: 100%; padding: 8px 0; font-size: 13px; color: var(--text-muted); background: none; border: none; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); text-align: center; cursor: pointer; font-family: var(--font); transition: color 0.15s; }
.feed-skipped-expand:hover { color: var(--brand); }
a.feed-skipped { display: block; padding: 8px 0; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); text-align: center; text-decoration: none; }
a.feed-skipped:hover { color: var(--brand); }

.feed-comment { display: flex; gap: 10px; padding: 8px 0; }

.feed-comment--preceding { opacity: 0.5; }
.feed-comment--new { opacity: 1; }
.feed-comment--unread { background: var(--brand-50, #e0f2fe); border-radius: var(--r-sm); margin: 2px -12px; padding: 6px 12px; }
.feed-entry--unread { background: var(--brand-50, #e0f2fe); border-radius: var(--r-sm) var(--r-sm) 0 0; }
/* Audio recording hidden until tested */
.recording-zone, .comment-audio-btn { display: none !important; }

.feed-task-link { color: inherit; text-decoration: none; }
.feed-task-link:hover { color: var(--brand); text-decoration: underline; }
.feed-new-badge { display: inline-block; background: var(--brand); color: white; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.05em; vertical-align: middle; margin-left: 4px; }
.role-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.role-badge--admin { background: #fef3c7; color: #92400e; }
.role-badge--team { background: #e0f2fe; color: #0369a1; }
.role-badge--me { background: var(--green-light); color: #15803d; }

.feed-comment-body { flex: 1; min-width: 0; }
.feed-comment-body p { font-size: 14px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.feed-comment-head { display: flex; align-items: baseline; gap: 8px; }
.feed-comment-head strong { font-size: 13px; color: var(--text); }

.feed-author-link { color: inherit; text-decoration: none; }
.feed-author-link:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.feed-avatar--sm { width: 28px; height: 28px; font-size: 11px; }

.participant-module-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 28px 0 8px; padding: 0; }
.participant-module-title:first-child { margin-top: 0; }

/* ===== Entry Kebab Menu ===== */
.entry-kebab { position: relative; }
.entry-kebab-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: var(--r-sm); transition: background 0.15s, color 0.15s; }
.entry-kebab-btn:hover { background: var(--border-light); color: var(--text); }
.entry-kebab-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-md); z-index: 50; min-width: 220px; padding: 4px; }
.entry-kebab.open .entry-kebab-menu { display: block; }
.entry-kebab-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; padding: 8px 12px; font-size: 13px; color: var(--text); cursor: pointer; border-radius: var(--r-sm); font-family: var(--font); white-space: nowrap; }
.entry-kebab-item:hover { background: var(--brand-light); color: var(--brand-dark); }
.entry-kebab-item svg { flex-shrink: 0; }

/* ===== Move Entry Modal ===== */
.move-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s; }
.move-modal { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 440px; max-height: 80vh; display: flex; flex-direction: column; }
.move-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.move-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.move-modal-close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.move-modal-close:hover { color: var(--text); }
.move-modal-body { overflow-y: auto; padding: 12px 20px; flex: 1; }
.move-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-light); }
.move-module-name { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 12px 0 6px; }
.move-module-name:first-child { margin-top: 0; }
.move-task-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; flex-wrap: wrap; }
.move-task-name { font-size: 14px; color: var(--text); flex-shrink: 0; }
.move-variant-btn { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); color: var(--text-2); cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.move-variant-btn:hover { border-color: var(--brand); color: var(--brand); }
.move-variant-btn.selected { background: var(--brand); color: #fff; border-color: var(--brand); }
.move-variant-btn.current { background: var(--border-light); color: var(--text-muted); border-color: var(--border); cursor: default; font-style: italic; }

/* ===== Team Table ===== */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--white); }
.overview-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.overview-table th, .overview-table td { padding: 10px 10px; border-bottom: 1px solid var(--border-light); text-align: center; }
.overview-table th { background: var(--bg); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.overview-table .th-task { border-bottom: none; padding-bottom: 2px; }
.overview-table .th-variant { font-size: 10px; font-weight: 500; padding-top: 0; color: var(--text-muted); opacity: 0.7; }
.overview-table .th-sticky, .overview-table .td-sticky { position: sticky; left: 0; background: var(--white); text-align: left; font-weight: 600; z-index: 2; }
.overview-table .th-sticky { background: var(--bg); z-index: 3; }
.overview-table tbody tr:hover td { background: var(--border-light); }
.overview-table tbody tr:hover .td-sticky { background: var(--border-light); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.status-dot.approved { background: var(--green); }
.status-dot.full { background: var(--amber); }
.status-dot.half { background: #f59e0b; opacity: 0.5; }
.status-dot.none { background: var(--border); }

/* ===== Admin ===== */
.admin-nav { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.admin-tab { padding: 10px 20px; border: none; background: none; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: var(--font); text-decoration: none; transition: color 0.15s; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-section { margin-bottom: 32px; }
.admin-section h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.user-list { list-style: none; }
.user-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-light); gap: 8px; }
.user-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.user-status--invited { background: #fef3c7; color: #92400e; }
.user-status--pending { background: #e0f2fe; color: #0369a1; }
.user-status--active { background: #dcfce7; color: #16a34a; }
.user-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.task-manage-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 6px; transition: opacity 0.2s, border-color 0.2s; }
.task-manage-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-manage-name { font-size: 15px; color: var(--text); }
.task-manage-variants { display: flex; flex-wrap: wrap; gap: 4px; }
.task-manage-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.drag-handle { cursor: grab; color: var(--text-muted); font-size: 16px; line-height: 1; padding: 4px; user-select: none; opacity: 0.5; transition: opacity 0.15s, color 0.15s; }
.drag-handle:hover { opacity: 1; color: var(--brand); }
.drag-handle:active { cursor: grabbing; }
.task-manage-item.dragging { opacity: 0.4; }
.task-manage-item.drag-over { border-top: 3px solid var(--brand); margin-top: -2px; }
.task-manage-actions { display: flex; gap: 4px; flex-shrink: 0; }
.sort-btn { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; }
.sort-btn:hover { border-color: var(--brand); color: var(--brand); }
.sort-btn--danger { color: var(--danger); }
.sort-btn--danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.sort-btn--disabled, .sort-btn:disabled { opacity: 0.35; cursor: not-allowed; color: var(--text-muted); }
.sort-btn--disabled:hover, .sort-btn:disabled:hover { border-color: var(--border); color: var(--text-muted); background: var(--white); }

/* Collapsible "Přidat nový modul" */
.module-add > summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; font-size: 13px; font-weight: 600;
    background: var(--white); color: var(--brand);
    border: 1.5px solid var(--brand); border-radius: var(--r-sm);
    transition: all 0.15s;
}
.module-add > summary::-webkit-details-marker { display: none; }
.module-add > summary:hover { background: var(--brand-50); }
.module-add[open] > summary { margin-bottom: 10px; }

/* ===== Settings ===== */
.settings-form .form-group { padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.toggle-label { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.toggle-wrap { position: relative; flex-shrink: 0; }
.toggle-switch { width: 44px; height: 24px; background: var(--border); border-radius: 12px; position: relative; transition: background 0.2s; display: block; }
.toggle-switch::after { content: ''; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.2s; box-shadow: var(--shadow-sm); }
.sr-only:checked + .toggle-switch { background: var(--brand); }
.sr-only:checked + .toggle-switch::after { transform: translateX(20px); }

/* ===== Animations ===== */
.completion-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.92); backdrop-filter: blur(4px); z-index: 300; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.checkmark-circle { width: 80px; height: 80px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
.checkmark-circle svg { width: 40px; height: 40px; stroke: #fff; stroke-width: 3; fill: none; stroke-dasharray: 50; stroke-dashoffset: 50; animation: drawCheck 0.4s 0.2s forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--text); color: #fff; padding: 10px 20px; border-radius: var(--r); font-size: 14px; font-weight: 500; z-index: 400; transition: transform 0.3s ease; box-shadow: var(--shadow-md); }
.toast.visible { transform: translateX(-50%) translateY(0); }

/* Autosave */
.autosave-indicator { position: fixed; bottom: 16px; right: 16px; background: var(--white); border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--r-sm); font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; z-index: 50; }
.autosave-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ===== All-read ===== */
.all-read { text-align: center; padding: 32px 20px; }
.all-read-icon { display: none; }
.all-read-text { font-size: 14px; color: var(--text-muted); }

/* Feed end state */
.feed-end { text-align: center; padding: 32px 20px 16px; }
.feed-end-check { width: 44px; height: 44px; margin: 0 auto 10px; background: var(--green-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.feed-end-text { font-size: 14px; font-weight: 600; color: var(--green); }
.feed-load-more-wrap { text-align: center; padding: 0 20px 32px; }
.feed-load-more { font-size: 14px; }

/* Page titles */
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.03em; color: var(--text); }
.page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== Drafts ===== */
#draftsBox { margin-bottom: 20px; }
.draft-item { display: flex; align-items: center; gap: 8px; background: #fef3c7; border: 1.5px solid #fcd34d; border-radius: var(--r); padding: 10px 14px; margin-bottom: 8px; font-size: 13px; }
.draft-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.draft-link:hover { color: var(--brand); }
.draft-label { font-weight: 700; color: #92400e; white-space: nowrap; }
.draft-variant { color: var(--text-muted); white-space: nowrap; }
.draft-preview { color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-discard { background: none; border: none; color: #92400e; font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; flex-shrink: 0; }
.draft-discard:hover { color: var(--danger); }

/* ===== Onboarding ===== */
.onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.onboarding-card { background: var(--white); border-radius: var(--r); max-width: 600px; width: 100%; padding: 32px; box-shadow: 0 8px 40px rgba(0,0,0,0.2); margin: auto 0; }
.onboarding-card h2 { font-size: 17px; font-weight: 700; color: var(--brand); margin: 24px 0 8px; }
.onboarding-card h2:first-child { margin-top: 0; }
.onboarding-card p { font-size: 15px; line-height: 1.6; color: var(--text-2); margin: 0 0 8px; }
.onboarding-card ul { font-size: 15px; line-height: 1.6; color: var(--text-2); padding-left: 20px; margin: 0 0 8px; }
.onboarding-card ul ul { margin-top: 4px; }
.onboarding-card .btn-block { margin-top: 24px; }

/* Writing guide (task view) */
.writing-guide { background: var(--bg, #f9f6f0); border: 1.5px solid var(--border-light); border-radius: var(--r); padding: 20px 24px; margin-bottom: 20px; }
.writing-guide h3 { font-size: 15px; font-weight: 700; color: var(--brand); margin: 0 0 8px; }
.writing-guide p { font-size: 14px; line-height: 1.6; color: var(--text-2); margin: 0 0 6px; }
.writing-guide-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; margin-bottom: 12px; border: none; background: none; font-family: var(--font); padding: 0; }
.writing-guide-toggle:hover { color: var(--brand); }
.writing-guide-toggle svg { flex-shrink: 0; }

/* ===== Responsive ===== */
@media (max-width: 639px) {
    .task-row-inline { flex-direction: column; align-items: flex-start; gap: 8px; }
    .task-chips-inline { flex-shrink: 1; flex-wrap: wrap; }
    .watch-btn--desktop { display: none; }
    .watch-btn--mobile { display: inline-flex; }
}
@media (max-width: 1023px) {
    .header-left { order: 1; }
    .header-right { order: 2; }
}
@media (min-width: 640px) {
    .app-main { padding: 32px; }
    .app-main.with-header { padding-top: calc(var(--header-h) + 40px); }
}
@media (min-width: 1024px) {
    :root { --layout-w: calc(var(--sidebar-w) + 640px + 96px); }
    .menu-toggle { display: none; }
    .app-header-inner { max-width: var(--layout-w); margin: 0 auto; padding: 0 48px 0 20px; }
    .side-menu { transform: translateX(0); top: var(--header-h); right: auto; border-left: none; border-right: 1px solid var(--border); box-shadow: none; z-index: 50; left: max(0px, calc((100vw - var(--layout-w)) / 2)); }
    .menu-overlay { display: none !important; }
    .app-main { max-width: var(--layout-w); margin: 0 auto; padding-left: calc(var(--sidebar-w) + 48px); padding-right: 48px; }
    .app-main.with-header { padding-top: calc(var(--header-h) + 24px); }
    .auth-page .app-main { padding-left: 48px; }
}

/* === Feed page head with sort toggle === */
.feed-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.feed-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.feed-controls--mobile { display: none; }
.feed-sort, .feed-filter { display: inline-flex; gap: 2px; background: var(--border-light); border-radius: 999px; padding: 2px; }
.feed-sort-btn, .feed-filter-btn { padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s; text-decoration: none; font-family: var(--font); }
.feed-sort-btn:hover, .feed-filter-btn:hover { color: var(--text); text-decoration: none; }
.feed-sort-btn.is-active, .feed-filter-btn.is-active { background: var(--white); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.feed-dropdown { position: relative; }
.feed-dropdown-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--border-light); border: none; border-radius: 999px; cursor: pointer; font-family: var(--font); transition: background 0.15s; }
.feed-dropdown-btn:hover { background: var(--border); }
.feed-dropdown-btn svg { flex-shrink: 0; color: var(--text-muted); }
.feed-dropdown-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-md); z-index: 50; min-width: 180px; padding: 4px; }
.feed-dropdown.open .feed-dropdown-menu { display: block; }
.feed-dropdown-item { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; padding: 8px 12px; font-size: 13px; color: var(--text); cursor: pointer; border-radius: var(--r-sm); font-family: var(--font); white-space: nowrap; text-align: left; text-decoration: none; }
.feed-dropdown-item:hover { background: var(--brand-light); color: var(--brand-dark); text-decoration: none; }
.feed-dropdown-item.is-active { color: var(--brand-dark); font-weight: 600; }
.feed-dropdown-check { display: inline-block; width: 14px; color: var(--brand); font-weight: 700; }

@media (max-width: 600px) {
    .feed-controls--desktop { display: none; }
    .feed-controls--mobile { display: flex; gap: 8px; }
}

/* === Reactions === */
.reactions-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; position: relative; }
.reaction-summary { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; background: var(--border-light); border: 1px solid transparent; border-radius: 999px; font-size: 13px; line-height: 1.4; cursor: pointer; transition: background 0.15s, border-color 0.15s; font-family: var(--font); color: var(--text); }
.reaction-summary:hover { background: var(--brand-light); }
.reaction-summary:disabled { cursor: default; }
.reaction-summary:disabled:hover { background: var(--border-light); }
.reaction-summary--mine { background: var(--brand-light); border-color: var(--brand); }
.reaction-summary--mine:hover { background: var(--brand-50); }
.reaction-summary-emojis { display: inline-flex; align-items: center; gap: 4px; }
.reaction-emoji { font-size: 14px; line-height: 1; }
.reaction-summary-count { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.reaction-summary--mine .reaction-summary-count { color: var(--brand-dark); }

.reaction-add { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 26px; padding: 0; background: var(--border-light); border: 1px solid transparent; border-radius: 999px; cursor: pointer; color: var(--text-muted); transition: background 0.15s, color 0.15s; }
.reaction-add:hover { background: var(--brand-light); color: var(--brand-dark); }

.reaction-popover { position: absolute; z-index: 60; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-md); padding: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 280px; min-width: 240px; }
.reaction-popover-picker { display: flex; flex-wrap: wrap; gap: 2px; }
.reaction-popover-emoji { background: none; border: 1px solid transparent; padding: 6px 8px; font-size: 18px; line-height: 1; cursor: pointer; border-radius: var(--r-sm); }
.reaction-popover-emoji:hover { background: var(--brand-light); }
.reaction-popover-emoji.is-mine { background: var(--brand-50); border-color: var(--brand); }
.reaction-popover-reactors { border-top: 1px solid var(--border-light); padding: 6px 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.reaction-popover-reactors:first-child { border-top: none; padding-top: 0; }
.reaction-reactor-line { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text); line-height: 1.3; }
.reaction-reactor-line-emoji { font-size: 14px; flex-shrink: 0; }
.reaction-reactor-line-names { color: var(--text-muted); }

.feed-reaction-row { display: flex; align-items: stretch; background: var(--white); border: 1px solid var(--border-light); border-radius: var(--r-sm); margin-bottom: 6px; overflow: hidden; transition: border-color 0.15s; }
.feed-reaction-row:hover { border-color: var(--brand-light); }
.feed-reaction-link { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.feed-reaction-link:hover { background: var(--brand-50); color: var(--text); text-decoration: none; }
.feed-reaction-content { flex: 1; min-width: 0; }
.feed-reaction-text { line-height: 1.4; }
.feed-reaction-preview { color: #52525b; font-size: 13px; line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-reaction-row .feed-time { color: var(--text-muted); font-size: 12px; flex-shrink: 0; padding-top: 1px; }
.feed-reaction-dismiss { display: inline-flex; align-items: center; justify-content: center; width: 40px; background: none; border: none; border-left: 1px solid var(--border-light); color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; flex-shrink: 0; }
.feed-reaction-dismiss:hover { background: #ecfdf5; color: #16a34a; }

@media (max-width: 600px) {
    .reaction-popover--mobile { position: fixed; bottom: 0; left: 0; right: 0; max-width: none; min-width: 0; padding: 14px 12px max(28px, calc(env(safe-area-inset-bottom, 0px) + 14px)); border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,0.18); max-height: 80vh; overflow-y: auto; }
    .reaction-popover--mobile .reaction-popover-picker { justify-content: center; gap: 4px; }
    .reaction-popover--mobile .reaction-popover-emoji { font-size: 26px; padding: 10px 12px; min-width: 48px; min-height: 48px; }
    .reaction-popover--mobile .reaction-popover-reactors { padding-bottom: 4px; }
}

