/* ShopPilot. One stylesheet, mobile first. Neutral colours, one ink colour for actions, no gradients. */

:root {
  color-scheme: light;
  --ink: #1c1b19;          /* text + main buttons */
  --on-ink: #ffffff;       /* text ON an ink button */
  --ink-soft: #3d3b37;
  --muted: #6f6b64;
  --line: #e4e1da;
  --line-strong: #cfcbc2;
  --page: #f7f6f3;         /* warm off-white, like paper */
  --surface: #ffffff;
  --tint: #efede8;         /* empty photo, chips, code */
  --link: #1d5c8f;
  --ok: #2f6b3a;
  --ok-bg: #e7f0e5;
  --warn: #8a5a12;
  --warn-bg: #f6ecd9;
  --error: #9b2c2c;
  --error-bg: #f7e4e2;
  --ok-line: #cfe0cb;
  --warn-line: #ead6b0;
  --error-line: #ecc9c5;
  --bubble: #dcebf7;       /* the customer's chat bubble on the landing page */
  --like: #c2334d;         /* a liked heart */
  --focus: rgba(29, 92, 143, .15);
  --shadow-photo: 0 0 0 1px var(--line);
  --radius: 10px;
  --font: "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* dark: the device's setting, unless the visitor picked light with the toggle ... */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --ink: #ecebe7;
  --ink-soft: #c9c6bf;
  --on-ink: #161513;
  --muted: #9d998f;
  --line: #2f2d29;
  --line-strong: #45423c;
  --page: #141311;
  --surface: #1d1c19;
  --tint: #292723;
  --link: #8ec1ea;
  --ok: #9fd3a3;
  --ok-bg: #1d2a1e;
  --ok-line: #2f4a31;
  --warn: #e7c07a;
  --warn-bg: #2c2416;
  --warn-line: #4a3c20;
  --error: #f0a3a0;
  --error-bg: #2f1a19;
  --error-line: #533130;
  --bubble: #1e3346;
  --like: #f08a9c;
  --focus: rgba(142, 193, 234, .25);
  --shadow-photo: 0 0 0 1px var(--line);
  }
}
/* ... or picked dark with the toggle (data-theme is set before the page paints: base.html) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ecebe7;
  --ink-soft: #c9c6bf;
  --on-ink: #161513;
  --muted: #9d998f;
  --line: #2f2d29;
  --line-strong: #45423c;
  --page: #141311;
  --surface: #1d1c19;
  --tint: #292723;
  --link: #8ec1ea;
  --ok: #9fd3a3;
  --ok-bg: #1d2a1e;
  --ok-line: #2f4a31;
  --warn: #e7c07a;
  --warn-bg: #2c2416;
  --warn-line: #4a3c20;
  --error: #f0a3a0;
  --error-bg: #2f1a19;
  --error-line: #533130;
  --bubble: #1e3346;
  --like: #f08a9c;
  --focus: rgba(142, 193, 234, .25);
  --shadow-photo: 0 0 0 1px var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
/* hidden always wins, even over a class that sets display (.btn is inline-flex) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { display: block; max-width: 100%; }

a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { background: var(--tint); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 40px; padding-bottom: 40px; }
.narrow { max-width: 440px; }
.narrow-wide { max-width: 720px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 60ch; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink); cursor: pointer; text-decoration: none;
  background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 600; line-height: 1.2;
  padding: 10px 16px; border-radius: 8px;
}
.btn:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--on-ink); }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn-large { padding: 13px 20px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-plain, .btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-plain:hover, .btn-ghost:hover { background: var(--tint); color: var(--ink); border-color: var(--line-strong); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--error); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
form.inline { display: inline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- top bars ---------- */
.topbar, .shopbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .shopbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-weight: 600; }
.topnav, .appnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topnav a, .appnav a { text-decoration: none; color: var(--ink-soft); }
.topnav a:hover, .appnav a:hover { color: var(--ink); }
.topnav .btn { color: var(--on-ink); }
.appnav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink); padding-bottom: 2px; }
/* top and bottom only: the sides keep .container's 16px */
.app .topbar-inner { padding-top: 6px; padding-bottom: 6px; }
.nav-split { width: 1px; height: 18px; background: var(--line-strong); }
/* a phone: the brand on one line, the menu on the next, sliding sideways instead of piling up */
@media (max-width: 719px) {
  .appnav { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 16px; padding-bottom: 6px; scrollbar-width: none; }
  .appnav::-webkit-scrollbar { display: none; }
  .appnav > * { flex: none; white-space: nowrap; }
}
.shopbar { position: sticky; top: 0; z-index: 20; }
.shopbar-name { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; letter-spacing: -.01em; min-width: 0; }
.shopbar-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopbar-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line); }

/* ---------- cards, grids, alerts ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.grid-2, .grid-3 { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .span-2 { grid-column: span 2; }
}
.alert { padding: 11px 14px; border-radius: 8px; margin: 16px 0; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--error-bg); color: var(--error); border-color: var(--error-line); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--line); }
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: var(--tint); color: var(--ink-soft); }
.badge-offer { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-new { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .94rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink-soft); outline: none; box-shadow: 0 0 0 3px var(--focus); }
textarea { resize: vertical; }
.field-error { color: var(--error); font-weight: 500; }
.checks-row { display: flex; gap: 20px; flex-wrap: wrap; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* ---------- the shop location picker (account/_location_fields.html + location.js) ---------- */
.location-picker { display: grid; gap: 10px; }
.location-picker > p { margin: 0; }
.location-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.location-tools input { flex: 1 1 220px; min-width: 0; }
.location-map { height: 320px; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; z-index: 0; }
.check input { width: auto; accent-color: var(--ink); }
details summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; margin: 8px 0; }
details[open] summary { margin-bottom: 12px; }

/* ---------- landing ---------- */
.intro { background: var(--surface); border-bottom: 1px solid var(--line); }
.intro-inner { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 48px; align-items: center; }
@media (min-width: 860px) { .intro-inner { grid-template-columns: 1.2fr 1fr; } }
.chat-sample { background: var(--page); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 10px; }
.bubble { margin: 0; padding: 9px 13px; border-radius: 14px; max-width: 85%; font-size: .95rem; }
.from-customer { justify-self: end; background: var(--bubble); border-bottom-right-radius: 4px; }
.from-shop { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 58px; position: relative; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--ink); font-weight: 700; font-size: .9rem; display: grid; place-items: center;
}
.steps p { margin: 0; color: var(--ink-soft); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.plain-list { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.plain-list li { margin-bottom: 6px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.note p { color: var(--ink-soft); max-width: 60ch; }

/* ---------- shop page: profile ---------- */
.profile { background: var(--surface); border-bottom: 1px solid var(--line); }
.cover-frame { padding-top: 16px; }
.cover {
  aspect-ratio: 12 / 5; width: 100%; overflow: hidden; background: var(--tint);
  border-radius: 10px; box-shadow: var(--shadow-photo);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 720px) { .cover-frame { padding-top: 20px; } .cover { aspect-ratio: 16 / 5; max-height: 300px; border-radius: 14px; } }
/* no cover photo yet: no empty band, the logo sits in the normal flow */
.no-cover .cover { display: none; }
.no-cover .logo { margin-top: 24px; }
.profile-inner { display: grid; gap: 12px; padding-bottom: 24px; }
.logo {
  width: 88px; height: 88px; margin-top: -44px; margin-left: 12px; border-radius: 50%; overflow: hidden; position: relative;
  background: var(--surface); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; color: var(--ink-soft);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.profile-text { min-width: 0; }
.profile-text h1 { font-size: clamp(1.55rem, 3.6vw, 2.1rem); font-weight: 750; letter-spacing: -.025em; line-height: 1.15; margin: 0; }
.profile-meta { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.profile-meta strong { color: var(--ink-soft); font-weight: 600; }
.profile-about { color: var(--ink-soft); margin: 10px 0 0; max-width: 62ch; }
.profile-facts { margin-top: 12px !important; }
.profile-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; color: var(--ink-soft); font-size: .9rem; }
.profile-facts li { background: var(--page); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; }
.profile-action .hint { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
@media (min-width: 860px) {
  /* the name starts BELOW the cover's edge, next to the logo: it never touches the photo */
  .profile-inner { grid-template-columns: auto 1fr auto; align-items: start; column-gap: 22px; }
  .profile-text { padding-top: 18px; }
  .profile-action { padding-top: 22px; }
  .logo { width: 112px; height: 112px; margin-top: -56px; margin-left: 20px; align-self: start; }
  .no-cover .logo { margin-top: 28px; }
  .profile-action { text-align: right; }
}

.offer { margin: 18px 0 0; padding: 11px 14px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); border-radius: 8px; }

/* category chips: scroll sideways on a phone */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 18px; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px; font-size: .92rem; }
.chip span { color: var(--muted); margin-left: 4px; }
.chip:hover { border-color: var(--ink-soft); }

/* ---------- shop page: products + info ---------- */
.shop-body { display: grid; gap: 28px; padding-top: 8px; padding-bottom: 96px; }
@media (min-width: 900px) {
  .shop-body { grid-template-columns: 1fr 300px; align-items: start; padding-bottom: 48px; }
  /* starts level with the first heading next to it (.cat-title's top margin) */
  .about { position: sticky; top: 74px; margin-top: 26px; }
}
.cat-title { margin: 26px 0 12px; font-size: 1.15rem; scroll-margin-top: 70px; }
.products { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.item-photo { position: relative; aspect-ratio: 1; background: var(--tint); display: grid; place-items: center; color: var(--muted); font-size: 2rem; font-weight: 700; }
.item-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* while a photo loads (or if it can't), its alt text stays small and quiet */
  font-size: .8rem; font-weight: 400; color: var(--muted); }
.item-flag { position: absolute; left: 8px; top: 8px; font-size: .75rem; font-weight: 600; background: var(--surface); color: var(--ink-soft); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.item-text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.item-name { font-size: .98rem; font-weight: 600; margin: 0; }
.item-desc { margin: 0; color: var(--muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { margin: auto 0 0; padding-top: 6px; font-weight: 700; font-size: 1.02rem; }
.item-out .item-photo img { opacity: .55; }
.item-out .item-name, .item-out .item-price { color: var(--muted); }

.about { display: grid; gap: 12px; }
.about-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.about-block h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 8px; }
.about-block dl { margin: 0; }
.about-block dt { font-size: .82rem; color: var(--muted); margin-top: 8px; }
.about-block dd { margin: 0; overflow-wrap: anywhere; }

/* the order button stays at the bottom of a phone screen */
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.mobile-cta .btn { flex: 1; min-width: 0; }
@media (min-width: 900px) { .mobile-cta { display: none; } }

/* ---------- dashboard ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-list { list-style: none; padding: 0; margin: 0 0 24px; }
.admin-item { padding: 14px 18px; margin-bottom: 10px; }
.admin-item.is-hidden { background: var(--page); }
.admin-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.price { font-weight: 700; white-space: nowrap; }
.stat { display: grid; gap: 4px; text-decoration: none; color: var(--ink); margin-bottom: 0; }
.stat:hover { border-color: var(--line-strong); color: var(--ink); }
.stat-number { font-size: 1.9rem; font-weight: 800; }
.stat-label { color: var(--ink-soft); }
.share { margin-top: 18px; }
.share-link { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; margin: 0; }
.share-followers { margin: 8px 0 0; color: var(--muted); }
.share-followers strong { color: var(--ink); }

/* ---------- posts (social/_post.html): the feed, the shop page, the owner's list ---------- */
.post-list { display: grid; gap: 12px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; scroll-margin-top: 80px; }
.post-offer { border-left: 3px solid var(--warn); }
.post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.post-shop { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.post-shop img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line); }
.post-who { display: grid; line-height: 1.25; min-width: 0; }
.post-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-who time { color: var(--muted); font-size: .85rem; }
.post-shop:hover strong { text-decoration: underline; text-underline-offset: 2px; }
/* the owner's line breaks stay; the text is escaped, never HTML */
.post-body { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 10px; }
.post-image { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; background: var(--tint); }
.post-image-link { display: block; }
.post-foot { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.post-delete { margin-left: auto; }
.like, .like-count { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font: inherit; font-size: .92rem; }
.like { background: none; border: 0; padding: 4px 8px 4px 0; cursor: pointer; border-radius: 6px; }
.like:hover { color: var(--like); }
.like.is-liked { color: var(--like); font-weight: 600; }
.like.is-liked .icon { fill: currentColor; }
.older { margin-top: 16px; }

/* ---------- feed + following ---------- */
.feed-layout { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .feed-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .feed-side { position: sticky; top: 16px; }
}
.feed-main { max-width: 680px; width: 100%; }
.empty-big { padding: 36px 24px; }
.empty-big h2 { color: var(--ink); }
.empty-big p { margin: 0; }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.shop-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-list-name { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.shop-list-name img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line); }
.shop-list-name > span { display: grid; line-height: 1.25; min-width: 0; }
.shop-list-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-list-name:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.follow-list { list-style: none; margin: 16px 0 0; padding: 0; }
.follow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 10px; }
.follow-row .shop-list-name img { width: 44px; height: 44px; }
.follow-controls { display: flex; align-items: center; gap: 14px; }
.notify-form { display: flex; align-items: center; gap: 8px; }
.notify-form select { width: auto; padding: 6px 10px; font-size: .92rem; transition: box-shadow .3s; }
.notify-form.is-saved select { box-shadow: 0 0 0 3px var(--ok-line); }
.follow-card { text-align: center; }
.follow-card .form { text-align: left; margin-bottom: 12px; }
.follow-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; box-shadow: 0 0 0 1px var(--line); }
.follow-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.center-actions { justify-content: center; }
.follow-back { margin: 16px 0 0; }

/* ---------- the owner's new post ---------- */
.kind-picker { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kind-picker legend { font-weight: 600; font-size: .94rem; margin-bottom: 6px; padding: 0; }
.form .kind-picker label { display: block; font-weight: 500; }
.kind-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-picker span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; background: var(--surface); }
.kind-picker input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.kind-picker input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.counter { font-weight: 400; text-align: right; min-height: 1.2em; }
.list-title { margin-top: 28px; }

/* ---------- shop page: follow, directions, map, posts ---------- */
.profile-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 860px) { .contact-buttons { justify-content: flex-end; } }
.profile-action .contact-buttons + .hint + .profile-buttons { margin-top: 12px; }
@media (min-width: 860px) { .profile-buttons { justify-content: flex-end; } }
.shop-main { min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
/* "Posts 12" on the shop page */
.btn-count { font-size: .8rem; font-weight: 700; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--tint); color: var(--ink-soft); line-height: 20px; text-align: center; }
.shop-map { height: 200px; border-radius: 8px; overflow: hidden; background: var(--tint); margin-bottom: 10px; z-index: 0; box-shadow: 0 0 0 1px var(--line); }
.shop-address { margin: 0 0 10px; color: var(--ink-soft); font-size: .94rem; }
#location .actions { margin-top: 0; }

/* ---------- a person's profile (account/profile.html): the shop page's header, for a person ---------- */
/* no cover photo for people: a quiet dotted band */
.cover-plain {
  aspect-ratio: auto; height: 120px;
  background-color: var(--tint);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 16px 16px;
}
@media (min-width: 720px) { .cover-plain { height: 170px; } }
.avatar { background: var(--ink); color: var(--on-ink); letter-spacing: .02em; user-select: none; }
.person .profile-facts li { overflow-wrap: anywhere; }
.shop-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .shop-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shop-tile {
  display: grid; justify-items: center; gap: 4px; text-align: center; height: 100%;
  padding: 16px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.shop-tile:hover { border-color: var(--line-strong); }
.shop-tile img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); margin-bottom: 4px; }
.shop-tile strong { font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.shop-tile small { font-size: .8rem; }
.form label .optional { font-weight: 400; }
.about-actions { margin-top: 12px; }

/* ---------- photo uploads (account/_photo.html): a person's photo + cover, a shop's logo, cover, products ---------- */
.cover-wrap { position: relative; }
.avatar-wrap { position: relative; width: fit-content; }
/* where the camera sits on the photo */
.photo-spot { position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; }
.photo-spot-cover { top: 12px; right: 12px; }
.photo-spot-avatar { right: -2px; bottom: 4px; }
.photo-spot-product { top: 8px; right: 8px; }
.photo-form { display: flex; align-items: center; gap: 6px; margin: 0; }
/* the label opens the file picker; the input itself stays out of sight */
.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; font-size: .88rem; font-weight: 600; line-height: 1.2;
  background: rgba(20, 19, 17, .62); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.photo-button:hover { background: rgba(20, 19, 17, .8); }
button.photo-button { font: inherit; font-size: .88rem; }
.photo-button-round { width: 34px; height: 34px; padding: 0; }
.photo-button:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.photo-button.is-busy { opacity: .6; cursor: progress; }
.photo-spot-avatar .photo-button { width: 36px; height: 36px; padding: 0; background: var(--ink); color: var(--on-ink); border: 3px solid var(--surface); }
.photo-spot-avatar .photo-button:hover { background: var(--ink-soft); }
.photo-spot-product .photo-button { width: 34px; height: 34px; padding: 0; }
@media (max-width: 559px) {
  /* a phone: the cover's button is just the camera */
  .photo-spot-cover .photo-button { width: 36px; height: 36px; padding: 0; }
  .photo-button-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.photo-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.photo-row:first-of-type { border-top: 0; padding-top: 4px; }
.photo-row-cover { grid-template-columns: minmax(0, 1fr); }
.photo-preview { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--tint); display: grid; place-items: center; text-align: center; padding: 6px; box-shadow: 0 0 0 1px var(--line); }
.photo-preview:has(img) { padding: 0; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-row-cover .photo-preview { width: 100%; height: auto; aspect-ratio: 16 / 5; border-radius: 8px; }
.photo-tools h3 { margin: 0 0 2px; font-size: 1rem; }
.photo-tools p { margin: 0 0 8px; }
.photo-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.photo-upload input[type="file"] { width: auto; flex: 1 1 200px; padding: 6px; font-size: .9rem; }
.photo-note { margin: 12px 0 0; }
/* "Photo sizes: cover 1600 × 500 px · ..." under the header of Profile and My shop */
.photo-sizes { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 18px; padding: 9px 12px; font-size: .86rem; color: var(--ink-soft); background: var(--page); border: 1px solid var(--line); border-radius: 8px; }
.photo-sizes .icon { margin-top: 2px; color: var(--muted); }
.photo-sizes strong { color: var(--ink); font-weight: 600; }
.photo-button-size { font-weight: 400; opacity: .85; }

/* ---------- My shop: the shop page in edit mode (owner/shop.html) ---------- */
.edit-bar { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: .92rem; }
.edit-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.edit-bar-inner > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.edit-bar a:not(.btn) { color: inherit; font-weight: 600; }
.edit-link { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.edit-link .icon, .item-edit .icon { width: 15px; height: 15px; }
.edit-link:hover, .item-edit:hover { text-decoration: underline; }
.inline-edit { margin-top: 10px; max-width: 62ch; }
.inline-edit summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 400; color: var(--ink-soft); margin: 0; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit summary .profile-about { margin: 0; }
.inline-edit[open] summary .edit-link { display: none; }
.inline-edit .form { margin-top: 10px; }
.about-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.about-head h2 { margin-bottom: 8px; }
.item-hidden .item-photo img { opacity: .45; }
.item-flags { position: absolute; left: 8px; top: 8px; display: grid; gap: 4px; justify-items: start; }
.item-flags .item-flag { position: static; }
.item-hidden .item-name { color: var(--muted); }
.item-edit { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: .88rem; font-weight: 600; color: var(--link); text-decoration: none; }
.item-editing { grid-column: 1 / -1; margin: 0; scroll-margin-top: 16px; }
.item-editing h3 { margin: 0; }
.item-editing-more { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.add-tile {
  height: 100%; min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 4px;
  border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-soft); text-decoration: none; font-weight: 600;
}
.add-tile span { font-size: 2rem; line-height: 1; font-weight: 400; }
.add-tile:hover { border-color: var(--ink-soft); color: var(--ink); }
.add-product { margin: 0 0 20px; scroll-margin-top: 16px; }
.add-product h3 { margin: 0; }
.edit-chips { padding-top: 0; margin-bottom: 4px; }
.edit-products .cat-title .muted { font-weight: 400; }
.edit-products .item { scroll-margin-top: 16px; }

/* ---------- the bell (owner/layout.html + bell.js) and its page ---------- */
.bell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.bell:hover { background: var(--tint); }
.bell .icon { width: 20px; height: 20px; }
.appnav a.bell[aria-current="page"] { box-shadow: none; background: var(--tint); padding-bottom: 0; }
.bell-count {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--like); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
/* the bell's list (social/notifications.html): one line per post, a tap opens it */
.notif-card { padding: 6px; display: grid; gap: 2px; }
.notif-group { font-size: 1.02rem; margin: 10px 10px 4px; }
.notif-group:first-child { margin-top: 6px; }
.notification {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; transition: background-color .15s;
}
.notification:hover { background: var(--tint); }
.notification:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.notification.is-unread { background: color-mix(in srgb, var(--link) 9%, var(--surface)); }
.notification.is-unread:hover { background: color-mix(in srgb, var(--link) 15%, var(--surface)); }
.notif-avatar { position: relative; flex: none; width: 56px; height: 56px; }
.notif-avatar img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.notif-kind {
  position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--link); box-shadow: 0 0 0 2px var(--surface);
}
.notif-kind svg { width: 13px; height: 13px; }
.notif-kind-offer { background: #c77a12; }
.notif-kind-new_product { background: #2f8a4a; }
.notif-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notif-line {
  overflow-wrap: anywhere; line-height: 1.35; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.notif-line strong { color: var(--ink); }
.notif-time { font-size: .82rem; color: var(--muted); }
.notification.is-unread .notif-line { color: var(--ink); }
.notification.is-unread .notif-time { color: var(--link); font-weight: 600; }
.notif-thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--tint); }
.notif-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--link); }
@media (max-width: 480px) {
  .notif-avatar, .notif-avatar img { width: 48px; height: 48px; }
  .notif-thumb { width: 52px; height: 52px; }
}

/* one post on its own page (social/post.html) */
.post-page .back-link { display: inline-block; margin-bottom: 12px; }
.post-page .post-image { max-height: none; }
.post-more { margin-top: 14px; }

/* the new post's own photo (owner/posts.html) */
.post-photo { display: grid; gap: 6px; }
.form .post-photo-pick {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 14px; cursor: pointer;
  border: 1px dashed var(--line-strong); border-radius: 8px; font-weight: 600; background: var(--surface);
}
.post-photo-pick:hover { background: var(--tint); }
.post-photo-pick:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.post-photo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.post-photo-preview { display: grid; gap: 6px; justify-items: start; }
.post-photo-preview img { width: 100%; max-width: 360px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--tint); }
.push-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.push-text { flex: 1 1 260px; }
.push-text p { margin: 2px 0 0; }
/* a spinner: on a working button (push.js), and before the text while the browser is checked */
.btn.is-loading { cursor: progress; opacity: .85; }
.btn.is-loading::before, .push-card.is-checking .push-status::before {
  content: ""; display: inline-block; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.push-card.is-checking .push-status { display: flex; align-items: center; gap: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::before, .push-card.is-checking .push-status::before { animation-duration: 2.5s; }
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 18px 0; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ---------- the light / dark switch ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-soft);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-soft); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.bar-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- one product, big (public/_product_dialog.html, public/product.html) ---------- */
.item-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.item:has(.item-link) { transition: box-shadow .15s, transform .15s; }
.item:has(.item-link:hover) { box-shadow: 0 6px 18px rgba(0, 0, 0, .12); transform: translateY(-2px); }
.item-link:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; border-radius: var(--radius); }
.item-photo-open { position: absolute; inset: 0; z-index: 1; cursor: zoom-in; }
.item-photo-open:focus-visible { outline: 2px solid var(--link); outline-offset: -3px; }
.item-photo .item-flags { z-index: 2; pointer-events: none; }

.product-view { display: grid; gap: 20px; }
@media (min-width: 760px) { .product-view { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; } }
.product-view-photo { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--tint); }
.product-view-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-view-text { display: grid; gap: 8px; align-content: start; min-width: 0; }
.product-view-text p { margin: 0; }
.product-view-category { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.product-view-name { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.product-view-price { font-size: 1.5rem; font-weight: 800; }
.product-view-stock { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: .85rem; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.product-view-stock.is-out { background: var(--tint); color: var(--muted); border-color: var(--line); }
.product-view-flag { font-size: .88rem; color: var(--warn); }
.product-view-desc { white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-soft); line-height: 1.6;
  padding-top: 10px; margin-top: 4px !important; border-top: 1px solid var(--line); }
.product-view-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.product-view .hint { font-size: .85rem; color: var(--muted); }
.product-page { margin-top: 12px; }
.more-title { margin-top: 36px; }
.back-link { display: inline-block; }

.product-dialog {
  width: min(920px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.product-dialog::backdrop { background: rgba(10, 10, 10, .6); }
.product-dialog .product-view { padding: 16px; }
@media (min-width: 760px) { .product-dialog .product-view { padding: 24px; } }
.product-dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.product-dialog-close:hover { background: var(--tint); }
.product-dialog[open] { animation: product-in .18s ease-out; }
@keyframes product-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .product-dialog[open] { animation: none; } .item:has(.item-link:hover) { transform: none; } }

/* ---------- who follows the shop (social/_followers_dialog.html, owner/followers.html) ---------- */
.meta-link { color: inherit; text-decoration: none; border-radius: 4px; }
.meta-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.meta-link:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.people-dialog {
  width: min(420px, calc(100% - 32px)); max-height: min(560px, calc(100% - 64px)); padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); flex-direction: column; overflow: hidden;
}
.people-dialog[open] { display: flex; animation: product-in .18s ease-out; }
.people-dialog::backdrop { background: rgba(10, 10, 10, .6); }
.people-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; border-bottom: 1px solid var(--line); }
.people-head h2 { font-size: 1rem; margin: 0; }
.people-head .product-dialog-close { top: 8px; right: 8px; width: 34px; height: 34px; border: 0; }
.people-search { padding: 10px 14px 4px; }
.people-search input { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--tint); color: var(--ink); font: inherit; }
.people-list { list-style: none; margin: 0; padding: 6px 6px; overflow-y: auto; flex: 1; min-height: 60px; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; }
.person-photo { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.person-initials { display: grid; place-items: center; background: var(--tint); color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.person-text { display: grid; min-width: 0; line-height: 1.3; }
.person-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-note { margin: 0; padding: 0 16px 10px; text-align: center; }
.people-note:empty { display: none; }
.people-note.is-loading { display: flex; justify-content: center; align-items: center; gap: 8px; }
.people-note.is-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.people-more { padding: 0 14px 12px; text-align: center; }
.people-more:has([hidden]) { display: none; }
.people-page { padding: 6px; }

/* ---------- the Inbox (owner/inbox.html): the app bar, then the chats beside one chat, like a messenger ---------- */
.inbox { display: grid; gap: 12px 16px; padding-top: 16px; padding-bottom: 20px; }
@media (min-width: 860px) {
  .inbox { grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  .inbox-list, .inbox-chat { min-height: 0; }
}
/* a phone: the apps + the list, or only the open chat */
@media (max-width: 859px) {
  .inbox.has-chat .inbox-list, .inbox.has-chat .inbox-apps { display: none; }
  .inbox:not(.has-chat) .inbox-chat { display: none; }
  .inbox.has-chat .inbox-chat { height: calc(100dvh - 96px); }
}

/* the apps: All · Telegram · Messenger · ... like a second menu */
.inbox-apps { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.inbox-apps::-webkit-scrollbar { display: none; }
.inbox-app {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.inbox-app:hover { border-color: var(--line-strong); }
.inbox-app:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.inbox-app[aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.inbox-app-logo { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--muted); }
.inbox-app-logo svg { width: 16px; height: 16px; }
.inbox-app-all { background: var(--tint); color: var(--ink-soft); }
.inbox-app[aria-current="page"] .inbox-app-all { background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); }
.inbox-app.is-off .inbox-app-logo { filter: grayscale(1); opacity: .55; }
.inbox-app.is-off { color: var(--muted); }
.inbox-app-add { padding: 5px 14px; min-height: 40px; color: var(--muted); border-style: dashed; background: transparent; }
.inbox-app-add span { font-size: 1.15rem; line-height: 1; }
.inbox .card { padding: 0; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 6px; }
.inbox-head h1 { font-size: 1.35rem; margin: 0; }
.badge-wait { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.inbox-tabs { display: flex; gap: 4px; padding: 6px 12px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.inbox-tabs a { flex: none; padding: 5px 11px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.inbox-tabs a:hover { background: var(--tint); }
.inbox-tabs a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.tab-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--like); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; }
.inbox-sort { display: flex; gap: 6px; align-items: center; }
.inbox-sort select { width: auto; padding: 5px 8px; font-size: .84rem; }
.inbox-off { margin: 0; padding: 8px 16px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }
.chat-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.chat-rows { list-style: none; margin: 0; padding: 4px 6px; }
.chat-group { margin: 0; padding: 12px 16px 2px; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.chat-group-wait { color: var(--like); }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.chat-row:hover { background: var(--tint); }
.chat-row.is-active { background: color-mix(in srgb, var(--link) 14%, var(--surface)); }
.chat-row:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.chat-avatar {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tint); color: var(--ink-soft); font-weight: 700; font-size: .92rem; box-shadow: 0 0 0 1px var(--line);
}
.chat-app { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--muted); box-shadow: 0 0 0 2px var(--surface); }
.chat-app svg { width: 12px; height: 12px; }
.chat-app-telegram { background: #229ed9; }
.chat-app-whatsapp { background: #25d366; }
.chat-app-messenger { background: #0866ff; }
.chat-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-top time { flex: none; font-size: .78rem; color: var(--muted); }
.chat-preview { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.is-waiting .chat-preview { color: var(--ink); font-weight: 600; }
.chat-row.is-waiting .chat-top time { color: var(--link); font-weight: 600; }
.chat-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--like); }
.older-chats { margin: 4px 12px 12px; }
.inbox-list .empty { padding: 20px 16px; margin: 0; }

.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-back { font-size: 1.3rem; color: var(--ink); text-decoration: none; padding: 0 4px; }
@media (min-width: 860px) { .chat-back { display: none; } }
.chat-who { flex: 1; min-width: 140px; display: grid; line-height: 1.3; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--tint); color: var(--ink-soft); }
.pill-bot { background: var(--ok-bg); color: var(--ok); }
.pill-you { background: var(--warn-bg); color: var(--warn); }
.handoff-note { margin: 0; padding: 10px 16px; font-size: .9rem; background: var(--warn-bg); color: var(--ink); border-bottom: 1px solid var(--warn-line); }

.messages { list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; background: var(--page); }
.bubble { max-width: min(78%, 560px); padding: 8px 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; }
.bubble time { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.bubble-who { display: block; font-size: .72rem; font-weight: 700; margin-bottom: 1px; opacity: .8; }
.bubble-bot, .bubble-owner { align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.bubble-bot { background: var(--tint); }
.bubble-owner { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.bubble-owner time { color: inherit; opacity: .7; }
.messages-empty { align-self: center; margin: auto; }

.reply-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px 12px; border-top: 1px solid var(--line); }
.reply-box textarea { resize: none; min-height: 42px; max-height: 160px; padding: 10px 12px; border-radius: 20px; line-height: 1.4; }
.reply-box .btn { border-radius: 20px; min-height: 42px; }
.reply-note, .reply-hint { grid-column: 1 / -1; margin: 0; }
.reply-note { color: var(--error); }
.reply-blocked { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.chat-none { margin: auto; padding: 40px 24px; text-align: center; max-width: 360px; }
.chat-none .icon { width: 44px; height: 44px; color: var(--muted); }
.chat-none h2 { margin: 8px 0 4px; }
.inbox-chat > .alert { margin: 16px; }

/* ---------- a connected app about to stop answering (owner/_channel_warnings.html) ---------- */
.channel-warning a { font-weight: 700; margin-left: 4px; }
.token-ends-soon { color: var(--warn); font-weight: 600; }
.inbox-warnings { grid-column: 1 / -1; }
.inbox-warnings .alert { margin: 0 0 6px; }
@media (min-width: 860px) {
  .inbox:has(.inbox-warnings) { grid-template-rows: auto auto minmax(0, 1fr); }
}

/* ---------- "Connect with Facebook" (owner/settings.html, owner/messenger_pick.html) ---------- */
.btn-facebook { display: inline-flex; align-items: center; gap: 8px; background: #0866ff; border-color: #0866ff; color: #fff; }
.btn-facebook:hover { background: #0757d6; border-color: #0757d6; color: #fff; }
.btn-facebook .icon { width: 18px; height: 18px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.token-paste { margin-top: 14px; }
.card > .btn-facebook { margin: 6px 0 12px; }
.page-pick { display: grid; gap: 10px; }
.page-pick .page-choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.page-pick .page-choice:has(input:checked) { border-color: #0866ff; box-shadow: 0 0 0 2px color-mix(in srgb, #0866ff 25%, transparent); }
.page-pick .page-choice input { width: auto; margin: 0; flex: none; }

/* ---------- "Post to social media" (owner/social_compose.html, the product cards, Posts) ---------- */
.item-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.item-actions .icon { width: 14px; height: 14px; }
.btn-ai { background: linear-gradient(135deg, #6d4aff, #0866ff); border-color: transparent; color: #fff; }
.btn-ai:hover { filter: brightness(1.08); color: #fff; }
.btn-ai.is-loading { opacity: .75; cursor: progress; }
.social-cta { margin: 4px 0 18px; }
.social-compose .card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0 0 4px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: .85rem; }
.social-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; justify-content: space-between; }
.social-language { min-width: 160px; }
.social-note { color: var(--error); margin: 0; }
.social-preview { display: grid; gap: 14px; }
@media (min-width: 700px) { .social-preview:has(.social-photo:not([hidden])) { grid-template-columns: 200px minmax(0, 1fr); align-items: start; } }
.social-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-photo); }
.social-where { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 8px; margin: 0; }
.social-where legend { font-weight: 600; padding: 0 4px; }
.social-where .is-off { color: var(--muted); }
.platform { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 700; font-size: .8rem; }
.platform-facebook { background: #0866ff; }
.platform-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.platform-shoppilot { background: var(--ink); color: var(--on-ink); }
.alert-ok a { font-weight: 700; margin-left: 10px; }

