/* ==========================================================================
   FONTSE — Swiss editorial design system
   ========================================================================== */

:root {
  --ink: #0b0b0b;
  --ink-2: #1d1d1d;
  --muted: #6b6b6b;
  --muted-2: #8b8b8b;
  --line: #e3e1dc;
  --line-4: #efeeea;
  --paper: #ffffff;
  --paper-2: #f7f6f3;
  --paper-3: #f1efea;
  --accent: #ff3b00;
  --ok: #0f8a4a;
  --warn: #b45309;
  --radius: 2px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --shadow: 0 18px 40px -28px rgba(11, 11, 11, .45);
  --specimen-size: 40px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: #fff; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.main { min-height: 60vh; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; font-size: 12px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Top strip ---------------------------------------------------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: #f1f1ef;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 30px; gap: 16px;
}
.topbar__dot { color: var(--accent); margin: 0 6px; }
.topbar__right { color: #b9b9b4; }

/* ---------- Header ------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__row {
  display: flex; align-items: center; gap: 26px;
  min-height: 70px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px;
  letter-spacing: -0.06em; transition: background .16s ease;
}
.brand__logo {
  display: block; height: 32px; width: auto; max-width: 190px;
  object-fit: contain;
}
.brand__logo--sm { height: 24px; max-width: 150px; }
.brand:hover .brand__mark { background: var(--accent); }
.brand__mark--sm { width: 24px; height: 24px; font-size: 11px; }
.brand__word { font-weight: 800; font-size: 20px; letter-spacing: -0.035em; }
.brand__dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav__link {
  position: relative; padding: 24px 0 21px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: color .16s ease;
}
.nav__link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent; transition: background .16s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); font-weight: 600; }
.nav__link.is-active::after { background: var(--ink); }

.search { position: relative; margin-left: auto; width: 260px; max-width: 34vw; }
.search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.search__input {
  width: 100%; padding: 9px 12px 9px 34px;
  font-size: 13px; font-family: var(--sans);
  border: 1px solid transparent; background: var(--paper-2);
  outline: none; transition: border-color .16s ease, background .16s ease;
  border-radius: var(--radius);
}
.search__input:focus { background: #fff; border-color: var(--ink); }

.header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header__login { font-size: 13px; font-weight: 600; padding: 8px 4px; }
.header__login:hover { color: var(--accent); }

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius);
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: background .16s ease, color .16s ease, border-color .16s ease;
  background: none; line-height: 1;
}
.btn--solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--ink); border-color: var(--ink); }
.btn--sm { padding: 9px 14px; font-size: 11px; }
.btn--lg { padding: 15px 24px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn--danger { border-color: #f0c9c2; color: #c0260b; background: #fff; }
.btn--danger:hover { background: #c0260b; border-color: #c0260b; color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Account dropdown -------------------------------------------- */

.account { position: relative; }
.account__trigger {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px 4px 4px; border: 1px solid var(--ink); background: var(--paper-2);
  cursor: pointer; border-radius: var(--radius);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: background .16s ease, color .16s ease;
}
.account__trigger:hover { background: var(--ink); color: #fff; }
.account__name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__chev { width: 12px; height: 12px; flex-shrink: 0; }
.account__menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 232px;
  background: #fff; border: 1px solid var(--ink); box-shadow: var(--shadow);
  z-index: 80; display: flex; flex-direction: column;
}
.account__menu[hidden] { display: none; }
.account__meta {
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2);
  display: flex; flex-direction: column; gap: 2px;
}
.account__meta strong { font-size: 12.5px; }
.account__meta span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.account__menu a {
  padding: 11px 14px; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; border-bottom: 1px solid var(--line-4);
  transition: background .14s ease, color .14s ease;
}
.account__menu a:hover { background: var(--ink); color: #fff; }
.account__menu a.account__logout { color: #c0260b; border-bottom: 0; }
.account__menu a.account__logout:hover { background: #c0260b; color: #fff; }

.avatar { display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.avatar--img {
  object-fit: cover; border: 0; background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--line);
}
.avatar--initials {
  background: var(--paper-3); color: var(--ink); font-weight: 800; letter-spacing: -0.04em;
  font-size: 11px; box-shadow: inset 0 0 0 1px var(--line);
}
.avatar--xs { width: 24px; height: 24px; font-size: 9px; }
.avatar--sm { width: 32px; height: 32px; font-size: 11px; }
.avatar--md { width: 48px; height: 48px; font-size: 15px; }
.avatar--lg { width: 76px; height: 76px; font-size: 24px; }
.avatar--xl { width: 110px; height: 110px; font-size: 34px; }

/* ---------- Mobile nav toggle ------------------------------------------- */

.nav-toggle { display: none; width: 38px; height: 34px; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 0; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); margin: 4px auto; transition: transform .2s ease; }
.nav-toggle.is-open span:first-child { transform: translateY(2.75px) rotate(45deg); }
.nav-toggle.is-open span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

/* ---------- Toasts ------------------------------------------------------- */

.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px; width: calc(100% - 40px);
}
.toast {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: 13px 15px;
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow);
  animation: toastIn .22s ease-out both;
  border-left: 3px solid #fff;
}
.toast--success { border-left-color: #3ddc84; }
.toast--warning, .toast--error { border-left-color: var(--accent); }
.toast--info { border-left-color: #9ecbff; }
.toast__close { background: none; border: 0; color: #a1a1a1; cursor: pointer; font-size: 12px; padding: 0; }
.toast__close:hover { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Hero --------------------------------------------------------- */

.hero { border-bottom: 1px solid var(--line); padding: 46px 0 34px; }
.hero__grid { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.hero__main { max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); background: var(--paper-2);
  padding: 6px 10px; margin-bottom: 20px;
}
.eyebrow__dot { width: 6px; height: 6px; background: var(--accent); }
.hero h1 {
  font-size: clamp(2.35rem, 5.4vw, 4.1rem);
  letter-spacing: -0.04em; line-height: 1.02;
}
.hero__aside { max-width: 330px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hero__lede { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ---------- Preview controls -------------------------------------------- */

.controls { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; padding-top: 30px; }
.control {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: var(--paper-2); padding: 10px 14px;
  border-radius: var(--radius);
}
.control--active { border-color: var(--ink); background: #fff; }
.control__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.control__input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink);
}
.control__reset { background: none; border: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); cursor: pointer; text-transform: uppercase; letter-spacing: .1em; }
.control__reset:hover { color: var(--accent); }
.control__value { font-family: var(--mono); font-size: 10.5px; color: var(--ink); font-weight: 600; min-width: 46px; text-align: right; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2px;
  background: #d8d6d0; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px;
  background: var(--ink); border-radius: 0; transition: background .15s ease, transform .15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { background: var(--accent); transform: scale(1.15); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--ink); border: 0; border-radius: 0; }

/* ---------- Chips -------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; }
.chip {
  padding: 7px 13px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  transition: all .14s ease; border-radius: var(--radius);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Sections ----------------------------------------------------- */

.section { padding: 38px 0 10px; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.section__head h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--mono); font-weight: 600; color: var(--muted); }
.section__hint { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); letter-spacing: .06em; }

/* ---------- Font list ---------------------------------------------------- */

.fontlist { border-bottom: 1px solid var(--line); }
.fontrow {
  border-top: 1px solid var(--line);
  padding: 20px 4px 22px;
  transition: background .16s ease;
}
.fontrow:hover { background: var(--paper-2); }
.fontrow__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fontrow__id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fontrow__name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.fontrow__name:hover { color: var(--accent); }
.fontrow__by { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fontrow__by strong { color: var(--ink); font-weight: 600; }
.fontrow__by:hover strong { text-decoration: underline; }
.fontrow__meta { display: flex; align-items: center; gap: 14px; }
.fontrow__dl { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.fontrow__open {
  border: 1px solid var(--ink); background: #fff; padding: 8px 13px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: all .14s ease;
}
.fontrow:hover .fontrow__open { background: var(--ink); color: #fff; }
.fontrow__open:hover { background: var(--accent) !important; border-color: var(--accent); color: #fff; }
.specimen {
  display: block;
  max-width: 100%;
  font-size: var(--specimen-size);
  line-height: 1.12;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  padding: 4px 0 2px;
}

/* ---------- Badges ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid var(--line); background: #fff; color: var(--muted);
}
.badge--solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge--pending { background: #fff6ed; color: var(--warn); border-color: #f3d5b0; }
.badge--ok { background: #edf9f1; color: var(--ok); border-color: #bfe6cd; }

/* ---------- Cards / grids ------------------------------------------------ */

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line); background: #fff; padding: 22px;
  transition: border-color .16s ease, box-shadow .16s ease;
  display: flex; flex-direction: column; gap: 14px;
}
.card:hover { border-color: var(--ink); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card__title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.card__specimen { font-size: 30px; line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card__foot { margin-top: auto; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.card:hover .card__foot { color: var(--accent); }

.designer-card { display: flex; flex-direction: column; gap: 16px; }
.designer-card__head { display: flex; align-items: center; gap: 14px; }
.designer-card__name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.designer-card__loc { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.designer-card__bio { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.designer-card__stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--paper-2); text-align: center; }
.designer-card__stat { padding: 9px 6px; border-right: 1px solid var(--line); }
.designer-card__stat:last-child { border-right: 0; }
.designer-card__stat b { display: block; font-family: var(--mono); font-size: 15px; letter-spacing: -0.02em; }
.designer-card__stat span { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Page headers ------------------------------------------------ */

.pagehead { padding: 44px 0 26px; border-bottom: 1px solid var(--line); }
.pagehead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pagehead h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.04em; margin-top: 8px; }
.pagehead__sub { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 620px; line-height: 1.6; }
.kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar__label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Single font page -------------------------------------------- */

.single-head { padding: 30px 0 26px; border-bottom: 1px solid var(--line); }
.backlink { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; display: inline-block; margin-bottom: 22px; }
.backlink:hover { color: var(--ink); }
.single-head h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.045em; margin: 12px 0 14px; }
.single-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.single-head__meta strong { color: var(--ink); font-weight: 600; }
.single-head__meta a:hover { text-decoration: underline; }

.stage { margin-top: 26px; border: 1px solid var(--line); }
.stage__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.stage__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage__size { display: flex; align-items: center; gap: 10px; }
.stage__size input { width: 130px; }
.mini-btn {
  padding: 6px 10px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  transition: all .14s ease;
}
.mini-btn:hover { border-color: var(--ink); }
.mini-btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage__metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff;
}
.stage__metric { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stage__metric input[type="range"] { flex: 1 1 auto; min-width: 30px; width: 100%; }
.stage__metric .control__label { flex-shrink: 0; }
.stage__metric .control__value { min-width: 34px; flex-shrink: 0; text-align: right; }
.stage__canvas { padding: 30px 26px; background: #fff; transition: background .2s ease, color .2s ease; }
.stage__canvas.is-dark { background: var(--ink); color: #fff; }
.specimen-input {
  width: 100%; border: 0; outline: none; background: transparent; resize: vertical;
  color: inherit; line-height: 1.14; min-height: 130px;
  font-size: 56px;
}

/* Download / licence action bar */
.actionbar {
  margin-top: 40px; border: 1px solid var(--ink); background: var(--paper-2);
  padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.actionbar__copy { max-width: 460px; }
.actionbar__label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.actionbar__text { font-size: 13px; margin-top: 5px; line-height: 1.5; }
.actionbar__text button {
  background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11px;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.actionbar__buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actionbar__buttons .btn { padding: 14px 20px; font-size: 11.5px; }

/* Character map */
.block { margin-top: 46px; }
.block__head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block h2 { font-size: 18px; letter-spacing: -0.02em; }
.char-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.char {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  font-size: 30px; cursor: default; transition: background .14s ease, color .14s ease;
}
.char:hover { background: var(--ink); color: #fff; }

.waterfall { border-top: 1px solid var(--line); }
.waterfall__row { display: flex; align-items: baseline; gap: 20px; padding: 10px 2px; border-bottom: 1px solid var(--line-4); overflow: hidden; }
.waterfall__size { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 48px; flex-shrink: 0; }
.waterfall__sample { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }

.notes { font-size: 15px; line-height: 1.7; max-width: 720px; color: var(--ink-2); }

/* Notes + product spec side by side (the right column used to sit empty) */
.notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.notes-layout .notes { max-width: none; }

.spec { border: 1px solid var(--ink); background: #fff; display: flex; flex-direction: column; }
.spec__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--ink); background: var(--paper-2);
}
.spec__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.spec__ref { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); }
.spec__specimen {
  border-bottom: 1px solid var(--line); padding: 14px 16px;
  font-size: 54px; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink);
  overflow: hidden; white-space: nowrap;
}
.spec__rows { display: flex; flex-direction: column; }
.spec__row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--line-4);
  font-size: 12px; line-height: 1.45;
}
.spec__row:last-child { border-bottom: 0; }
.spec__key { font-family: var(--mono); font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.spec__val { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.spec__val a { color: var(--ink); border-bottom: 1px solid var(--line); }
.spec__val a:hover { color: var(--accent); border-color: var(--accent); }
.spec__muted { color: var(--muted); font-weight: 400; }

/* ---------- Journal ----------------------------------------------------- */

.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; transition: border-color .16s ease; }
.post-card:hover { border-color: var(--ink); }
.post-card__cover { height: 190px; border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card__theme { height: 100%; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.theme-obsidian { background: #101010; color: #fff; }
.theme-sand { background: #e8e1d3; color: #14120f; }
.theme-vermilion { background: var(--accent); color: #fff; }
.post-card__theme .t { font-size: 20px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.post-card__body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__date { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.post-card__title { font-size: 17px; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; }
.post-card__excerpt { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.post-card__foot { margin-top: auto; padding-top: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.article { max-width: 760px; margin: 0 auto; padding: 44px 0 20px; }
.article__head { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.article__meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.article h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); letter-spacing: -0.035em; margin: 14px 0 14px; line-height: 1.06; }
.article__excerpt { font-size: 16px; color: var(--muted); line-height: 1.6; }
.article__cover { border: 1px solid var(--line); margin-bottom: 32px; max-height: 420px; object-fit: cover; width: 100%; }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.prose p { margin: 0 0 20px; }
.prose h2 { font-size: 24px; margin: 34px 0 14px; letter-spacing: -0.02em; }
.prose h3 { font-size: 19px; margin: 28px 0 12px; }
.prose ul { margin: 0 0 20px; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 26px 0; padding: 6px 0 6px 20px; border-left: 2px solid var(--ink);
  font-size: 19px; font-style: italic; color: var(--ink); line-height: 1.5;
}
.prose strong { color: var(--ink); }

/* ---------- Forms ------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 18px; }
.form-card { border: 1px solid var(--ink); background: #fff; padding: 26px; }
.form-card__head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-card h2 { font-size: 20px; }
.form-card__hint { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); background: #fff; outline: none; border-radius: var(--radius);
  transition: border-color .14s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.help { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }

.upload-drop {
  border: 1px dashed var(--ink); background: var(--paper-2); padding: 24px;
  text-align: center; cursor: pointer; transition: background .15s ease;
}
.upload-drop:hover { background: var(--paper-3); }
.upload-drop strong { display: block; font-size: 14px; margin-bottom: 4px; }
.upload-drop span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.upload-drop input[type="file"] { display: none; }
.file-name { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-top: 8px; }

.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: border-color .14s ease, background .14s ease;
}
.radio-card:hover { border-color: var(--ink); }
.radio-card:has(input:checked) { border-color: var(--ink); background: var(--paper-2); }
.radio-card input { accent-color: #0b0b0b; margin: 0; }

/* ---------- Auth pages -------------------------------------------------- */

.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 70vh; }
.auth__aside { background: var(--ink); color: #fff; padding: 54px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth__aside h2 { font-size: 30px; line-height: 1.1; letter-spacing: -0.035em; max-width: 360px; }
.auth__aside p { color: #b6b6b1; font-size: 13.5px; line-height: 1.65; max-width: 360px; margin-top: 14px; }
.auth__specimen { font-size: 46px; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }
.auth__demo { border-top: 1px solid #2a2a2a; padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.auth__demo-title { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: #8d8d88; }
.auth__demo button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, .04); border: 1px solid #333; color: #f1f1ef;
  padding: 10px 12px; cursor: pointer; text-align: left; font-size: 11px;
  transition: background .15s ease, border-color .15s ease;
}
.auth__demo button:hover { background: rgba(255, 255, 255, .1); border-color: #777; }
.auth__demo code { font-family: var(--mono); font-size: 10px; color: #b9b9b4; }
.auth__main { padding: 54px 48px; display: flex; align-items: center; justify-content: center; }
.auth__form { width: 100%; max-width: 400px; }
.auth__form h1 { font-size: 28px; letter-spacing: -0.03em; }
.auth__form .lede { font-size: 13.5px; color: var(--muted); margin: 8px 0 26px; }
.auth__swap { margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.auth__swap a { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--ink); }

/* Show / hide password */
.pw { position: relative; display: flex; }
.pw__input { padding-right: 94px; }
.pw__toggle {
  position: absolute; top: 1px; right: 1px; bottom: 1px;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 11px;
  border: 0; border-left: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  transition: color .14s ease, background .14s ease;
}
.pw__toggle:hover { color: var(--ink); background: var(--paper-2); }
.pw__toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.pw__toggle[aria-pressed="true"] { color: var(--ink); background: var(--paper-2); }
.pw__icon { width: 15px; height: 15px; flex: none; }

/* ---------- Dashboard -------------------------------------------------- */

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 32px 0 22px; border-bottom: 1px solid var(--line); }
.dash-head__id { display: flex; align-items: center; gap: 16px; }
.dash-head h1 { font-size: 26px; letter-spacing: -0.03em; }
.dash-head__role { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 3px 8px; margin-bottom: 7px; display: inline-block; }
.dash-head__role--admin { background: var(--accent); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab {
  padding: 8px 13px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); background: #fff; color: var(--muted); transition: all .14s ease;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab__count { opacity: .65; margin-left: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--line); padding: 18px; background: #fff; }
.stat__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; }
.stat--accent { border-color: var(--accent); }
.stat--accent .stat__value { color: var(--accent); }

.panel { border: 1px solid var(--line); background: #fff; }
.panel__head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--paper-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel__head h3 { font-size: 11px; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel__body { padding: 18px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-4); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfcfb; }
.table__name { font-weight: 700; }
.table__name:hover { color: var(--accent); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.manage-row { border: 1px solid var(--line); background: #fff; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.manage-row--pending { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.manage-row__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.manage-row__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.manage-row__title strong { font-size: 15px; }
.manage-row__grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.empty { border: 1px dashed var(--line); padding: 50px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty a { color: var(--ink); text-decoration: underline; }

.list-simple { display: flex; flex-direction: column; }
.list-simple__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-4); }
.list-simple__item:last-child { border-bottom: 0; }
.list-simple__title { font-size: 13px; font-weight: 700; }
.list-simple__meta { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* ---------- Filters banner --------------------------------------------- */

.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--ink); background: var(--paper-2); padding: 14px 18px; margin-top: 22px;
}
.filterbar__id { display: flex; align-items: center; gap: 12px; }
.filterbar__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.filterbar__name { font-size: 14px; font-weight: 800; }

/* ---------- Licences page ----------------------------------------------- */

.license-block { border: 1px solid var(--line); padding: 26px; background: #fff; display: flex; flex-direction: column; gap: 14px; }
.license-block h2 { font-size: 20px; letter-spacing: -0.02em; }
.license-block p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.license-terms { font-family: var(--mono); font-size: 11.5px; line-height: 1.75; white-space: pre-line; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line); padding: 18px; }

/* ---------- Modal ------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 8, .62); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal__card { background: #fff; border: 1px solid var(--ink); width: 100%; max-width: 660px; max-height: 88vh; overflow: auto; padding: 28px; position: relative; animation: modalIn .2s ease-out both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal__close { position: absolute; top: 16px; right: 16px; background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--muted); line-height: 1; padding: 4px; }
.modal__close:hover { color: var(--ink); }
.modal__tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.modal h2 { font-size: 23px; letter-spacing: -0.03em; margin: 6px 0 8px; }
.modal__summary { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.modal__body { font-family: var(--mono); font-size: 11.5px; line-height: 1.8; white-space: pre-line; background: var(--paper-2); border: 1px solid var(--line); padding: 18px; max-height: 42vh; overflow: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Footer ------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 70px; }
.footer__grid { display: grid; grid-template-columns: 1.9fr 1fr 1fr 1fr; gap: 34px; padding: 46px 0 34px; border-bottom: 1px solid var(--line); }
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.03em; margin-bottom: 14px; }
.footer__desc { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 380px; }
.footer__badge { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-top: 16px; }
.footer__col h4 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.footer__col a, .footer__col span { display: block; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.footer__col a:hover { color: var(--ink); }
.footer__mono { font-family: var(--mono); font-size: 10px !important; letter-spacing: .08em; text-transform: uppercase; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 30px; font-size: 11.5px; color: var(--muted); }

/* ---------- Utilities --------------------------------------------------- */

.is-hidden { display: none !important; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--muted); }
.center { text-align: center; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }

/* ---------- Admin approval list (one line per submission) --------------- */

.approve-list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.approve-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-bottom: 1px solid var(--line-4); background: #fff;
  transition: background .14s ease;
}
.approve-row:last-child { border-bottom: 0; }
.approve-row:hover { background: var(--paper-2); }
.approve-row.is-pending { box-shadow: inset 3px 0 0 var(--accent); }
.approve-row__main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; flex-wrap: wrap; }
.approve-row__name { font-size: 14px; font-weight: 800; letter-spacing: -0.015em; white-space: nowrap; }
.approve-row__main:hover .approve-row__name { color: var(--accent); }
.approve-row__meta {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.approve-row__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mini-btn--solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.mini-btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.review { border: 1px solid var(--line); background: #fff; padding: 24px; margin-top: 12px; display: flex; flex-direction: column; gap: 20px; }
.review__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.review__title { font-size: 26px; letter-spacing: -0.03em; margin-bottom: 6px; }
.review__files { display: flex; flex-direction: column; gap: 8px; }
.review__filelist { display: flex; flex-wrap: wrap; gap: 8px; }
.face-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--line); background: var(--paper-2);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.face-chip strong { color: var(--ink); font-weight: 600; }
.face-chip--empty { color: var(--warn); }

.face-list { display: flex; flex-direction: column; border: 1px solid var(--line); }
.face-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-bottom: 1px solid var(--line-4); font-size: 13px;
}
.face-row:last-child { border-bottom: 0; }
.face-row .mono { font-size: 10.5px; }

.reset-form { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.input--sm { padding: 7px 9px; font-size: 11.5px; max-width: 170px; }
.textarea--mono { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; }

/* ---------- Live article editor ---------------------------------------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 24px; align-items: start; }
.editor__form { position: relative; }
.textarea--editor { font-family: var(--mono); font-size: 13px; line-height: 1.75; min-height: 380px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.live-flag__dot { width: 6px; height: 6px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }

.live-pane {
  position: sticky; top: 88px;
  border: 1px solid var(--line); background: var(--paper-2);
  display: flex; flex-direction: column; max-height: calc(100vh - 120px);
}
.live-pane__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff;
}
.live-pane__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.live-pane__meta { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.live-pane__scroll { overflow: auto; padding: 22px; }
.live-article { background: #fff; border: 1px solid var(--line); padding: 24px; }
.live-article__meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.live-article__title { font-size: 25px; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 10px; }
.live-article__excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.live-article .prose { font-size: 14px; line-height: 1.7; }
.live-article .prose h2 { font-size: 18px; margin: 22px 0 10px; }
.live-article .prose h3 { font-size: 15px; }
.live-article .prose p { margin-bottom: 14px; }
.live-article .prose blockquote { font-size: 15px; margin: 18px 0; padding-left: 14px; }
.live-article .prose ul { padding-left: 18px; margin-bottom: 14px; }
.live-empty { color: var(--muted-2); font-size: 13px; font-style: italic; }

/* ---------- Ads / banner slots ----------------------------------------- */

.ad-slot {
  margin: 30px 0; border: 1px solid var(--line); background: var(--paper-2);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.ad-slot__label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted-2);
}
.ad-slot__unit { display: flex; justify-content: center; overflow: hidden; }
.ad-slot__unit ins, .ad-slot__unit iframe { max-width: 100%; }
.ad-slot--banner { padding: 0; border: 0; background: none; margin: 26px 0; }
.ad-slot--banner img { width: 100%; height: auto; border: 1px solid var(--line); }
.ad-slot--banner .ad-slot__label { padding: 0 0 6px; }

.stage__styles {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); background: var(--paper-2);
}

/* ---------- Logo field (site content) ---------- */

.logo-field { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.logo-preview {
  display: grid; place-items: center; min-width: 132px; height: 76px; padding: 12px;
  border: 1px solid var(--line); background: var(--paper-2);
}
.logo-preview img { max-height: 44px; max-width: 108px; width: auto; object-fit: contain; }
.icon-preview {
  display: grid; place-items: center; width: 76px; height: 76px; padding: 10px;
  border: 1px solid var(--line); background: var(--paper-2);
}
.icon-preview img { width: 48px; height: 48px; object-fit: contain; }
.icon-preview .brand__mark { width: 44px; height: 44px; font-size: 17px; }

/* ---------- Catalogue toolbar / sort ---------- */

.catalogue-bar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; padding-top: 22px;
}
.sortgroup { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sortbtn {
  padding: 7px 12px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  transition: all .14s ease; white-space: nowrap;
}
.sortbtn:hover { border-color: var(--ink); color: var(--ink); }
.sortbtn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Face switcher under a catalogue specimen ---------- */

.face-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 10px; }
.face-switch__label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2);
  margin-right: 2px;
}
.face-pill {
  padding: 4px 10px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-family: var(--mono); font-size: 10px; letter-spacing: .05em; cursor: pointer;
  transition: all .14s ease;
}
.face-pill:hover { border-color: var(--ink); color: var(--ink); }
.face-pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Designer roster (single column rows) ---------- */

.designer-list { border-top: 1px solid var(--line); }
.designer-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 20px; padding: 18px 6px;
  border-bottom: 1px solid var(--line); transition: background .14s ease;
}
.designer-row:hover { background: var(--paper-2); }
.designer-row__body { min-width: 0; }
.designer-row__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.designer-row__name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.designer-row__name:hover { color: var(--accent); }
.designer-row__loc { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.designer-row__bio { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 5px; }
.designer-row__stats { display: flex; gap: 22px; }
.designer-row__stat { text-align: right; }
.designer-row__stat b { display: block; font-family: var(--mono); font-size: 15px; letter-spacing: -0.02em; }
.designer-row__stat span { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.designer-row__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Markdown toolbar + notes preview ---------- */

.md-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap; padding: 6px;
  border: 1px solid var(--line); border-bottom: 0; background: var(--paper-2);
}
.md-toolbar button {
  min-width: 32px; height: 28px; padding: 0 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-family: var(--mono); font-size: 11px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: all .13s ease;
}
.md-toolbar button:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.md-toolbar__link { font-family: var(--sans) !important; font-size: 11.5px !important; padding: 0 10px !important; }
.md-toolbar + .textarea { border-top-left-radius: 0; border-top-right-radius: 0; }

.field-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.word-count {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.word-count.is-over { color: var(--accent); font-weight: 600; }

.notes-preview { border: 1px solid var(--line); background: var(--paper-2); padding: 14px 16px; }
.notes-preview__label {
  display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px;
}
.notes-preview .notes { font-size: 13.5px; }
.notes a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.notes a:hover { color: var(--accent); }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent); }

/* ---------- Submission confirmation ---------- */

.submit-done {
  max-width: 680px; margin: 40px auto 20px; text-align: center;
  border: 1px solid var(--ink); background: #fff; padding: 40px 32px;
}
.submit-done__mark {
  display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 18px;
  background: var(--ink); color: #fff; font-size: 20px; font-weight: 700;
}
.submit-done h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.035em; margin: 8px 0 14px; }
.submit-done__lede { font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 520px; margin: 0 auto; }
.submit-done__card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); background: var(--paper-2); padding: 16px 18px; margin: 24px 0 10px; text-align: left;
}
.submit-done__name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.submit-done__actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Download landing page ---------- */

.download-page { max-width: 720px; margin: 44px auto 8px; }
.download-card {
  border: 1px solid var(--ink); background: #fff; padding: 34px 30px; text-align: center;
}
.download-card__mark {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 16px;
  background: var(--ink); color: #fff;
}
.download-card h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.03em; margin: 10px 0 14px; line-height: 1.15; }
.download-card__note { font-size: 14px; color: var(--muted); line-height: 1.65; }
.download-card__note a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.download-card__note a:hover { color: var(--accent); }
.download-card__file {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--paper-2); padding: 13px 16px; margin: 22px 0 16px; text-align: left;
}
.download-card__file strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
.download-card__file .mono { font-size: 10px; }
.download-card__licence { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.download-card__licence a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.download-card__actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.download-page__hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.download-page__hint a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Related articles ---------- */

.related { max-width: 1100px; margin: 20px auto 0; padding: 34px 0 10px; border-top: 1px solid var(--line); }
.related .grid { margin-top: 4px; }

/* ---------- Category management ---------- */

.cat-list { display: flex; flex-direction: column; border: 1px solid var(--line); }
.cat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line-4);
}
.cat-row:last-child { border-bottom: 0; }
.cat-row strong { font-size: 13px; }
.cat-row .mono { font-size: 10px; margin-left: 6px; }
.rules { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.rules strong { color: var(--ink); }
.form-card .inline-form { margin-top: 4px; }
.form-card .inline-form .input { flex: 1; }

/* ---------- AI writer (Blog tab) ---------------------------------------- */

.ai-panel { border: 1px solid var(--ink); background: var(--paper-2); padding: 22px; margin-bottom: 24px; }
.ai-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-panel__kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.ai-panel h2 { font-size: 20px; letter-spacing: -0.02em; margin-top: 4px; }
.ai-panel__status {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 10px; border: 1px solid var(--line); background: #fff; color: var(--muted); white-space: nowrap;
}
.ai-panel__status.is-on { border-color: var(--ink); color: var(--ink); }
.ai-panel__lede { font-size: 12.5px; color: var(--muted); line-height: 1.6; max-width: 720px; margin-bottom: 16px; }
.ai-panel__optional { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }

.ai-form { display: flex; flex-direction: column; gap: 14px; }
.ai-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-form__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ai-form .input:disabled, .ai-form .select:disabled { background: var(--paper-3); color: var(--muted-2); cursor: not-allowed; }

.ai-setup { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.ai-setup summary {
  cursor: pointer; font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink); padding: 4px 0;
}
.ai-setup summary:hover { color: var(--accent); }
.ai-setup form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.ai-draft {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--ink); border-left: 4px solid var(--accent); background: #fff;
  padding: 12px 16px; margin-bottom: 18px; font-size: 13px;
}
.ai-draft strong { display: block; }
.ai-draft__meta { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .04em; }

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 1080px) {
  .search { width: 200px; }
  .hero__grid { gap: 26px; }
  .split { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .live-pane { position: static; max-height: none; }
  .designer-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
  .designer-row__stats { grid-column: 1 / -1; justify-content: flex-start; gap: 26px; }
  .designer-row__stat { text-align: left; }
  .designer-row__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line); flex-direction: column;
    align-items: stretch; gap: 0; padding: 6px 20px 14px; z-index: 70;
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: 12px 0; border-bottom: 1px solid var(--line-4); }
  .nav__link::after { display: none; }
  .nav-toggle { display: block; }
  .header__row { gap: 14px; position: relative; }
  .search { display: none; }
  .header__studio { display: none; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { padding: 36px 28px; }
  .auth__main { padding: 36px 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-row__grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .stage__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-form__row, .ai-form__row--3 { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; gap: 22px; }
  .spec { max-width: 420px; }
  .hero__aside { max-width: 100%; }
  .hero__lede { max-width: 560px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .header__login { display: none; }
  .brand__word { font-size: 17px; }
  .brand__mark { width: 28px; height: 28px; font-size: 13px; }
  .brand__logo { height: 26px; max-width: 130px; }
  .header__join { padding: 9px 11px; font-size: 10px; }
  .header__row { gap: 10px; }
  .account__trigger { padding: 3px 6px 3px 3px; }
  .specimen { font-size: min(var(--specimen-size), 42px); }
}

@media (max-width: 680px) {
  .topbar__right { display: none; }
  .hero { padding: 32px 0 24px; }
  .controls { grid-template-columns: 1fr; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid--3, .radio-row { grid-template-columns: 1fr; }
  .pagehead { padding: 30px 0 20px; }
  .actionbar { flex-direction: column; align-items: stretch; }
  .actionbar__buttons { flex-direction: column; align-items: stretch; }
  .actionbar__buttons .btn { width: 100%; }
  .stage__bar { gap: 10px; }
  .specimen-input { font-size: 40px !important; min-height: 100px; }
  .stage__metrics { grid-template-columns: 1fr; gap: 10px; }
  .stage__metric .control__label { min-width: 96px; }
  .char-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .char { font-size: 22px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stats { grid-template-columns: 1fr; }
  .account__name { display: none; }
  .dash-head { padding: 24px 0 18px; }
  .table-wrap { overflow-x: auto; }
  .fontrow__meta { width: 100%; justify-content: space-between; }
  .modal__card { padding: 22px; }
  .article { padding: 30px 0 10px; }
  .section { padding: 28px 0 6px; }
  .catalogue-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .designer-row { padding: 16px 2px; gap: 14px; }
  .submit-done { padding: 28px 20px; margin: 24px auto 10px; }
  .submit-done__card { flex-direction: column; align-items: flex-start; }
  .md-toolbar button { min-width: 30px; height: 30px; }
  .related { padding: 26px 0 6px; }
}
