
:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --ink: #1c211f;
  --muted: #6b7671;
  --line: #e2e6e3;
  --accent: #3a4a44;
  --accent-soft: #eaf0ed;
  --warn: #9a4b2f;
  --ok: #2f6b4f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { width: min(860px, 100% - 2.5rem); margin-inline: auto; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: .9rem 0;
  margin-bottom: 2rem;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.topbar nav { display: flex; gap: 1.25rem; font-size: .92rem; }
.topbar nav a { color: var(--accent); text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin: 0 0 .35rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0; }
.lead { color: var(--muted); margin: 0 0 1.6rem; }
.crumb { font-size: .88rem; color: var(--muted); margin: 0 0 1rem; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb span { margin: 0 .4rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }

.pages { list-style: none; padding: 0; margin: 0; }
.pages li { margin-bottom: .6rem; }
.pages a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .95rem 1.2rem; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.pages a:hover { border-color: var(--accent); transform: translateY(-1px); }
.pages a.disabled { opacity: .5; pointer-events: none; }
.pages .name { font-weight: 500; }
.pages .meta { font-size: .85rem; color: var(--muted); }
.warn { color: var(--warn); font-style: normal; }

.zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.tag { font-size: .75rem; color: var(--muted); background: var(--accent-soft); padding: .15rem .5rem; border-radius: 999px; }
.zone.changed { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.toolbar { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .5rem; }
.toolbar button {
  font: inherit; font-size: .82rem; line-height: 1;
  padding: .4rem .6rem; min-width: 2rem;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.toolbar button:hover { border-color: var(--accent); background: var(--accent-soft); }
.toolbar .hint { font-size: .8rem; color: var(--warn); margin-left: .5rem; }

.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .8rem .9rem;
  min-height: 2.8rem;
  background: #fdfdfc;
  outline: none;
}
.editor:focus { border-color: var(--accent); background: #fff; }
.editor p { margin: 0 0 .7rem; }
.editor p:last-child { margin-bottom: 0; }
.editor h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.editor a { color: var(--accent); }

.link-panel { display: flex; gap: .4rem; margin-bottom: .5rem; }
.link-panel input { flex: 1; font: inherit; font-size: .9rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 6px; }
.link-panel button { font: inherit; font-size: .85rem; padding: .4rem .7rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.link-panel .ok { background: var(--accent); color: #fff; border-color: var(--accent); }

label { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
input[type="password"], input[type="url"], input[type="text"] {
  display: block; width: 100%; margin-top: .35rem;
  font: inherit; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fdfdfc;
}
input:focus { outline: none; border-color: var(--accent); background: #fff; }

button[type="submit"] {
  font: inherit; font-weight: 500;
  padding: .6rem 1.3rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
}
button[type="submit"]:hover { filter: brightness(1.15); }
button[type="submit"]:disabled { opacity: .45; cursor: not-allowed; }

.actions { display: flex; align-items: center; gap: 1.2rem; margin: 1.5rem 0 3rem; }
.quiet { color: var(--muted); text-decoration: none; font-size: .9rem; }
.quiet:hover { text-decoration: underline; }
button.link { background: none; border: none; color: var(--accent); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; text-decoration: underline; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: .92rem; }
.flash.error { background: #fbeeea; color: var(--warn); }
.flash.success { background: #e9f3ed; color: var(--ok); }

.history summary { cursor: pointer; font-size: .92rem; color: var(--muted); }
.history ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.history form { margin: 0; }

.foot { color: #66716c; font-size: .82rem; padding: 2rem 0 3rem; }

@media (max-width: 540px) {
  .pages a { flex-direction: column; gap: .25rem; }
  .zone-head { flex-direction: column; align-items: flex-start; gap: .3rem; }
}

.demo-note {
  background: #1c211f; color: #fff;
  border-radius: var(--radius);
  padding: .9rem 1.15rem; margin-bottom: 1.4rem;
  font-size: .9rem; line-height: 1.5;
}
.demo-note strong { font-weight: 600; }
.demo-note a { color: #fff; text-decoration: underline; margin-left: .4rem; white-space: nowrap; }

.groupe {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 600;
  margin: 2.4rem 0 .9rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.groupe:first-of-type { margin-top: .4rem; }
