/* =====================================================================
   Harish Anglos: Community Classifieds
   Goal: Craigslist-grade clarity. Function first: dense, scannable,
   high-contrast, fast to read. A light editorial wordmark keeps the
   community character; everything else is plain and legible.
   ===================================================================== */

@import url('/static/fonts/fonts.css');

:root {
  /* High-contrast light palette */
  --paper:      #fbfaf6;   /* page background, barely warm */
  --panel:      #f3f0e7;   /* sunk panels / filter bar */
  --card:       #ffffff;   /* white cards & inputs */
  --ink:        #1a1814;   /* near-black body text */
  --ink-soft:   #3a352d;   /* secondary text */
  --muted:      #6c6557;   /* meta / labels */
  --hairline:   #ddd6c7;   /* light rules */
  --hairline-2: #c4bba8;   /* stronger rules / input borders */
  --link:       #14418c;   /* classic classifieds blue: links */
  --link-hover: #b14724;   /* terracotta accent on hover */
  --accent:     #b14724;   /* terracotta: brand accent */
  --accent-ink: #8d3417;   /* darkened accent for borders */
  --free:       #1f7a45;   /* giveaway green */
  --whatsapp:   #128c4b;
  --danger:     #b1241f;

  --sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono:    'Spline Sans Mono', 'SFMono-Regular', ui-monospace, monospace;

  --maxw: 1120px;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
body.mk {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Zero-specificity default via :where() so component colors (buttons,
   wordmark, card titles) always win: otherwise `body.mk a` would force
   blue text onto e.g. the solid "Post a notice" button. */
:where(body.mk a) { color: var(--link); text-decoration: none; }
:where(body.mk a:hover) { color: var(--link-hover); text-decoration: none; }
body.mk img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ------------------------------------------------------------- masthead */
.mk-masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.mk-masthead__rule { display: none; }              /* drop the heavy ink rules */
.mk-masthead__rule--bottom { display: none; }

.mk-masthead__bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}
.mk-dateline { margin: 0; }
.mk-dateline a { color: var(--link); }
.mk-dateline__sep { opacity: .5; padding: 0 .35em; }
.mk-dateline--right { text-align: right; }

.mk-wordmark {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
  font-size: clamp(34px, 6.5vw, 60px);
  padding: 18px 0 2px;
}
.mk-wordmark:hover { text-decoration: none; color: var(--ink); }
.mk-wordmark__b { font-style: italic; font-weight: 500; color: var(--accent); }
.mk-tagline {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}

/* category nav: a plain, dense link bar */
.mk-nav {
  padding: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.mk-nav__toggle {
  display: none;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  background: var(--ink); color: #fff; border: 0; padding: 11px 16px;
  width: 100%; text-align: left; cursor: pointer;
}
.mk-nav__list {
  list-style: none; margin: 0; padding: 8px 0;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 2px 20px;
  font-size: 14px;
}
.mk-nav__list a { color: var(--link); padding: 4px 0; }
.mk-nav__list a:hover { color: var(--link-hover); }
.mk-nav__list a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: underline; }
.mk-nav__post a { color: var(--accent); font-weight: 700; }
.mk-nav__post a:hover { color: var(--accent-ink); }
/* "Front page" — the clear way home, set in ink so it reads as the masthead anchor */
.mk-nav__home a { color: var(--ink); font-weight: 700; }
.mk-nav__home a:hover { color: var(--accent); }
.mk-nav__toggle { justify-content: space-between; align-items: center; gap: 10px; }
.mk-nav__toggle-caret { transition: transform .2s ease; font-size: 12px; }
.mk-nav__toggle[aria-expanded="true"] .mk-nav__toggle-caret { transform: rotate(180deg); }

/* ------------------------------------------------------------- layout */
.mk-main { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 32px; }
.mk-main--narrow { max-width: 640px; }
.mk-field__hint { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3, #6b6b6b); }

.mk-section-title {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); display: flex; align-items: center; gap: 14px; margin: 0 0 14px;
}
.mk-section-title::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

/* ------------------------------------------------------------- buttons */
.mk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1;
  padding: 11px 18px; border: 1px solid var(--hairline-2); cursor: pointer;
  background: var(--card); color: var(--ink); border-radius: 4px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
}
.mk-btn:hover { text-decoration: none; background: var(--panel); color: var(--ink); border-color: var(--hairline-2); }
/* Primary: solid dark, WHITE text (was muddy cream-on-black) */
.mk-btn--solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.mk-btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.mk-btn--ghost { background: var(--card); color: var(--ink); }
.mk-btn--ghost:hover { background: var(--panel); color: var(--ink); }
.mk-btn--danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.mk-btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.mk-btn--xs { padding: 6px 11px; font-size: 12px; }
.mk-btn--whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; font-size: 15px; padding: 13px 22px; }
.mk-btn--whatsapp:hover { background: #0e7340; border-color: #0e7340; color: #fff; }
.mk-btn--block { width: 100%; }
.mk-btn__icon { font-size: 16px; }

/* ------------------------------------------------------------- lede */
.mk-lede {
  padding: 18px 20px; margin-bottom: 26px;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 6px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
}
.mk-lede__kicker { display: none; }
.mk-lede__head {
  font-family: var(--display); font-weight: 700; letter-spacing: -.01em; line-height: 1.05;
  font-size: clamp(22px, 3.4vw, 30px); margin: 0; flex: 1 1 320px;
}
.mk-lede__head br { display: none; }
.mk-lede__head em { font-style: italic; color: var(--accent); }
.mk-lede__sub { font-size: 15px; color: var(--ink-soft); flex: 1 1 100%; margin: 0; }
.mk-lede .mk-btn { flex: 0 0 auto; }

/* ------------------------------------------------------------- featured */
.mk-featured { margin-bottom: 30px; }
.mk-featured__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.mk-feature {
  background: var(--card); padding: 16px 16px 14px;
  border: 1px solid var(--hairline-2); border-radius: 6px; border-top: 3px solid var(--accent);
  display: flex; flex-direction: column; color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.mk-feature:hover { text-decoration: none; box-shadow: 0 4px 14px -8px rgba(26,24,20,.5); transform: translateY(-2px); color: var(--ink); }
.mk-feature__num { display: none; }
.mk-feature__title { font-family: var(--sans); font-weight: 700; font-size: 17px; line-height: 1.2; margin: 0 0 6px; color: var(--link); }
.mk-feature:hover .mk-feature__title { color: var(--link-hover); }
.mk-feature__blurb { color: var(--ink-soft); font-size: 13.5px; line-height: 1.45; flex: 1; }
.mk-feature__count {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-top: 12px;
}
.mk-feature__arrow { color: var(--accent); }

/* ------------------------------------------------------------- index list */
.mk-index { margin-bottom: 34px; }
.mk-index__list {
  list-style: none; margin: 0; padding: 0;
  columns: 3; column-gap: 40px;
}
.mk-index__item { break-inside: avoid; }
.mk-index__item a { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; color: var(--link); }
.mk-index__item a:hover { text-decoration: none; }
.mk-index__item a:hover .mk-index__label { color: var(--link-hover); }
.mk-index__label { font-family: var(--sans); font-size: 15px; }
.mk-index__leader { flex: 1; border-bottom: 1px dotted var(--hairline-2); transform: translateY(-3px); }
.mk-index__count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- cards (recent) */
.mk-recent { margin-bottom: 36px; }
.mk-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mk-card { background: var(--card); border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; }
.mk-card a { color: var(--ink); display: block; }
.mk-card a:hover { text-decoration: none; }
.mk-card__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--panel); border-bottom: 1px solid var(--hairline);
}
.mk-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mk-card__media--empty { display: grid; place-items: center; }
.mk-card__glyph { font-family: var(--display); font-size: 52px; color: var(--hairline-2); }
.mk-card__price {
  position: absolute; left: 0; bottom: 0; background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: 13px; padding: 4px 9px; letter-spacing: .02em;
}
.mk-card__body { padding: 10px 12px 12px; }
.mk-card__title { font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.25; margin: 6px 0 4px; color: var(--link); }
.mk-card a:hover .mk-card__title { color: var(--link-hover); }
.mk-card__meta { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

.mk-tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--panel); border: 1px solid var(--hairline-2); padding: 2px 7px; border-radius: 3px;
}

/* ------------------------------------------------------------- browse */
.mk-crumb { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.mk-crumb a { color: var(--link); }
.mk-crumb span { padding: 0 .5em; opacity: .5; }

.mk-browse-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 18px; }
.mk-browse-head__title { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; }
.mk-browse-head__count { color: var(--ink-soft); margin: 6px 0 0; font-size: 14px; }

.mk-filters { margin-bottom: 18px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 6px; padding: 14px 16px; }
.mk-filters__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mk-field { display: flex; flex-direction: column; gap: 4px; }
.mk-field--grow { flex: 1 1 220px; }
.mk-field--narrow { width: 92px; }
.mk-field > span, .mk-field__label {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted);
}
.mk-field__label em { font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.mk-field input, .mk-field select, .mk-field textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card); border: 1px solid var(--hairline-2); padding: 9px 11px; width: 100%; border-radius: 4px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mk-field input:focus, .mk-field select:focus, .mk-field textarea:focus {
  outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(20,65,140,.12);
}

/* rows: the core Craigslist list */
.mk-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.mk-row { border-bottom: 1px solid var(--hairline); }
.mk-row__link {
  display: grid; grid-template-columns: 54px 56px 1fr auto; align-items: center; gap: 14px;
  padding: 9px 8px; color: var(--ink); transition: background .12s ease;
}
.mk-row__link:hover { background: var(--card); text-decoration: none; }
.mk-row__date { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.mk-row__thumb { width: 56px; height: 46px; overflow: hidden; background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 3px; }
.mk-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mk-row__thumb--empty { display: grid; place-items: center; font-family: var(--display); color: var(--hairline-2); font-size: 22px; }
.mk-row__main { min-width: 0; }
.mk-row__title { font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1.25; display: block; color: var(--link); }
.mk-row__link:hover .mk-row__title { color: var(--link-hover); }
.mk-row__meta, .mk-row__status { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.mk-row__status { color: var(--accent); }
.mk-row__price { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.mk-row--mine { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.mk-row--mine .mk-row__link { flex: 1 1 360px; }
.mk-row__actions { display: flex; gap: 8px; padding: 6px 8px; }
.mk-row__actions form { margin: 0; }

.mk-pager { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 0; padding: 14px 0; }
.mk-pager__pos { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mk-pager__btn { font-weight: 600; }

/* ------------------------------------------------------------- detail */
.mk-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding-bottom: 20px; }
.mk-gallery__main { background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 6px; aspect-ratio: 4 / 3; overflow: hidden; }
.mk-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.mk-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mk-gallery__thumb { width: 66px; height: 52px; padding: 0; border: 1px solid var(--hairline-2); border-radius: 3px; background: none; cursor: pointer; overflow: hidden; }
.mk-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mk-gallery__thumb.is-active { border-color: var(--accent); border-width: 2px; }
.mk-detail__noimg { aspect-ratio: 4 / 3; background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 6px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--hairline-2); }
.mk-detail__noimg span { font-family: var(--display); font-size: 72px; }
.mk-detail__noimg p { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin: 0; }

.mk-detail__title { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.08; margin: 10px 0 14px; color: var(--ink); }
.mk-detail__price { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.mk-price { font-family: var(--mono); font-size: 26px; color: var(--ink); }
.mk-price--free { color: var(--free); font-weight: 600; }
.mk-price--ask { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mk-stamp {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #fff;
  background: var(--danger); padding: 4px 10px; border-radius: 3px;
}
.mk-meta { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 20px; padding: 14px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.mk-meta dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.mk-meta dd { margin: 0; font-size: 15px; }
.mk-detail__text { font-size: 16px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; margin-bottom: 22px; }
.mk-detail__pm { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.mk-owner { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--hairline-2); }
.mk-owner__label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.mk-owner__actions { display: flex; gap: 10px; }
.mk-owner__actions form { margin: 0; }

/* ------------------------------------------------------------- post form */
.mk-post-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 20px; }
.mk-post-head__title { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; font-size: clamp(24px, 3.6vw, 34px); line-height: 1.05; }
.mk-post-head__sub { color: var(--ink-soft); margin: 6px 0 0; font-size: 14px; }
.mk-form { display: flex; flex-direction: column; gap: 18px; padding-bottom: 20px; }
.mk-form .mk-field { gap: 6px; }
.mk-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mk-price-block { display: flex; align-items: flex-end; gap: 22px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 6px; }
.mk-check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-soft); padding-bottom: 10px; }
.mk-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.mk-photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mk-photo-previews img { width: 70px; height: 70px; object-fit: cover; border: 1px solid var(--hairline-2); border-radius: 3px; }
.mk-form__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }

.mk-errors { background: #fbeae3; border: 1px solid var(--danger); border-radius: 6px; padding: 14px 18px; margin-bottom: 20px; }
.mk-errors p { font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--danger); margin: 0 0 6px; }
.mk-errors ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------- support */
.mk-support-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.mk-support-presets[aria-hidden="true"] { display: none; }

/* ------------------------------------------------------------- legal */
.mk-legal { padding-bottom: 36px; }
.mk-legal__updated { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.mk-legal__lead { font-size: 16px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 6px; }
.mk-legal h2 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 30px 0 8px; color: var(--ink); }
.mk-legal h3 { font-size: 15px; font-weight: 700; margin: 18px 0 4px; color: var(--ink); }
.mk-legal p, .mk-legal li { font-size: 15px; line-height: 1.65; color: var(--ink-soft); }
.mk-legal ul { padding-left: 20px; margin: 8px 0; }
.mk-legal li { margin-bottom: 6px; }
.mk-legal strong { color: var(--ink); }
.mk-legal__callout { background: var(--panel); border: 1px solid var(--hairline-2); border-left: 3px solid var(--accent); border-radius: 4px; padding: 14px 16px; margin: 16px 0; }
.mk-legal__callout p { margin: 0; }

/* ------------------------------------------------------------- empty */
.mk-empty { text-align: center; padding: 56px 20px; }
.mk-empty__head { font-family: var(--display); font-weight: 700; font-size: 28px; margin-bottom: 8px; }
.mk-empty p { color: var(--ink-soft); }

/* ------------------------------------------------------------- footer */
.mk-footer { max-width: var(--maxw); margin: 50px auto 0; padding: 0 20px 44px; }
.mk-footer__rule { height: 1px; background: var(--hairline-2); margin-bottom: 20px; }
.mk-footer__inner { text-align: center; }
.mk-wordmark--small { font-size: 26px; padding: 0; }
.mk-footer__note { max-width: 56ch; margin: 10px auto 14px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.mk-footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; font-family: var(--sans); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.mk-footer__links--legal { font-weight: 400; margin-top: -4px; }
.mk-footer__linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--link); font-weight: 400; }
.mk-footer__linkbtn:hover { color: var(--link-hover); }
.mk-footer__set { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--hairline-2); }
.mk-footer__powered { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }
.mk-footer__powered a { font-weight: 600; }

/* ===================================================================
   Sign-in modal: reuses /static/js/auth.js (magic-link flow).
   Hidden by default; .is-open shows it. CSP-safe (no inline JS).
   =================================================================== */
.mk-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px;
  background: rgba(26,24,20,.55); backdrop-filter: blur(2px);
  overflow-y: auto;
}
.mk-modal.is-open { display: flex; }
.mk-modal__dialog {
  background: var(--card); width: 100%; max-width: 420px;
  border: 1px solid var(--hairline-2); border-radius: 8px;
  box-shadow: 0 24px 60px -20px rgba(26,24,20,.6);
  border-top: 4px solid var(--accent);
}
.mk-modal__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 18px 20px 0;
}
.mk-modal__title { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ink); }
.mk-modal__close {
  background: none; border: 0; cursor: pointer; line-height: 1;
  font-size: 26px; color: var(--muted); padding: 2px 6px;
}
.mk-modal__close:hover { color: var(--ink); }
.mk-modal__sub { padding: 4px 20px 0; margin: 0; color: var(--muted); font-size: 13.5px; }
.mk-modal__body { padding: 16px 20px 22px; }

/* social / google button inside modal */
.social-auth { margin-bottom: 12px; }
.google-auth-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; border: 1px solid var(--hairline-2); border-radius: 4px;
  background: var(--card); color: var(--ink) !important; font-size: 14px; font-weight: 600;
}
.google-auth-button:hover { background: var(--panel); text-decoration: none; }
.social-auth-divider { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.social-auth-divider::before, .social-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

/* magic-link form (shares markup/JS with the standalone login page) */
.magic-link-auth .form-group { margin-bottom: 12px; }
.magic-link-auth label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin-bottom: 4px; }
.magic-link-auth input {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card); border: 1px solid var(--hairline-2); padding: 10px 12px; width: 100%; border-radius: 4px;
}
.magic-link-auth input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(20,65,140,.12); }
.magic-code-input { font-family: var(--mono); font-size: 22px; letter-spacing: 8px; text-align: center; }
.auth-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px 16px; border: 1px solid var(--ink); border-radius: 4px; cursor: pointer;
  background: var(--ink); color: #fff; font-family: var(--sans); font-size: 15px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}
.auth-button:hover { background: var(--accent); border-color: var(--accent); }
.auth-button.secondary { background: var(--card); color: var(--ink); border-color: var(--hairline-2); }
.auth-button.secondary:hover { background: var(--panel); }
.button-group { display: flex; gap: 10px; margin-top: 10px; }
.code-instruction { font-size: 14px; color: var(--ink); margin: 0 0 4px; }
.code-instruction strong { color: var(--accent); }
.code-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
#magic-link-code-step { display: none; }
#magic-link-code-step.show { display: block; }
#magic-link-email-step.hide { display: none; }

/* flash messages inside modal */
.mk-modal .flash { font-size: 13px; padding: 9px 12px; border-radius: 4px; margin-top: 10px; display: none; }
.mk-modal .flash.show { display: block; }
.mk-modal .flash.error { background: #fbeae3; color: var(--danger); border: 1px solid var(--danger); }
.mk-modal .flash.success, .mk-modal .flash.info { background: #e7f3ec; color: var(--free); border: 1px solid var(--free); }

/* ------------------------------------------------------------- cookie banner */
.cb-overlay {
  position: fixed; inset: 0; z-index: 1100; display: none;
  align-items: flex-end; justify-content: center; padding: 16px;
  background: rgba(26, 24, 20, .4);
}
.cb-overlay.is-open { display: flex; }
.cb-card {
  background: var(--card); max-width: 560px; width: 100%;
  border: 1px solid var(--hairline-2); border-top: 4px solid var(--accent); border-radius: 8px;
  box-shadow: 0 24px 60px -20px rgba(26, 24, 20, .6); padding: 20px 22px;
}
.cb-heading { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.cb-body { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.55; }
.cb-panel { border-top: 1px solid var(--hairline); margin: 0 0 14px; }
.cb-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; color: var(--ink); }
.cb-muted { color: var(--muted); font-size: 12.5px; }
.cb-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-width: 560px) {
  .cb-overlay { align-items: stretch; }
  .cb-actions .mk-btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------- motion */
[data-reveal] { opacity: 0; transform: translateY(8px); animation: mk-rise .4s ease forwards; }
.mk-feature, .mk-card { opacity: 0; animation: mk-fade .35s ease forwards; animation-delay: calc(var(--d, 0) * 40ms + 60ms); }
@keyframes mk-rise { to { opacity: 1; transform: none; } }
@keyframes mk-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .mk-feature, .mk-card { animation: none; opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .mk-featured__grid { grid-template-columns: repeat(2, 1fr); }
  .mk-cards { grid-template-columns: repeat(3, 1fr); }
  .mk-index__list { columns: 2; }
}
@media (max-width: 720px) {
  .mk-detail { grid-template-columns: 1fr; gap: 22px; }
  .mk-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  /* --- masthead: compact & decluttered --- */
  .mk-masthead__bar { flex-wrap: wrap; gap: 3px 10px; padding: 7px 0; font-size: 10px; }
  .mk-dateline__date,
  .mk-dateline__sep--date { display: none; }              /* drop the long weekday date */
  .mk-dateline--right { flex: 1 1 100%; text-align: left; } /* actions get their own line */
  .mk-dateline__sep { padding: 0 .25em; }
  .mk-wordmark { font-size: clamp(27px, 8.5vw, 34px); padding: 8px 0 2px; }
  .mk-tagline { font-size: 9.5px; letter-spacing: .1em; margin: 0 0 10px; }

  /* --- hero/lede: smaller heading, tighter box (was oversized on phones) --- */
  .mk-lede { flex-direction: column; align-items: flex-start; padding: 15px 16px; margin-bottom: 18px; gap: 9px; }
  .mk-lede__head { font-size: 20px; line-height: 1.12; flex-basis: 100%; }
  .mk-lede__sub { font-size: 14px; }

  /* --- primary nav becomes a tap-to-open menu (Menu ▾) --- */
  .mk-nav__toggle { display: flex; }
  .mk-nav { border-top-width: 2px; }
  .mk-nav__list { display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .mk-nav__list.is-open { display: flex; }
  .mk-nav__list li { border-bottom: 1px solid var(--hairline); }
  .mk-nav__list a { display: block; padding: 12px 4px; }
  .mk-nav__home { background: var(--panel); }           /* anchor the menu with "Front page" */
  .mk-nav__post { background: var(--panel); }

  /* --- grids/lists --- */
  .mk-featured__grid { grid-template-columns: 1fr 1fr; }
  .mk-index__list { columns: 1; }
  .mk-form__row { grid-template-columns: 1fr; }
  .mk-row__link { grid-template-columns: 48px 1fr auto; }
  .mk-row__thumb { display: none; }
}

/* ------------------------------------------------------------- utilities */
.mk-mt-md { margin-top: 18px; }
.mk-mt-lg { margin-top: 20px; }
.mk-donation-links { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* =============================================================== account */
.mk-post-head--withaction { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.mk-post-head--withaction > div { flex: 1; }
.mk-post-head--withaction .mk-btn { flex: 0 0 auto; margin-top: 4px; }
@media (max-width: 560px) {
  .mk-post-head--withaction { flex-direction: column; }
  .mk-post-head--withaction .mk-btn { align-self: flex-start; }
}

.mk-flash { border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.mk-flash--ok { background: #e7f3ec; color: var(--free); border-color: var(--free); }
.mk-flash--err { background: #fbeae3; color: var(--danger); border-color: var(--danger); }

.mk-acct { padding: 22px 0; border-bottom: 1px solid var(--hairline); }
.mk-acct:last-of-type { border-bottom: 0; }

/* definition list of account details */
.mk-acct__defs { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.mk-acct__def { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: baseline; }
.mk-acct__def dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.mk-acct__def dd { margin: 0; font-size: 15px; color: var(--ink); word-break: break-word; }

/* a labelled row with an action on the right (security, danger zone) */
.mk-acct__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.mk-acct__row-text { flex: 1; }
.mk-acct__row-title { font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--ink); margin: 0 0 4px; }
.mk-acct__row-sub { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; max-width: 46ch; }
.mk-acct__row-action { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mk-acct__row-action form { margin: 0; }

/* status pill */
.mk-pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.mk-pill--on { color: var(--free); background: #e7f3ec; border-color: var(--free); }
.mk-pill--off { color: var(--muted); background: var(--panel); border-color: var(--hairline-2); }

/* contributions, styled like a stack of receipts */
.mk-invoice { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.mk-invoice__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--hairline); }
.mk-invoice__main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.mk-invoice__amount { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); line-height: 1; }
.mk-invoice__date { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.mk-invoice__side { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.mk-invoice__receipt { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--link); white-space: nowrap; }
.mk-invoice__receipt:hover { color: var(--link-hover); }

.mk-acct__empty { background: var(--panel); border: 1px solid var(--hairline); border-radius: 6px; padding: 20px; color: var(--ink-soft); font-size: 14px; }
.mk-acct__empty p { margin: 0; line-height: 1.55; }
.mk-acct__empty-cta { margin-top: 14px !important; }

/* danger zone accents */
.mk-acct--danger { margin-top: 8px; border: 1px solid var(--danger); border-radius: 8px; padding: 18px 18px; background: #fdf4f2; }
.mk-section-title--danger { color: var(--danger); }
.mk-section-title--danger::after { background: rgba(177,36,31,.25); }

/* delete confirmation modal action row (reuses .mk-modal) */
.mk-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.mk-modal__actions form { margin: 0; }
.mk-modal__sub strong { color: var(--danger); }

@media (max-width: 560px) {
  .mk-acct__def { grid-template-columns: 1fr; gap: 2px; }
  .mk-acct__row { flex-direction: column; gap: 12px; }
  .mk-invoice__row { flex-direction: column; align-items: flex-start; gap: 8px; }
}
