/* One small stylesheet. Phone first: large text, big touch targets. */
:root {
  color-scheme: light dark;
  --accent: #1a6fb5;
  --muted: #6b7280;
  --error: #b42318;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
main { max-width: 34rem; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input {
  width: 100%; font: inherit; padding: 0.7rem 0.8rem;
  border: 1px solid #9ca3af; border-radius: 0.6rem; margin-bottom: 0.9rem;
}
button {
  font: inherit; font-weight: 600; width: 100%; padding: 0.8rem;
  border: 0; border-radius: 0.6rem; background: var(--accent); color: white;
  margin-bottom: 0.6rem;
}
button.link {
  background: none; color: var(--accent); font-weight: 400; width: auto; padding: 0.3rem 0;
}
form.quiet { margin-top: 2rem; }
.hint { color: var(--muted); font-size: 0.93rem; }
.error { color: var(--error); font-weight: 600; }
.notice { background: #fef3c7; color: #78350f; padding: 0.6rem 0.8rem; border-radius: 0.6rem; }
.step { font-size: 1.15rem; font-weight: 600; }
.big { font-size: 1.3rem; font-weight: 600; }
.code {
  font: 700 2.4rem/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.08em; margin: 0.4rem 0 1rem;
}
#identities button { background: none; color: var(--accent); border: 1px solid var(--accent); }
img.qr {
  display: block; width: min(80vw, 22rem); height: auto;
  background: white; padding: 1rem; border-radius: 0.6rem; margin: 1rem 0;
}
ul.children { padding-left: 1.2rem; }
ul.children li { margin: 0.3rem 0; }
@media (prefers-color-scheme: dark) {
  :root { --accent: #6cb4ff; --muted: #9ca3af; --error: #ff8a80; }
  input { background: #1f2937; color: inherit; border-color: #4b5563; }
  button { color: #0b1220; }
  .notice { background: #3b2f0b; color: #fde68a; }
}

/* --- messages ----------------------------------------------------------- */
header.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
header.bar h1 { margin-bottom: 0.5rem; }
a { color: var(--accent); }
a.action { font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
nav.tabs { display: flex; gap: 1.2rem; margin-bottom: 0.6rem; border-bottom: 1px solid #d1d5db; }
nav.tabs a { padding: 0.4rem 0; text-decoration: none; color: var(--muted); }
nav.tabs a[aria-current] { color: inherit; font-weight: 600; border-bottom: 2px solid var(--accent); }
ul.threads { list-style: none; margin: 0; padding: 0; }
ul.threads li { border-bottom: 1px solid #e5e7eb; }
ul.threads a { display: block; padding: 0.7rem 0; color: inherit; text-decoration: none; }
ul.threads .row { display: flex; justify-content: space-between; gap: 0.6rem; }
ul.threads .sender { font-size: 0.93rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.threads .when { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
ul.threads .subject { margin-top: 0.1rem; }
ul.threads li.unread .subject { font-weight: 700; }
ul.threads .preview { font-size: 0.9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); margin-right: 0.4rem; vertical-align: 0.1rem; }
nav.pager { display: flex; justify-content: space-between; margin: 1rem 0; }
article.message { border-bottom: 1px solid #e5e7eb; padding: 0.8rem 0 1rem; }
article.message header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.8rem; margin-bottom: 0.5rem; }
article.message .sender { font-weight: 600; }
article.message .when { font-size: 0.85rem; color: var(--muted); }
article.message .body { overflow-wrap: anywhere; }
article.message .body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
article.message .body td, article.message .body th { border: 1px solid #d1d5db; padding: 0.2rem 0.4rem; }
ul.attachments { padding-left: 0; list-style: none; }
@media (prefers-color-scheme: dark) {
  nav.tabs, ul.threads li, article.message { border-color: #374151; }
}

/* --- tabs and ugeplan ------------------------------------------------------ */
nav.apptabs { display: flex; gap: 0.5rem; margin: 0 0 0.8rem; }
nav.apptabs a {
  flex: 1; text-align: center; padding: 0.5rem; border-radius: 0.6rem;
  text-decoration: none; color: var(--muted); background: rgba(127, 127, 127, 0.1);
}
nav.apptabs a[aria-current] { color: white; background: var(--accent); font-weight: 600; }
section.weekplan h2 { margin-top: 0.8rem; }
.weeknote { background: rgba(26, 111, 181, 0.08); border-radius: 0.6rem; padding: 0.6rem 0.9rem; margin: 0.6rem 0 1rem; }
.weeknote h3 { margin: 0.2rem 0 0.4rem; font-size: 1rem; }
h3.day { font-size: 1.05rem; margin: 1.3rem 0 0.3rem; padding-bottom: 0.2rem; border-bottom: 1px solid #e5e7eb; }
article.lesson { padding: 0.5rem 0 0.7rem 0.7rem; border-left: 3px solid var(--accent); margin: 0.6rem 0; }
article.lesson header { display: flex; justify-content: space-between; gap: 0.8rem; }
article.lesson .title { font-weight: 600; }
article.lesson .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
article.lesson h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin: 0.5rem 0 0.1rem; }
.note .body, .weeknote .body { overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) {
  nav.apptabs a[aria-current] { color: #0b1220; }
  h3.day { border-color: #374151; }
}
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin: 0.5rem 0; }
