/* Self-hosted type. Archivo (grotesque, industrial, trade-desk character) carries the wordmark
   and headings; Hanken Grotesk is the workhorse text + UI face. Both are variable fonts — one
   latin file per family covers every weight used. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 750; font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 750; font-display: swap;
  src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 650; font-display: swap;
  src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 650; font-display: swap;
  src: url("/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================================
   KBSD — Cobalt Citrus
   Primitive tokens feed semantic tokens. Each colour has ONE role (see the brief):
   cobalt = brand/structure/links/focus/inquiry; lime = primary CTA only;
   coral = high-interest / urgent status only; warm ivory = every surface.
   No gradients. One shadow token. 1px borders. Light only, by design.
   ========================================================================== */

:root {
  /* -- primitives -- */
  --color-ivory-50:  #FFFEF9;
  --color-ivory-100: #F7F4EA;
  --color-ink-900:   #23263A;
  --color-ink-500:   #62677A;
  --color-cobalt-600: #2E46C7;
  --color-cobalt-800: #22359A;
  --color-cobalt-050: #EEF2FF;
  --color-lime-400:  #C7F04A;
  --color-lime-500:  #B7DF3E;
  --color-coral-600: #C74742;
  --color-coral-700: #A5352F;
  --color-coral-050: #FFF0EC;
  --color-mint-100:  #D9EFE8;
  --color-peach-100: #F3DFD0;
  --color-border:    #DDD9CF;

  /* -- semantic -- */
  --surface-canvas:   var(--color-ivory-100);
  --surface-elevated: var(--color-ivory-50);
  --surface-sunken:   #F2EEE0;
  --surface-info:     var(--color-cobalt-050);
  --text-primary:     var(--color-ink-900);
  --text-secondary:   var(--color-ink-500);
  --text-on-cobalt:   #FFFFFF;
  --text-on-lime:     #1C2200;
  --link:             var(--color-cobalt-600);
  --action-primary:        var(--color-lime-400);
  --action-primary-hover:  var(--color-lime-500);
  --action-secondary:      var(--color-cobalt-600);
  --action-secondary-hover: var(--color-cobalt-800);
  --status-interest:  var(--color-coral-600);
  --status-interest-text: var(--color-coral-700); /* coral used AS text on a tinted ground — AA on #FFF0EC */
  --status-interest-surface: var(--color-coral-050);
  --border-subtle:    var(--color-border);
  --focus-ring:       var(--color-cobalt-600);

  /* angular / trade-desk: crisp 2px corners everywhere, no soft capsules */
  --radius-card: 2px;
  --radius-control: 2px;
  --radius-pill: 2px;
  --shadow-card: 0 1px 0 rgba(35, 38, 58, .04), 0 2px 10px rgba(35, 38, 58, .05);
  --content-max: 552px;
  --header-h: 56px;
  --bottom-nav-h: 56px;

  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-display: "Archivo", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-num: "Archivo", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* browser surfaces themed from the palette (craft floor) */
::selection { background: var(--color-cobalt-050); color: var(--color-cobalt-800); }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
:root { scrollbar-color: #C9C4B4 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #C9C4B4; border-radius: var(--radius-pill); border: 2px solid var(--surface-canvas); }
*::-webkit-scrollbar-track { background: transparent; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--action-secondary-hover); }

img { max-width: 100%; display: block; }
h1, h2, h3 {
  margin: 0; font-family: var(--font-display);
  font-weight: 640; letter-spacing: -0.02em; line-height: 1.2;
}
p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }
.prose { max-width: 60ch; }

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* skip link */
.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--surface-elevated); color: var(--link);
  padding: 10px 14px; border-radius: var(--radius-control); z-index: 100;
  border: 1px solid var(--border-subtle); font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------------------------------------------------------------- layout -- */
.page { min-height: 100dvh; padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 721px) { .page { padding-bottom: 40px; } }

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--action-secondary);
  color: var(--text-on-cobalt);
  border-bottom: 1px solid var(--color-cobalt-800);
}
.site-header__bar {
  max-width: var(--content-max); margin: 0 auto;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; min-width: 0; }
.brand:hover { color: inherit; }
.brand__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.16em;
  padding-right: 2px;
}
.brand__name {
  font-size: 12.5px; font-weight: 500;
  color: rgba(255, 255, 255, .82);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (max-width: 400px) { .brand__name { display: none; } }

.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.site-header .icon-btn:focus-visible { outline-color: #fff; }

/* buttons -------------------------------------------------------------------- */
.btn {
  --_bg: transparent; --_fg: var(--text-primary); --_bd: var(--border-subtle);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 600; font-size: 15px;
  border-radius: var(--radius-control);
  border: 1px solid var(--_bd);
  background: var(--_bg); color: var(--_fg);
  cursor: pointer; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary { --_bg: var(--action-primary); --_fg: var(--text-on-lime); --_bd: var(--action-primary); }
.btn--primary:hover { --_bg: var(--action-primary-hover); --_bd: var(--action-primary-hover); color: var(--text-on-lime); }
.site-header .btn--primary { box-shadow: 0 0 0 1px rgba(0,0,0,.06); }

.btn--cobalt { --_bg: var(--action-secondary); --_fg: var(--text-on-cobalt); --_bd: var(--action-secondary); }
.btn--cobalt:hover { --_bg: var(--action-secondary-hover); --_bd: var(--action-secondary-hover); color: var(--text-on-cobalt); }

.btn--outline { --_bg: var(--surface-elevated); --_fg: var(--link); --_bd: var(--action-secondary); }
.btn--outline:hover { --_bg: var(--color-cobalt-050); color: var(--action-secondary-hover); }

.btn--ghost { --_bg: transparent; --_fg: var(--text-primary); --_bd: var(--border-subtle); }
.btn--ghost:hover { --_bg: var(--surface-sunken); }

.btn--danger { --_bg: var(--surface-elevated); --_fg: var(--status-interest); --_bd: #E7B4B1; }
.btn--danger:hover { --_bg: var(--status-interest-surface); }

.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn--block { width: 100%; }

.header-signin { display: inline-flex; }
@media (max-width: 360px) { .header-signin .btn { padding-inline: 12px; } }
/* ghost buttons in the cobalt header (buyer "Account", admin "Admin") read white, not dark */
.site-header .btn--ghost { --_bg: transparent; --_fg: #fff; --_bd: rgba(255, 255, 255, .38); }
.site-header .btn--ghost:hover { --_bg: rgba(255, 255, 255, .14); --_bd: rgba(255, 255, 255, .5); color: #fff; }
.site-header .btn--ghost svg { color: #fff; }
.header-link {
  color: rgba(255, 255, 255, .92); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 10px; border-radius: var(--radius-control); white-space: nowrap;
}
.header-link:hover { background: rgba(255, 255, 255, .14); color: #fff; }
@media (max-width: 380px) { .header-link { display: none; } }

/* ---------------------------------------------------------------- search -- */
.search-region { padding: 16px 0 4px; }
.search-form { display: flex; gap: 8px; }
.search-field {
  position: relative; flex: 1; display: flex; align-items: center;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}
.search-field:focus-within { border-color: var(--action-secondary); box-shadow: 0 0 0 3px var(--color-cobalt-050); }
.search-field__icon { display: flex; padding-left: 12px; color: var(--text-secondary); }
.search-field input {
  flex: 1; border: 0; background: transparent; outline: 0;
  font: inherit; font-size: 15px; color: var(--text-primary);
  padding: 12px 12px 12px 8px; min-height: 44px;
}
.search-field input::placeholder { color: var(--text-secondary); }
.search-field__clear { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 8px 10px; display: none; }
.search-field__clear.is-visible { display: inline-flex; }
.search-submit { flex: none; }
@media (max-width: 400px) {
  .search-submit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .search-submit { padding-inline: 12px; }
}

/* "View as buyer" preview strip — shown to an admin who toggled the buyer view */
.preview-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--color-cobalt-800); color: #fff;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
}
.preview-bar svg { flex: none; }
.preview-bar span { flex: 1 1 auto; }
.preview-bar a { color: #fff; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* -------------------------------------------------- admin feed composer --- */
/* the admin's post box, pinned to the top of the feed. Server renders it only for a verified
   admin session — anonymous / buyer requests never receive this markup. */
.composer {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 16px;
  margin: 14px 0 4px;
}
.composer__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; margin-bottom: 10px; }
.composer__title { font-family: var(--font-display); font-weight: 620; font-size: 15px; }
.composer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; font-size: 12.5px; }
.composer__links a, .composer__signout { white-space: nowrap; }
.composer__links a { color: var(--text-secondary); }
.composer__links a:hover { color: var(--link); }
.composer__links form { display: inline; }
.composer__signout { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.composer__signout:hover { color: var(--link); }
.composer__form .field { margin-bottom: 10px; }
.composer__form .form-actions { display: flex; gap: 8px; }

/* --------------------------------------------------------------- notice --- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-info);
  border: 1px solid #C2CEFF;
  color: var(--color-cobalt-800);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  margin: 12px 0 4px;
  font-size: 14px; line-height: 1.5;
}
.notice span { max-width: 58ch; }
.notice svg { flex: none; margin-top: 1px; }

/* ------------------------------------------------------- section headers -- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 22px 0 10px;
}
.section-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.section-head__count { color: var(--text-secondary); font-size: 13.5px; }

/* ----------------------------------------------------------------- feed --- */
.feed { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
/* skip rendering work for cards well below the fold in a long feed (first 3 always render) */
.feed .offer:nth-child(n+4) { content-visibility: auto; contain-intrinsic-size: auto 520px; }

.offer {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  /* overflow visible so the admin ⋮ menu can escape the card; inner blocks clip themselves */
}
.offer.is-inactive { background: var(--surface-sunken); }

.offer__top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }

.offer__tag {
  margin-left: auto; flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent;
}
.offer__tag--hot    { background: var(--status-interest-surface); color: var(--status-interest-text); border-color: #EBB9B5; }
.offer__tag--warm   { background: var(--color-peach-100); color: #7A3F1C; border-color: #E2BE9F; }
.offer__tag--new    { background: var(--color-mint-100); color: #1B5E4C; border-color: #ADD6C9; }
.offer__tag--muted  { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border-subtle); }
.offer__tag--review { background: var(--color-cobalt-050); color: var(--color-cobalt-800); border-color: #C2CEFF; }

/* admin-only provenance line ("Posted by <partner>") — buyers never see this */
.offer__via {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 6px 10px;
  background: var(--color-cobalt-050); border: 1px solid #C2CEFF; border-radius: var(--radius-control);
  color: var(--color-cobalt-800); font-size: 12.5px; font-weight: 600;
}
.offer__via svg { flex: none; }
.offer.is-pending { border-color: #C2CEFF; box-shadow: 0 0 0 1px #C2CEFF; }
.seller__logo {
  width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--action-secondary); color: var(--text-on-cobalt);
  display: flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: 12px; letter-spacing: .06em;
}
.seller__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.seller__name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.seller__time { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }

.offer__body { padding: 10px 16px 16px; }
.offer__name { font-family: var(--font-display); font-size: 18px; font-weight: 620; margin: 2px 0 10px; overflow-wrap: anywhere; }

.offer__text { font-size: 14.5px; color: var(--text-primary); max-width: 62ch; }
.offer__text p { margin: 0 0 0.7em; overflow-wrap: anywhere; }
.offer__text p:last-child { margin-bottom: 0; }

.offer__status {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 13.5px; font-weight: 600;
}

/* anonymous counts under the post */
.social {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 13px;
}
.social + .offer__actions { border-top: 0; padding-top: 0; margin-top: 12px; }
.social + .offer__status { border-top: 0; padding-top: 4px; margin-top: 8px; }
.social__item { display: inline-flex; align-items: center; gap: 6px; }
.social__item svg { color: var(--text-secondary); }

/* offer photo collage (Naver-Band style): 1 = full width natural height, 2-4 = cropped grid */
.offer__media {
  margin-top: 12px;
  display: grid; gap: 3px;
  border-radius: var(--radius-control); overflow: hidden;
  background: var(--surface-sunken);
}
.offer__media:first-child { margin-top: 0; }
.offer__shot {
  position: relative; display: block; margin: 0; padding: 0;
  border: 0; background: var(--surface-sunken); cursor: zoom-in;
  overflow: hidden;
}
.offer__shot:focus-visible { outline: 2px solid var(--focus-ring, var(--action-secondary)); outline-offset: -2px; }
.offer__shot img { display: block; width: 100%; }
.offer__media--1 { grid-template-columns: 1fr; }
.offer__media--1 .offer__shot img { height: auto; }
.offer__media--2 { grid-template-columns: 1fr 1fr; }
.offer__media--3 { grid-template-columns: 1.5fr 1fr; }
.offer__media--3 .offer__shot:first-child { grid-row: span 2; }
.offer__media--4 { grid-template-columns: 1fr 1fr; }
.offer__media--2 .offer__shot,
.offer__media--3 .offer__shot,
.offer__media--4 .offer__shot { aspect-ratio: 1 / 1; }
.offer__media--3 .offer__shot:first-child { aspect-ratio: auto; }
.offer__media--2 .offer__shot img,
.offer__media--3 .offer__shot img,
.offer__media--4 .offer__shot img { height: 100%; object-fit: cover; }
.offer__more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 22, 34, .5); color: #fff;
  font-family: var(--font-display); font-weight: 650; font-size: 22px;
  letter-spacing: .01em;
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(20, 22, 34, .92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 2px; }
.lightbox__close, .lightbox__nav {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; min-width: 48px;
  border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav--prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .82); font-size: 13px; font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) { .lightbox__nav { width: 44px; height: 44px; } }

/* admin-only per-card ⋮ menu (rendered server-side only for a verified admin session) */
.offer-menu { position: relative; flex: none; margin-left: auto; }
.offer__tag + .offer-menu { margin-left: 4px; }
.offer-menu__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  border: 1px solid transparent; background: transparent; color: var(--text-secondary); cursor: pointer;
}
.offer-menu__btn:hover { background: var(--surface-sunken); color: var(--text-primary); }
.offer-menu__pop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20;
  min-width: 168px; padding: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
  box-shadow: var(--shadow-pop, 0 10px 30px rgba(20, 22, 34, .16));
  display: flex; flex-direction: column;
}
.offer-menu__item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: calc(var(--radius-control) - 4px);
  background: transparent; color: var(--text-primary); font: inherit; font-size: 13.5px; cursor: pointer;
}
.offer-menu__item:hover { background: var(--surface-sunken); }
.offer-menu__item--danger { color: var(--status-interest-text); }

.offer__actions { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.offer__status + .offer__actions { border-top: 0; padding-top: 0; margin-top: 10px; }
.offer__actions .btn { flex: 1; }
@media (max-width: 380px) { .offer__actions { flex-direction: column; } }

.offer__admin {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-subtle);
}

/* --------------------------------------------------------- empty / states -- */
.empty {
  text-align: center; padding: 44px 20px;
  border: 1px dashed var(--border-subtle); border-radius: var(--radius-card);
  background: var(--surface-elevated); color: var(--text-secondary);
}
.empty h3 { color: var(--text-primary); font-size: 16px; margin-bottom: 6px; }

.feed-status { padding: 10px 2px; color: var(--text-secondary); font-size: 13.5px; min-height: 20px; }

/* ------------------------------------------------------------ bottom nav -- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 721px) { .bottom-nav { display: none; } }
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--bottom-nav-h);
  color: var(--text-secondary); text-decoration: none; font-size: 11px; font-weight: 600;
}
.bottom-nav a[aria-current="page"] { color: var(--link); }
.bottom-nav a:focus-visible { outline-offset: -3px; }

/* ---------------------------------------------------------------- forms --- */
.form-page { padding: 24px 0 48px; }
.form-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.form-card h1 { font-size: 23px; }
.form-lede { color: var(--text-secondary); font-size: 14px; margin: 6px 0 18px; max-width: 58ch; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field .opt { color: var(--text-secondary); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px;
  color: var(--text-primary); background: var(--surface-elevated);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
  padding: 11px 12px; min-height: 44px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--action-secondary); box-shadow: 0 0 0 3px var(--color-cobalt-050);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--status-interest); box-shadow: 0 0 0 3px var(--status-interest-surface);
}
.field__error { display: none; color: var(--status-interest-text); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.field__error.is-visible { display: block; }
.field__hint { color: var(--text-secondary); font-size: 12.5px; margin-top: 5px; max-width: 56ch; }

.form-row { display: grid; gap: 14px; }
@media (min-width: 460px) { .form-row--2 { grid-template-columns: 1fr 1fr; } }

.form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius-control); padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}
.form-alert--error { background: var(--status-interest-surface); color: var(--status-interest-text); border: 1px solid #EBB9B5; }
.form-alert--ok { background: var(--color-mint-100); color: #1B5E4C; border: 1px solid #ADD6C9; }
.form-alert svg { flex: none; margin-top: 1px; }
.form-alert span { max-width: 56ch; }

.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-actions .btn { flex: 1; }

.readback { background: var(--surface-info); border: 1px solid #CBD5FF; border-radius: var(--radius-control); padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.readback dt { color: var(--color-cobalt-800); font-weight: 650; }
.readback dd { margin: 0 0 6px; }

/* --------------------------------------------------------------- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(35, 38, 58, .42);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 560px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal {
  background: var(--surface-canvas);
  width: 100%; max-width: 520px;
  max-height: 92dvh; overflow-y: auto;
  border-radius: 2px 2px 0 0;
  border: 1px solid var(--border-subtle);
}
@media (min-width: 560px) { .modal { border-radius: 2px; } }
.modal__head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px;
  background: var(--surface-canvas);
  border-bottom: 1px solid var(--border-subtle);
}
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 18px 16px 22px; }

[hidden] { display: none !important; }

.spin { animation: kbsd-spin 0.8s linear infinite; }
@keyframes kbsd-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ===================================================== admin console (acp) == */
.admin-strip {
  background: var(--color-cobalt-800); color: #fff;
  font-size: 13px; font-weight: 600; text-align: center; padding: 8px 14px;
}
.admin-strip a { color: #fff; text-underline-offset: 2px; }

body.acp { background: var(--surface-sunken); }

/* dedicated admin sign-in */
.acp-login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.acp-login__card {
  width: 100%; max-width: 380px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.acp-login__brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  font-size: 17px; color: var(--color-cobalt-800);
  margin-bottom: 18px;
}
.acp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--action-secondary); color: #fff;
  padding: 12px 18px;
}
.acp-bar__brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-size: 15px; }
.acp-bar__right { display: inline-flex; align-items: center; gap: 4px; }
.acp-bar__logout { margin: 0; }
.acp-bar__link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, .88); font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 10px; border-radius: var(--radius-control); text-decoration: none;
}
.acp-bar__link:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.acp-shell { display: block; }
.acp-nav {
  position: sticky; top: 0; z-index: 29;
  display: flex; gap: 4px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px; overflow-x: auto; scrollbar-width: none;
}
.acp-nav::-webkit-scrollbar { display: none; }
.acp-nav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: var(--radius-control);
  color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600;
}
.acp-nav a:hover { background: var(--surface-sunken); color: var(--text-primary); }
.acp-nav a[aria-current="page"] { background: var(--color-cobalt-050); color: var(--color-cobalt-800); }

.acp-main { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }

/* left sidebar on wider screens */
@media (min-width: 760px) {
  .acp-shell { display: flex; align-items: flex-start; }
  .acp-nav {
    flex: none; width: 208px;
    flex-direction: column; gap: 2px;
    align-self: stretch; min-height: calc(100dvh - 52px);
    border-bottom: 0; border-right: 1px solid var(--border-subtle);
    padding: 16px 12px; overflow: visible;
  }
  .acp-nav a { font-size: 14.5px; padding: 10px 12px; }
  .acp-main { flex: 1; min-width: 0; margin: 0; max-width: 820px; padding: 26px 28px 60px; }
}
.acp-h1 { font-size: 22px; margin-bottom: 16px; }
.acp-h2 { font-size: 15px; margin: 26px 0 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.acp-h3 { font-size: 14px; margin-bottom: 10px; }
.acp-count { color: var(--text-secondary); font-weight: 500; font-size: .78em; }
.acp-listhead { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; }
.acp-listhead h2 { font-size: 15px; }

.acp-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px; margin-bottom: 16px;
}

/* stat tiles + mini bar tables */
.acp-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
@media (min-width: 620px) { .acp-stats { grid-template-columns: repeat(4, 1fr); } }
.acp-stat { background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); padding: 14px; }
.acp-stat__v { font-family: var(--font-display); font-size: 24px; font-weight: 640; letter-spacing: -0.02em; }
.acp-stat__l { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.acp-stat__s { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }

.acp-cols { display: grid; gap: 12px; }
@media (min-width: 640px) { .acp-cols { grid-template-columns: 1fr 1fr; } }
.acp-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acp-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; font-size: 13px; }
.acp-bars__l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.acp-bars__track { grid-column: 1 / -1; height: 5px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.acp-bars__fill { display: block; height: 100%; background: var(--action-secondary); border-radius: var(--radius-pill); }
.acp-bars__v { font-weight: 600; color: var(--text-primary); }

/* inquiries */
.acp-inqs { display: flex; flex-direction: column; gap: 12px; }
.acp-inq { background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 16px; }
.acp-inq__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acp-inq__method { display: inline-flex; align-items: center; gap: 5px; text-transform: capitalize; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle); }
.acp-inq__method--whatsapp { background: var(--color-mint-100); color: #1B5E4C; border-color: #ADD6C9; }
.acp-inq__method--email { background: var(--color-cobalt-050); color: var(--color-cobalt-800); border-color: #C2CEFF; }
.acp-inq__time { color: var(--text-secondary); font-size: 12.5px; }
.acp-inq__offer { font-weight: 650; margin: 8px 0 10px; }
.acp-inq__grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
.acp-inq__grid dt { color: var(--text-secondary); font-weight: 600; }
.acp-inq__grid dd { margin: 0; overflow-wrap: anywhere; }

/* rich offer editor — a contenteditable upgrade of #f-body; [image:KEY] tokens show inline */
.offer-editor {
  width: 100%; font: inherit; font-size: 15px; line-height: 1.55;
  color: var(--text-primary); background: var(--surface-elevated);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
  padding: 11px 12px; min-height: 108px;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.offer-editor.is-empty::before { white-space: pre-wrap; }
.offer-editor:focus { outline: 0; border-color: var(--action-secondary); box-shadow: 0 0 0 3px var(--color-cobalt-050); }
.offer-editor[aria-invalid="true"] { border-color: var(--status-interest); box-shadow: 0 0 0 3px var(--status-interest-surface); }
.offer-editor[aria-busy="true"] { opacity: .7; cursor: progress; }
.offer-editor.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text-secondary); pointer-events: none;
}
.offer-editor__img {
  display: block; max-width: min(100%, 260px); height: auto; max-height: 300px;
  margin: 12px 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
  background: var(--surface-sunken); object-fit: contain;
}
.offer-editor__img::selection, .offer-editor ::selection { background: var(--color-cobalt-050); }
.pastezone__pick { color: var(--link); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
#f-body[aria-busy="true"] { opacity: .7; }

/* ------------------------------------------------- partner posting page --- */
.partner-main { max-width: 680px; }
.partner-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface-info); border: 1px solid #C2CEFF; border-radius: var(--radius-control);
  padding: 12px 14px; margin: 0 0 16px;
  color: var(--color-cobalt-800); font-size: 13px; line-height: 1.5;
}
.partner-note svg { flex: none; margin-top: 1px; }
.partner-main .composer { margin: 0 0 8px; box-shadow: none; }
.partner-rows { display: flex; flex-direction: column; gap: 8px; }
.partner-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control); padding: 12px 14px;
}
.partner-row__main { flex: 1 1 240px; min-width: 0; }
.partner-row__title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.partner-row__meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; }
.partner-row__act { display: flex; gap: 8px; flex: none; }
.partner-pill {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 650; border: 1px solid transparent;
}
.partner-pill--review { background: var(--color-cobalt-050); color: var(--color-cobalt-800); border-color: #C2CEFF; }
.partner-pill--live   { background: var(--color-mint-100); color: #1B5E4C; border-color: #ADD6C9; }
.partner-pill--muted  { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border-subtle); }

/* admin -> Partners section */
.acp-partners { display: flex; flex-direction: column; gap: 8px; }
.acp-partner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control); padding: 12px 14px;
}
.acp-partner.is-disabled { opacity: .6; }
.acp-partner__main { flex: 1 1 240px; min-width: 0; }
.acp-partner__name { font-weight: 650; font-size: 14px; }
.acp-partner__meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.acp-partner form { flex: none; }

footer.site-foot { color: var(--text-secondary); font-size: 12.5px; text-align: center; padding: 28px 16px 8px; }
