@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Karibu — design tokens. Source of truth: DESIGN.md. */

:root {
  --canvas:  #1B1C1E;
  --surface: #1C1D1F;
  --raised:  #232427;
  --field:   #2B2C2F;
  --hover:   #2B2C2F;
  --ink:     #F2F3F4;
  --ink-2:   #A6A9AF;
  --ink-3:   #6C6F75;
  --line:        rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --radius-window: 14px;
  --radius-bubble: 12px;
  --radius-control: 8px;
  --radius-chip: 6px;

  --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-card: 0 0 0 1px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-composer: 0 1px 2px rgba(0,0,0,0.035);

  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden; /* only the messages area scrolls; page itself never does */
}

a { color: inherit; }

.hidden { display: none !important; }

/* Shared column — every page is a centered 480px column on the canvas */
.app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;        /* fixed to the viewport so header + composer stay put */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
/* Desktop: a real centered-content web page, not a framed phone mock.
   One seamless ground (no side shadow/border), a comfortable reading column
   centered like a standard web app. */
@media (min-width: 481px) {
  body { background: var(--surface); }
  .app {
    max-width: 760px;
    box-shadow: none;
  }
}

/* ---------- motion ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--field);
  border: none;
  border-radius: var(--radius-chip);
  padding: 3px 10px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
}
.chip:hover { background: var(--hover); }
.unclaimed-chip { font-size: 11px; color: var(--ink-3); background: var(--field); }
.mock-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--raised);
  text-transform: lowercase;
}

/* ---------- chat page ---------- */
.chat-header {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.chat-header-meta {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-3);
}

.chat-main {
  flex: 1;
  min-height: 0; /* lets the messages child actually scroll instead of pushing the page */
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header, .composer { flex: none; } /* pinned; only .messages scrolls */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

/* user bubble — right aligned, radius 12px */
.msg-user {
  align-self: flex-end;
  background: var(--field);
  border-radius: var(--radius-bubble);
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 75%;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fade-up 400ms var(--ease);
}

/* assistant — no bubble, plain ink */
.msg-assistant {
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fade-up 400ms var(--ease);
}

.thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 12px;
  padding: 4px 2px;
  animation: fade-up 200ms var(--ease);
}
.thinking .dots { display: inline-flex; gap: 2px; }
.thinking .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s var(--ease) infinite;
}
.thinking .dot:nth-child(2) { animation-delay: 0.15s; }
.thinking .dot:nth-child(3) { animation-delay: 0.3s; }

.welcome { animation: fade-up 400ms var(--ease); }
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* escalation links as chip buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 5px 10px;
  font-size: 12px;
  text-decoration: none;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
  animation: pop-in 180ms var(--ease);
}
.action-btn:hover { background: var(--hover); border-color: var(--line-strong); }

/* composer */
.composer {
  padding: 10px;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.composer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow-composer);
}
.composer-box:focus-within { border-color: var(--line-strong); }
.composer-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px; /* >=16px stops iOS Safari auto-zoom on focus */
}
.composer-box input::placeholder { color: var(--ink-3); }

.send-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-control);
  background: var(--line-strong);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 200ms var(--ease), background 150ms var(--ease), color 150ms var(--ease);
}
.send-btn:not(:disabled) {
  background: var(--ink);
  color: var(--canvas);
  cursor: pointer;
}
.send-btn:not(:disabled):active { transform: scale(0.96); }

/* empty / 404 state */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 24px;
  animation: fade-up 400ms var(--ease);
}
.empty-title { font-size: 15px; font-weight: 600; }
.empty-sub { font-size: 12px; line-height: 1.4; color: var(--ink-3); max-width: 260px; }

/* footer */
.footer {
  padding: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.footer a { color: var(--ink-3); text-decoration: none; }
.footer a:hover { color: var(--ink-2); }

/* ---------- admin page ---------- */
.admin-header {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brand:hover { color: var(--ink-2); }
.admin-title { font-size: 14px; font-weight: 600; }
.admin-sub { font-size: 12px; color: var(--ink-3); }

.admin-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gate {
  margin: auto;
  width: 100%;
  max-width: 320px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-up 400ms var(--ease);
}
.gate-title { font-size: 15px; font-weight: 600; }
.gate-sub { font-size: 12px; color: var(--ink-3); }
.gate-sub b { color: var(--ink); font-weight: 500; }
.gate-error {
  font-size: 12px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 6px 10px;
}
.gate-hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

.panel { padding: 0 14px 20px; animation: fade-up 400ms var(--ease); }

.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-window);
  padding: 14px;
  margin-top: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 10px 0 4px;
}
.field-input {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
}
.field-input::placeholder { color: var(--ink-3); }
.field-input:focus { border-color: var(--line-strong); }
.field-textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
select.field-input { appearance: auto; }

.btn {
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: var(--ink);
  color: var(--canvas);
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover { background: var(--ink-2); border-color: transparent; }
.btn-danger { color: var(--ink-2); }
.btn-sm { padding: 3px 8px; font-size: 11px; }

.save-btn, .gate-btn { margin-top: 4px; width: 100%; }
.form-actions { display: flex; gap: 8px; margin-top: 10px; }
.form-actions .btn { flex: 1; }

.toast {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 10px;
  min-height: 0;
}
.toast.error { color: var(--ink); }

.kgroup { margin-top: 14px; }
.kgroup-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.kitem {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  margin-bottom: 6px;
}
.kitem-title { font-size: 13px; font-weight: 600; }
.kitem-content {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.kitem-empty { color: var(--ink-3); font-size: 12px; }
.kitem-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- landing ---------- */
.landing-header {
  padding: 16px 20px 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand-tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.landing {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.landing h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.landing-sub { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-top: 12px; }
.landing-sub i { color: var(--ink); font-style: normal; }
.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 24px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--radius-control);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: transform 200ms var(--ease), background 150ms var(--ease);
}
.demo-link:hover { background: var(--ink-2); }
.demo-link:active { transform: scale(0.96); }
.bullets { list-style: none; margin-top: 32px; }
.bullet {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.bullet b { color: var(--ink); font-weight: 600; min-width: 150px; }

/* ---------- bio "About" dropdown ---------- */
button.chat-header-title {
  background: none; border: 0; margin: 0; padding: 0;
  width: 100%; text-align: left; color: var(--ink);
  cursor: pointer; font-family: inherit;
}
button.chat-header-title:hover .h-chev { color: var(--ink-2); }
.h-chev { margin-left: auto; color: var(--ink-3); transition: transform 180ms var(--ease); flex: none; }
.chat-header-title[aria-expanded="true"] .h-chev { transform: rotate(180deg); }

.biz-details {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 8px;
  animation: fade-up 240ms var(--ease) both;
}
.bd-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.4; }
.bd-label { color: var(--ink-3); flex: none; width: 62px; }
.bd-value { color: var(--ink-2); }
.bd-link { color: var(--ink); text-decoration: none; }
.bd-link:hover { text-decoration: underline; }
.bd-actions { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.bd-btn {
  font-size: 12.5px; color: var(--ink); text-decoration: none;
  background: var(--field); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 6px 12px;
  transition: background-color 120ms var(--ease);
}
.bd-btn:hover { background: var(--hover); }

/* ---------- photo strip ---------- */
.photo-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.photo-thumb {
  flex: 0 0 auto; width: 108px; height: 76px; padding: 0; border: 0;
  border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--raised);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 200ms var(--ease); }
.photo-thumb:hover img { transform: scale(1.05); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.86);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 160ms var(--ease) both;
}
.lb-img {
  max-width: 92vw; max-height: 84vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  animation: pop-in 180ms var(--ease) both;
}
.lb-nav, .lb-close {
  position: absolute; background: rgba(255,255,255,0.08); color: #fff;
  border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 120ms var(--ease);
}
.lb-nav { width: 44px; height: 44px; top: 50%; transform: translateY(-50%); }
.lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,0.18); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-close { top: 14px; right: 14px; width: 40px; height: 40px; }
.lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- product cards ---------- */
.product-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.product-card {
  flex: 1 1 150px;
  max-width: 170px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-window);
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  color: var(--ink);
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.product-card:hover { background: var(--field); border-color: var(--line-strong); }
.product-card:active { transform: scale(0.98); }

.product-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--raised);
  overflow: hidden;
  flex: none;
}
.product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms var(--ease);
}
.product-card:hover .product-media img { transform: scale(1.05); }
.product-media.product-media-mono {
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-mono {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1;
}
.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  min-width: 0;
}
.product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-desc {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* product detail modal — sibling overlay, reuses .lightbox conventions but
   sits below the photo lightbox (z-index 50) so full-size images open above. */
.product-modal { z-index: 40; }
.pm-panel {
  width: calc(100% - 48px);
  max-width: 420px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-card);
  position: relative;
  animation: pop-in 180ms var(--ease) both;
}
.pm-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--raised);
  border-radius: var(--radius-window) var(--radius-window) 0 0;
  overflow: hidden;
  cursor: zoom-in;
}
.pm-media img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms var(--ease);
}
.pm-close:hover { background: rgba(255, 255, 255, 0.25); }
.pm-body { padding: 16px; display: flex; flex-direction: column; }
.pm-title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.pm-price { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.pm-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.pm-ask {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 200ms var(--ease), background 150ms var(--ease);
}
.pm-ask:active { transform: scale(0.96); }

/* ---------- streaming cursor ---------- */
.thinking.streaming::after {
  content: '▍'; margin-left: 1px; color: var(--ink-3);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- inline product images in chat ---------- */
.chat-img-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chat-img {
  padding: 0; border: 1px solid var(--line); background: var(--raised);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  width: 160px; max-width: 60%; aspect-ratio: 4 / 3;
}
.chat-img img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 200ms var(--ease); }
.chat-img:hover img { transform: scale(1.04); }

/* ---------- markdown in replies ---------- */
.md-body > div { margin: 0; }
.md-body strong { font-weight: 600; color: var(--ink); }
.md-body em { font-style: italic; }
.md-body code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px;
  background: var(--field); padding: 1px 5px; border-radius: 5px; }
.md-body ul { margin: 4px 0; padding-left: 18px; }
.md-body li { margin: 1px 0; }

/* ---------- manage dashboard ---------- */
/* /manage super-admin tool — same dark tokens, wider 900px column, scrolls. */
.manage-body { overflow-y: auto; }

.manage-app {
  width: 100%;
  max-width: 900px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
@media (min-width: 901px) {
  .manage-app { box-shadow: var(--shadow-card); }
}
.manage-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.manage-title { font-size: 16px; font-weight: 600; }
.manage-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.manage-main { flex: 1; padding: 0 18px 40px; }
.manage-gate { max-width: 360px; }

.manage-dash { animation: fade-up 400ms var(--ease); }

/* summary stats */
.manage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.mstat {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-window);
  padding: 14px;
}
.mstat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.mstat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* add-business form */
.manage-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-window);
  padding: 16px;
  margin-top: 16px;
}
.manage-form { margin-top: 6px; }
.m-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 14px;
}
@media (max-width: 600px) {
  .m-grid { grid-template-columns: 1fr; }
}
.m-result { margin-top: 12px; animation: fade-up 200ms var(--ease); }
.m-result .field-label { margin-top: 8px; }
.m-result .field-label:first-child { margin-top: 0; }

/* business list */
.m-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.m-search { max-width: 260px; flex: 1 1 200px; }
.m-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 8px 0 2px;
}
.m-head {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.m-head .m-name { flex: 1 1 220px; min-width: 0; }

.m-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.m-row:hover { background: var(--field); }
.m-empty { padding: 20px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }

.m-name {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.m-name-link { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.m-name-link:hover { text-decoration: underline; }
.m-slug { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

.chip.m-status { font-family: var(--font-mono); font-size: 11px; }
.chip.m-claimed { background: var(--field); color: var(--ink); }
.chip.m-unclaimed { background: var(--field); color: var(--ink-3); }

.m-cell {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 74px;
}
.m-cell-label {
  display: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.m-cell-text { font-size: 12.5px; color: var(--ink-2); }
.m-cell-mono .m-cell-text { font-family: var(--font-mono); font-size: 11px; }
.m-cell-mono .m-cell-label { font-family: var(--font-mono); font-size: 10px; }

.m-owner { flex: none; }

/* owner-link reveal — full width under its row */
.m-owner-box {
  flex-basis: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fade-up 200ms var(--ease);
}
.m-owner-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.m-admin-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}
.m-admin-link:hover { text-decoration: underline; }
.m-token {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 6px 8px;
  word-break: break-all;
  cursor: pointer;
  user-select: all;
  align-self: flex-start;
}
.m-token:hover { border-color: var(--line-strong); }
.m-owner-actions { display: flex; gap: 8px; margin-top: 6px; }

@media (max-width: 600px) {
  .m-head { display: none; }
  .m-cell { flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
  .m-cell-label { display: block; }
}
