/* Change Logs (changelog.php), in the default design system (DESIGN.md).
   Releases newest first: "3.3.0 MAJOR 5 Dec 2026 Saturday", the notes, then any hotfixes.
   Admins also get the draft editor and release step at the top. */
.cl-page {
  --cl-primary: oklch(0.46 0.19 270);
  --cl-primary-deep: oklch(0.36 0.17 270);
  --cl-accent: oklch(0.80 0.14 75);
  --cl-ink: oklch(0.18 0.01 270);
  --cl-body: oklch(0.40 0.015 270);
  --cl-muted: oklch(0.52 0.015 270);
  --cl-surface: oklch(0.96 0.006 270);
  --cl-border: oklch(0.88 0.008 270);
  --cl-bg: oklch(1.0 0 0);
  --cl-danger: oklch(0.55 0.21 25);
  --cl-danger-text: oklch(0.4 0.2 25);
  --cl-success-text: oklch(0.32 0.13 145);

  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cl-ink);
  box-sizing: border-box;
}
.cl-page *, .cl-page *::before, .cl-page *::after { box-sizing: border-box; }
.cl-page [hidden] { display: none !important; }

/* Header: title, search on the right */
.cl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.cl-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--cl-ink);
}
.cl-search { position: relative; width: 220px; flex: none; }
.cl-search svg {
  position: absolute; left: 9px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%);
  fill: none; stroke: var(--cl-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.cl-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--cl-ink);
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 150ms ease-out;
}
.cl-search input:focus { border-color: var(--cl-primary); }
.cl-search input::placeholder { color: var(--cl-muted); }

/* ---- A release ---- */

.cl-rel { padding: 16px 0 12px; border-top: 1px solid var(--cl-border); }

.cl-rel-head, .cl-fix-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.cl-rel-version {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--cl-ink);
}
.cl-date { font-size: 0.8125rem; font-weight: 500; color: var(--cl-ink); }
.cl-date-weekday { margin-left: 6px; font-weight: 400; color: var(--cl-muted); }

/* MAJOR / MINOR / HOTFIX */
.cl-badge {
  align-self: center;
  padding: 1px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cl-badge-year, .cl-badge-major { background: var(--cl-accent); color: var(--cl-ink); }
.cl-badge-minor { background: var(--cl-surface); color: var(--cl-body); border-color: var(--cl-border); }
.cl-badge-hotfix { background: oklch(0.55 0.21 25 / 0.1); color: var(--cl-danger-text); }

/* The notes as written: # ## ### headings, - bullets */
.cl-notes { margin-top: 6px; max-width: 70ch; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-notes > :first-child { margin-top: 0; }
.cl-notes > :last-child { margin-bottom: 0; }
.cl-notes h3 { margin: 14px 0 4px; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.cl-notes h4 { margin: 12px 0 2px; font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.cl-notes h5 { margin: 10px 0 2px; font-size: 0.8125rem; font-weight: 600; line-height: 1.4; color: var(--cl-body); }
.cl-notes p { margin: 4px 0; }
.cl-notes ul, .cl-notes ol { margin: 4px 0; padding-left: 18px; }
.cl-notes ul ul, .cl-notes ol ol, .cl-notes ul ol, .cl-notes ol ul { margin: 2px 0; }
.cl-notes li { margin: 2px 0; padding-left: 2px; }
.cl-notes li::marker { color: var(--cl-muted); }
.cl-notes strong { font-weight: 600; }

/* A hotfix, attached under its release */
.cl-fix {
  margin-top: 12px;
  padding: 10px 0 0 12px;
  border-top: 1px dashed var(--cl-border);
}

/* ---- Admins ---- */

.cl-draft {
  margin: 0 0 20px;
  padding: 12px;
  background: var(--cl-surface);
  border: 1px solid var(--cl-border);
  border-radius: 10px;
}
.cl-draft-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 8px; }
.cl-draft-title { margin: 0; white-space: nowrap; font-size: 0.8125rem; font-weight: 600; line-height: 1.3; color: var(--cl-ink); }
.cl-draft-state { font-size: 0.75rem; color: var(--cl-muted); }
.cl-draft-text { min-height: 140px; }
.cl-hint { margin: 6px 0 0; font-size: 0.75rem; color: var(--cl-body); }
.cl-hint code {
  padding: 0 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--cl-ink);
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 6px;
}

.cl-draft-ft, .cl-release-ft, .cl-edit-ft { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cl-draft-ft { margin-top: 10px; }
.cl-msg { flex: 1; min-width: 100px; font-size: 0.75rem; color: var(--cl-danger-text); }
.cl-msg.is-ok { color: var(--cl-success-text); }

/* Release step: type, version, note, buttons */
.cl-release {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cl-border);
}
.cl-release-note { flex-basis: 100%; font-size: 0.75rem; color: var(--cl-body); }
.cl-release-note:empty { display: none; }
.cl-release-ft { flex-basis: 100%; }

.cl-version-field { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 600; color: var(--cl-body); }
.cl-input.cl-version { width: 96px; font-variant-numeric: tabular-nums; }

.cl-input {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cl-ink);
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 6px;
  resize: none;
  outline: none;
  transition: border-color 150ms ease-out;
}
textarea.cl-input { overflow: hidden; }
.cl-input:focus { border-color: var(--cl-primary); }
.cl-input::placeholder { color: var(--cl-muted); }

/* Segmented control */
.cl-seg {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 6px;
  overflow: hidden;
}
.cl-seg label { position: relative; display: flex; cursor: pointer; }
.cl-seg label + label { border-left: 1px solid var(--cl-border); }
.cl-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cl-seg span {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cl-body);
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.cl-seg label:hover span { color: var(--cl-ink); background: var(--cl-surface); }
.cl-seg input:checked + span { color: #fff; background: var(--cl-primary); }
.cl-seg input:focus-visible + span { outline: 2px solid var(--cl-primary); outline-offset: -4px; }
.cl-seg input:checked:focus-visible + span { outline-color: #fff; }

.cl-btn {
  height: 32px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cl-ink);
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.cl-btn:hover { background: var(--cl-surface); }
.cl-btn-primary { color: #fff; background: var(--cl-primary); border-color: var(--cl-primary); }
.cl-btn-primary:hover { background: var(--cl-primary-deep); border-color: var(--cl-primary-deep); }
.cl-btn-danger { color: var(--cl-danger-text); }
.cl-btn-danger:hover { background: oklch(0.55 0.21 25 / 0.08); border-color: var(--cl-danger); }
.cl-btn:disabled { opacity: 0.6; cursor: default; }
.cl-btn:focus-visible, .cl-edit-btn:focus-visible { outline: 2px solid var(--cl-primary); outline-offset: 2px; }

/* Edit: quiet until the release is hovered or focused (always shown on touch) */
.cl-edit-btn {
  margin-left: auto;
  padding: 0 4px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cl-muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease-out, color 150ms ease-out;
}
.cl-rel-main:hover .cl-edit-btn, .cl-fix:hover .cl-edit-btn, .cl-edit-btn:focus-visible { opacity: 1; }
.cl-edit-btn:hover { color: var(--cl-primary); }
@media (hover: none) { .cl-edit-btn { opacity: 1; } }

.cl-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cl-edit .cl-version-field { align-self: flex-start; }

.cl-status { margin: 20px 0 0; text-align: center; font-size: 0.8125rem; color: var(--cl-body); }
.cl-status:empty { display: none; }
#cl-sentinel { height: 1px; }

@media (max-width: 600px) {
  .cl-page { padding: 20px 16px 48px; }
  .cl-head { flex-wrap: wrap; gap: 12px; }
  .cl-search { width: 100%; }
  .cl-draft-ft .cl-msg, .cl-release-ft .cl-msg, .cl-edit-ft .cl-msg { order: 3; flex-basis: 100%; }
  .cl-draft-ft .cl-msg:empty, .cl-release-ft .cl-msg:empty, .cl-edit-ft .cl-msg:empty { display: none; }
  .cl-draft-ft .cl-btn:first-of-type, .cl-release-ft .cl-btn:first-of-type { margin-left: auto; }
  .cl-seg label:nth-child(3) { border-left: none; }
  .cl-seg label:nth-child(n+3) { border-top: 1px solid var(--cl-border); }
  .cl-seg label { flex: 1 1 50%; }
  .cl-seg span { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cl-page * { transition: none !important; }
}
