* { box-sizing: border-box; }
:root { font-family: Arial, "Noto Sans Bengali", sans-serif; color: #172033; background: #f3f6fb; }
body { margin: 0; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px max(18px, calc((100% - 980px)/2)); background: #102a56; color: white; }
.brand-mark { width: 54px; height: 54px; border: 2px solid #d8e6ff; border-radius: 14px; display: grid; place-items: center; font-weight: 800; letter-spacing: 1px; }
h1, h2, h3, p { margin-top: 0; }
.topbar h1 { margin-bottom: 3px; font-size: 1.25rem; }
.topbar p { margin-bottom: 0; color: #d8e6ff; }
.container { width: min(940px, calc(100% - 28px)); margin: 28px auto; }
.panel { background: white; border: 1px solid #dce4f0; border-radius: 16px; padding: 22px; margin-bottom: 18px; box-shadow: 0 6px 22px rgba(16,42,86,.05); }
.panel h2 { font-size: 1.2rem; margin-bottom: 8px; }
label { display: block; font-weight: 600; margin: 14px 0; }
input { display: block; width: 100%; padding: 12px; border: 1px solid #c8d2e2; border-radius: 9px; margin-top: 6px; font: inherit; background: white; }
button { border: 0; border-radius: 9px; background: #174ea6; color: white; font-weight: 700; padding: 11px 16px; cursor: pointer; font: inherit; }
button:hover { filter: brightness(.95); }
button.secondary { background: #e8eef8; color: #17325f; }
.hidden { display: none !important; }
.muted { color: #63718a; }
.small { font-size: .85rem; line-height: 1.5; }
.notice { background: #fff6d9; border: 1px solid #f0d37c; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; line-height: 1.6; }
.message { min-height: 1.2em; margin: 12px 0 0; color: #17623b; overflow-wrap: anywhere; }
.message.error { color: #b42318; }
.welcome, .notes-heading, .viewer-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.welcome h2 { margin-bottom: 5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notes-list { display: grid; gap: 10px; }
.note-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e0e7f1; border-radius: 12px; }
.note-card h3 { font-size: 1rem; margin-bottom: 5px; overflow-wrap: anywhere; }
.note-card p { margin-bottom: 0; }
.note-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button.danger { background: #b42318; color: #fff; }
button:disabled { opacity: .65; cursor: wait; }
.viewer-wrap { position: relative; overflow: hidden; border: 1px solid #dce4f0; border-radius: 10px; min-height: 280px; background: #f8fafc; isolation: isolate; }
#file-viewer { position: relative; z-index: 1; min-height: 280px; }
.pdf-page-wrap, .image-page-wrap { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 18px; overflow: hidden; background: white; box-shadow: 0 2px 12px rgba(16,42,86,.12); }
.pdf-page { display: block; max-width: 100%; height: auto; }
.note-image { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.page-watermark { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, 1fr); align-items: center; justify-items: center; overflow: hidden; }
.page-watermark span { color: rgba(22, 47, 88, .23); font-size: clamp(9px, 1.5vw, 14px); font-weight: 700; transform: rotate(-25deg); text-align: center; overflow-wrap: anywhere; max-width: 95%; }
footer { text-align: center; padding: 24px 12px; color: #63718a; font-size: .85rem; }
@media (max-width: 600px) {
  .topbar { padding: 18px 14px; }
  .topbar h1 { font-size: 1.05rem; }
  .panel { padding: 16px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .note-card { align-items: flex-start; }
  .note-card { flex-direction: column; }
  .note-actions { width: 100%; }
}

/* Topic/class folder navigation */
.folder-breadcrumb { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin: 8px 0 16px; }
.folder-crumb { background:#e8eef8; color:#17325f; padding:8px 11px; font-size:.9rem; }
.folder-crumb-current { font-weight:700; color:#17325f; overflow-wrap:anywhere; }
.crumb-separator { color:#8793a8; font-size:1.1rem; }
.folder-card { display:flex; align-items:center; gap:14px; width:100%; text-align:left; color:#172033; background:#fff; border:1px solid #dce4f0; padding:16px; border-radius:12px; }
.folder-card:hover { background:#f5f8fd; border-color:#9db5dc; }
.folder-icon { font-size:1.8rem; }
.folder-card-text { display:flex; flex:1; flex-direction:column; gap:5px; min-width:0; }
.folder-card-text strong { font-size:1rem; overflow-wrap:anywhere; }
.folder-card-text small { color:#63718a; font-weight:400; }
.folder-open-label { color:#174ea6; font-size:.85rem; margin-top:2px; }
.note-actions { display:flex; flex-wrap:wrap; gap:8px; }
button.danger { background:#b42318; color:white; }
@media (max-width:600px) { .folder-card { padding:13px; } .note-actions { flex-direction:column; } }
