:root {
  --ink: #16181d;
  --muted: #5c636e;
  --line: #dfe3ea;
  --surface: #ffffff;
  --page: #f6f7f9;
  --accent: #14532d;

  /* Shared responsive shell: one token pair every page reads from, so a page that
     needs more room (the composer) overrides --shell-max instead of inventing its
     own container. Gutters scale with viewport instead of jumping at breakpoints.
     80rem is sized so the header's flex row (logo/login flush to the padding edge)
     lands on the same content edges as Home's 72rem hero+"Cách hoạt động" pair at
     wide desktop — the alignment is a shell-width choice, not a per-page offset. */
  --shell-max: 80rem;
  --shell-gutter: clamp(1rem, 3.5vw, 4rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap { max-width: var(--shell-max); margin: 0 auto; padding: 0 var(--shell-gutter); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; }
.brand { font-weight: 700; letter-spacing: 0.04em; text-decoration: none; color: var(--ink); }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav { display: flex; align-items: center; gap: 0.35rem; }
.site-header nav .nav-exchange { white-space: nowrap; }
.nav-badge { display: inline-block; min-width: 1.2rem; padding: 0.08rem 0.35rem; border-radius: 999px; background: var(--mb-gold-500, #AB8B3E); color: #fff; text-align: center; font-size: 0.75rem; font-weight: 700; }
.exchange-pin-reminder { margin: 0 auto; max-width: 72rem; padding: 0.5rem 1rem; background: #fdf8ea; border-bottom: 1px solid #d9b44a; text-align: center; }
.exchange-pin-reminder a { color: inherit; font-weight: 600; text-decoration: none; }
/* The one signed-in header entry: a navy pill with a gold person mark, so it reads as "your account"
   rather than another text link. On /tai-khoan it gains a gold ring (aria-current). */
.site-header nav .nav-account {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.38rem 0.9rem 0.38rem 0.7rem; border-radius: 999px;
  background: var(--mb-navy-800, #12304C); color: #fff; font-size: 0.92rem; font-weight: 600;
}
.site-header nav .nav-account svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--mb-gold-300, #D9C489); stroke-width: 1.8; stroke-linecap: round; }
.site-header nav .nav-account:hover { background: var(--mb-navy-700, #1A4269); color: #fff; }
.site-header nav .nav-account:focus-visible { outline: 2px solid var(--mb-gold-500, #AB8B3E); outline-offset: 2px; }
.site-header nav .nav-account[aria-current="page"] { background: var(--mb-navy-900, #0B2036); box-shadow: 0 0 0 2px var(--mb-gold-400, #C7AC63); }
.site-header nav .nav-account[aria-current="page"] svg { fill: var(--mb-gold-400, #C7AC63); stroke: var(--mb-gold-400, #C7AC63); }

main.wrap { padding-top: 1.5rem; padding-bottom: 3rem; }

.hero h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.lead { color: var(--muted); margin-top: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 1.25rem auto;
  max-width: 48rem;
}
.panel.narrow { max-width: 26rem; }
.panel h1, .panel h2 { margin-top: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

label { display: block; margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }
input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  font: inherit;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: progress; }

.status { min-height: 1.4rem; margin: 0.9rem 0 0; color: var(--muted); }
.status.error { color: #9b1c1c; }

.hidden { display: none; }

table { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; }

code { background: var(--page); padding: 0.1rem 0.3rem; border-radius: 0.2rem; font-size: 0.9em; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 1rem 0; }
/* Footer links were browser-default blue; they follow the footer's muted text like the rest of the chrome. */
.site-footer a { color: inherit; text-underline-offset: 2px; white-space: nowrap; }
.site-footer a:hover { color: var(--ink); }

/* P2 cut: SellOffer publish/manage flow and the two Home listing sections. */

select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.button.secondary, button.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--line);
}

.actions, .owner-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.inline-form { display: inline-block; margin: 0; }
.listing-specs { margin: 1rem 0 0.25rem; padding: 0.25rem 0.9rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; }
.listing-specs legend { padding: 0 0.35rem; font-size: 0.9rem; font-weight: 600; }
.listing-specs .hint { margin: 0.25rem 0 0; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--ink); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--page);
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.badge.status-active { background: #e6f4ea; color: #1e7b34; }
.badge.status-paused { background: #fdf3d8; color: #92700c; }
.badge.status-closed { background: var(--page); color: var(--muted); }
.badge.status-pending { background: #fdf3d8; color: #92700c; }
.badge.status-rejected { background: #fbe9e7; color: #b3261e; }

.price-lg { font-size: 1.4rem; font-weight: 700; margin: 0.2rem 0 1rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.35rem; border: 1px solid var(--line); }
.photo-tile { margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.photo-tile figcaption { font-size: 0.7rem; text-align: center; }

/* Home listing sections. No max-width/padding of its own: .mb-listings already sits inside
   main.wrap, which supplies the shell's max-width and --shell-gutter padding once — repeating
   either here double-applies the gutter and insets the section further than .mb-home, breaking the
   shared left/right edge the two sections must share (PO alignment corrective). */
.mb-listings { margin: 2rem auto 0; }

/* minmax(0, 1fr), not a bare 1fr: a plain fr track keeps its content's min-content width as an
   automatic floor, so a long title can widen the whole grid (and the page) instead of shrinking
   and eliding — the same overflow class .mb-composer's own comment documents elsewhere in this
   codebase. */
.mb-listing-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 720px) { .mb-listing-cols { grid-template-columns: minmax(0, 1fr); } }

.mb-listing-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.6rem; }
.mb-listing-head h2 { margin: 0; font-size: 1.05rem; }
.mb-listing-count { color: var(--muted); font-size: 0.85rem; }
.mb-listing-empty { color: var(--muted); font-size: 0.9rem; }

.mb-listing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }

.mb-listing-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.65rem 0.8rem;
  text-decoration: none;
  color: inherit;
}
a.mb-listing-card:hover { border-color: var(--accent); }
.mb-listing-card.is-summary { cursor: default; }

.mb-listing-thumb { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 0.35rem; flex: none; background: var(--page); }
.mb-listing-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.mb-listing-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-listing-meta { font-size: 0.85rem; color: var(--muted); }
.mb-listing-time { font-size: 0.78rem; color: var(--muted); }
.mb-listing-login { font-size: 0.82rem; color: var(--accent); text-decoration: none; margin-top: 0.2rem; }
.mb-listing-login:hover { text-decoration: underline; }

/* OD-20: read-only quota standing on tài khoản, one line per mode. */
.quota-line { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--muted); }
.quota-bar {
  display: inline-block;
  width: 6rem;
  height: 0.4rem;
  margin: 0 0.4rem;
  vertical-align: middle;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.quota-bar-fill { display: block; height: 100%; background: var(--accent); }
.quota-bar-fill.is-full { background: #9b1c1c; }
.quota-note { display: block; margin-top: 0.15rem; }

/* Owner/status notice after a POST-redirect (TinBan, YeuCau, KetQua). Was referenced but never styled. */
.alert-notice { background: var(--mb-primary-050, #F2F7FD); border: 1px solid var(--mb-primary-100, #E4EFFB); color: var(--ink); border-radius: 0.5rem; padding: 0.65rem 0.9rem; margin: 0 0 1rem; font-size: 0.92rem; }

/* ---------------------------------------------------------------- P3 results (/ket-qua/:id) ---------
   09-ui-screens §6: band chip (never a number), reason with a teal hairline, one card skeleton for both
   directions — a BuyRequest has no photo, so its media slot is the navy block with the budget. */
/* No max-width of its own: main.wrap already equals the header's content box (--shell-max minus
   --shell-gutter), so the page body lands on the same left/right edges as the logo and nav. */
.mb-res { display: flex; flex-direction: column; gap: 1rem; }
.mb-res-back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.mb-res-back:hover { color: var(--ink); }
.mb-res-head h1 { margin: 0; font-size: 1.6rem; }
.mb-res-anchor { margin: 0.25rem 0 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 0.35rem; }
.mb-res-anchor span:first-child { color: var(--ink); font-weight: 600; }

.mb-res-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.85rem 1rem; }
.mb-res-field { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 11rem; min-width: 0; }
.mb-res-field label { margin: 0; font-size: 0.82rem; }
.mb-res-field select, .mb-res-field input { width: 100%; }
.mb-res-filter-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }
.mb-res-count { margin: 0; font-weight: 600; }

.mb-res-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.mb-res-card { background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; display: flex; flex-direction: column; }
.mb-res-card.is-dismissed { opacity: 0.6; }
.mb-res-media { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; object-fit: cover; background: var(--mb-n-100, #EDF1F7); }
.mb-res-media.is-request { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; background: linear-gradient(135deg, var(--mb-navy-800, #12304C), var(--mb-navy-900, #0B2036)); color: var(--mb-gold-300, #D9C489); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; aspect-ratio: 3 / 1; }
.mb-res-media.is-request strong { color: #fff; font-size: 1.25rem; letter-spacing: 0; text-transform: none; }
.mb-res-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.mb-res-body p { margin: 0; }
.mb-res-tags { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.mb-res-band { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; }
.mb-res-band.is-strong { background: #E3F3EC; color: var(--mb-success, #0E7C5A); }
.mb-res-band.is-good { background: var(--mb-primary-100, #E4EFFB); color: var(--mb-primary-700, #0B4E92); }
.mb-res-band.is-possible { background: var(--mb-n-100, #EDF1F7); color: var(--mb-n-600, #4E6178); }
.mb-res-seen { font-size: 0.74rem; color: var(--muted); }
.mb-res-title { margin: 0.1rem 0 0; font-size: 1rem; line-height: 1.35; }
.mb-res-title a { color: var(--ink); text-decoration: none; }
.mb-res-title a:hover { text-decoration: underline; }
.mb-res-price { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.mb-res-over { color: #8A5A00; font-size: 0.82rem; }
.mb-res-meta, .mb-res-time { color: var(--muted); font-size: 0.85rem; }
.mb-res-reason { border-left: 2px solid var(--mb-accent-500, #12B5C9); padding-left: 0.55rem; font-size: 0.88rem; }
.mb-res-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: auto; padding-top: 0.6rem; }
.mb-res-actions form { margin: 0; }
.mb-res-actions .button { flex: 1; text-align: center; }
.mb-res-dismissed-note { color: var(--muted); font-size: 0.85rem; padding: 0.6rem 1rem 0.9rem; margin: 0; }

.mb-res-thin, .mb-res-empty { background: var(--surface); border: 1px dashed var(--mb-n-300, #C3CFE0); border-radius: 0.6rem; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.mb-res-thin p, .mb-res-empty p, .mb-res-empty h2 { margin: 0; }
.mb-res-empty h2 { font-size: 1.1rem; }
.mb-res-empty .button { align-self: flex-start; }
.mb-res-thin-q { font-weight: 600; }
.mb-res-relax { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.mb-res-relax li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.75rem; }
.mb-res-relax form { margin: 0; }
.mb-res-relax small { flex-basis: 100%; color: var(--muted); }
.mb-res-thin-hint, .mb-res-note { color: var(--muted); font-size: 0.85rem; }
.mb-res-note { margin: 0; }

@media (max-width: 30rem) {
  .mb-res-filter-actions { flex: 1 1 100%; }
  .mb-res-filter-actions > * { flex: 1; text-align: center; }
}

/* ---------------------------------------------------------------- Account hub (/tai-khoan) -----------
   One person, both sides: post actions up top, then Tổng quan / Nhu cầu mua / Tin bán / Hồ sơ & bảo mật
   / Thông báo as server-rendered tabs (?muc=); Trao đổi & giao dịch links out to /thuong-luong. */
/* Same rule as .mb-res: fills main.wrap so every page body shares the header's edges. */
.acc { display: flex; flex-direction: column; gap: 1rem; }
.acc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.acc-kicker { margin: 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mb-gold-600, #8C6D28); font-weight: 600; }
.acc-head h1 { margin: 0.1rem 0 0.2rem; font-size: 1.7rem; color: var(--mb-navy-900, #0B2036); }
.acc-sub { margin: 0; color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.acc-post { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.acc-post .button { margin-top: 0; font-weight: 600; }
.acc-post-buy { background: var(--mb-navy-800, #12304C); }
.acc-post-sell { background: var(--mb-gold-gradient, #A9832E); color: #fff; }

.acc-tabs { display: flex; gap: 0.25rem; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.acc-tabs a { flex: none; padding: 0.6rem 0.85rem; font-size: 0.93rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.acc-tabs a:hover { color: var(--ink); }
.acc-tabs a[aria-current="page"] { color: var(--mb-navy-900, #0B2036); border-bottom-color: var(--mb-gold-500, #AB8B3E); font-weight: 600; }
.acc-tabs a:focus-visible { outline: 2px solid var(--mb-gold-500, #AB8B3E); outline-offset: -2px; }
.acc-count { display: inline-block; min-width: 1.4rem; margin-left: 0.2rem; padding: 0 0.35rem; border-radius: 999px; background: var(--mb-n-100, #EDF1F7); font-size: 0.75rem; text-align: center; color: var(--mb-n-600, #4E6178); }

.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 1rem; align-items: start; }
.acc-grid.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acc-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.acc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; padding: 1.1rem 1.2rem; min-width: 0; }
.acc-card h2 { margin: 0 0 0.6rem; font-size: 1.08rem; color: var(--mb-navy-900, #0B2036); }
.acc-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.acc-card-head .button { margin-top: 0; }
.acc-card-head > a:not(.button) { font-size: 0.88rem; color: var(--mb-primary-700, #0B4E92); text-decoration: none; }
.acc-h-gap { margin-top: 1.4rem !important; }
.acc-group { margin: 1.2rem 0 0.4rem; font-size: 0.9rem; color: var(--mb-n-600, #4E6178); }
.acc-empty { margin: 0; color: var(--muted); }
.acc-muted { color: var(--muted); }
.acc-hint { display: block; margin-top: 0.2rem; font-size: 0.84rem; color: var(--muted); }
.acc-rename { margin-top: 0.5rem; }
.acc-rename summary { cursor: pointer; font-weight: 600; color: var(--mb-navy-800, #12304C); }
.acc-rename .status.error { margin: 0.4rem 0 0; }
.acc-ok { color: var(--mb-success, #0E7C5A); font-weight: 600; font-size: 0.88rem; margin-left: 0.4rem; }
.acc-value { overflow-wrap: anywhere; }

.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-item, .acc-todo { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.acc-list > li:first-child { border-top: 0; }
.acc-item .badge, .acc-todo .badge { margin: 0; flex: none; }
.acc-item-main { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.acc-item-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.acc-item-title:hover { text-decoration: underline; }
.acc-item-meta { font-size: 0.85rem; color: var(--muted); }
.acc-item-actions { display: flex; gap: 0.45rem; flex: none; }
.acc-item-cta, .acc-item .inline-form button { margin-top: 0; padding: 0.4rem 0.8rem; font-size: 0.88rem; white-space: nowrap; }
.acc-item-cta.button:not(.secondary) { background: var(--mb-navy-800, #12304C); }
.acc-side { align-self: flex-start; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--mb-primary-100, #E4EFFB); color: var(--mb-primary-700, #0B4E92); }
.acc-todo.is-rejected { box-shadow: inset 3px 0 0 var(--mb-danger, #B3261E); padding-left: 0.75rem; }
.acc-todo.is-expiring, .acc-todo.is-paused { box-shadow: inset 3px 0 0 var(--mb-gold-500, #AB8B3E); padding-left: 0.75rem; }
.acc-note { font-size: 0.85rem; color: var(--mb-danger, #B3261E); }
.acc-this { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #E3F3EC; color: var(--mb-success, #0E7C5A); font-size: 0.72rem; font-weight: 600; vertical-align: middle; }

.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0 0 0.75rem; }
.acc-stats div { background: var(--mb-n-050, #F6F8FB); border-radius: 0.45rem; padding: 0.5rem 0.6rem; }
.acc-stats dt { font-size: 0.76rem; color: var(--muted); }
.acc-stats dd { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--mb-navy-900, #0B2036); }
.acc-quota { margin: 0 0 0.5rem; font-size: 0.88rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.acc-quota progress { width: 7rem; height: 0.45rem; accent-color: var(--mb-navy-700, #1A4269); }
.acc-quota.is-full progress { accent-color: var(--mb-danger, #B3261E); }
.acc-quota .acc-hint { flex-basis: 100%; margin: 0; }
.acc-facts { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.6rem 1rem; margin: 0; }
.acc-facts dt { color: var(--muted); font-size: 0.9rem; }
.acc-facts dd { margin: 0; }
.acc-ended { margin-top: 1rem; }
.acc-group-hint { margin: -0.2rem 0 0.3rem; }
.acc-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.4rem; }
.acc-start a { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 0.55rem; text-decoration: none; color: var(--ink); background: var(--mb-n-050, #F6F8FB); }
.acc-start a:hover { border-color: var(--mb-gold-400, #C7AC63); }
.acc-start strong { color: var(--mb-navy-900, #0B2036); }
.acc-start span { font-size: 0.86rem; color: var(--muted); }
.acc-ended summary { cursor: pointer; font-size: 0.9rem; color: var(--mb-n-600, #4E6178); font-weight: 600; }

/* /dang-tin?mode=sell reuses the hub shell above; only the in-card field rows are its own. */
.sell-form .sf-row { display: grid; gap: 0 1rem; }
.sell-form .sf-row-title { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); }
.sell-form .sf-row-specs { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
.sell-form .hint { margin: 0.35rem 0 0; font-size: 0.84rem; color: var(--muted); }
.sell-form textarea { resize: vertical; }
/* OD-39 §6.3: "Người mua thường hỏi" — each chip adds one line to the description. */
.sell-form .sf-suggest { margin-top: 0.6rem; }
.sell-form .sf-suggest-title { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--mb-navy-800, #12304C); }
.sell-form .sf-suggest-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.sell-form .sf-suggest-chips .mb-chip { min-height: 2.5rem; padding: 0.45rem 0.75rem; font-size: 0.88rem; }
.sell-form .status.error { margin: 0; padding: 0.7rem 1rem; border: 1px solid #f1c4c0; border-radius: 0.5rem; background: #fdf1f0; }
.sell-form .status.error ul { margin: 0; padding-left: 1.1rem; }
.sell-form .sf-submit { width: 100%; margin-top: 1.1rem; padding: 0.7rem 1rem; font-weight: 600; background: var(--mb-navy-800, #12304C); }
.sell-form .sf-submit:hover { background: var(--mb-navy-700, #1A4269); }

/* Listing detail pages (/tin-mua, /tin-ban) on the hub shell: the frame spans the header's edges,
   long prose keeps a readable measure. */
.acc-lead { max-width: 44rem; }
.acc-id > .back-link { display: block; margin-bottom: 0.35rem; }
.acc-head .badge { margin: 0.35rem 0 0; }
.listing-page .price-lg { margin: 0.1rem 0 0; }
.listing-page .moderation-note { margin: 0; }
.listing-page .mb-card { margin: 0; }
/* Card rows in two columns. Every row draws its right and bottom rule; the list is 1px wider/taller
   than the card so .mb-card's overflow:hidden trims the outer ones instead of per-row parity rules. */
.listing-page .mb-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 -1px -1px 0; }
.listing-page .mb-row, .listing-page .mb-row:last-child { border-bottom: 1px solid var(--mb-n-100, #EDF1F7); border-right: 1px solid var(--mb-n-100, #EDF1F7); }
.listing-page .mb-row.is-wide { grid-column: 1 / -1; }
.listing-page .mb-row-button { cursor: default; }
.listing-page .mb-row-button:hover { background: none; }
.listing-page .owner-actions, .listing-page .actions, .listing-page .mb-actions { margin-top: 0; }
.listing-page .owner-actions button, .listing-page .actions .button { margin-top: 0; }
.listing-page .edit-panel { margin-top: 1rem; }
.listing-page .edit-panel summary { cursor: pointer; font-weight: 600; color: var(--mb-navy-800, #12304C); }
.listing-page .hint { margin: 0.35rem 0 0; font-size: 0.84rem; color: var(--muted); }
.listing-page .photo-grid { margin: 0; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.listing-page .facts { grid-template-columns: 11rem minmax(0, 1fr); gap: 0.6rem 1rem; }
.listing-page .facts dd { overflow-wrap: anywhere; }
.listing-page .facts dd > :first-child { margin-top: 0; }
.listing-page .facts dd > :last-child { margin-bottom: 0; }
.listing-safety { margin: 0; padding: 0.8rem 1rem; font-size: 0.9rem; border: 1px dashed var(--line); border-radius: 0.6rem; background: var(--mb-n-050, #F6F8FB); }

@media (max-width: 860px) {
  .acc-grid, .acc-grid.is-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .acc-head h1 { font-size: 1.4rem; }
  .acc-post { width: 100%; }
  .acc-post .button { flex: 1; text-align: center; padding: 0.6rem 0.5rem; font-size: 0.92rem; white-space: nowrap; }
  .acc-card { padding: 0.95rem; }
  .acc-tabs { flex-wrap: wrap; overflow: visible; }
  .acc-start { grid-template-columns: minmax(0, 1fr); }
  .acc-item, .acc-todo { flex-wrap: wrap; }
  .acc-item-main { flex-basis: 100%; }
  .acc-item-actions { width: 100%; }
  .acc-item-actions .button { flex: 1; text-align: center; }
  .acc-facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .acc-facts dd { margin-bottom: 0.6rem; }
  .sell-form .sf-row-title, .sell-form .sf-row-specs { grid-template-columns: minmax(0, 1fr); }
  .listing-page .mb-rows { grid-template-columns: minmax(0, 1fr); }
  .listing-page .facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .listing-page .facts dd { margin-bottom: 0.6rem; }
  .site-header nav .nav-account { padding: 0.35rem 0.75rem 0.35rem 0.6rem; font-size: 0.88rem; }
}

/* OD-37 Sell Intent Card: composer card rows, read-only, with a lasting highlight for changed rows. */
.sf-card { margin-bottom: 1rem; }
.sf-card-row { padding: .6rem 1rem; }
.sf-card .mb-row.is-changed { animation: none; background: var(--mb-gold-100); }
.sf-card-before { color: var(--mb-n-500); font-weight: 400; }
/* OD-37 BOOK card fold ("Thêm chi tiết") and the device group folded for a book listing. */
.mb-row-more { list-style: none; }
.mb-card-more > summary, .sf-specs-fold > summary { cursor: pointer; padding: .7rem 1rem; color: var(--mb-n-600); font-size: .85rem; }
.sf-specs-fold > summary { padding: .5rem 0; }
.sf-specs-fold.is-plain > summary { display: none; } /* Laptop/Phone: the group looks exactly as before. */
/* OD-37 B1: the sell handoff CTA is a link styled as the composer CTA button. */
a.mb-cta { display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; }

/* ---------------------------------------------------------------- Legal pages (_LegalLayout) ----------
   One grid, two axes. Left: the kicker/h1, the rail and the footer all start on main.wrap's content edge,
   i.e. under the logo. Right: the document card ends on the same edge as the header nav. The narrow reading
   width is a cap on the text inside the card (30rem: longest line ≤ 68 characters, 08 §6), not a box floating mid-page.
   Spacing steps: 0.5 / 0.75 / 1 / 1.5 / 2 / 2.5rem only. */
.legal { display: flex; flex-direction: column; gap: 1.5rem; }
.legal-head { display: flex; flex-direction: column; gap: 0.5rem; }
.legal-kicker { margin: 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mb-gold-600, #8C6D28); font-weight: 600; }
.legal-head h1 { margin: 0; font-size: 1.7rem; line-height: 1.25; color: var(--mb-navy-900, #0B2036); }
.legal-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; font-size: 0.875rem; color: var(--muted); }
.legal-meta > div { display: flex; gap: 0.35rem; }
.legal-meta dt::after { content: ":"; }
.legal-meta dd { margin: 0; color: var(--ink); }
.legal-pending, .legal-meta dd.legal-pending { color: var(--muted); font-style: italic; }
.legal-draft { align-self: flex-start; margin: 0; padding: 0.25rem 0.75rem; border: 1px dashed var(--mb-gold-500, #AB8B3E); border-radius: var(--mb-r-sm, 4px); background: var(--mb-gold-100, #F3E9CE); color: var(--mb-gold-800, #5C4718); font-size: 0.8rem; }

.legal-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
/* padding-top = the card's padding and the title shares the h2 line box, so "Tài liệu" sits on the same
   row as the document's first heading. */
.legal-rail { position: sticky; top: 1.5rem; padding-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; font-size: 0.9rem; }
.legal-rail ul, .legal-rail ol { list-style: none; margin: 0; padding: 0; }
.legal-rail-title { margin: 0 0 0.5rem; font-size: 0.78rem; line-height: calc(1.15rem * 1.35); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.legal-rail li a { display: block; padding: 0.375rem 0 0.375rem 0.75rem; border-left: 2px solid var(--line); line-height: 1.4; color: var(--muted); text-decoration: none; }
.legal-rail li a:hover { color: var(--ink); border-left-color: var(--mb-n-300, #C3CFE0); }
.legal-rail li a:focus-visible { outline: 2px solid var(--mb-gold-500, #AB8B3E); outline-offset: 2px; }
.legal-pages a[aria-current="page"] { color: var(--mb-navy-900, #0B2036); font-weight: 600; border-left-color: var(--mb-gold-500, #AB8B3E); }
.legal-toc ol { counter-reset: legal-toc; }
.legal-toc li { counter-increment: legal-toc; }
.legal-toc a::before { content: counter(legal-toc) ". "; }

.legal-doc { min-width: 0; padding: 2rem 2.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; line-height: 1.7; }
.legal-doc > * { max-width: 30rem; margin: 0; } /* 08-design-system §6: prose ≤ 68 characters per line (measured). */
.legal-doc > * + * { margin-top: 1rem; }
.legal-doc > h2 { max-width: none; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 1.15rem; line-height: 1.35; color: var(--mb-navy-900, #0B2036); scroll-margin-top: 1.5rem; }
.legal-doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-doc > h2 + * { margin-top: 0.75rem; }
.legal-doc > h2:target { color: var(--mb-gold-700, #70551D); }
.legal-doc ul { padding-left: 1.25rem; }
.legal-doc li + li { margin-top: 0.5rem; }
.legal-doc a { color: var(--mb-primary-700, #0B4E92); text-underline-offset: 2px; }

@media (max-width: 56rem) {
  .legal-body { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .legal-rail { position: static; padding-top: 0; gap: 1rem; }
  .legal-pages .legal-rail-title { display: none; }
  /* Wraps instead of scrolling, as .acc-tabs does at phone width: all four documents stay visible. */
  .legal-pages ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; border-bottom: 1px solid var(--line); }
  .legal-pages li a { padding: 0.6rem 0; border-left: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
  .legal-pages a[aria-current="page"] { border-bottom-color: var(--mb-gold-500, #AB8B3E); }
  .legal-toc { padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; }
  .legal-doc { padding: 1.25rem; }
  .legal-head h1 { font-size: 1.4rem; }
}
@media (max-width: 35rem) {
  .legal-meta { flex-direction: column; }
}

/* OD-40 §9.6: policy "Hỏi rõ" box (yellow) and the inline field error of a Block. */
.policy-clarify { margin: 0.8rem 0; padding: 0.75rem 0.9rem; border: 1px solid #E8C96A; border-radius: 0.5rem; background: #FFF8E1; color: var(--ink); font-size: 0.92rem; }
.policy-clarify p { margin: 0 0 0.45rem; }
.policy-clarify-confirm { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 500; margin: 0.4rem 0 0.6rem; }
.policy-clarify-confirm input { margin-top: 0.2rem; width: auto; }
.field-error { margin: 0.3rem 0 0; color: #9b1c1c; font-size: 0.86rem; }
