/* HeyBuddy marketplace shell: My Gear, Browse, List gear, Messages, Help.
   Loads after /styles.css and reuses its brand tokens (forest, terracotta, Playfair + Source Sans).
   Everything here is scoped to .mk so the homepage is untouched. */

.mk {
  --mk-paper: #FAF7EF;
  --mk-surface: #FFFFFF;
  --mk-sage: #EAF2EC;
  --mk-sage-strong: #D5E6DA;
  --mk-line: #E4DFD2;
  --mk-line-strong: #C9C2AF;
  --mk-ink: #1F2A24;
  --mk-muted: #5A6157;
  --mk-forest: var(--forest, #1B4332);
  --mk-forest-2: var(--forest-light, #2D6A4F);
  --mk-accent: var(--terracotta, #B5411B);
  --mk-accent-2: #993614;
  --mk-amber-bg: #FBF0DA;
  --mk-amber-ink: #6E430A;
  --mk-danger: #A3261B;
  --mk-focus: #E9A23B;
  --mk-radius: 16px;
  --mk-radius-sm: 10px;
  --mk-shadow: 0 1px 2px rgba(31, 42, 36, 0.05), 0 12px 32px -18px rgba(31, 42, 36, 0.28);
  --mk-max: 72rem;
  background: var(--mk-paper);
  color: var(--mk-ink);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The hidden attribute always wins over layout display values below. */
.mk [hidden] { display: none !important; }

.mk :focus-visible {
  outline: 3px solid var(--mk-focus);
  outline-offset: 2px;
}

.mk-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: #fff;
  color: var(--mk-forest);
  padding: 10px 16px;
  border-radius: var(--mk-radius-sm);
  font-weight: 700;
}
.mk-skip:focus { top: 12px; }

/* ---------- Header ---------- */
.mk-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--mk-forest);
  color: #fff;
  box-shadow: 0 2px 18px rgba(8, 28, 21, 0.28);
  isolation: isolate;
}
.mk-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/assets/topo-forest-amber.svg') center / cover no-repeat;
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}
.mk-header-inner {
  max-width: var(--mk-max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px 24px;
}
.mk-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  flex: none;
}
.mk-brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: #fff;
}
.mk-brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.mk-brand-name span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
}
.mk-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mk-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: 0.9688rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mk-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.mk-nav a[aria-current="page"] { background: #fff; color: var(--mk-forest); }
.mk-nav svg { width: 18px; height: 18px; flex: none; }
.mk-nav .mk-nav-help { border: 1.5px solid rgba(255, 255, 255, 0.4); margin-left: 6px; }
.mk-nav .mk-nav-help[aria-current="page"] { border-color: #fff; }

@media (max-width: 820px) {
  .mk-header-inner { flex-wrap: wrap; padding: 8px 16px 0; }
  .mk-brand img { width: 44px; height: 44px; }
  .mk-nav {
    order: 3;
    margin: 0 -16px;
    padding: 4px 12px 10px;
    width: calc(100% + 32px);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mk-nav::-webkit-scrollbar { display: none; }
  .mk-nav a { min-height: 38px; padding: 0 12px; font-size: 0.9375rem; }
  .mk-nav .mk-nav-help { margin-left: 2px; }
}
@media (max-width: 480px) {
  .mk-nav { gap: 2px; padding: 4px 10px 10px; justify-content: space-between; }
  .mk-nav a { padding: 0 10px; font-size: 0.9063rem; }
  .mk-nav svg, .mk-nav-more { display: none; }
}
@media (max-width: 380px) {
  .mk-nav a { padding: 0 7px; font-size: 0.875rem; }
}

/* ---------- Page frame ---------- */
.mk-main {
  flex: 1;
  width: 100%;
  max-width: var(--mk-max);
  margin: 0 auto;
  padding: 32px 16px 72px;
}
@media (min-width: 760px) { .mk-main { padding: 48px 32px 96px; } }

.mk-pagehead { max-width: 46rem; margin-bottom: 28px; }
.mk-pagehead h1 {
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3rem);
  color: var(--mk-forest);
  text-wrap: balance;
}
.mk-pagehead p {
  margin-top: 10px;
  color: var(--mk-muted);
  font-size: 1.0625rem;
  max-width: 62ch;
}

.mk-main a:not(.mk-btn):not(.mk-card-link) {
  color: var(--mk-forest-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.mk-main a:not(.mk-btn):not(.mk-card-link):hover { color: var(--mk-forest); text-decoration-thickness: 2px; }

.mk-notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--mk-radius-sm);
  background: var(--mk-sage);
  color: var(--mk-forest);
  font-weight: 600;
}
.mk-notice:empty { display: none; }

.mk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}
.mk-links[hidden] { display: none; }

/* ---------- Surfaces ---------- */
.mk-card {
  background: var(--mk-surface);
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  box-shadow: var(--mk-shadow);
  padding: 24px;
}
@media (min-width: 760px) { .mk-card { padding: 28px 32px; } }
.mk-card[hidden] { display: none; }
.mk-card h2 {
  font-size: 1.5rem;
  color: var(--mk-ink);
  margin: 0;
  text-wrap: balance;
}
.mk-card-sub {
  margin: 6px 0 20px;
  color: var(--mk-muted);
  font-size: 0.9688rem;
}
.mk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.mk-card-head .mk-card-sub { margin: 4px 0 0; }
.mk-card-head > div { flex: 1 1 260px; }
.mk-stack { display: grid; gap: 24px; align-content: start; }

.mk-callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--mk-radius-sm);
  background: var(--mk-amber-bg);
  color: var(--mk-amber-ink);
}
.mk-callout svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.mk-callout h2, .mk-callout h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: inherit; margin: 0 0 4px; }
.mk-callout p { margin: 0 0 4px; font-size: 0.9688rem; }
.mk-callout a { color: inherit !important; }

/* ---------- Forms ---------- */
.mk-form { display: grid; gap: 18px; }
.mk-grid { display: grid; gap: 18px; }
@media (min-width: 640px) {
  .mk-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-span-all { grid-column: 1 / -1; }
}
.mk-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--mk-ink);
  min-width: 0;
}
.mk-field[hidden] { display: none; }
.mk input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.mk select,
.mk textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  color: var(--mk-ink);
  background: #fff;
  border: 1.5px solid var(--mk-line-strong);
  border-radius: var(--mk-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mk textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.mk select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--mk-muted) 50%), linear-gradient(135deg, var(--mk-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.mk input:not([type="checkbox"]):not([type="radio"]):hover,
.mk select:hover,
.mk textarea:hover { border-color: #ADA48D; }
.mk input:not([type="checkbox"]):not([type="radio"]):focus,
.mk select:focus,
.mk textarea:focus {
  outline: none;
  border-color: var(--mk-forest-2);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.22);
}
.mk input:disabled, .mk select:disabled, .mk textarea:disabled { background: #F3F1EA; color: var(--mk-muted); cursor: not-allowed; }
.mk ::placeholder { color: #767C70; }
.mk-hint { margin: 0; font-size: 0.875rem; font-weight: 400; color: var(--mk-muted); }

.mk-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  font-size: 0.9688rem;
  line-height: 1.45;
  cursor: pointer;
}
.mk-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--mk-forest);
  cursor: pointer;
}
.mk-check[hidden] { display: none; }

.mk-chips { border: 0; padding: 0; margin: 0; min-width: 0; }
.mk-chips legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 8px; padding: 0; }
.mk-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-chip { position: relative; display: inline-flex; cursor: pointer; }
.mk-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.mk-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--mk-line-strong);
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mk-ink);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mk-chip:hover span { border-color: var(--mk-forest-2); }
.mk-chip input:checked + span { background: var(--mk-forest); border-color: var(--mk-forest); color: #fff; }
.mk-chip input:focus-visible + span { outline: 3px solid var(--mk-focus); outline-offset: 2px; }

.mk input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--mk-muted);
  padding: 14px;
  border: 1.5px dashed var(--mk-line-strong);
  border-radius: var(--mk-radius-sm);
  background: var(--mk-paper);
}
.mk input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--mk-forest);
  color: #fff;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--mk-radius-sm);
  background: var(--mk-forest);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.mk-btn:hover { background: var(--mk-forest-2); }
.mk-btn:active { transform: translateY(1px); }
.mk-btn:disabled, .mk-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.mk-btn[hidden] { display: none; }
.mk-btn svg { width: 18px; height: 18px; flex: none; }
.mk-btn--accent { background: var(--mk-accent); }
.mk-btn--accent:hover { background: var(--mk-accent-2); }
.mk-btn--quiet { background: #fff; color: var(--mk-forest); border-color: var(--mk-line-strong); }
.mk-btn--quiet:hover { background: var(--mk-sage); border-color: var(--mk-forest-2); }
.mk-btn--danger { background: #fff; color: var(--mk-danger); border-color: #E2B9B3; }
.mk-btn--danger:hover { background: #FBECEA; border-color: var(--mk-danger); }
.mk-btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.mk-btn--block { width: 100%; }
.mk-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.mk-textbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--mk-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.mk-textbtn:hover { color: var(--mk-ink); }
.mk-textbtn--danger:hover { color: var(--mk-danger); }
.mk-textbtn svg { width: 15px; height: 15px; }
.mk-textbtn[hidden] { display: none; }

/* ---------- Status pills ---------- */
.mk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #EFEEE8;
  color: #4A5045;
  font-style: normal;
  white-space: nowrap;
}
.mk-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mk-pill[data-status="available"], .mk-pill[data-status="completed"], .mk-pill.is-available, .mk-pill.is-completed { background: #E1F0E6; color: #1E5A3B; }
.mk-pill[data-status="reserved"], .mk-pill.is-reserved { background: var(--mk-amber-bg); color: var(--mk-amber-ink); }
.mk-pill[data-status="canceled"], .mk-pill[data-status="withdrawn"], .mk-pill[data-status="expired"], .mk-pill.is-canceled, .mk-pill.is-expired { background: #F4E7E5; color: #8A2A1F; }

/* ---------- Footer ---------- */
.mk-footer {
  background: var(--forest-dark, #081C15);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9375rem;
}
.mk-footer-inner {
  max-width: var(--mk-max);
  margin: 0 auto;
  padding: 36px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
}
.mk-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.mk-footer a { color: rgba(255, 255, 255, 0.86); }
.mk-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.mk-footer p { margin: 0; color: rgba(255, 255, 255, 0.6); }

/* ---------- My Gear: sign in ---------- */
.mk-signin {
  display: grid;
  background: #fff;
  border: 1px solid var(--mk-line);
  border-radius: 22px;
  box-shadow: var(--mk-shadow);
  overflow: hidden;
}
.mk-signin:has(> #signin[hidden]) { display: none; }
@media (min-width: 880px) {
  .mk-signin { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 520px; }
}
.mk-signin form { padding: 32px 24px; display: grid; gap: 18px; align-content: center; }
@media (min-width: 760px) { .mk-signin form { padding: 48px 52px; } }
.mk-signin h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); color: var(--mk-forest); margin: 0; }
.mk-signin-lede { color: var(--mk-muted); font-size: 1.0625rem; margin: -6px 0 0; }
.mk-signin-points { display: grid; gap: 10px; margin: 4px 0 0; padding: 0; }
.mk-signin-points li { display: flex; gap: 10px; align-items: center; font-size: 0.9688rem; }
.mk-signin-points svg { width: 20px; height: 20px; color: var(--mk-forest-2); flex: none; }
.mk-fine { font-size: 0.875rem; color: var(--mk-muted); margin: 0; }
.mk-signin-art { position: relative; margin: 0; min-height: 220px; order: -1; background: var(--mk-forest); }
@media (min-width: 880px) { .mk-signin-art { order: 0; } }
.mk-signin-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mk-signin-art figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 28px 24px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.25;
  background: linear-gradient(to top, rgba(8, 28, 21, 0.82), rgba(8, 28, 21, 0));
  text-wrap: balance;
}

/* ---------- My Gear: signed in ---------- */
.mk-account { display: grid; gap: 24px; }
.mk-account[hidden] { display: none; }
@media (min-width: 980px) {
  .mk-account { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
  .mk-account-side { position: sticky; top: 104px; }
}
.mk-gear-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mk-gear {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--mk-line);
  border-radius: 12px;
  background: #FFFDF8;
}
.mk-gear-badge {
  grid-row: span 3;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--mk-sage);
  color: var(--mk-forest);
}
.mk-gear-badge svg { width: 22px; height: 22px; }
.mk-gear-title { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; color: var(--mk-ink); margin: 0; }
.mk-gear-meta { margin: 0; color: var(--mk-muted); font-size: 0.9375rem; }
.mk-gear-history { margin: 2px 0 0; font-size: 0.875rem; color: var(--mk-forest-2); font-weight: 600; }
.mk-gear-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.mk-empty {
  padding: 28px 20px;
  border: 1.5px dashed var(--mk-line-strong);
  border-radius: 12px;
  text-align: center;
  color: var(--mk-muted);
}
.mk-empty strong { display: block; color: var(--mk-ink); font-size: 1.0625rem; margin-bottom: 4px; }
.mk-signed-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--mk-sage);
  color: var(--mk-forest);
  font-weight: 600;
}
.mk-help-card p { color: var(--mk-muted); font-size: 0.9688rem; margin: 6px 0 14px; }

/* ---------- Browse ---------- */
.mk-filters { display: grid; gap: 16px; }
.mk-filters[hidden] { display: none; }
.mk-filter-row { display: grid; gap: 14px; }
@media (min-width: 720px) { .mk-filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; } }
.mk-more summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--mk-forest-2);
  width: fit-content;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.mk-more summary::-webkit-details-marker { display: none; }
.mk-more summary::after { content: "+"; font-size: 1.25rem; line-height: 1; }
.mk-more[open] summary::after { content: "\2212"; }
.mk-more .mk-filter-row { margin-top: 12px; }
@media (min-width: 720px) { .mk-more .mk-filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.mk-results {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  margin-top: 28px;
}
.mk-listing {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  overflow: hidden;
  box-shadow: var(--mk-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mk-listing:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(31, 42, 36, 0.06), 0 18px 36px -18px rgba(31, 42, 36, 0.36); }
.mk-listing-photo { position: relative; aspect-ratio: 4 / 3; background: var(--mk-sage); margin: 0; }
.mk-listing-photo img { width: 100%; height: 100%; object-fit: cover; }
.mk-price {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--mk-ink);
  font-weight: 800;
  font-size: 0.9375rem;
  box-shadow: 0 2px 8px rgba(8, 28, 21, 0.18);
}
.mk-price[data-free] { background: var(--mk-accent); color: #fff; }
.mk-photo-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(8, 28, 21, 0.72);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}
.mk-listing-body { display: grid; gap: 6px; padding: 16px 18px 18px; flex: 1; align-content: start; }
.mk-listing-tag { font-size: 0.8125rem; font-weight: 700; color: var(--mk-forest-2); margin: 0; }
.mk-listing h2 { font-family: var(--font-body); font-size: 1.125rem; font-weight: 700; color: var(--mk-ink); margin: 0; line-height: 1.3; }
.mk-listing-meta { margin: 0; color: var(--mk-muted); font-size: 0.9375rem; }
.mk-listing-who { margin: 2px 0 0; font-size: 0.875rem; color: var(--mk-muted); display: flex; gap: 6px; align-items: center; }
.mk-listing-who svg { width: 15px; height: 15px; flex: none; }
.mk-listing-foot { padding: 0 18px 16px; display: grid; gap: 4px; }
.mk-more-btn { display: flex; justify-content: center; margin-top: 28px; }

.mk-gate { text-align: center; max-width: 34rem; margin: 8px auto 0; }
.mk-gate[hidden] { display: none; }
.mk-gate h2 { color: var(--mk-forest); }
.mk-gate p { color: var(--mk-muted); margin: 8px 0 20px; }
.mk-gate .mk-actions { justify-content: center; }

/* ---------- List gear ---------- */
.mk-list-layout { display: grid; gap: 24px; }
@media (min-width: 980px) {
  .mk-list-layout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
  .mk-list-side { position: sticky; top: 104px; }
}
.mk-history { padding: 16px 18px; border-radius: 12px; background: var(--mk-sage); }
.mk-history[hidden] { display: none; }
.mk-history h2 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--mk-forest); margin: 0 0 4px; }
.mk-history p { margin: 0 0 6px; font-size: 0.9375rem; }
.mk-history ul { margin: 6px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mk-history li { padding: 2px 10px; border-radius: 999px; background: #fff; font-size: 0.8125rem; font-weight: 600; }
.mk-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 4px 0 8px; }
.mk-photo-grid:empty { display: none; }
.mk-photo { margin: 0; border: 1px solid var(--mk-line); border-radius: 12px; overflow: hidden; background: #fff; }
.mk-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.mk-photo button { width: 100%; border-radius: 0; border: 0; border-top: 1px solid var(--mk-line); }
.mk-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: step; }
.mk-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 0.9688rem; color: var(--mk-muted); }
.mk-steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mk-sage);
  color: var(--mk-forest);
  font-weight: 800;
}
.mk-steps strong { display: block; color: var(--mk-ink); }

/* ---------- Messages ---------- */
.mk-inbox { display: grid; gap: 24px; }
@media (min-width: 900px) { .mk-inbox { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }
.mk-inbox-side { display: grid; gap: 20px; }
.mk-inbox-side h2 { font-size: 1.25rem; margin-bottom: 12px; }
.mk-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mk-list-btn {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--mk-line);
  border-radius: 12px;
  background: #FFFDF8;
  font: inherit;
  color: var(--mk-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.mk-list-btn:hover { border-color: var(--mk-forest-2); background: #fff; }
.mk-list-btn[aria-current="true"] { border-color: var(--mk-forest); background: var(--mk-sage); }
.mk-list-btn strong { font-weight: 700; }
.mk-list-btn span { font-size: 0.875rem; color: var(--mk-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mk-list-empty { color: var(--mk-muted); font-size: 0.9375rem; margin: 0; }
.mk-inbox-main { display: grid; gap: 20px; }
.mk-inbox-placeholder { text-align: center; padding: 56px 24px; }
.mk-inbox-placeholder svg { width: 40px; height: 40px; color: var(--mk-forest-2); margin: 0 auto 12px; }
.mk-inbox-placeholder h2 { font-size: 1.375rem; color: var(--mk-ink); }
.mk-inbox-placeholder p { color: var(--mk-muted); margin: 6px auto 0; max-width: 34ch; }
.mk-inbox-main:has(> #thread:not([hidden])) > .mk-inbox-placeholder,
.mk-inbox-main:has(> #handoff:not([hidden])) > .mk-inbox-placeholder { display: none; }
.mk-thread-info { color: var(--mk-muted); font-size: 0.9375rem; margin: 4px 0 0; }
.mk-safety-row { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--mk-line); }
.mk-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0;
  max-height: min(60vh, 560px);
  overflow-y: auto;
}
.mk-messages:empty::before { content: "No messages yet. Say hello and ask about the gear."; color: var(--mk-muted); font-size: 0.9375rem; text-align: center; padding: 16px 0; }
.mk-bubble {
  max-width: min(78%, 34rem);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #F1EFE7;
  color: var(--mk-ink);
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mk-bubble.is-mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--mk-forest); color: #fff; }
.mk-bubble small { display: block; font-size: 0.75rem; font-weight: 700; opacity: 0.75; margin-bottom: 2px; }
.mk-composer { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--mk-line); }
.mk-composer textarea { min-height: 88px; }
.mk-composer .mk-actions { justify-content: space-between; }
.mk-handoff-state { font-size: 1.0625rem; margin: 6px 0 4px; }
.mk-handoff-note { color: var(--mk-muted); font-size: 0.9375rem; }
.mk-handoff-cancel { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--mk-line); }
.mk-handoff-cancel[hidden] { display: none; }
.mk-handoff-cancel .mk-field { flex: 1 1 220px; }

/* ---------- Help ---------- */
.mk-help-layout { display: grid; gap: 24px; }
@media (min-width: 980px) { .mk-help-layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.mk-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.mk-tips li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 0.9688rem; }
.mk-tips svg { width: 20px; height: 20px; color: var(--mk-forest-2); margin-top: 2px; }
.mk-help-side h2 { font-size: 1.25rem; margin-bottom: 12px; }
.mk-help-side p { color: var(--mk-muted); font-size: 0.9688rem; }
.mk-sent { text-align: center; padding: 40px 24px; }
.mk-sent[hidden] { display: none; }
.mk-sent svg { width: 44px; height: 44px; color: var(--mk-forest-2); margin: 0 auto 12px; }
.mk-sent h2 { color: var(--mk-forest); font-size: 1.75rem; }
.mk-sent p { color: var(--mk-muted); margin: 8px auto 20px; max-width: 40ch; }

/* ---------- Report and block dialog ---------- */
.mk-dialog {
  margin: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--mk-ink);
  box-shadow: 0 24px 64px -16px rgba(8, 28, 21, 0.45);
  overflow: auto;
}
.mk-dialog::backdrop { background: rgba(8, 28, 21, 0.55); backdrop-filter: blur(2px); }
.mk-dialog form { display: grid; gap: 16px; padding: 24px; }
@media (min-width: 640px) { .mk-dialog form { padding: 28px 32px; } }
.mk-dialog h2 { font-size: 1.5rem; margin: 0; color: var(--mk-ink); }
.mk-dialog p { margin: 0; color: var(--mk-muted); font-size: 0.9688rem; }
.mk-dialog fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.mk-dialog legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.mk-reason { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 0.9688rem; }
.mk-reason:hover { background: var(--mk-paper); }
.mk-reason:has(input:checked) { background: var(--mk-sage); }
.mk-reason input { width: 18px; height: 18px; accent-color: var(--mk-forest); flex: none; }
.mk-dialog .mk-actions { justify-content: flex-end; }
.mk-dialog-status { font-weight: 600; color: var(--mk-danger); }
.mk-dialog-status:empty { display: none; }
.mk-dialog-done { color: var(--mk-forest) !important; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .mk *, .mk *::before, .mk *::after { transition: none !important; }
}

#thread, #handoff { scroll-margin-top: 132px; }

/* ---------- Shared helpers ---------- */
.mk-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px !important;
  font-size: 0.8125rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mk-accent) !important;
}
.mk-eyebrow svg { width: 18px; height: 18px; }

/* ---------- Compass ---------- */
.mk-compass { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1000px) {
  .mk-compass { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: 32px; }
  .mk-compass-form { position: sticky; top: 112px; max-height: calc(100vh - 132px); overflow-y: auto; }
}
.mk-compass-form { gap: 20px; }
.mk-compass-form .mk-chip span { min-height: 38px; padding: 0 14px; font-size: 0.9063rem; }
.mk-chips-hint { margin: -4px 0 8px; }
.mk-compass-results { display: grid; gap: 20px; min-width: 0; outline: none; scroll-margin-top: 112px; }
.mk-compass-results .mk-notice { margin: 0; }
#compass-output { display: grid; gap: 20px; }
#compass-output[hidden] { display: none; }

.mk-compass-intro h3 { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; color: var(--mk-forest); margin: 0 0 16px; }
.mk-compass-intro .mk-steps strong { margin-bottom: 2px; }

.mk-compass-top { display: grid; gap: 14px; border-top: 5px solid var(--mk-forest); }
.mk-compass-kicker { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mk-accent); }
.mk-compass-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem);
  line-height: 1.12;
  color: var(--mk-forest);
  text-wrap: balance;
  outline: none;
}
.mk-compass-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--mk-muted); font-size: 0.9375rem; }
.mk-compass-meta li { display: inline-flex; align-items: center; gap: 6px; }
.mk-compass-meta svg { width: 16px; height: 16px; color: var(--mk-forest-2); flex: none; }
.mk-compass-why { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.mk-compass-why li {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: var(--mk-sage);
  color: var(--mk-forest);
  font-size: 0.875rem; font-weight: 600;
}
.mk-compass-why svg { width: 14px; height: 14px; }
.mk-compass-summary { margin: 0; font-size: 1.0625rem; max-width: 62ch; }
.mk-compass-cols { display: grid; gap: 16px; }
@media (min-width: 720px) { .mk-compass-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; } }
.mk-compass-block h4, .mk-compass-know h4, .mk-compass-gear h4, .mk-compass-pass h4 {
  font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--mk-ink); margin: 0 0 8px;
}
.mk-compass-know h4 { color: inherit; }
.mk-compass-bullets { margin: 0; padding-left: 1.15rem; display: grid; gap: 6px; font-size: 0.9688rem; list-style: disc; }
.mk-compass-bullets li { display: list-item; }
.mk-compass-bullets li::marker { color: var(--mk-forest-2); }
.mk-compass-know .mk-compass-bullets { padding-left: 1rem; }
.mk-compass-top .mk-actions { margin-top: 4px; }

.mk-compass-gear h3 { font-size: 1.5rem; margin: 0; }
.mk-compass-gear .mk-card-head { margin-bottom: 8px; }
.mk-compass-gear-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .mk-compass-gear-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.mk-compass-gear-group { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--mk-line); background: #FFFDF8; }
.mk-compass-gear-group.is-used { background: var(--mk-sage); border-color: var(--mk-sage-strong); }
.mk-compass-gear-group.is-new { background: var(--mk-amber-bg); border-color: #EED9B0; }
.mk-compass-gear-group ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.mk-compass-gear-item { display: grid; gap: 2px; font-size: 0.9688rem; }
.mk-compass-gear-label { font-weight: 600; }
.mk-compass-gear-note { color: var(--mk-muted); font-size: 0.875rem; }
.is-new .mk-compass-gear-note { color: var(--mk-amber-ink); }
.mk-compass-gear-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; font-weight: 600; }
.is-have ul { display: flex; flex-wrap: wrap; gap: 6px; }
.is-have .mk-compass-gear-item { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--mk-line); font-size: 0.875rem; }
.is-have .mk-compass-gear-label { font-weight: 600; }
.mk-compass-gear-foot { margin-top: 16px; }
.mk-compass-gear-foot:empty { display: none; }
.mk-compass-pass {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--mk-line);
}
.mk-compass-pass > svg { flex: none; width: 28px; height: 28px; color: var(--mk-accent); margin-top: 2px; }
.mk-compass-pass p { margin: 0 0 12px; color: var(--mk-muted); font-size: 0.9688rem; max-width: 56ch; }
.mk-compass-pass p:last-child { margin-bottom: 0; }

.mk-compass-more h3 { font-family: var(--font-body); font-size: 1.125rem; font-weight: 700; color: var(--mk-ink); margin: 6px 0 12px; }
.mk-compass-alts { display: grid; gap: 16px; }
@media (min-width: 640px) { .mk-compass-alts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mk-compass-alt { display: grid; gap: 10px; align-content: start; padding: 20px; }
@media (min-width: 760px) { .mk-compass-alt { padding: 22px 24px; } }
.mk-compass-alt-name { margin: 0; font-family: var(--font-display); font-size: 1.3125rem; line-height: 1.2; color: var(--mk-forest); }
.mk-compass-alt-summary { margin: 0; color: var(--mk-muted); font-size: 0.9375rem; }
.mk-compass-alt .mk-btn { justify-self: start; margin-top: 4px; }
.mk-compass-share { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.mk-compass-fine { text-align: left; }
