/* ================================================================
   platform.css — Nihongo Planet Learning Platform (shared)
   Dark navy / deep space · Japanese-learning aesthetic
   red / pink / orange gradients · glassmorphism · subtle glow
   Poppins + Noto Sans JP · mobile responsive
   ================================================================ */

@import url("brand-tokens.css?v=20260910-02");

:root {
    --space-0: #070b18;
    --space-1: #0b1226;
    --space-2: #101a36;
    --space-3: #16224a;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.10);
    --border: rgba(255, 255, 255, 0.12);
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
    --accent-pink: #f76d8e;
    --accent-orange: #ff9f68;
    --accent-gold: #f7b267;
    --text-main: #f1f5fb;
    --text-muted: #94a3b8;
    --grad-main: linear-gradient(135deg, #d63031 0%, #f76d8e 55%, #ff9f68 100%);
    --grad-soft: linear-gradient(135deg, rgba(214, 48, 49, 0.18) 0%, rgba(247, 109, 142, 0.18) 100%);
    --shadow-glow: 0 8px 32px rgba(214, 48, 49, 0.25);
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --font-ui: 'Poppins', 'Noto Sans JP', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-ui);
    color: var(--text-main);
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(214, 48, 49, 0.22), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(247, 109, 142, 0.14), transparent 55%),
        radial-gradient(1000px 700px at 50% 120%, rgba(255, 159, 104, 0.10), transparent 60%),
        linear-gradient(180deg, var(--space-0) 0%, var(--space-1) 45%, var(--space-0) 100%);
    background-attachment: scroll;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ---------- shared header shell ---------- */
.p-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(9, 14, 30, 0.78);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(2, 6, 18, 0.35);
}

.p-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 62px;
}

/* Light-skin navbar (opt-in via localStorage.theme === 'light'? no: 'dark' default) */
body.light-skin .p-header {
    background: rgba(252, 252, 254, 0.86);
    border-bottom-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 30px rgba(15, 23, 42, 0.10);
}

body.light-skin .p-nav { color: #475569; }

body.light-skin .p-nav:hover { color: #16202f; background: rgba(15, 23, 42, 0.08); }

body.light-skin .p-user-name { color: #16202f; }

body.light-skin .p-btn-ghost {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(15, 23, 42, 0.16);
    color: #1f2a3d;
}

body.light-skin .p-btn-ghost:hover {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.28);
}

body.light-skin .p-avatar { box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(214, 48, 49, 0.28); }

body.light-skin .p-logo {
    background: linear-gradient(135deg, #b32324 0%, #db2777 55%, #ea6a4f 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

body.light-skin .p-logo-text {
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.p-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
    background: var(--grad-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    transition: filter 0.2s ease;
}

.p-logo:hover { filter: brightness(1.15); }

.p-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(247, 109, 142, 0.55);
    box-shadow: 0 0 0 2px rgba(247, 109, 142, 0.18), 0 4px 12px rgba(214, 48, 49, 0.30);
    transition: transform 0.7s ease;
}

.p-logo:hover .p-logo-img { transform: rotate(360deg); }

.p-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.p-controls .p-btn-ghost { white-space: nowrap; }
.p-controls .p-btn-ghost:first-child { min-width: 0; }

.p-nav-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
}

.p-nav {
    position: relative;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.p-nav:hover { color: var(--text-main); background: var(--glass-strong); transform: translateY(-1px); }
.p-nav:focus-visible { outline: 2px solid rgba(247, 109, 142, 0.7); outline-offset: 2px; }
.p-nav.active {
    color: #fff;
    background: var(--grad-main);
    box-shadow: var(--shadow-glow);
}

.p-user { display: flex; align-items: center; gap: 0.55rem; margin-inline-start: auto; }

.p-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--grad-main);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), 0 4px 14px rgba(214, 48, 49, 0.4);
}

.p-avatar-img {
    object-fit: cover;
    background: #fff;
}

.p-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- buttons ---------- */
.p-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.35rem;
    border: none;
    border-radius: 999px;
    background: var(--grad-main);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.p-btn-primary:hover { transform: translateY(-1px); opacity: 0.94; }
.p-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.p-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.p-btn-ghost:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, 0.25); }

.p-btn-danger { border-color: rgba(231, 76, 60, 0.5); color: #ff8b80; }
.p-btn-danger:hover { background: rgba(231, 76, 60, 0.15); }

.p-btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

/* ---------- cards ---------- */
.glass {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.glass-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1.4rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(247, 109, 142, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.glass-card-link { display: block; }

.p-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 4rem;
}

.p-hero {
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-2xl);
    background: var(--grad-soft);
    border: 1px solid rgba(247, 109, 142, 0.3);
    margin-bottom: 1.75rem;
}

.p-hero h1 { margin: 0 0 0.35rem; font-size: 1.7rem; font-weight: 800; }
.p-hero h1 .grad { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.p-hero p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.p-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 1.75rem 0 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p-section-title::before {
    content: '';
    width: 6px;
    height: 22px;
    border-radius: 99px;
    background: var(--grad-main);
}

/* ---------- grid / lists ---------- */
.p-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.p-list { display: flex; flex-direction: column; gap: 0.7rem; }

.p-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-xl);
    background: var(--glass);
    border: 1px solid var(--border);
}

.p-row:hover { border-color: rgba(247, 109, 142, 0.4); }

.p-row-main { flex: 1; min-width: 0; }
.p-row-title { font-weight: 700; font-size: 0.97rem; }
.p-row-sub { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.15rem; }

/* ---------- badges / chips ---------- */
.p-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.p-badge-state { background: var(--glass-strong); color: var(--text-muted); }
.p-badge-seen { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.p-badge-turned_in { background: rgba(247, 178, 103, 0.18); color: #fcd9a8; }
.p-badge-graded { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.p-badge-teacher_complete { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.p-badge-draft { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.p-badge-published { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.p-badge-pending { background: rgba(247, 178, 103, 0.18); color: #fcd9a8; }
.p-badge-ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.p-badge-warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.p-badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* ---------- progress bars ---------- */
.p-bar-track {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.p-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--grad-main);
    transition: width 0.5s ease;
}

.p-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.p-progress-label b { color: var(--text-main); }

/* ---------- forms ---------- */
.p-input, .p-textarea, .p-select {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.p-input:focus, .p-textarea:focus, .p-select:focus {
    border-color: rgba(247, 109, 142, 0.6);
    background: rgba(255, 255, 255, 0.09);
}

.p-textarea { min-height: 120px; resize: vertical; }

.p-field { margin-bottom: 1rem; }
.p-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; }

/* ---------- tables (teacher) ---------- */
.p-table-wrap { overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--glass); }

.p-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 0.88rem; }

.p-table th {
    text-align: start;
    padding: 0.75rem 1rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}

.p-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.p-table tr:last-child td { border-bottom: none; }
.p-table tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* ---------- tabs ---------- */
.p-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.p-tab {
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.87rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.p-tab:hover { color: var(--text-main); }
.p-tab.active { background: var(--grad-main); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* ---------- states (loading / empty / error / denied) ---------- */
.p-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.p-state-icon { font-size: 2.4rem; filter: drop-shadow(0 4px 12px rgba(247, 109, 142, 0.35)); }
.p-state-msg { color: var(--text-muted); font-size: 0.95rem; max-width: 420px; margin: 0; }

.p-skeleton {
    border-radius: var(--radius-xl);
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: p-shimmer 1.4s infinite;
    min-height: 96px;
}

@keyframes p-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- toast ---------- */
.p-toast {
    position: fixed;
    bottom: 1.4rem;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--space-2);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 90vw;
}

.p-toast.show { opacity: 1; transform: translate(-50%, 0); }
.p-toast.success { border-color: rgba(52, 211, 153, 0.5); }
.p-toast.error { border-color: rgba(239, 68, 68, 0.5); }

/* ---------- modal ---------- */
.p-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 20, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 1.25rem;
}

.p-modal {
    width: 100%;
    max-width: 560px;
    background: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 1.6rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.p-modal h3 { margin: 0 0 0.9rem; font-size: 1.15rem; }

/* ---------- RTL ---------- */
[dir="rtl"] .p-header-inner, [dir="rtl"] .p-row { text-align: right; }
[dir="rtl"] .p-bar-fill { background: var(--grad-main); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .p-header-inner { padding: 0.5rem 1rem; gap: 0.7rem; min-height: 56px; }
    .p-logo { font-size: 0.95rem; }
    .p-nav-wrap { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .p-nav-wrap::-webkit-scrollbar { display: none; }
    .p-nav { padding: 0.36rem 0.68rem; font-size: 0.8rem; white-space: nowrap; }
    .p-user { margin-inline-start: auto; }
    .p-user-name { display: none; }
    .p-controls .p-btn-ghost { padding: 0.34rem 0.7rem; font-size: 0.78rem; }
    .p-page { padding: 1.25rem 1rem 3rem; }
    .p-hero h1 { font-size: 1.35rem; }
    .p-grid { grid-template-columns: 1fr; }
    .p-row { flex-wrap: wrap; }
    .p-row .p-btn-primary, .p-row .p-btn-ghost { width: 100%; }
}

@media (max-width: 480px) {
    .glass-card { padding: 1.1rem; }
    .p-user .p-btn-ghost, .p-user .p-btn-ghost.p-btn-sm { padding: 0.34rem 0.65rem; font-size: 0.74rem; }
}

/* ---------- segmented control ---------- */
.p-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.p-seg-btn {
    padding: 0.38rem 1rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.83rem;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.p-seg-btn:hover { color: var(--text-main); }
.p-seg-btn.active {
    background: var(--grad-main);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

/* ================================================================
   PHASE 3 (R4) — Comments & Notifications UI (offline shells)
   Static markup + styles only; backend wiring ships separately.
   RTL-first: built exclusively on CSS logical properties so
   dir="rtl" (default) and dir="ltr" both lay out correctly.
   ================================================================ */

/* ---------- scoped hidden utility ---------- */
.np-notif-badge.hidden { display: none !important; }

/* ---------- notification bell (header integration) ---------- */
.np-notif {
    position: fixed;
    top: 72px;
    inset-inline-end: 14px;
    z-index: 1200;
}

.np-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(9, 14, 30, 0.78);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.np-notif-btn::-webkit-details-marker { display: none; }
.np-notif-btn::marker { content: ''; }
.np-notif-btn:hover { background: var(--glass-strong); transform: translateY(-1px); }
.np-notif-btn:focus-visible { outline: 2px solid rgba(247, 109, 142, 0.7); outline-offset: 2px; }

.np-notif[open] .np-notif-btn {
    background: var(--grad-soft);
    border-color: rgba(247, 109, 142, 0.5);
    box-shadow: var(--shadow-glow);
}

.np-notif-ico { width: 21px; height: 21px; display: block; pointer-events: none; }

.np-notif-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--grad-main);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(214, 48, 49, 0.5);
}

/* ---------- notification dropdown ---------- */
.np-notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    width: min(360px, calc(100vw - 24px));
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: rgba(11, 18, 38, 0.92);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 50px rgba(2, 6, 18, 0.55);
    overflow: hidden;
    animation: np-drop 0.18s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes np-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.np-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.np-notif-title { margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--text-main); }

.np-notif-markall {
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(247, 109, 142, 0.4);
    background: transparent;
    color: var(--accent-pink);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.np-notif-markall:hover { background: rgba(247, 109, 142, 0.14); border-color: rgba(247, 109, 142, 0.65); }
.np-notif-markall:focus-visible { outline: 2px solid rgba(247, 109, 142, 0.7); outline-offset: 2px; }

.np-notif-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 109, 142, 0.35) transparent;
}

.np-notif-empty {
    margin: 0;
    padding: 1.7rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.86rem;
}

/* notification card — unread highlight state */
.np-notif-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.np-notif-card:hover { background: var(--glass-strong); }
.np-notif-card.clickable { cursor: pointer; }

.np-notif-card.unread {
    background: var(--grad-soft);
    border-color: rgba(247, 109, 142, 0.28);
}

.np-notif-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--accent-pink);
    box-shadow: 0 0 8px rgba(247, 109, 142, 0.8);
    flex-shrink: 0;
}

.np-notif-dot.read { background: transparent; box-shadow: none; }

.np-notif-main { min-width: 0; flex: 1; }

.np-notif-text {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-main);
    overflow-wrap: break-word;
}

.np-notif-time { display: block; margin-top: 0.2rem; font-size: 0.72rem; color: var(--text-muted); }

.np-notif-dismiss {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.np-notif-dismiss:hover { color: #ff8b80; background: rgba(231, 76, 60, 0.12); }

.np-notif-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-pink);
    transition: filter 0.15s ease, background-color 0.15s ease;
}

.np-notif-footer:hover { filter: brightness(1.25); background: rgba(255, 255, 255, 0.03); }

/* ---------- private comments box (Learn workspace / Grading modal) ---------- */
.np-private-comments-box {
    border: 1px dashed rgba(247, 109, 142, 0.45);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(300px 120px at 100% 0%, rgba(214, 48, 49, 0.10), transparent 70%),
        linear-gradient(180deg, rgba(247, 109, 142, 0.07) 0%, rgba(11, 18, 38, 0.25) 100%);
    padding: 1rem;
}

.np-private-comments-head {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}

.np-private-comments-title {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 800;
    color: #ffd9e1;
    letter-spacing: 0.01em;
}

.np-private-comments-note { font-size: 0.72rem; color: var(--text-muted); }

/* compact timeline chat */
.np-private-chat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.4rem 0.15rem;
    margin: 0 0 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 109, 142, 0.35) transparent;
}

.np-private-comment-bubble {
    position: relative;
    max-width: 80%;
    padding: 0.5rem 0.8rem;
    border-radius: 14px;
    font-size: 0.87rem;
    line-height: 1.55;
    color: var(--text-main);
    overflow-wrap: break-word;
}

.np-private-comment-bubble .who {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
    opacity: 0.75;
}

/* student side = inline-start of the timeline */
.np-private-comment-bubble.student {
    align-self: flex-start;
    background: var(--space-2);
    border: 1px solid var(--border);
    border-start-start-radius: 4px;
}

/* teacher side = inline-end of the timeline (visually distinct tint) */
.np-private-comment-bubble.teacher {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(214, 48, 49, 0.28) 0%, rgba(247, 109, 142, 0.26) 100%);
    border: 1px solid rgba(247, 109, 142, 0.45);
    border-start-end-radius: 4px;
}

.np-private-chat-empty { margin: 0; padding: 0.8rem 0.2rem; font-size: 0.82rem; color: var(--text-muted); text-align: center; }

/* ---------- comment input row (shared: public + private) ---------- */
.np-comment-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.np-comment-input {
    flex: 1;
    min-width: 0;
    padding: 0.58rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.np-comment-input::placeholder { color: var(--text-muted); }
.np-comment-input:focus { outline: none; border-color: rgba(247, 109, 142, 0.55); background: var(--glass-strong); }
.np-comment-input:focus-visible { outline: 2px solid rgba(247, 109, 142, 0.7); outline-offset: 2px; }
.np-comment-input:disabled { opacity: 0.55; cursor: not-allowed; }

[dir="rtl"] .np-comment-input { text-align: right; }
[dir="ltr"] .np-comment-input,
.np-comment-input:dir(ltr) { text-align: left; }

.np-comment-send {
    padding: 0.58rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: var(--grad-main);
    color: #fff;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(214, 48, 49, 0.35);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.np-comment-send:hover { transform: translateY(-1px); opacity: 0.94; }
.np-comment-send:focus-visible { outline: 2px solid rgba(247, 109, 142, 0.7); outline-offset: 2px; }
.np-comment-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- mobile responsiveness (down to 375px) ---------- */
@media (max-width: 900px) {
    .np-notif { top: 66px; inset-inline-end: 10px; }
}

@media (max-width: 480px) {
    .np-notif { top: auto; bottom: 18px; inset-inline-end: 12px; }
    .np-notif-dropdown {
        position: fixed;
        top: auto;
        bottom: 72px;
        inset-inline-end: 10px;
        inset-inline-start: 10px;
        width: auto;
    }
    .np-notif-list { max-height: min(46vh, 340px); }
    .np-private-comment-bubble { max-width: 88%; }
}

@media (max-width: 375px) {
    .np-notif-btn { width: 38px; height: 38px; }
    .np-notif-ico { width: 19px; height: 19px; }
    .np-notif-badge { min-width: 16px; height: 16px; line-height: 16px; font-size: 0.6rem; }
    .np-notif-head { padding: 0.7rem 0.8rem; }
    .np-notif-title { font-size: 0.88rem; }
    .np-notif-markall { padding: 0.24rem 0.55rem; font-size: 0.68rem; }
    .np-private-comments-box { padding: 0.8rem; }
    .np-private-comment-bubble { max-width: 92%; font-size: 0.84rem; }
    .np-comment-input { padding: 0.52rem 0.8rem; font-size: 0.84rem; }
    .np-comment-send { padding: 0.52rem 0.95rem; font-size: 0.8rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}