/* Limewash Studio: the editing room. A quiet tool, not a dashboard.
   Interface words are set in a sans face; the writer's own words in the
   site's serif, so writing here feels like the page it will become. */

:root {
  --paper: #e9ebe4; --ink: #1e2b32; --accent: #5f7a52;
  --wash: #f4f5f1; --line: #d3d8cf; --soft: #5a686d; --warn: #9a4a2f;
  --ui: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", "Noto Sans", Roboto, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --bar: 3.5rem;
}
* { box-sizing: border-box; }
html { font: 15px/1.5 var(--ui); color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2 { font-weight: 500; margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.mark { width: 1.3rem; height: 1.3rem; flex: none; }
.mark path { stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; fill: none; }
.mark circle { fill: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.4rem; padding: 0 0.95rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #2c3d46; }
.btn:disabled { opacity: 0.45; cursor: default; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; color: var(--soft); cursor: pointer; }
.link:hover { color: var(--warn); }
.hint { display: block; color: var(--soft); font-size: 0.86rem; font-weight: 400; }

/* ── The door ─────────────────────────────────────────────────────────── */
.door main { min-height: 100dvh; display: grid; align-content: center; justify-items: start; gap: 1rem; max-width: 22rem; margin: 0 auto; padding: 2rem 1.5rem; }
.door .mark { width: 2.2rem; height: 2.2rem; }
.door h1 { font: 400 1.7rem/1.2 var(--serif); }
.door form { display: grid; gap: 0.6rem; width: 100%; }
.door input { min-height: 2.8rem; padding: 0 0.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); width: 100%; }
.door .error { color: var(--warn); margin: 0; }
.door .back { color: var(--soft); font-size: 0.9rem; }
.door code { background: var(--wash); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.9em; }
.door p { margin: 0; overflow-wrap: anywhere; }
.door .door-site { color: var(--soft); font-size: 0.95rem; margin-bottom: -0.6rem; }
.door .btn { justify-self: start; }
.door form .link { justify-self: start; min-height: 2.4rem; }
.as span, #again-as { font-weight: 500; overflow-wrap: anywhere; }
.door .sites { list-style: none; margin: 0; padding: 0; width: 100%; border-top: 1px solid var(--line); }
.door .sites li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.door .sites li > span { min-width: 0; overflow-wrap: anywhere; }

/* ── The bar ──────────────────────────────────────────────────────────── */
.bar { position: sticky; top: 0; z-index: 5; height: var(--bar); display: flex; align-items: center; gap: 0.6rem; padding: 0 0.9rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 500; margin-right: auto; }
.icon { width: 2.4rem; height: 2.4rem; border: 0; background: none; border-radius: 6px; cursor: pointer; display: none; place-items: center; margin-left: -0.4rem; }
.icon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.status { border: 0; background: none; color: var(--soft); font-size: 0.9rem; cursor: pointer; padding: 0.4rem 0.5rem; display: inline-flex; align-items: center; gap: 0.45rem; }
.fold { border: 0; background: none; color: var(--soft); font-size: 0.9rem; cursor: pointer; min-height: 2.4rem; padding: 0 0.6rem; border-radius: 6px; white-space: nowrap; }
.fold:hover { background: var(--wash); color: var(--ink); }
.status.waiting { color: var(--ink); }
.status.waiting::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
#publish[data-waiting]::after { content: attr(data-waiting); display: none; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 99px; background: var(--paper); color: var(--ink); font-size: 0.75rem; line-height: 1.25rem; text-align: center; }
.notice { padding: 0.6rem 1rem; background: #f3e3c8; border-bottom: 1px solid #e0c99d; font-size: 0.9rem; }

/* ── The shell: pieces on the left, work on the right ─────────────────── */
.shell { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); height: calc(100dvh - var(--bar)); }
.side { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.main { overflow-y: auto; }
#list { padding: 0.4rem 0 1rem; flex: 1; }
.group h2 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; font-weight: 500; color: var(--soft); padding: 1.1rem 1rem 0.35rem; }
.new { border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; padding: 0.3rem 0; font-size: 0.86rem; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li button { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; text-align: left; border: 0; background: none; padding: 0.5rem 1rem; cursor: pointer; border-left: 2px solid transparent; }
.group li button:hover { background: var(--wash); }
.group li button[aria-current] { background: var(--wash); border-left-color: var(--accent); }
.group li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group li em { font-size: 0.76rem; color: var(--soft); flex: none; }
.group li em.dot { font-size: 0; }
.group li em.dot::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent); }
.none { color: var(--soft); padding: 0.2rem 1rem; margin: 0; font-size: 0.9rem; }
.tools { border-top: 1px solid var(--line); padding: 0.6rem 0; display: grid; }
.tools button, .tools a { text-align: left; border: 0; background: none; padding: 0.5rem 1rem; cursor: pointer; text-decoration: none; border-left: 2px solid transparent; }
.tools button:hover, .tools a:hover { background: var(--wash); }
.tools [aria-current] { background: var(--wash); border-left-color: var(--accent); }
.tools a, .tools #leave { color: var(--soft); font-size: 0.9rem; }

.welcome { max-width: 30rem; padding: clamp(2rem, 12vh, 7rem) 2rem; }
.welcome h1 { font: 400 1.7rem/1.25 var(--serif); margin-bottom: 1rem; }
.welcome p { color: var(--soft); }

/* ── The editor ───────────────────────────────────────────────────────── */
.editor { height: 100%; display: flex; flex-direction: column; }
.editor-head { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.5rem; min-height: 3.2rem; color: var(--soft); font-size: 0.9rem; }
.editor-head .saved { margin-right: auto; }
.is-draft { font-size: 0.76rem; font-weight: 500; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 0.05rem 0.55rem; background: var(--wash); }
.saved.busy { font-style: italic; }
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.write { overflow-y: auto; padding: 0.5rem 1.5rem 4rem; }
.write > * { max-width: 40rem; }
.look { display: none; width: 100%; height: 100%; border: 0; border-left: 1px solid var(--line); background: var(--paper); }
.wide-only { display: none; }
.title { width: 100%; border: 0; background: none; font: 400 2rem/1.2 var(--serif); padding: 0.4rem 0; }
.title:focus { outline: none; }
.title::placeholder, .words::placeholder { color: #9aa5a3; }
.about { border-block: 1px solid var(--line); margin: 0.6rem 0 1rem; }
.about summary { cursor: pointer; padding: 0.7rem 0; color: var(--soft); font-size: 0.9rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.9rem 1rem; padding: 0.2rem 0 1.2rem; }
.fields .full { grid-column: 1 / -1; }
.fields label, .settings label, .label { display: grid; gap: 0.25rem; font-size: 0.9rem; font-weight: 500; }
.fields input:not([type="checkbox"]), .fields textarea, .settings input:not([type="checkbox"]):not([type="color"]):not([type="range"]), .settings textarea, .settings select, dialog input { width: 100%; min-height: 2.4rem; padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); font-weight: 400; }
.check { display: flex !important; align-items: center; gap: 0.55rem; font-weight: 400 !important; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.date-words { display: grid; gap: 0.25rem; font-size: 0.9rem; font-weight: 500; }
.date-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.date-row input { flex: 1 1 10rem; width: auto !important; }
.pick-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.25rem; }
.thumb { width: 4rem; height: 4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); display: grid; place-items: center; color: var(--soft); font-size: 0.78rem; font-weight: 400; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.45rem 0; background: var(--paper); }
.toolbar button { min-width: 2.4rem; min-height: 2.4rem; padding: 0 0.65rem; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; color: var(--soft); }
.toolbar button:hover { background: var(--wash); border-color: var(--line); color: var(--ink); }
.words { display: block; width: 100%; min-height: 55vh; border: 0; background: none; resize: vertical; font: 400 1.14rem/1.72 var(--serif); padding: 0.8rem 0 2rem; field-sizing: content; }
.words:focus { outline: none; }
.danger { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger button { border: 0; background: none; color: var(--soft); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; padding: 0.3rem 0; }
.danger button:hover { color: var(--warn); }

/* ── Pages inside the Studio: Shelf, Editions, Settings, Guide ────────── */
.page { max-width: 46rem; padding: 1.6rem 1.5rem 5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.page-head h1 { font: 400 1.7rem/1.2 var(--serif); }
.page h2 { font-size: 1rem; margin: 2.4rem 0 0.5rem; }
.lede { color: var(--soft); max-width: 36rem; margin: 0 0 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1rem; }
.tile { margin: 0; display: grid; gap: 0.4rem; align-content: start; }
.tile > button { border: 1px solid var(--line); border-radius: 6px; background: var(--wash); padding: 0; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.tile > button:hover { border-color: var(--ink); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile figcaption { display: grid; font-size: 0.8rem; gap: 0.1rem; justify-items: start; }
.tile figcaption span { overflow-wrap: anywhere; }
.tile small { color: var(--soft); }

.editions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.editions li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.editions div { display: grid; gap: 0.1rem; }
.editions em { font-style: normal; color: var(--accent); font-size: 0.86rem; font-weight: 500; }
.editions span { color: var(--soft); font-size: 0.86rem; }
.editions p { margin: 0.2rem 0 0; }

.settings { display: grid; gap: 1.8rem; }
.settings fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 1.1rem 0 0; display: grid; gap: 1rem; }
.settings legend { font-weight: 500; padding: 0 0.6rem 0 0; }
.range { display: flex; align-items: center; gap: 0.7rem; font-weight: 400; color: var(--soft); }
.range input { flex: 1; accent-color: var(--accent); }
.colours { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.colours input { width: 4rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); padding: 0.2rem; cursor: pointer; }
.kinds { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.kinds li { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; align-items: center; padding-bottom: 0.7rem; border-bottom: 1px dashed var(--line); }
.kinds select { grid-column: 1 / 2; }
.kinds .link { justify-self: start; }
#add-kind { justify-self: start; }

.guide p, .guide dd { max-width: 36rem; }
.guide dt { font-weight: 500; margin-top: 0.8rem; }
.guide dd { margin: 0; color: var(--soft); }

/* ── Dialogs and the toast ────────────────────────────────────────────── */
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 1.4rem; width: min(30rem, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(30, 43, 50, 0.25); }
dialog::backdrop { background: rgba(30, 43, 50, 0.35); }
dialog h2 { font: 400 1.4rem/1.2 var(--serif); margin-bottom: 0.9rem; }
dialog form { display: grid; gap: 0.7rem; }
dialog label { font-size: 0.9rem; font-weight: 500; }
dialog p { margin: 0; }
#again .error { color: var(--warn); }
.draft-notice { padding: 0.6rem 0.8rem; background: #f3e3c8; border: 1px solid #e0c99d; border-radius: 6px; }
dialog ul { list-style: none; margin: 0.5rem 0 0.4rem; padding: 0; max-height: 40vh; overflow-y: auto; border-top: 1px solid var(--line); }
dialog li { display: grid; grid-template-columns: 5rem 1fr; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
dialog li span { color: var(--soft); font-size: 0.86rem; }
#invite .error { color: var(--warn); }
#invite-done { display: grid; gap: 0.9rem; }
#invite-words { padding: 0.7rem 0.8rem; background: var(--wash); border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
#invite .row { flex-wrap: wrap; }

/* ── People (SPEC §15.6): one line each, said by what they can do ─────── */
.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 36rem; }
.people li { display: grid; gap: 0.5rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.people li > div { display: grid; gap: 0.1rem; min-width: 0; }
.people strong { font-weight: 500; overflow-wrap: anywhere; }
.people li > div span { color: var(--soft); font-size: 0.9rem; }
.people label { font-size: 0.9rem; font-weight: 500; }
.people input { width: 100%; min-height: 2.4rem; padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); }
.people .link { justify-self: start; min-height: 2.2rem; }

/* ── The site's address and the list (SPEC §15.6, card V109) ──────────── */
.site-address { display: grid; gap: 0.6rem; max-width: 36rem; margin: 0 0 1.8rem; padding: 1.1rem 0 0; border-top: 1px solid var(--line); }
.site-address h2, .sign-ups h2 { font-size: 1rem; font-weight: 500; margin: 0; }
.site-address p { margin: 0; }
.address-shown { font-weight: 500; overflow-wrap: anywhere; }
.site-address label { display: grid; gap: 0.2rem; font-size: 0.9rem; font-weight: 500; }
.address-row { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.address-row span { color: var(--soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.address-row input, .let-in input { flex: 1 1 8rem; min-width: 0; width: 100%; min-height: 2.4rem; padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); }
.site-address .btn, .let-in .btn { justify-self: start; }
.sign-ups h2 { margin: 1.2rem 0 0; }
/* Limewash's own page of sign-ups (card V115): the door's look, wider, from the top. */
.door.sign-ups main { max-width: 36rem; align-content: start; justify-items: stretch; }
.door.sign-ups .people li { grid-template-columns: minmax(0, 1fr); }
.door.sign-ups .people .row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: flex-start; margin: 0; }
.door.sign-ups .let-in, .door.sign-ups .let-in-done { margin: 0; }
.door .to-sign-ups .hint { display: block; }
/* A site of one's own, new: one line saying what it is, put away with Got it. */
.notice.started { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.notice.started[hidden] { display: none; }
.notice.started p { margin: 0; flex: 1 1 16rem; overflow-wrap: anywhere; }
.let-in { display: grid; gap: 0.5rem; max-width: 36rem; margin: 1.2rem 0 0; }
.let-in label { font-size: 0.9rem; font-weight: 500; }
.said { max-width: 36rem; margin: 1rem 0 0; padding: 0.7rem 0.8rem; background: var(--wash); border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.people .none { color: var(--soft); }
.let-in-done { display: grid; gap: 0.6rem; max-width: 36rem; margin: 1rem 0 0; justify-items: start; }
.let-in-done p { margin: 0; overflow-wrap: anywhere; }
.let-in-done .said { margin: 0; justify-self: stretch; }
#invite-note { overflow-wrap: anywhere; }

/* Removed from the site, or left it elsewhere: the Studio says so in place of everything else. */
body.is-gone > :not(#gone):not(dialog) { display: none !important; }
.gone { min-height: 100dvh; display: grid; align-content: center; gap: 1rem; max-width: 22rem; margin: 0 auto; padding: 2rem 1.5rem; }
.gone p { margin: 0; overflow-wrap: anywhere; }
/* An invitation waits for the person's answer (card V113): Join, or Not now. */
.invitations { display: grid; gap: 0.8rem; width: 100%; }
.invitations[hidden], .invitation[hidden] { display: none; }
.invitation { display: grid; gap: 0.5rem; padding: 0.8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.invitation .row { margin-top: 0; flex-wrap: wrap; }
/* Words kept in this tab for another site or person (card V112): plain text to copy away, never saved here. */
.not-saved { display: grid; gap: 0.8rem; width: 100%; min-width: 0; }
.not-saved[hidden] { display: none; }
.not-saved h2 { font: 400 1.3rem/1.2 var(--serif); margin: 0; }
dialog.not-saved { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
dialog.not-saved[open] { display: grid; }
.kept-list { display: grid; gap: 1rem; min-width: 0; }
.kept-copy { display: grid; gap: 0.5rem; min-width: 0; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.kept-copy p { margin: 0; overflow-wrap: anywhere; }
.kept-copy .row { margin-top: 0; flex-wrap: wrap; }
.kept-words { width: 100%; min-width: 0; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); font: 1rem/1.5 var(--serif); resize: vertical; }
.kept-sure { display: grid; gap: 0.4rem; }
.kept-sure[hidden] { display: none; }
/* The publish dialog: each line opens to show the change itself (record 0041).
   The list scrolls inside the dialog, so the note and the buttons stay in reach. */
#publish-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
#publish-dialog[open] { display: flex; flex-direction: column; }
#publish-dialog form { display: flex; flex-direction: column; gap: 0.7rem; flex: 1 1 auto; min-height: 0; }
#publish-dialog form > * { flex: none; }
#publish-dialog #publish-changes { flex: 0 1 auto; min-height: 4rem; overflow-y: auto; overscroll-behavior: contain; }
/* A quiet edge at the top and the bottom of the list, only where there is
   more to scroll (P71). Two soft shades stick to the list's top and bottom,
   over what scrolls under them; the opening sentence and a strip of paper
   after the last line move with the list and cover a shade once its end is
   reached. Nothing moves of its own accord, so reduced motion asks nothing
   more here. Colours come from the tokens, so the edge follows the paper and
   ink, light or dark. */
#publish-changes { --edge: 0.75rem; --shade: color-mix(in srgb, var(--ink) 20%, transparent); }
#publish-changes::before, #publish-changes::after { content: ""; display: block; position: sticky; z-index: 2; height: var(--edge); pointer-events: none; }
#publish-changes::before { top: 0; margin-bottom: calc(-1 * var(--edge)); background: radial-gradient(farthest-side at 50% 0, var(--shade), transparent); }
#publish-changes::after { bottom: 0; margin-top: calc(-1 * var(--edge)); background: radial-gradient(farthest-side at 50% 100%, var(--shade), transparent); }
#publish-changes > p:first-of-type::before, #publish-changes ul::after { content: ""; display: block; height: var(--edge); position: relative; z-index: 3; background: var(--paper); }
#publish-dialog #publish-changes { margin-top: calc(-1 * var(--edge)); } /* the top strip sits in the space under the heading: the words do not move */
#publish-changes ul { margin-bottom: 0; } /* so the bottom shade's margin meets the strip of paper, not the list's margin */
/* The open line's heading stays in view while its change scrolls under it. */
#publish-changes .change-line[aria-expanded="true"] { position: sticky; top: 0; z-index: 3; background: var(--paper); box-shadow: 0 1px 0 var(--line), 0 7px 7px -7px var(--shade); }
#publish-changes .change-line[aria-expanded="true"]:hover { background: var(--wash); }
#publish-changes ul { max-height: none; overflow: visible; }
#publish-changes li { display: block; padding: 0; }
.change-line { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 1rem; gap: 0.5rem; align-items: center; width: 100%; min-height: 2.4rem; padding: 0.45rem 0; border: 0; background: none; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.change-line:hover { color: #2c3d46; background: var(--wash); }
.change-line:focus-visible { outline-offset: -2px; }
.change-line::after { content: ""; justify-self: center; width: 0.45rem; height: 0.45rem; border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft); transform: translateY(-0.15rem) rotate(45deg); }
.change-line[aria-expanded="true"]::after { transform: translateY(0.1rem) rotate(-135deg); }
.change-body { display: grid; gap: 0.6rem; padding: 0.2rem 0 1rem; }
.change-body p { overflow-wrap: anywhere; }
.looking, .cannot { color: var(--soft); }
.detail strong { font-weight: 500; }
.detail, .detail strong { white-space: pre-line; }
.swatch { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.3em; border: 1px solid rgba(30, 43, 50, 0.35); border-radius: 2px; vertical-align: -0.1em; }
.change-title { font: 400 1.15rem/1.3 var(--serif); }
.opening { font: 1rem/1.55 var(--serif); }
.change-picture { display: block; max-width: 100%; max-height: 14rem; border: 1px solid var(--line); border-radius: 4px; background: var(--wash); }
.change-words { display: grid; gap: 0.55rem; font: 1rem/1.55 var(--serif); }
.folded { display: grid; gap: 0.55rem; }
.para p { white-space: pre-wrap; overflow-wrap: anywhere; }
.para.kept { color: var(--soft); }
.para.out, .para.in { padding: 0.4rem 0.65rem 0.5rem; border-left: 3px solid; border-radius: 0 6px 6px 0; }
.para.out { border-color: var(--warn); background: #f3e7e0; }
.para.in { border-color: var(--accent); background: #e2eadb; }
.para .said { display: block; margin-bottom: 0.15rem; font: 500 0.8rem/1.3 var(--ui); color: var(--ink); }
.para del { background: #ecccbd; text-decoration: line-through; text-decoration-color: var(--warn); }
.para ins { background: #c8dab8; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; text-decoration-color: var(--accent); }
.unfold { justify-self: start; min-height: 2.4rem; padding: 0 0.85rem; border: 1px dashed var(--line); border-radius: 6px; background: none; color: var(--soft); font: 0.9rem var(--ui); cursor: pointer; }
.unfold:hover { border-color: var(--soft); color: var(--ink); }
.row { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.6rem; }
.row.swap { flex-direction: row-reverse; justify-content: flex-start; }
#picker { width: min(46rem, calc(100vw - 2rem)); max-height: 86dvh; }
.picker-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.picker-head h2 { margin: 0 auto 0 0; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 1rem); max-width: calc(100vw - 2rem); background: var(--ink); color: var(--paper); padding: 0.7rem 1.1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--warn); }

/* ── Wider than a phone: the list can be folded away ──────────────────── */
@media (min-width: 52.0625rem) {
  .brand { margin-right: 0; }
  .fold { margin-right: auto; }
  body.list-folded .shell { grid-template-columns: minmax(0, 1fr); }
  body.list-folded .side { display: none; }
}

/* ── Wide screens: the preview sits beside the words ──────────────────── */
/* The divider is laid over the preview's left edge, so it takes no width and
   never covers the words' scrollbar. --words is the share the words take. */
#divider { display: none; }
@media (min-width: 76rem) {
  .split { position: relative; grid-template-columns: minmax(0, var(--words, 50%)) minmax(0, 1fr); }
  .split.no-look { grid-template-columns: minmax(0, 1fr); }
  .look { display: block; }
  .split.no-look .look { display: none; }
  .wide-only { display: inline-flex; }
  #divider { display: block; position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--words, 50%); width: 2.4rem; cursor: col-resize; touch-action: none; }
  .split.no-look #divider { display: none; }
  #divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 3px; background: transparent; }
  #divider::after { content: ""; position: absolute; top: 50%; left: -3px; width: 7px; height: 2.4rem; margin-top: -1.2rem; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); }
  #divider:hover::before, #divider:focus-visible::before, .split.dragging #divider::before { background: var(--accent); }
  #divider:hover::after, #divider:focus-visible::after, .split.dragging #divider::after { border-color: var(--accent); background: var(--accent); }
  #divider:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  /* While the line is dragged the preview must not take the pointer, and nothing moves on its own. */
  .split.dragging .look { pointer-events: none; }
  .split.dragging, .split.dragging * { transition: none !important; user-select: none; }
}

/* ── Phones: one pane at a time ───────────────────────────────────────── */
@media (max-width: 52rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  body[data-pane="side"] .main { display: none; }
  body[data-pane="main"] .side { display: none; }
  body[data-pane="main"] .icon { display: grid; }
  body[data-pane="main"] .brand span { display: none; }
  .side { border-right: 0; }
  .status, .fold { display: none; }
  /* Someone who can write has no Publish button to carry the count, so the status stays: it opens the list of changes (card V109). */
  body[data-may="write"] .status { display: inline-flex; margin-left: auto; min-height: 2.4rem; font-size: 0.85rem; text-align: right; }
  #publish[data-waiting]::after { display: inline-block; }
  .group li button { padding-block: 0.75rem; }
  .tools button, .tools a { padding-block: 0.7rem; }
  .write, .editor-head { padding-inline: 1.1rem; }
  .page { padding-inline: 1.1rem; }
  .title { font-size: 1.6rem; }
  .words { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
