:root {
  color-scheme: light;
  --paper: #f3efe4;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #d9d3c5;
  --red: #9d2c2c;
  --green: #1d3c2c;
  --green-soft: #e7f0e4;
  --card: #fffcf7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  background: var(--green);
  color: #f4f7f2;
  padding: 8px 12px;
}
.skip:focus { top: 8px; }

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 0;
  font-size: 0.86rem;
}
.topbar a { text-decoration: none; }

.paper { width: min(1120px, calc(100% - 32px)); margin: 0 auto 48px; }
.mast { text-align: center; margin-bottom: 28px; }
.mast h1 {
  margin: 8px 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
}
.edition, .mast-rule {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mast-rule { border-bottom-width: 1px; justify-content: center; letter-spacing: 0.16em; }
.front { display: grid; grid-template-columns: 1.7fr 0.9fr; gap: 28px; padding-top: 22px; }
.lead, .secondary a { color: inherit; text-decoration: none; }
.lead h2, .secondary h2, .reading h1 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.lead h2, .secondary h2, .wire a, .story h2, .reading h1 { overflow-wrap: anywhere; }
.lead h2 { font-size: clamp(2.2rem, 4vw, 3.5rem); margin: 8px 0 12px; }
.lead p, .secondary p { color: var(--muted); }
.lead .who, .who { color: var(--muted); font-size: 0.92rem; }
.lead img { width: 100%; max-height: 420px; object-fit: cover; margin-bottom: 14px; border-radius: 2px; }
.kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.secondary { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.secondary a { padding: 16px 0; border-bottom: 1px solid var(--line); }
.secondary h2 { font-size: 1.55rem; margin: 0 0 8px; }
.wire { list-style: none; margin: 28px 0 0; padding: 0; border-top: 3px solid var(--ink); }
.wire li {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.wire span { font-variant-numeric: tabular-nums; color: var(--red); }
.wire a { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; }
.wire em { color: var(--muted); font-style: normal; font-size: 0.82rem; }
.rubriques { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.rubriques a, .tag, .cloud a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  text-decoration: none;
  font-size: 0.86rem;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 640px) 300px;
  gap: 28px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  align-items: start;
}
.shell.solo { grid-template-columns: 220px minmax(0, 760px); }
.nav, .rail { position: sticky; top: 0; }
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100dvh;
  padding: 22px 0 80px;
  border-right: 1px solid var(--line);
}
.nav a, .nav button {
  display: block;
  width: fit-content;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav a[aria-current="page"], .tabbar a[aria-current="page"] { background: var(--green); color: #f4f7f2; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding-left: 8px; font-weight: 700; }
.column { min-width: 0; padding: 22px 0 72px; }
.column-head h1, .reading h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1.05; }
.deck, .standfirst { color: var(--muted); font-size: 1.05rem; }
.stream .story { padding: 16px 0; border-bottom: 1px solid var(--line); }
.story h2 { margin: 4px 0 6px; font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.25; }
.story h2 a { text-decoration: none; }
.story .deck { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.who { display: flex; gap: 8px; margin-bottom: 4px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.more { display: inline-block; margin: 18px 0; color: var(--green); font-weight: 700; }
.rail { padding: 22px 0 80px; }
.rail h2 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.rail .search input { width: 100%; margin-top: 6px; }
.cloud, .picks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.picks { flex-direction: column; gap: 10px; }
.picks a { text-decoration: none; }
.cloud b { font-weight: 600; }

.reading .body { font-family: var(--serif); font-size: 1.16rem; line-height: 1.6; }
.reading .body h2, .reading .body h3 { font-size: 1.4rem; margin: 1.2em 0 0.4em; }
.reading .cover { width: 100%; max-height: 460px; object-fit: cover; margin: 8px 0 18px; }
.comments { margin-top: 28px; padding-top: 12px; border-top: 3px solid var(--ink); }
.comments h2 span, .muted { color: var(--muted); font-weight: 400; }
.thread { display: grid; gap: 14px; margin-top: 18px; }
.thread article, .moderation, .desk-block, .stack, .sheet, .own-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.thread article, .moderation { padding: 14px 16px; }
.stack, .sheet form, .desk-block, .own-list { padding: 16px; }
.stack, .sheet form, .desk-block form, .comments form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
.btn {
  width: fit-content;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #f4f7f2;
  text-decoration: none;
  cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.notice, .errors { padding: 10px 12px; border-radius: 10px; }
.notice { background: var(--green-soft); }
.errors { margin: 0 0 12px; background: #f8e8e4; }
.empty { padding: 28px 0; color: var(--muted); }

.own-list { margin-bottom: 14px; }
.own-list ul, .roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.own-list li, .roster li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.sheet { padding: 8px 8px 0; }
.sheet-title, .sheet-deck, .sheet-body { border: 0; background: transparent; }
.sheet-title { font-family: var(--serif); font-size: 2rem; line-height: 1.1; padding-inline: 0; }
.sheet-deck { min-height: 64px; padding-inline: 0; }
.sheet-body { min-height: 280px; padding: 8px 0 16px; outline: none; font-size: 1.05rem; line-height: 1.55; }
.sheet-body:empty::before { content: attr(data-placeholder); color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tools button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.chips button { border: 0; border-radius: 999px; background: var(--green-soft); color: var(--green); padding: 6px 10px; cursor: pointer; }
.sheet-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px -8px 0; padding: 16px; background: #f6f4ee; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.sheet-meta .actions { display: flex; gap: 8px; align-items: center; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; min-height: 0; }
.cover-preview { max-height: 160px; border-radius: 8px; }
.grow { gap: 0; }
.desk-block { margin: 0 0 16px; }
.desk-block h2 { font-family: var(--serif); }
.choices { display: grid; gap: 8px; }
.choices label { flex-direction: row; align-items: flex-start; gap: 10px; }
.choices input { width: auto; min-height: 0; margin-top: 4px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-form button { align-self: end; }
.hp { position: absolute; left: -9999px; }

.tabbar {
  display: none;
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: #fffcf7;
  border-top: 1px solid var(--line);
}
.tabbar a { padding: 8px 6px; border-radius: 999px; text-decoration: none; font-size: 0.78rem; }

@media (max-width: 800px) {
  .topbar { display: none; }
  .front, .wire li, .sheet-meta, .grid-form { grid-template-columns: 1fr; }
  .edition { flex-direction: column; align-items: center; text-align: center; }
  .shell, .shell.solo { display: block; width: min(680px, calc(100% - 28px)); padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .nav { display: none; }
  .rail { display: block; position: static; padding-top: 8px; }
  .tabbar { display: flex; }
  .wide main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .column { padding-bottom: 12px; }
}
