:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-hover: #f4f4f5;
  --bg-active: #ececef;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #70707b;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --danger: #b91c1c;
  --radius: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 14px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  font-size: 1rem; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

body.with-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px;
  display: flex; flex-direction: column;
  background: var(--bg-subtle); border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: block; font-weight: 700; font-size: 1rem; color: var(--text);
  padding: 0.35rem 0.6rem; margin-bottom: 1rem;
}
.brand:hover { text-decoration: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav > a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem; border-radius: var(--radius);
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
}
.sidebar nav > a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidebar nav > a.active { background: var(--bg-active); color: var(--text); }
.sidebar-footer {
  border-top: 1px solid var(--border); padding-top: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.user-chip {
  display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0;
  color: var(--text); font-weight: 500; padding: 0.25rem 0.4rem; border-radius: var(--radius);
}
.user-chip:hover { background: var(--bg-hover); text-decoration: none; }
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; }
.main.htmx-request { pointer-events: none; }
.page { max-width: 900px; margin: 0 auto; padding: 2.25rem 2.5rem 4rem; }
.page--wide { max-width: 1100px; }
.page--full { max-width: none; padding: 0; height: 100vh; display: flex; flex-direction: column; }

body.no-shell .page { max-width: 420px; padding-top: 12vh; }

@media (max-width: 800px) {
  body.with-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; min-height: 0; flex: 0 0 auto;
             position: sticky; top: 0; z-index: 40;
             flex-direction: row; align-items: center; gap: 0.25rem;
             padding: 0.35rem 0.5rem; }
  .sidebar nav > a, .nav-bell { min-height: 44px; }
  .sidebar-footer .user-chip { min-width: 44px; min-height: 44px; justify-content: center; }
  .sidebar-footer .inline-form button { min-width: 44px; min-height: 44px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; flex: 1;
                 scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav > a, .nav-bell { flex: 0 0 auto; padding: 0.35rem 0.5rem; }
  .nav-label { gap: 0.35rem; }
  .brand { margin-bottom: 0; padding: 0.35rem 0.4rem; font-size: 0.95rem; }
  .sidebar-footer { border-top: none; padding-top: 0; }
  .sidebar-footer .user-chip-name { display: none; }
  .page { padding: 1.25rem 1rem 3rem; }
}

h1 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 0.5rem;
     overflow-wrap: anywhere; }
h2 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
     color: var(--muted); margin: 2.25rem 0 0.6rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.25rem; }
p { margin: 0 0 0.75rem; }
small { font-size: 0.86em; color: var(--muted); }
.page-meta { color: var(--muted); margin-bottom: 0.5rem; }
.meta { color: var(--muted); font-size: 0.86em; }

.section-head { display: flex; justify-content: space-between; align-items: baseline;
                margin: 2.25rem 0 0.6rem; }
.section-head h1, .section-head h2 { margin: 0; }
.page-heading { margin-top: 0; }
.text-danger { color: var(--danger); }
.back-link { margin-bottom: 0.5rem; }
.tab-action { margin-top: 1rem; }

button, [role="button"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  font: inherit; font-size: 0.9rem; font-weight: 500;
  padding: 0.32rem 0.75rem; border-radius: var(--radius);
  border: 1px solid var(--text); background: var(--text); color: var(--bg);
  cursor: pointer; white-space: nowrap;
}
button:hover, [role="button"]:hover { opacity: 0.85; text-decoration: none; }
button.secondary, button.outline, [role="button"].secondary, [role="button"].outline {
  background: var(--bg); border-color: var(--border); color: var(--text); opacity: 1;
}
button.secondary:hover, button.outline:hover,
[role="button"].secondary:hover, [role="button"].outline:hover {
  border-color: var(--muted); opacity: 1;
}
button.contrast { background: var(--bg); border-color: var(--border); color: var(--danger); }
button.ghost { background: none; border: none; color: var(--muted); padding: 0.25rem 0.5rem; }
button.ghost:hover { color: var(--text); opacity: 1; }
.inline-form { display: inline; margin: 0; }
.inline-form button { font-size: 0.86rem; padding: 0.2rem 0.6rem; }

form { margin: 0; }
label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.2rem; }
input, select, textarea {
  font: inherit; width: 100%;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}
form p { margin-bottom: 0.9rem; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.field-errors { display: block; color: var(--danger); font-size: 0.86em; margin-top: 0.25rem; }
.form-errors { color: var(--danger); border-left: 3px solid var(--danger);
               padding: 0.25rem 0 0.25rem 0.75rem; margin-bottom: 1rem; }
.form-errors p { margin: 0; color: inherit; }
.flash { border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 0.75rem;
         color: var(--muted); margin-bottom: 1rem; }

.status-compose { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.status-compose input { flex: 1; }
.status-compose button { flex: 0 0 auto; }

.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
           padding: 0.3rem 0; }
.rows .meta { white-space: nowrap; }
.notification-unread a { font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
     color: var(--muted); font-weight: 600; padding: 0.4rem 0.5rem;
     border-bottom: 1px solid var(--border); }
td { padding: 0.45rem 0.5rem; }

/* Course list: compact rows with chips */
.course-row { display: flex; gap: 1rem; align-items: baseline; padding: 0.85rem 0;
              border-top: 1px solid var(--border); color: inherit; }
.course-row:hover { text-decoration: none; }
.course-row:hover strong { color: var(--accent); }
.course-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.course-row-main strong { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.005em;
                          display: -webkit-box; -webkit-line-clamp: 2;
                          -webkit-box-orient: vertical; overflow: hidden;
                          overflow-wrap: anywhere; }
.course-row-desc { color: var(--muted); font-size: 0.9rem; max-width: 40rem; }
.course-row-cta { flex: 0 0 auto; white-space: nowrap; font-size: 0.85rem; }
.course-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.chip { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border);
        border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap; }

/* Course page: underline tabs, file rows */
.course-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                overflow: hidden; }
.course-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; }
.tabs a { padding: 0.45rem 0.1rem; color: var(--muted); font-weight: 500; font-size: 0.95rem;
          border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .cnt { color: var(--muted); font-size: 0.8em; margin-left: 0.25rem; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.42rem 0.4rem;
            border-radius: 6px; color: inherit; font-size: 0.95rem; }
.file-row:hover { background: var(--bg-hover); text-decoration: none; }
.file-row:hover .file-body { color: var(--accent); }
.file-body { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; font-weight: 500; }
.fext { flex: 0 0 auto; width: 2.4rem; font-size: 0.68rem; font-weight: 600;
        letter-spacing: 0.04em; color: var(--muted); }

.badge { display: inline-block; min-width: 1.15rem; padding: 0 0.3rem; margin-left: 0.35rem;
         border-radius: 0.6rem; text-align: center;
         background: var(--accent); color: var(--accent-contrast);
         font-size: 0.7rem; font-weight: 600; line-height: 1.15rem; }
.avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; flex: 0 0 auto; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center;
                  background: var(--bg-active); color: var(--muted);
                  font-size: 1.25rem; letter-spacing: 0.01em;
                  font-weight: 600; user-select: none; line-height: 1; }
.avatar-sm.avatar-initial { font-size: 0.72rem; }

.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
                flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-id h1, .profile-id p { margin: 0; }
.profile-head [role="button"] { flex: 0 0 auto; }

.status-update { margin-bottom: 0.9rem; }
.status-update p { margin-bottom: 0.1rem; }

.chat-panes { display: flex; flex: 1; min-height: 0; }
.conv-list { width: 280px; flex: 0 0 280px; border-right: 1px solid var(--border);
             overflow-y: auto; padding: 1rem 0.75rem; }
.conv { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem;
        margin-bottom: 3px; border-radius: var(--radius); color: var(--text); }
.conv:hover { background: var(--bg-hover); text-decoration: none; }
.conv.active { background: var(--bg-active); }
.conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-name { font-weight: 500; display: flex; align-items: center; overflow-wrap: anywhere; }
.conv-last { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.conv-last small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
                   white-space: nowrap; }
.conv-last .meta { font-size: 0.75em; flex: 0 0 auto; white-space: nowrap; }
.conv-group-icon svg { width: 16px; height: 16px; }

.thread { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
          padding: 1rem 1.5rem; }
.thread-head { display: flex; align-items: center; gap: 0.6rem;
               padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.thread-head h1 { margin: 0; font-size: 1.05rem; }
.thread-empty { flex: 1; display: flex; align-items: center; justify-content: center;
                color: var(--muted); }
#chat-log { flex: 1; overflow-y: auto; padding: 1rem 0; display: flex; flex-direction: column; }
.chat-row { display: flex; align-items: flex-end; gap: 0.5rem; margin-bottom: 0.55rem;
            max-width: 70%; align-self: flex-start; }
.chat-row-own { align-self: flex-end; }
.chat-row .avatar { flex: 0 0 auto; margin-bottom: 0.1rem; }
.chat-msg { min-width: 0; background: var(--bg-hover); border-radius: 10px;
            padding: 0.35rem 0.7rem; }
.chat-msg-own { background: var(--text); color: var(--bg); }
.chat-msg .chat-head { display: block; font-size: 0.72em; color: var(--muted); }
.chat-msg .chat-head strong { color: inherit; }
.chat-msg .chat-text { display: inline; overflow-wrap: break-word; }
.chat-attachment-image { display: block; max-width: min(320px, 65vw); max-height: 320px;
                         margin-top: 0.4rem; border-radius: 7px; object-fit: contain; }
.chat-attachment-file { display: flex; align-items: center; gap: 0.45rem; max-width: 280px;
                        margin-top: 0.35rem; padding: 0.45rem 0.55rem; color: inherit;
                        border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
                        border-radius: 6px; }
.chat-attachment-file svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.chat-attachment-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { display: inline-block; font-size: 0.65rem; color: var(--muted);
             margin-left: 0.5rem; vertical-align: bottom; transform: translateY(0.1rem); }
.chat-msg-own .chat-time { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.chat-divider { align-self: center; font-size: 0.72rem; font-weight: 500;
                color: var(--muted); margin: 0.9rem 0 0.5rem; }
#chat-form { display: flex; gap: 0.5rem; align-items: center; padding-top: 0.6rem; }
#chat-form input { flex: 1; }
#chat-form button { background: none; border: none; color: var(--muted); padding: 0.3rem;
                    min-width: 44px; min-height: 44px; display: inline-flex;
                    align-items: center; justify-content: center; }
#chat-form button:hover { color: var(--accent); opacity: 1; }
#chat-form button svg { width: 1.2rem; height: 1.2rem; }
.chat-attach-button { display: inline-flex; align-items: center; justify-content: center;
                      min-width: 44px; min-height: 44px; color: var(--muted); cursor: pointer; }
.chat-attach-button:hover { color: var(--accent); }
.chat-attach-button svg { width: 1.2rem; height: 1.2rem; }
.chat-upload-state, .chat-upload-error { margin-top: 0.25rem; font-size: 0.78rem; }

.nav-label { display: inline-flex; align-items: center; gap: 0.55rem; }
.nav-label svg { width: 15px; height: 15px; flex: 0 0 auto; }
.nav-bell { width: 100%; background: none; border: none; color: var(--muted);
            font: inherit; font-size: 0.95rem; font-weight: 500;
            display: flex; align-items: center; justify-content: space-between;
            padding: 0.4rem 0.6rem; border-radius: var(--radius); cursor: pointer; }
.nav-bell:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }
.notif-anchor { position: relative; }
.notif-panel { position: absolute; left: calc(100% + 12px); top: 0; width: 380px;
               max-height: 330px; overflow-y: auto; background: var(--bg);
               border: 1px solid var(--border); border-radius: 8px;
               box-shadow: 0 8px 24px rgba(0,0,0,0.12);
               padding: 0.75rem 1rem; z-index: 50; }
@media (max-width: 800px) {
  .notif-panel { position: fixed; left: 1rem; right: 1rem; top: 4rem; width: auto; }
  .chat-panes { flex-direction: column; min-height: 0; }
  .conv-list { width: 100%; flex: 1 1 auto; border-right: none; }
  .chat-panes.in-room .conv-list { display: none; }
  .chat-panes.in-room .thread { padding: 0.75rem 1rem; }
  .thread-empty { display: none; }
  .page--full { height: calc(100vh - 56px); min-height: 0; }
  .chat-row { max-width: 85%; }
  #chat-log { flex: 1; height: auto; min-height: 0; }
  .thread { padding: 0.5rem 1rem 0.75rem; }
}
.notif-panel-head { font-weight: 600; margin-bottom: 0.5rem; }

.dash-title { margin-bottom: 1.25rem; }
.cal-nav { display: inline-flex; align-items: center; gap: 0.5rem; }
.cal-nav a { color: var(--muted); font-size: 0.9rem; padding: 0.5rem 0.6rem;
             margin: -0.5rem 0; display: inline-flex; align-items: center; }
.cal-nav a:hover { color: var(--text); text-decoration: none; }
.mini-cal { table-layout: fixed; margin-bottom: 1rem; }
.mini-cal th { text-align: center; padding: 0.2rem; border-bottom: none; }
.mini-cal td { text-align: center; padding: 0.15rem 0; border-bottom: none;
               font-size: 0.88rem; color: var(--muted); height: auto; }
.mini-cal td span, .mini-cal td a { display: inline-flex; align-items: center;
                justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; }
.mini-cal td.cal-today span, .mini-cal td.cal-today a {
  outline: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; }
.mini-cal td.cal-has a { background: var(--accent); color: var(--accent-contrast);
                         font-weight: 600; }
.mini-cal td.cal-has a:hover { text-decoration: none; opacity: 0.85; }

.photo-edit { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.photo-button { position: relative; background: none; border: none; padding: 0;
                border-radius: 50%; overflow: hidden; cursor: pointer; }
.photo-button img.avatar { display: block; }
.photo-button .photo-hint { position: absolute; inset: auto 0 0 0; padding: 0.15rem 0;
                            background: rgba(0,0,0,0.55); color: #fff; font-size: 0.65rem;
                            text-align: center; opacity: 0; transition: opacity 0.12s; }
.photo-button:hover .photo-hint { opacity: 1; }
.photo-button:hover { opacity: 1; }
.photo-edit .ghost svg { width: 1rem; height: 1rem; }
.photo-edit .ghost:hover { color: var(--danger); }

.cell-action { text-align: right; }
.feedback-col { max-width: 40rem; }
.feedback-item { padding: 0.7rem 0; }
.feedback-item + .feedback-item { border-top: 1px solid var(--border); }
.feedback-item p { margin: 0.15rem 0 0; }
.feedback-head { display: flex; align-items: baseline; gap: 0.6rem; }
.feedback-head a { color: var(--text); font-weight: 550; }
.feedback-head .meta { margin-left: auto; }
.rating { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.feedback-form { margin-bottom: 1.25rem; border: 1px solid var(--border);
                 border-radius: var(--radius); }
.feedback-form textarea { display: block; width: 100%; min-height: 3rem;
                          border: none; border-radius: var(--radius) var(--radius) 0 0;
                          resize: none; font-size: 0.92rem; }
.feedback-form textarea:focus { outline: none; }
.feedback-form:focus-within { border-color: var(--accent); }
.feedback-form-row { display: flex; align-items: center; gap: 0.5rem;
                     padding: 0.4rem 0.5rem; border-top: 1px solid var(--border); }
.feedback-form-row label { margin: 0 0 0 auto; font-weight: 400; }
.feedback-form-row select { width: auto; font-size: 0.85rem; padding: 0.2rem 0.4rem; }
.feedback-form-row button { font-size: 0.85rem; padding: 0.22rem 0.7rem; }
.feedback-form .field-errors { padding: 0 0.5rem 0.4rem; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 360px; }
.auth-brand { display: block; font-weight: 700; margin-bottom: 2.25rem; }
.auth-box h1 { font-size: 1.45rem; margin-bottom: 0.2rem; }
.auth-box .page-meta { margin-bottom: 1.75rem; }
.auth-box form p { margin-bottom: 1rem; }
.auth-cols { display: flex; gap: 0.75rem; }
.auth-cols p { flex: 1; }
.auth-submit { width: 100%; padding: 0.5rem; margin-top: 0.5rem; font-size: 0.95rem; }
.auth-alt { margin-top: 1.5rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* Course list filter: text box + teacher chips */
.course-filter { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
                 margin: 0.25rem 0 1.25rem; }
#course-search { max-width: 19rem; font-size: 0.9rem; padding: 0.32rem 0.6rem; }
.course-filter-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-btn { background: var(--bg); cursor: pointer; font: inherit; font-size: 0.72rem;
            color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
            padding: 0.05rem 0.5rem; min-height: 0; }
.chip-btn:hover { border-color: var(--muted); opacity: 1; }
.chip-btn.on { background: var(--bg-active); color: var(--text); border-color: var(--muted); }

/* People directory: avatar rows with role chips */
.people-search { flex: 0 1 19rem; }
.people-search input { font-size: 0.9rem; padding: 0.32rem 0.6rem; }
.people-list { list-style: none; padding: 0; margin: 0; }
.person-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.4rem;
              border-radius: 6px; color: inherit; }
.person-row:hover { background: var(--bg-hover); text-decoration: none; }
.person-row:hover strong { color: var(--accent); }
.person-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-body strong { font-size: 0.95rem; font-weight: 550;
                      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Assignments tab: date block + body + due, one row each */
.assign-list { list-style: none; padding: 0; margin: 0; }
.assign-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.3rem;
              border-radius: 6px; }
.assign-date { display: inline-flex; flex-direction: column; align-items: center;
               width: 2.4rem; flex: 0 0 auto; line-height: 1.1;
               border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0; }
.assign-date em { font-style: normal; font-weight: 650; font-size: 0.95rem; }
.assign-date small { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em;
                     color: var(--muted); }
.assign-past { opacity: 0.5; }
.assign-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.assign-body strong { font-size: 0.95rem; }
.assign-when { white-space: nowrap; }
.empty-state { margin: 0.2rem 0 0; padding: 0.25rem 0.3rem; }

/* Dashboard: main work column + right rail */
.dash-cols { display: flex; gap: 3.5rem; align-items: flex-start; }
.dash-main { flex: 1; min-width: 0; }
.dash-main h2:first-child { margin-top: 0; }
.dash-group { margin: 1.1rem 0 0.15rem; font-size: 0.72rem; text-transform: uppercase;
              letter-spacing: 0.06em; }
.dash-group:first-of-type { margin-top: 0.25rem; }
.dash-rail { width: 300px; flex: 0 0 300px; }
.rail-list { list-style: none; padding: 0; margin: 0; }
.rail-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.4rem;
            border-radius: 6px; color: inherit; }
.rail-row:hover { background: var(--bg-hover); text-decoration: none; }
.rail-row:hover strong { color: var(--accent); }
.rail-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rail-body strong { font-size: 0.92rem; font-weight: 550;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rail .mini-cal { margin-bottom: 0.5rem; }
.dash-rail .status-compose { margin-bottom: 0.9rem; }
.dash-rail .status-compose input { min-width: 0; }
@media (max-width: 900px) {
  .dash-cols { flex-direction: column; }
  .dash-rail { width: 100%; flex: 1 1 auto; }
}


/* Notification rows: message on top, quiet time beneath; links stay text-coloured */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { position: relative; display: flex; flex-direction: column; gap: 0.05rem;
                 padding: 0.42rem 0 0.42rem 0.9rem; }
.notif-list li::before { content: ''; position: absolute; left: 0; top: 0.95rem;
                         width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.notif-list li.notification-unread::before { background: var(--accent); }
.notif-list .notif-text { overflow-wrap: anywhere; }
.notif-list .notif-text a { color: var(--text); }
.notif-list .notif-text a:hover { color: var(--accent); text-decoration: none; }
.notif-list time { font-size: 0.75rem; }
