:root {
  --paper: #FAF7F2;
  --surface: #F2EDE4;
  --ink: #261D16;
  --muted: #8B7B6C;
  --hairline: #E2D8C9;
  --accent: #5A3A26;
  --accent-soft: #E7DCCF;
  --flag: #9A5B1F;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181210;
    --surface: #221A15;
    --ink: #EFE6DA;
    --muted: #A6968A;
    --hairline: #3A2E25;
    --accent: #C79A72;
    --accent-soft: #3B2C20;
    --flag: #D89A55;
  }
}
* { box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  padding: 0 1.25rem 4rem;
}
.sheet { max-width: 68rem; margin: 0 auto; }

header.site { padding: 2rem 0 1.25rem; border-bottom: 1px solid var(--hairline); }
.eyebrow {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .5rem;
}
h1 {
  font-family: "Bodoni MT", Didot, "Didot LT STD", "Playfair Display", Georgia, serif;
  font-weight: 500; font-size: clamp(1.5rem, 4vw, 2.3rem);
  line-height: 1.15; margin: 0; text-wrap: balance;
}
.lede { max-width: 42rem; color: var(--muted); margin: .75rem 0 0; }
a { color: var(--accent); }

.flash {
  background: var(--accent-soft); border: 1px solid var(--hairline);
  color: var(--ink); padding: .75rem 1rem; margin-top: 1.25rem; font-size: .95rem;
}

.cols { display: grid; grid-template-columns: 19rem 1fr; gap: 2.5rem; padding-top: 2rem; }
@media (max-width: 46rem) { .cols { grid-template-columns: 1fr; } }
figure { margin: 0; }
.sticky { position: sticky; top: 1rem; }
figure img {
  width: 100%; max-width: 19rem; display: block;
  border: 1px solid var(--hairline); background: #fff;
}
figcaption { font-size: .78rem; color: var(--muted); margin-top: .5rem; }

.attr { padding: 1.1rem 0; border-bottom: 1px solid var(--hairline); }
.attr-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.attr-label {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); min-width: 8.5rem;
}
.attr-value {
  font-family: "Bodoni MT", Didot, "Didot LT STD", "Playfair Display", Georgia, serif;
  font-size: 1.3rem; line-height: 1.2;
}
.conf {
  display: inline-flex; align-items: center; gap: .45rem; margin-left: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.bar { width: 4.5rem; height: 3px; background: var(--accent-soft); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.low .bar i { background: var(--flag); }
.low .conf { color: var(--flag); }

.reading {
  border-left: 3px solid var(--accent);
  margin: 2rem 0 0; padding: .25rem 0 .25rem 1.25rem;
}
.reading h2 {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem; font-weight: 600;
}
.reading p {
  font-family: "Bodoni MT", Didot, "Didot LT STD", "Playfair Display", Georgia, serif;
  font-size: 1.05rem; line-height: 1.65; margin: 0 0 .6rem; max-width: 40rem;
}
.reading .note { font-family: system-ui, "Segoe UI", sans-serif; font-size: .8rem; color: var(--muted); }

.ans {
  display: block; width: 100%; max-width: 40rem; margin-top: .6rem;
  min-height: 3rem; padding: .6rem .75rem; resize: vertical;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 2px;
  font-family: system-ui, "Segoe UI", sans-serif; font-size: .95rem; line-height: 1.5;
}
.ans:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ans::placeholder { color: var(--muted); opacity: .8; }
.q { margin: .55rem 0 0; max-width: 40rem; font-size: .9rem; color: var(--muted); }

button, .btn {
  font-family: system-ui, "Segoe UI", sans-serif; font-size: .95rem; font-weight: 600;
  padding: .7rem 1.4rem; cursor: pointer; border-radius: 2px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--paper);
}
button.quiet { background: transparent; color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[disabled] { opacity: .6; cursor: wait; }

.panel {
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 1.25rem 1.5rem; margin-top: 2rem;
}
.panel h2 {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .6rem; font-weight: 600;
}

.upload-box {
  border: 1px dashed var(--accent); background: var(--surface);
  padding: 2rem 1.5rem; margin-top: 2rem; text-align: center;
}
.upload-box input[type="file"] { margin: 0 auto 1rem; display: block; }
#spinner { display: none; margin-top: 1rem; color: var(--muted); font-size: .9rem; }

table.schede { border-collapse: collapse; width: 100%; margin-top: 1.5rem; }
table.schede th, table.schede td {
  text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--hairline);
  font-size: .92rem;
}
table.schede th {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.tag-ok { color: var(--accent); font-weight: 600; }
.tag-todo { color: var(--flag); font-weight: 600; }

.login-card {
  max-width: 22rem; margin: 15vh auto 0; padding: 2rem;
  background: var(--surface); border: 1px solid var(--hairline);
}
.login-card input[type="password"] {
  width: 100%; padding: .65rem .75rem; margin: 1rem 0;
  border: 1px solid var(--hairline); border-radius: 2px;
  background: var(--paper); color: var(--ink); font-size: 1rem;
}
footer.site {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--hairline);
  font-size: .78rem; color: var(--muted);
}
