/* Simple, responsive, self-contained stylesheet (no build step required). */
:root {
  /* Light theme: calm, high-contrast colours that work on school laptops
     and phones alike. Text/muted meet WCAG AA on --surface and --bg. */
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #d9dfea;
  --text: #1c2433;
  --muted: #5b6474;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #e3ecff;
  --danger: #c62828;
  --ok: #1b7f4b;
  --warn: #9a5b00;
  --shadow: 0 6px 20px rgba(28, 36, 51, .12);
  --radius: 10px;
}

* { box-sizing: border-box; }

/* The [hidden] attribute must win over component display rules (e.g. flex),
   otherwise elements toggled via .hidden in JS stay visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header / nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(28, 36, 51, .06);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  flex-wrap: wrap;
}
.nav .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.nav .spacer { flex: 1; }
.nav a { color: var(--muted); font-size: .95rem; }
.nav a:hover { color: var(--text); }
/* Buttons in the nav keep their own colours (the .nav a rule above would
   otherwise turn their label grey). */
.nav a.btn, .nav a.btn:hover { color: #fff; }
.nav form { display: inline; }
.nav-profile { display: inline-flex; align-items: center; }
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}

/* Mentions */
.mention { color: var(--accent); font-weight: 600; }
.mention-dropdown {
  position: absolute;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.mention-option { padding: .4rem .6rem; cursor: pointer; font-size: .9rem; white-space: nowrap; }
.mention-option.active, .mention-option:hover { background: var(--surface-2); }
.mention-handle { color: var(--muted); font-size: .8rem; }

/* Reactions: toggle button + who-reacted hover popup */
.reaction-wrap { position: relative; display: inline-flex; }
.reaction-btn { font-size: 1.05rem; padding: .2rem .55rem; border-radius: .4rem; }
.reaction-btn.mine { background: var(--accent-soft); color: var(--accent-hover); }
.reaction-count { font-size: .78rem; }
.reactors-popup {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: .35rem;
  z-index: 50;
  min-width: 150px;
  max-width: 240px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .35rem 0;
}
.reaction-wrap:hover .reactors-popup { display: block; }
.reactors-head { padding: .2rem .6rem .35rem; font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.reactor { padding: .12rem .6rem; font-size: .82rem; white-space: nowrap; }

/* Top-bar message icon + notification counter + popup */
.nav-msg { position: relative; display: inline-flex; font-size: 1.1rem; }
.nav-profile-wrap { position: relative; display: inline-flex; }

/* Messages */
.convo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .15rem 1rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.convo-row:hover { background: var(--surface-2); }
.convo-name { font-weight: 600; }
.convo-preview { grid-column: 1; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-time { grid-column: 2; grid-row: 1; font-size: .78rem; }
.msg-thread { display: flex; flex-direction: column; gap: .4rem; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 75%; padding: .4rem .65rem; border-radius: var(--radius); }
.msg .msg-body { white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; }
/* Secondary text and links inside one's own (accent-coloured) bubble. */
.msg.mine .muted, .msg.mine a, .msg.mine .btn.link { color: rgba(255, 255, 255, .88); }
.msg.theirs { align-self: flex-start; background: var(--surface-2); }
.msg-time { font-size: .68rem; margin-top: .15rem; }
.msg-sender { font-size: .72rem; font-weight: 600; opacity: .85; margin-bottom: .1rem; }
.msg-edited { font-size: .62rem; font-style: italic; opacity: .8; margin-left: .3rem; }
.msg-reply-btn { font-size: .68rem; padding: 0; }
/* Cited (quoted) message shown inside a reply bubble */
.msg-quote {
  display: block;
  border-left: 3px solid currentColor;
  padding: .15rem .45rem;
  margin-bottom: .25rem;
  border-radius: 4px;
  background: rgba(127, 127, 127, .14);
  font-size: .78rem;
  text-decoration: none;
  color: inherit;
  opacity: .92;
}
.msg-quote-name { font-weight: 600; display: block; }
.msg-quote-text { display: block; opacity: .85; }
/* Composer citation preview */
.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: .3rem .5rem;
  margin-bottom: .4rem;
  font-size: .8rem;
}
.reply-preview-name { font-weight: 600; margin: 0 .3rem; }
/* Message attachments */
.msg-attachments { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0; }
.msg-att-img img { max-width: 200px; max-height: 200px; border-radius: 6px; display: block; }
.msg-att-file {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  padding: .4rem .6rem;
  background: rgba(127, 127, 127, .14);
  border-radius: 8px;
  font-size: .82rem;
  color: inherit;
}
.msg-att-icon { font-size: 1.4rem; line-height: 1; }
.msg-att-video { display: flex; flex-direction: column; gap: .2rem; max-width: 100%; }
.msg-att-video video { max-width: min(100%, 360px); max-height: 320px; border-radius: 8px; background: #000; }
.msg-att-meta { display: flex; flex-direction: column; min-width: 0; }
.msg-att-meta > a { font-weight: 600; overflow-wrap: anywhere; color: inherit; }
.revision { padding: .5rem 0; border-top: 1px solid var(--border); }
.revision:first-child { border-top: none; }
.revision.current .revision-body { font-weight: 500; }
.revision-meta { font-size: .75rem; margin-bottom: .25rem; }
.revision-body { white-space: pre-wrap; }
.role-badge { font-size: .8em; margin-left: .25rem; vertical-align: baseline; cursor: help; }
.group-manage > summary { list-style: none; cursor: pointer; display: inline-block; }
.group-manage > summary::-webkit-details-marker { display: none; }
.badge-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}
.notif-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: .4rem;
  width: 300px;
  max-width: 84vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
}
/* An invisible bridge over the gap between the avatar and the popup, so moving
   the cursor down to click an item doesn't cross dead space and close it. */
.notif-popup::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: .5rem;
}
.nav-profile-wrap:hover .notif-popup,
.nav-profile-wrap.open .notif-popup { display: block; }
.notif-popup-head { padding: .5rem .75rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.notif-item {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-time { font-size: .72rem; white-space: nowrap; }
.notif-empty { padding: .75rem; font-size: .85rem; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .5rem .9rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .95rem;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.link { background: none; color: var(--muted); padding: .25rem; }
.btn.whatsapp { background: #25d366; color: #0b3d20; }
.btn.whatsapp:hover { background: #1ebe5b; color: #0b3d20; }

/* Cards / grid */
main { padding: 1.5rem 0 3rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(28, 36, 51, .05);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  position: relative;
}
.tile img, .tile .thumb-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem;
}
.tile .caption { padding: .5rem .6rem; font-size: .85rem; color: var(--text); }
.tile .meta { color: var(--muted); font-size: .75rem; }

/* "That's not me" correction, overlaid on a matched-photo tile. */
.tile-cell { position: relative; }
.not-me-overlay { position: absolute; top: .4rem; right: .4rem; margin: 0; }
.not-me-overlay button {
  font-size: .72rem;
  padding: .2rem .5rem;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.not-me-overlay button:hover { background: rgba(0, 0, 0, .8); }

.badge {
  display: inline-block;
  font-size: .7rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.pending { color: var(--warn); border-color: #f0d49c; background: #fff8e8; }
.badge.ready { color: var(--ok); border-color: #b5dfc6; background: #edf8f1; }
.badge.failed { color: var(--danger); border-color: #f1c0c0; background: #fdeeee; }
.badge.video { position: absolute; top: .4rem; right: .4rem; background: rgba(0,0,0,.6); color:#fff; }

/* Forms */
form .field { margin-bottom: 1rem; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .25rem; }
input, textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .55rem .65rem;
  font-size: .95rem;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
.helptext { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: .25rem 0; font-size: .85rem; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .5rem;
  border: 1px solid var(--border); background: var(--surface);
}
.messages li.success { border-color: #b5dfc6; background: #edf8f1; color: #145c37; }
.messages li.error { border-color: #f1c0c0; background: #fdeeee; color: #8e1c1c; }
.messages li.warning { border-color: #f0d49c; background: #fff8e8; color: var(--warn); }
.messages li.info { border-color: #c7d7fb; background: var(--accent-soft); color: #1e3a8a; }

/* Breadcrumbs */
.breadcrumbs { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.toolbar form { display: flex; gap: .5rem; flex-wrap: wrap; }
.prose { max-width: 70ch; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* Media detail / lightbox */
.viewer {
  background: #000;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 75vh;
  overflow: hidden;
}
.viewer img, .viewer video { max-width: 100%; max-height: 75vh; display: block; }
.nav-arrows { display: flex; justify-content: space-between; margin-top: 1rem; }

/* Upload drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
#file-list { margin-top: 1rem; font-size: .9rem; color: var(--muted); }

/* Language switcher */
.lang-switch { display: inline; }
.lang-switch select {
  width: auto;
  padding: .3rem .5rem;
  font-size: .85rem;
}

/* Facebook-style composer */
.emoji-wrap { position: relative; display: inline-flex; }
.emoji-panel {
  display: none;          /* hidden until the button is hovered/opened */
  position: absolute;
  bottom: 100%;           /* float above the button as an overlay */
  left: 0;
  margin-bottom: .35rem;
  z-index: 40;
  flex-wrap: wrap;
  gap: .15rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem;
  width: 300px;
  max-width: 80vw;
  box-shadow: var(--shadow);
}
/* A small invisible bridge so moving the cursor from button to panel
   doesn't cross a gap that would drop the :hover state. */
.emoji-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: .35rem;
}
.emoji-wrap:hover .emoji-panel,
.emoji-wrap.open .emoji-panel { display: flex; }
.emoji-cell {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: .2rem .25rem;
  border-radius: .35rem;
}
.emoji-cell:hover { background: var(--border); }

.composer-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
}
.composer-previews:not(:empty) { margin-top: .5rem; }
.preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.preview-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #000;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: .25rem;
  right: .25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.preview-remove:hover { background: var(--danger); }
.preview-name {
  font-size: .7rem;
  color: var(--muted);
  padding: .25rem .35rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-card select { font-size: .8rem; padding: .25rem; margin: .25rem; width: calc(100% - .5rem); }

footer.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
  padding: 1.5rem 0;
}

/* Push permission banner + onboarding modal */
.push-banner {
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem .85rem; margin-bottom: 1rem;
}
.push-banner-actions { display: flex; gap: .5rem; align-items: center; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 1rem;
  background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
}
body.modal-open { overflow: hidden; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 560px; width: 100%;
  padding: 1.5rem; max-height: 90vh; overflow: auto;
  box-shadow: 0 12px 40px rgba(28, 36, 51, .25);
}
.intro-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .7rem; }
.intro-list li { line-height: 1.45; }

/* Class forum: class tag, author role, audience, moderation state */
.class-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .05rem .45rem;
  margin-right: .35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  vertical-align: middle;
}
.role-tag {
  display: inline-block;
  font-size: .7rem;
  padding: 0 .4rem;
  margin-left: .3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  vertical-align: middle;
}
.audience { font-size: .75rem; color: var(--muted); }
.hidden-banner {
  border: 1px dashed var(--danger);
  background: #fdeeee;
  color: #8e1c1c;
  border-radius: var(--radius);
  padding: .35rem .6rem;
  font-size: .85rem;
  margin: .4rem 0;
}
.audience-switches { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }
.audience-switches label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .85rem; }
.table td, .table th { padding: .45rem .4rem; border-top: 1px solid var(--border); vertical-align: top; }
.inline-form { display: inline; }
.stack > * + * { margin-top: .75rem; }
.nav-select { width: auto; padding: .3rem .5rem; font-size: .85rem; }
.info-banner {
  border: 1px solid #c7d7fb;
  background: var(--accent-soft);
  color: #1e3a8a;
  border-radius: var(--radius);
  padding: .5rem .75rem;
  font-size: .9rem;
  margin: .4rem 0;
}
.class-tag { background: var(--accent); }
.role-tag { background: var(--surface-2); }

/* Phones: brand + account icons on the first line, the section links in a
   horizontally scrollable strip below — no wrapping into three rows and
   nothing cut off at the right edge. */
@media (max-width: 640px) {
  .nav { gap: .5rem .9rem; padding: .5rem 1rem; }
  /* The language switch moves to the footer on phones. */
  .nav .lang-switch { display: none; }
  .nav .brand { order: 0; }
  .nav .spacer { order: 1; }
  .nav .lang-switch, .nav .nav-msg, .nav .nav-profile-wrap, .nav > form, .nav > a.btn,
  .nav > a[href*="login"] { order: 2; }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    display: flex;
    gap: .9rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: .25rem;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-profile-wrap { margin-right: .4rem; }
}
@media (min-width: 641px) {
  .nav-links { display: contents; }
}
.footer-lang { margin-top: .5rem; }
@media (min-width: 641px) { .footer-lang { display: none; } }

/* Public introduction page (/was_ist_klassenbuch): one reading column like a
   letter to parents, with the visibility table as the only wide element. */
.about {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(20px, 5vw, 48px);
  line-height: 1.6;
}
.about h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.about h2 { font-size: 1.35rem; margin: 2.2rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.about h3 { font-size: 1.05rem; margin: 1.4rem 0 0; }
.about p, .about ul, .about ol { margin: .6rem 0 0; max-width: 65ch; }
.about li + li { margin-top: .3rem; }
.about-eyebrow { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }
.about-lead { font-size: 1.1rem; color: var(--muted); }
.about-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 1.4rem; }
.about-facts > div { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.about-facts b { display: block; }
.about-facts span { color: var(--muted); font-size: .92rem; }
.about-roles { display: grid; gap: 8px; margin: 1rem 0 0; }
.about-roles > div { display: grid; grid-template-columns: 10rem 1fr; gap: 4px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.about-roles > div:last-child { border-bottom: 0; }
.about-roles dt { font-weight: 600; }
.about-roles dd { margin: 0; min-width: 0; }
@media (max-width: 560px) { .about-roles > div { grid-template-columns: 1fr; } }
.about-steps { counter-reset: s; list-style: none; padding-left: 0; }
.about-steps li { counter-increment: s; position: relative; padding-left: 2.3rem; }
.about-steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: .1rem;
  width: 1.65rem; height: 1.65rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .85rem;
}
.about-addr { font-weight: 600; white-space: nowrap; }
.about-table { overflow-x: auto; margin-top: 1rem; }
.about-table table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
.about-table th, .about-table td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.about-table thead th { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.about-table .c { text-align: center; width: 7.5rem; }
.about-table .yes { color: var(--ok); background: #edf8f1; font-weight: 600; border-radius: 6px; padding: .1rem .5rem; }
.about-table .no { color: var(--muted); }
.about-note { font-size: .9rem; color: var(--muted); }
.about-callout { margin-top: 1.1rem; background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; }
.about-callout p { margin: 0; }
.about-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem !important; }

/* Error pages (templates/404.html, 500.html, …) */
.error-page { max-width: 520px; margin: 2rem auto; text-align: center; }
.error-page .error-icon { font-size: 2.5rem; line-height: 1; }
.error-page h1 { margin-top: .5rem; }
.error-page .error-actions { margin-top: 1.25rem; }

/* Growing message fields (composer.js, data-autogrow): start small, grow with
   the text, scroll beyond 40 % of the screen height. */
textarea[data-autogrow] {
  resize: none;
  overflow-y: hidden;
  max-height: 40vh;
  transition: height .08s ease-out;
}

/* Reactions on chat messages (_message_reactions.html) */
.msg-reactions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .3rem; }
.msg-reaction {
  font: inherit; font-size: .85rem; line-height: 1.2; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .45rem;
  color: var(--text);
}
span.msg-reaction { cursor: default; }
.msg-reaction.mine { background: var(--accent-soft); border-color: var(--accent); }
.msg-react-add { position: relative; }
.msg-react-add > summary {
  list-style: none; cursor: pointer; font-size: .8rem; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 999px; padding: .1rem .45rem;
}
.msg-react-add > summary::-webkit-details-marker { display: none; }
.msg-react-picker {
  position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 20; display: flex; gap: .15rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .2rem .35rem; box-shadow: var(--shadow); white-space: nowrap;
}
.msg.mine .msg-react-picker { left: auto; right: 0; }
.msg-react-picker button { font-size: 1.25rem; background: none; border: 0; cursor: pointer; padding: .1rem .2rem; border-radius: .4rem; }
.msg-react-picker button:hover { background: var(--surface-2); }
.msg.mine .msg-reactions { justify-content: flex-end; }

/* Cookie notice (_cookie_notice.html) */
.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 720px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .8rem 1rem; font-size: .9rem;
}
.cookie-notice p { margin: 0; flex: 1 1 280px; }

/* Polls in group chats (_poll.html) */
.msg:has(.poll) { width: min(440px, 88%); max-width: 88%; }
.poll { width: 100%; margin: .2rem 0; }
.poll-question { overflow-wrap: anywhere; }
.poll-question { font-weight: 600; margin-bottom: .15rem; }
.poll-meta { font-size: .78rem; margin-bottom: .45rem; }
.poll-option-form { margin: 0 0 .35rem; }
.poll-option {
  position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; gap: .5rem;
  font: inherit; text-align: left; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .45rem .6rem;
}
.poll-option:disabled { cursor: default; }
.poll-option.mine { border-color: var(--accent); }
.poll-option > span:not(.poll-bar) { position: relative; z-index: 1; }
.poll-text { flex: 1; }
.poll-check { color: var(--accent); }
.poll-count { font-size: .85rem; color: var(--muted); }
.poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  background: var(--accent-soft); transition: width .2s ease-out;
}
.poll-voters { font-size: .75rem; margin: .1rem .2rem 0; }
.poll-foot { font-size: .78rem; }
