:root {
  color-scheme: light;
  --ink: #302331;
  --muted: #655460;
  --line: #e6d8df;
  --page: #f8f2ee;
  --white: #fff;
  --navy: #331b30;
  --teal: #7f385f;
  --teal-dark: #612844;
  --light-teal: #f5e6ed;
  --seafoam: #f7cb93;
  --shadow: 0 12px 28px #331b3120;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--teal-dark); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: .55rem 0; }
h1, h2, h3 { margin: 0; line-height: 1.16; letter-spacing: -.028em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #ce790b; outline-offset: 3px; }
.skip { position: absolute; top: 6px; left: 8px; z-index: 10; padding: 10px; background: #fff; transform: translateY(-140%); }
.skip:focus { transform: none; }
.wrap { width: min(1184px, calc(100% - 48px)); margin-inline: auto; }

.site-header { background: var(--white); }
.header, .nav, .brand { display: flex; align-items: center; gap: 14px; }
.header { justify-content: space-between; min-height: 65px; padding-block: 9px; }
.brand { text-decoration: none; color: var(--navy); font-weight: 800; gap: 10px; }
.brand-logo { display: block; flex: none; object-fit: contain; }
.nav a { font-size: .88rem; font-weight: 650; text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.menu { box-shadow: inset 0 1px var(--line); }
.main-nav { gap: clamp(13px, 2.7vw, 29px); min-height: 43px; overflow-x: auto; white-space: nowrap; padding-block: 5px; padding-inline: 2px; }
.main-nav a { color: var(--ink); padding: 4px 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: fit-content;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  white-space: nowrap;
}
.button:hover { background: var(--teal-dark); color: #fff; text-decoration: none; }
.button.small { padding: 6px 12px; min-height: 34px; font-size: .84rem; }
.button.accent { background: var(--seafoam); color: #331628; }
.button.accent:hover { background: #ffe7c0; }
.button.secondary { background: #fff; color: var(--teal-dark); border-color: var(--line); }
.button.secondary:hover { background: var(--light-teal); }
.surface { padding: clamp(16px, 3vw, 25px); border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.lookup { box-shadow: var(--shadow); }
.lookup h2 { font-size: 1.4rem; }
.lookup p, .page-head p { color: var(--muted); }
.lookup > a { display: inline-block; margin-top: 13px; font-size: .85rem; font-weight: 650; }
.lookup-form, .filters, .moderate { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.lookup-form label, .filters label { min-width: 160px; flex: 1; }
.lookup-form label:nth-child(2) { flex: 2; }
.lookup-form { margin-top: 12px; }

.section { padding-block: 27px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.section-head a, .meta { color: var(--muted); font-size: .85rem; }
.page-head { margin-bottom: 19px; }
.category-grid, .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.category-card { padding: 16px; color: var(--ink); text-decoration: none; }
.category-card:hover { border-color: var(--teal); background: #fef9fc; text-decoration: none; }
.category-card h3 { display: flex; justify-content: space-between; gap: 8px; }
.category-card span { color: var(--teal); }
.category-card p { margin-bottom: 0; color: var(--muted); font-size: .875rem; }
.tag { margin: 0 0 7px; color: var(--teal-dark); font-size: .76rem; font-weight: 800; }
.summary { color: var(--muted); overflow-wrap: anywhere; font-size: .9rem; }
.empty { margin-top: 10px; color: var(--muted); }
.filters { margin-bottom: 15px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-block: 16px; }

label { display: grid; gap: 5px; font-size: .875rem; font-weight: 680; }
input:not([type=checkbox]), select, textarea {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
  border: 1px solid #c1b1bb;
  border-radius: 8px;
}
textarea { resize: vertical; }
.form-grid { display: grid; gap: 13px; margin-top: 14px; }
.fields-inline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; }
.narrow { max-width: 510px; margin-inline: auto; }
.reading { max-width: 855px; }
.article h1, .page-head h1 { overflow-wrap: anywhere; }
.article-body { margin-block: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.gallery, .edit-images { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block: 14px; }
.gallery a:first-child { grid-column: 1/-1; }
.gallery img, .edit-images img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--light-teal); }
.gallery a:first-child img { max-height: 410px; aspect-ratio: 16/9; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; padding: 12px; background: var(--page); border-radius: 10px; }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.comments { margin-top: 12px; }
.comment { border-bottom: 1px solid var(--line); padding: 9px 0; }
.comment p { overflow-wrap: anywhere; white-space: pre-wrap; }

.notice { margin-block: 12px; padding: 10px 14px; background: var(--light-teal); border-radius: 8px; }
.account-grid, .admin-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.logout { margin-top: 12px; }
.admin-grid { grid-template-columns: 190px minmax(0, 1fr); }
.admin-nav { padding: 8px; display: grid; gap: 3px; }
.admin-nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.admin-nav a[aria-current], .admin-nav a:hover { background: var(--light-teal); color: var(--teal-dark); }
.admin-content > * + * { margin-top: 10px; }
.stat { display: grid; text-decoration: none; }
.stat strong { font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .86rem; }
.admin-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.admin-item h3 { overflow-wrap: anywhere; }
.moderate select { width: auto; max-width: 100%; }
details summary { font-weight: 720; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 7px 12px; border-bottom: 1px solid var(--line); }

@media (max-width: 900px) {
  .category-grid, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 28px); }
  .header { flex-wrap: wrap; gap: 6px 12px; }
  .account-nav { gap: 9px; }
  .main-nav { font-size: .83rem; }
  .category-grid { gap: 8px; }
  .category-card { padding: 12px; }
  .category-card h3 { font-size: .94rem; }
  .fields-inline, .account-grid, .admin-grid { grid-template-columns: 1fr; }
  .admin-nav { display: flex; flex-wrap: wrap; }
  .admin-nav a { font-size: .83rem; }
  .lookup-form label { min-width: 100%; }
  .lookup-form .button { width: 100%; }
  .gallery, .edit-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.menu-toggle { display: none; }
.main-nav a {
  border-radius: 7px;
  padding: 7px 9px;
}
.main-nav a:hover, .main-nav a:focus-visible {
  color: var(--teal-dark);
  background: var(--light-teal);
  text-decoration: none;
}
.main-nav { gap: clamp(4px, 1.15vw, 14px); }

.lookup-status:empty, #lookup-results:empty { display: none; }
.lookup-status { margin-top: 10px; font-size: .85rem; }
#lookup-results { scroll-margin-top: 16px; }
#lookup-results[aria-busy="true"] { opacity: .65; }
.lookup-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.lookup-results-head span, .lookup-zone {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--light-teal);
  color: var(--teal-dark);
  font-size: .79rem;
  font-weight: 700;
}
.lookup-card {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: 16px;
  margin-top: 10px;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.lookup-card-head h4 {
  margin: 4px 0;
  font-size: clamp(1.12rem, 2.3vw, 1.85rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.lookup-zone { display: inline-block; margin-top: 0; }
.lookup-history, .lookup-update, .lookup-annotation {
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.lookup-codes, .lookup-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}
.lookup-codes div, .lookup-specs div {
  min-width: 0;
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--page);
}
.lookup-codes dt, .lookup-specs dt { color: var(--muted); font-size: .76rem; }
.lookup-codes dd, .lookup-specs dd { margin: 0; font-weight: 680; overflow-wrap: anywhere; }





.lookup-empty { margin-top: 16px; padding: 12px; background: var(--page); border-radius: 7px; }





@media (max-width: 720px) {
  .header { min-height: 55px; }
  .brand { flex: 1 0 auto; }
  .account-nav { margin-left: auto; }
  .menu-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 6px 9px;
    background: var(--light-teal);
    color: var(--teal-dark);
    font-weight: 730;
  }
  .menu.menu-collapsed { display: none; }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    white-space: normal;
    padding-block: 8px;
  }
  .main-nav a { background: var(--page); }
  .lookup-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

.language-menu {
  position: relative;
  z-index: 4;
}
.language-menu summary {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: .75rem;
}
.language-menu ul {
  position: absolute;
  right: 0;
  top: 100%;
  width: max-content;
  padding: 4px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: var(--shadow);
  list-style: none;
}
.language-menu a {
  display: block;
  padding: 5px 8px;
  border-radius: 5px;
}
.language-menu a[aria-current], .language-menu a:hover { background: var(--light-teal); }


/* Keep programmatic lookup focus on the result title without outlining the card. */
#lookup-results:focus, [data-lookup-focus]:focus { outline: none; }
.lookup-status:not(:empty) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lookup-card {
  grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(13px, 2vw, 21px);
  border-radius: 14px;
}
.lookup-card-head h4 {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: clamp(1.28rem, 3vw, 2rem);
  letter-spacing: -.028em;
}
.lookup-card-head .lookup-name-label {
  margin: 6px 0 1px;
  color: var(--muted);
  font-size: .76rem;
}
.lookup-codes { margin-top: 12px; }
.lookup-codes div {
  background: var(--light-teal);
  padding: 8px 10px;
}
.lookup-codes dd { color: var(--teal-dark); font-size: 1rem; }
.lookup-specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lookup-specs div {
  padding: 8px 9px;
  display: grid;
  align-content: space-between;
  gap: 4px;
}
.lookup-specs dd { font-size: 1rem; }
.lookup-specs dd.lookup-unknown {
  color: var(--muted);
  font-size: .81rem;
  font-weight: 560;
}
.lookup-metadata { margin: 12px 0 0; }
.lookup-metadata div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 6px 0;
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.lookup-metadata dt { color: var(--muted); }
.lookup-metadata dd { margin: 0; font-weight: 640; }



@media (max-width: 720px) {
  .lookup-card { grid-template-columns: minmax(0, 1fr); }

}
@media (max-width: 380px) {
  .lookup-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.lookup .lookup-form {
  display: grid;
  grid-template-columns: minmax(160px, .75fr) minmax(0, 1.65fr) minmax(112px, auto);
  align-items: end;
  gap: 9px;
  margin-top: 12px;
}
.lookup .lookup-form label {
  min-width: 0;
  gap: 4px;
}
.lookup-form select,
.lookup-form input[type="search"],
.lookup-form .button {
  min-height: 44px;
  width: 100%;
  transition: border-color .17s, box-shadow .17s, background-color .17s;
}
.lookup-form select:hover,
.lookup-form input[type="search"]:hover {
  border-color: var(--teal);
}
.lookup-form select:focus,
.lookup-form input[type="search"]:focus {
  border-color: var(--teal);
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--light-teal);
}
.lookup-form input[type="search"] { background: #fbf8fa; }
.lookup-card { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 620px) {
  .lookup .lookup-form {
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
    gap: 7px;
  }
  .lookup .lookup-mode { grid-column: 1 / -1; }
  .lookup-form .button {
    justify-self: end;
    padding-inline: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lookup-form select, .lookup-form input, .lookup-form .button { transition: none; }
}

:root { --line: #dfcdd7; }
.button {
  border-color: #420f2f;
  box-shadow: 0 2px 0 #2c132235;
}
.button.accent { border-color: #b1809e; }
.button.secondary { border-color: #ab92a1; }
.surface { border-color: var(--line); }
.category-card { border-color: #c2adba; }
.category-card h3 a { color: var(--ink); }
.main-nav a:hover, .main-nav a:focus-visible { box-shadow: inset 0 0 0 1px #c7acbd; }
.category-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.category-card .category-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  background: #ece2e8;
}
.category-card .category-arrow { align-self: start; }
.category-card .category-card-head h3 { display: block; overflow-wrap: anywhere; }
.category-card:hover .category-photo { box-shadow: 0 0 0 1px #a58699; }

@media (max-width: 650px) {
  .category-card-head { gap: 6px; }
  .category-card .category-photo { width: 34px; height: 34px; }
}

.community-feed .section-head { margin-bottom: 17px; }
.community-feed .section-head a {
  padding: 6px 11px;
  border: 1px solid #cfbcc8;
  border-radius: 9px;
  background: #fdfbfc;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: none;
}
.community-feed .section-head a:hover { background: #f0e6ec; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(13px, 2vw, 22px);
}
.post-card {
  --post-tint: #f3e5ee;
  --post-edge: #e1cddd;
  --post-accent: #71395d;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--post-edge);
  border-radius: 18px;
  background: #fffcfa;
  box-shadow: 0 7px 22px #361a2b10;
}
.post-card:is([data-category="nha-hang"], [data-category="ca-phe"]) {
  --post-tint: #fbefdd;
  --post-edge: #e5d4bb;
  --post-accent: #75471f;
}
.post-card[data-category="spa-massage"] {
  --post-tint: #f2eaf6;
  --post-edge: #dfcee8;
  --post-accent: #684477;
}
.post-card[data-category="thong-bao"] {
  --post-tint: #f3eaf1;
  --post-edge: #e7d6e3;
  --post-accent: #64405d;
}
.post-card .cover {
  overflow: hidden;
  aspect-ratio: 2.3 / 1;
  background: var(--post-tint);
}
.post-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card .post-cover-category {
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--post-edge);
  background:
    radial-gradient(ellipse at 50% 120%, #ffffffa3 0 36%, transparent 37%),
    linear-gradient(125deg, #ffffff80, transparent 72%), var(--post-tint);
}
.post-card .post-cover-category img {
  width: auto;
  height: min(84%, 128px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  box-shadow: 0 5px 14px #37273125;
}
.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: clamp(13px, 1.6vw, 19px);
}
.post-card-body :is(h3,p) { margin: 0; }
.post-card .tag {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--post-tint);
  color: var(--post-accent);
  overflow-wrap: anywhere;
  font-size: .72rem;
  line-height: 1.35;
}
.post-card h3 {
  font-size: clamp(1.04rem, 1.5vw, 1.28rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { position: absolute; inset: 0; content: ""; }
.post-card:focus-within { outline: 2px solid var(--post-accent); outline-offset: 3px; }
.post-card h3 a > span, .post-card .summary, .listing-card-details p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card h3 a > span, .post-card .summary { -webkit-line-clamp: 3; }
.post-card .summary { line-height: 1.48; }
.listing-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  align-self: stretch;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--post-edge);
}
.listing-card-details p {
  -webkit-line-clamp: 2;
  color: var(--post-accent);
  overflow-wrap: anywhere;
  font-size: .8rem;
  font-weight: 720;
}
.listing-card-details strong, .listing-card-details .meta { display: block; font-size: .76rem; }
.post-card-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--post-edge);
  border-radius: 50%;
  background: var(--post-tint);
  color: var(--post-accent);
}
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-card {
    display: grid;
    grid-template-columns: clamp(76px, 25vw, 125px) minmax(0, 1fr);
    border-radius: 14px;
  }
  .post-card .cover { aspect-ratio: auto; }
  .post-card .post-cover-category { border: 0; border-inline-end: 1px solid var(--post-edge); }
  .post-card .post-cover-category img { width: 74%; height: auto; border-radius: 10px; }
  .post-card-body { gap: 6px; padding: 11px 12px; }
  .post-card .summary { -webkit-line-clamp: 2; font-size: .8rem; }
  .listing-card-meta { padding-top: 6px; }
  .listing-card-details p { -webkit-line-clamp: 1; }
}
.listing-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.listing-stars { color: #99570b; font-size: 1.12rem; line-height: 1.1; white-space: nowrap; }
.listing-stars span { color: #91898e; }
.listing-detail { max-width: 1020px; }
.listing-article { border-top: 4px solid var(--teal); }
.listing-article h1 { font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1.12; margin-bottom: 10px; }
.listing-article h2, .listing-review h2 { font-size: 1.13rem; }
.listing-review-link { display: inline-block; margin-bottom: 10px; }
.listing-contacts, .listing-about { border-top: 1px solid #e6dee3; padding-top: 14px; margin-top: 16px; }
.listing-about .article-body { margin-top: 9px; }
.listing-link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.listing-link { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; }
.listing-link.zalo { color: #084faa; }
.listing-link.whatsapp { color: #1a6748; }
.listing-map { width: 100%; min-height: 300px; border: 1px solid #dfd0d9; border-radius: 11px; margin-top: 12px; }
.listing-review { margin-top: 12px; scroll-margin-top: 18px; }
.rating-fieldset, .listing-links-edit { min-width: 0; border: 1px solid #d7c8d1; border-radius: 10px; padding: 10px 12px; }
.rating-fieldset legend, .listing-links-edit legend { padding: 0 6px; font-weight: 750; }
.rating-picker { display: flex; flex-wrap: wrap; gap: 3px; }
.rating-picker label { position: relative; display: grid; place-items: center; min-width: 44px; min-height: 44px; font-size: 1.6rem; cursor: pointer; color: #91898e; }
.rating-picker input, .rating-sr { position: absolute; width: 1px !important; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); }
.rating-picker label:has(input:checked), .rating-picker label:has(~ label input:checked) { color: #99570b; }
.rating-picker label:has(input:focus-visible) { outline: 2px solid var(--teal); border-radius: 7px; }
.listing-links-edit { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; }
.listing-links-edit p { grid-column: 1/-1; margin: 0; }
@media (max-width: 560px) {
  .listing-links-edit { grid-template-columns: 1fr; }
  .listing-map { min-height: 245px; }
}

/* Public pages, listing details and interactive states. */
:root {
  --accent-line: #c4a4b8;
  --accent-border: #d7c2cf;
  --accent-soft: #f7eff4;
  --warm-line: #e5c694;
  --warm-soft: #fff7e8;
  --warm-ink: #744417;
}
body {
  background:
    radial-gradient(ellipse 58rem 37rem at 100% 16rem, #f5e5cf 0%, transparent 75%),
    radial-gradient(ellipse 70rem 45rem at 0 29rem, #f1dfe9 0%, transparent 82%),
    linear-gradient(160deg, #fffaf5 0%, #faf1f1 55%, #fbf6ed 100%);
}
.site-header { box-shadow: 0 3px 12px #331b300a; }
.menu { background: #fff9f6; }
.main-nav a { border-radius: 10px; }
.brand:hover { color: var(--teal); }

.surface { border-color: var(--accent-border); }
.lookup { border-top: 3px solid #79335e; }
.lookup-card { border-color: var(--accent-border); background: #fff; }
.lookup-codes > div { border: 1px solid var(--accent-border); }
.notice { border: 1px solid var(--accent-border); border-inline-start: 4px solid var(--teal); }
.admin-nav a[aria-current] { box-shadow: inset 3px 0 #7e3361; font-weight: 750; }
.section-head h2, .lookup h2 { color: var(--teal-dark); }

.button {
  border-color: #662a48;
  border-radius: 11px;
  background: linear-gradient(155deg,#914670 0%,#612844 85%);
  box-shadow: 0 2px 0 #3b0b2944, 0 4px 9px #39182c18;
  transition: transform .16s ease, box-shadow .18s ease, background-color .18s ease;
}
.button.accent {
  background: linear-gradient(145deg,#ffe8c3,#f2bf7f);
  border-color: #d8a466;
  color: #482738;
}
.button.secondary {
  border-color: #bea3b4;
  background: #fefcfd;
  color: var(--teal-dark);
  box-shadow: 0 2px 0 #401c3224;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #401c3230;
}
.button:disabled { opacity: .6; cursor: not-allowed; }

.category-card {
  --category-tint: #f7eef3;
  --category-edge: #b089a1;
  --category-ink: #592043;
  border-color: var(--accent-border);
  border-top: 3px solid var(--category-edge);
  background: linear-gradient(155deg,var(--category-tint),#fff 65%);
  box-shadow: 0 3px 9px #331b300c;
}
.category-card:nth-child(4n+2) {
  --category-tint: #fff5e8;
  --category-edge: #d7a467;
  --category-ink: #835020;
}
.category-card:nth-child(4n+3) {
  --category-tint: #f7edf3;
  --category-edge: #cfadc3;
  --category-ink: #7c4665;
}
.category-card:nth-child(4n+4) {
  --category-tint: #f6f0fa;
  --category-edge: #bc9dcd;
  --category-ink: #754e88;
}
.category-card-head .category-arrow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--category-edge);
  border-radius: 50%;
  color: var(--category-ink);
  background: #fff;
}

.listing-article {
  padding: clamp(15px, 2.6vw, 27px);
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  box-shadow: 0 14px 34px #39172c11;
}
.listing-head {
  padding: clamp(15px, 3vw, 30px);
  border: 1px solid var(--accent-border);
  border-inline-start: 4px solid #843465;
  border-radius: 14px;
  background: linear-gradient(130deg,#f3e8ef 0%,#fbf8fa 72%);
}
.listing-head .tag {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid #d5bdcc;
  border-radius: 999px;
  background: #fef9fc;
  color: #4e1137;
}
.listing-head h1 {
  max-width: 860px;
  margin: 7px 0 14px;
  font-size: clamp(1.65rem, 4vw, 3.05rem);
  letter-spacing: -.04em;
  text-wrap: balance;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .listing-head h1 {
    background-image: linear-gradient(120deg,#371c35,#4d1236);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .listing-head h1 { background: transparent; color: CanvasText; }
}
.listing-head-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; align-items: center; }
.listing-head-meta .meta { margin: 0; }
.listing-review-link {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--warm-line);
  border-radius: 11px;
  background: var(--warm-soft);
  color: var(--warm-ink);
  text-decoration: none;
}
.listing-review-link .meta { color: #704b2a; }
.listing-review-link:hover { border-color: #ad7536; background: #ffedcc; }
.listing-stars { color: #915117; }

.listing-quick { display: grid; gap: 12px; margin-block: 16px; }
.listing-quick:has(.facts):has(.listing-contacts):not(:has(.listing-map)) {
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
}
.listing-quick :is(.facts,.listing-contacts), .listing-about {
  min-width: 0;
  margin: 0;
  padding: clamp(13px, 2vw, 18px);
  border: 1px solid var(--accent-border);
  border-radius: 13px;
}
.listing-quick .facts { align-items: center; gap: 12px; background: var(--accent-soft); }
.listing-quick .facts dt { color: #592c48; font-weight: 700; }
.listing-quick .facts dd { font-weight: 750; }
.listing-quick .listing-contacts {
  border-color: #e3cce1;
  background: #faf4fa;
}
.listing-contacts h2 { margin-bottom: 9px; color: #643560; }
.listing-link-row { gap: 9px; }
.listing-link { min-height: 44px; }
.listing-link.website, .listing-link.map_url { color: #653261; border-color: #c29ebf; }
.listing-link.zalo { border-color: #8eb4dd; }
.listing-link.whatsapp { border-color: #94c1a4; }
.listing-link span { transition: transform .17s ease; }
.listing-about { margin-block: 16px; background: #fff; }
.listing-about h2 { color: var(--teal-dark); }
.listing-about .article-body { margin-bottom: 0; line-height: 1.7; }
.listing-review { border-color: var(--warm-line); background: linear-gradient(#fff9ee,#fff 100%); }
.listing-detail .comments { border-color: var(--accent-border); }
.listing-detail :is(.listing-review,.comments) h2 { margin-bottom: 9px; }
.rating-picker label { border-radius: 9px; transition: color .15s ease, background-color .15s ease; }
.rating-picker label:hover { color: #915117; background: var(--warm-soft); }

@media (hover: hover) {
  .button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 13px #39182c33;
  }
  .button.secondary:hover { border-color: #824f6f; background: #f4eaf0; }
  .button.accent:hover { background: linear-gradient(145deg,#fff0d5,#f6cb95); }
  .button:active:not(:disabled) { transform: translateY(1px); }
  :is(.category-card,.post-card) { transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease; }
  .category-card:hover { border-color: var(--category-edge); background: linear-gradient(155deg,var(--category-tint),#fff 82%); }
  :is(.category-card,.post-card):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px #3a1a2e1e;
  }
  .post-card:hover { border-color: var(--post-accent); }
  .post-card:hover h3 a { color: var(--post-accent); }
  .post-card:hover .post-card-arrow { background: var(--post-accent); color: #fff; }
  .listing-link:hover span { transform: translate(2px,-2px); }
}
@media (max-width: 640px) {
  .listing-detail { width: calc(100% - 24px); }
  .listing-quick:has(.facts):has(.listing-contacts):not(:has(.listing-map)) { grid-template-columns: minmax(0,1fr); }
  .listing-article { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.button,.category-card,.post-card,.rating-picker label,.listing-link span) {
    transition: none;
  }
  :is(.button,.category-card,.post-card):is(:hover,:active), .listing-link:hover span { transform: none; }
}

.action-arrow {
  display: inline-block;
  position: relative;
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  color: inherit;
}
.action-arrow::before, .action-arrow::after { content: ""; position: absolute; }
.action-arrow::before {
  inset: 1px 1px auto auto;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}
.action-arrow::after {
  inset: 5px 1px auto auto;
  width: 9px;
  height: 1.5px;
  transform: rotate(-45deg);
  background: currentColor;
}
.lookup > a { display: inline-flex; align-items: center; gap: 6px; }
.category-card .action-arrow { color: var(--category-ink); }

.post-editor { max-width: 920px; }
.editor-heading { padding-bottom: 12px; border-bottom: 1px solid var(--accent-border,var(--line)); }
.editor-heading h1 { font-size: clamp(1.6rem,4vw,2.8rem); }
.editor-heading p { color: var(--muted); }
.editor-main-fields { display: grid; grid-template-columns: minmax(160px,1fr) minmax(0,2fr); gap: 12px; }
.editor-draft, .editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-draft button, .editor-actions a { white-space: normal; }
.post-editor [data-editor-status] { margin: 0; }
.post-editor .editor-error { color: #9c3526; }
.editor-upload, .editor-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid #c9b1c0;
  border-radius: 12px;
  background: #f9f3f7;
}
.editor-upload legend { padding: 0 5px; font-weight: 750; }
.editor-upload-select { max-width: 560px; }
.editor-upload-select input { background: white; }
.editor-upload.editor-dragover { outline: 2px dashed var(--teal); outline-offset: -5px; }
.editor-photos { display: grid; grid-template-columns: repeat(auto-fill,minmax(112px,1fr)); gap: 10px; }
.editor-photos:not(:empty) { margin-top: 12px; }
.editor-photo {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 7px;
  border: 1px solid #dac7d3;
  border-radius: 9px;
  background: #fff;
}
.editor-photo canvas { width: 100%; height: auto; border-radius: 5px; }
.editor-photo span { max-width: 100%; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-preview { background: #fdfbfc; }
.editor-preview summary { color: var(--teal-dark); font-weight: 750; }
.editor-preview h2 { margin-top: 8px; overflow-wrap: anywhere; }
.editor-preview p:empty, .editor-preview div:empty { display: none; }
.admin-post-tools { justify-content: flex-end; }
.admin-post-tools a { color: #fff; }
.admin-post-row { align-items: center; }
.admin-post-row > div { min-width: 0; }
.post-state {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  background: #f3eff3;
  color: #5a4659;
  font-weight: 700;
}
.post-state[data-status="published"] { background: #e4f5ea; color: #185840; }
.post-state[data-status="pending"] { background: #fff3da; color: #704915; }
.post-state[data-status="rejected"] { background: #fbe9e5; color: #8f392b; }
@media (max-width: 620px) {
  .editor-main-fields { grid-template-columns: 1fr; }
}
.post-editor [hidden] { display: none !important; }
.editor-import { background: #fdf3fc; border-color: #dfc0dc; }
.editor-import .form-grid { margin-bottom: 3px; }
.editor-import [data-import-status] { margin: 0; }
.editor-import-result { border-top: 1px solid #e1c8df; padding-top: 12px; }
.editor-import-result .article-body { max-height: 16rem; overflow-y: auto; }

.admin-banner-image { width: min(300px,100%); border-radius: 9px; border: 1px solid var(--line); }
.banner-timing { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 14px; }
.banner-timing label { max-width: 230px; }
.lookup-prompts { display: flex; flex-wrap: wrap; gap: 5px 7px; }
.lookup-prompts[hidden] { display: none; }
.lookup-prompts button {
  padding: 4px 9px;
  border: 1px solid #d3becb;
  border-radius: 999px;
  background: #fbf9fa;
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 650;
}
.lookup-prompts button:hover { background: #f3e9ef; }
#lookup-results { text-align: start; }
.lookup-status.is-loading:not(:empty) {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: auto;
  clip-path: none;
  color: var(--teal-dark);
}
.lookup-status.is-loading::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-border);
  border-top-color: var(--teal-dark);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .lookup-status.is-loading::before { animation: lookup-spin .7s linear infinite; }
  .lookup-results-reveal > * { animation: lookup-reveal .24s ease-out both; }
}
@keyframes lookup-spin { to { transform: rotate(360deg); } }
@keyframes lookup-reveal {
  from { opacity: 0; transform: translateY(5px); }
}
.lookup-conversation {
  width: min(100%,720px);
  margin: 12px auto;
  display: grid;
  gap: 8px;
}
.lookup .lookup-question {
  justify-self: end;
  max-width: 92%;
  margin: 0;
  padding: 6px 11px;
  border-radius: 13px 13px 4px 13px;
  background: var(--teal-dark);
  color: #fff;
  overflow-wrap: anywhere;
  font-size: .9rem;
}
.lookup-answer {
  min-width: 0;
  padding: clamp(8px,2.5vw,14px);
  border: 1px solid var(--accent-border);
  border-radius: 4px 14px 14px 14px;
  background: #f9f3f7;
}
.lookup-answer > h3 { color: var(--teal-dark); font-size: .96rem; }
.lookup-knowledge-card {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbcbd5;
  border-radius: 10px;
  background: #fff;
  overflow-wrap: anywhere;
}
.lookup-knowledge-card h4 { margin: 0; }
.lookup-knowledge-card dl { margin: 6px 0 0; }
.lookup-knowledge-card dl div + div { margin-top: 6px; }
.lookup-knowledge-card dt { color: var(--muted); font-size: .79rem; }
.lookup-knowledge-card dd { margin: 0; }
.lookup-answer-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.lookup-answer-links .button { white-space: normal; }

.main-nav a[aria-current="page"] { color: var(--teal); box-shadow: inset 0 -2px var(--teal); }
body:has(.chat-page) {
  height: var(--chat-visible-height,100dvh);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1b1420;
}
body:has(.chat-page) .site-header { flex: none; }
body:has(.chat-page) .site-footer { display: none; }
.chat-page {
  --chat-bg: #221826;
  --chat-panel: #2e2131;
  --chat-line: #524052;
  --chat-ink: #fcf2f7;
  --chat-muted: #c7b1c3;
  --chat-accent: #f5cc99;
  width: min(1700px,calc(100% - 24px));
  max-width: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-block: 8px;
  margin-block: 0;
  color: var(--chat-ink);
  color-scheme: dark;
}
.chat-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--chat-line);
  border-radius: 12px;
  background: var(--chat-bg);
}
.chat-panel [hidden] { display: none; }
.chat-panel-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--chat-line);
  background: linear-gradient(108deg,#391e2f,#26273c);
}
.chat-panel-head h1 { color: var(--chat-ink); font-size: clamp(1.15rem,3vw,1.55rem); letter-spacing: -.025em; }
.chat-panel-head p { color: #dcc6d4; margin: 2px 0 0; font-size: .8rem; }
.chat-page .button.secondary {
  color: var(--chat-accent);
  background: #3b2a3a;
  border-color: #765b74;
}
.chat-page .button.secondary:hover { background: #543c52; color: #fff; }
.chat-page a:not(.button) { color: var(--chat-accent); }
.chat-page :is(button,a,input,textarea,summary):focus-visible { outline-color: var(--chat-accent); }
.chat-gate { max-width: 460px; width: 100%; margin: auto; padding: clamp(17px,4vw,31px); overflow: auto; }
.chat-gate h2 { color: var(--chat-ink); margin-bottom: 15px; }
.chat-join-form { margin-bottom: 14px; }
.chat-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0,1fr) clamp(205px,22vw,296px);
  grid-template-rows: minmax(0,1fr) auto;
  grid-template-areas: "stream people" "composer people";
}
.chat-stream { grid-area: stream; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-stream-head {
  flex: none; min-height: 37px; display: flex; justify-content: space-between; align-items: center; gap: 7px;
  padding: 4px 13px; border-bottom: 1px solid var(--chat-line); background: #382736;
}
.chat-stream h2 { min-width: 0; margin: 0; color: var(--chat-ink); font-size: .94rem; overflow-wrap: anywhere; }
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 9px clamp(8px,1.6vw,19px);
  scrollbar-gutter: stable;
  background: radial-gradient(ellipse at 0% 100%,#372536,transparent 58%),var(--chat-bg);
}
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px solid #ffffff0a;
}
.chat-message:hover { background: #ffffff08; }
.chat-message.is-own, .chat-message.chat-role-admin { background: #ffffff06; }
.chat-message-content { min-width: 0; flex: 1; }
.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  align-items: baseline;
  margin: 0;
  font-size: .78rem;
  color: var(--chat-muted);
  overflow-wrap: anywhere;
}
.chat-message-meta strong { color: #f3cfec; }
.chat-message.is-own .chat-message-meta strong { color: #e6bfd7; }
.chat-message.chat-role-admin .chat-message-meta strong, .chat-role-admin a:not(.button) { color: #d9c9ff; }
.chat-message-meta time { margin-inline-start: auto; font-size: .72rem; }
.chat-bubble { padding: 0; margin: 1px 0 0; color: var(--chat-ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.chat-empty, .chat-older { margin: 8px 0; text-align: center; color: var(--chat-muted); }
.chat-avatar {
  display: grid; place-items: center; flex: 0 0 26px; height: 26px;
  border-radius: 7px; background: #58374b; color: #ffebfb; font-size: .74rem; font-weight: 800;
}
.chat-role-admin .chat-avatar { background: #6953a6; color: #fff; }
.chat-badge {
  display: inline-block; padding: 0 5px; border-radius: 4px; background: #523a50;
  color: #f1e0ef; font-size: .64rem; font-weight: 750; vertical-align: 1px;
}
.chat-role-admin .chat-badge { background: #51416f; color: #eadfff; }
.chat-role-moderator .chat-badge { background: #643860; color: #f7dbf5; }
.chat-name-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.chat-roster {
  grid-area: people;
  min-width: 0;
  min-height: 0;
  border-inline-start: 1px solid var(--chat-line);
  background: var(--chat-panel);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.chat-roster summary {
  display: block;
  padding: 8px 10px;
  min-height: 37px;
  border-bottom: 1px solid var(--chat-line);
  background: #382736;
  font-size: .87rem;
}
.chat-roster summary::-webkit-details-marker { display: none; }
.chat-online-count { float: right; color: var(--chat-accent); font-size: .75rem; }
.chat-tabs {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--chat-line);
  background: #372736;
}
.chat-tabs button {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--chat-muted);
  font-size: .79rem;
  font-weight: 700;
}
.chat-tabs button:hover { background: #4a3348; color: #fff; }
.chat-tabs button[aria-selected="true"] { color: var(--chat-accent); border-bottom-color: #ba749f; }
.chat-sidebar-content { padding: 4px 5px; }
.chat-people, .chat-threads { list-style: none; padding: 0; margin: 0; }
.chat-person { display: flex; gap: 7px; align-items: center; padding: 5px 4px; overflow-wrap: anywhere; }
.chat-person + .chat-person { border-top: 1px solid #ffffff0c; }
.chat-person > div { min-width: 0; }
.chat-person strong { font-size: .82rem; }
.chat-presence { display: block; color: var(--chat-muted); font-size: .67rem; }
.chat-presence::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-inline-end: 5px;
  border-radius: 50%; background: #b49fb2;
}
.chat-presence[data-online="1"] { color: #b0efc9; }
.chat-presence[data-online="1"]::before { background: #66d796; }
.chat-inbox .chat-empty { margin: 4px 6px; text-align: start; font-size: .78rem; }
.chat-threads a {
  display: flex; justify-content: space-between; gap: 4px;
  border-radius: 6px; padding: 6px 7px; overflow-wrap: anywhere; font-size: .85rem;
}
.chat-threads a:hover, .chat-threads a[aria-current] { background: #553c53; }
.chat-unread { padding: 0 5px; border-radius: 9px; background: #9f5683; color: #260a1b; font-size: .7rem; }
.chat-composer {
  grid-area: composer;
  min-width: 0;
  padding: 5px 9px 8px;
  border-top: 1px solid var(--chat-line);
  background: var(--chat-panel);
}
.chat-composer form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; align-items: end; }
.chat-composer-tools { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.chat-shortcut { color: var(--chat-muted); font-size: .71rem; }
.chat-tool {
  padding: 2px 6px; border: 1px solid #735971; border-radius: 5px;
  background: #473245; color: var(--chat-ink); font-size: .72rem;
}
.chat-tool:hover { background: #5d415a; }
.chat-emoji { position: relative; }
.chat-emoji-picker {
  position: absolute; bottom: calc(100% + 5px); inset-inline-start: 0; z-index: 2;
  display: grid; grid-template-columns: repeat(6,30px); gap: 3px;
  padding: 5px; border: 1px solid #7b5d78; border-radius: 8px; background: #432c41;
  box-shadow: 0 5px 18px #0006;
}
.chat-emoji-picker button { padding: 0; min-height: 28px; border: 0; border-radius: 5px; background: transparent; font-size: 1rem; }
.chat-emoji-picker button:hover { background: #694d66; }
.chat-page :is(input,textarea) {
  background: #281a26;
  color: var(--chat-ink);
  border-color: #785a75;
}
.chat-composer textarea { min-height: 44px; max-height: 30dvh; font-size: 1rem; padding: 7px 9px; }
.chat-composer textarea::placeholder { color: var(--chat-muted); }
.chat-page .chat-send { min-width: 79px; min-height: 40px; background: #db8fbe; border-color: #db8fbe; color: #260c1c; }
.chat-page .chat-send:hover { background: #f8d6b1; }
.chat-composer button:disabled { opacity: .65; }
.chat-status:empty { display: none; }
.chat-status { margin: 4px 0 0; color: #ffd4a2; font-size: .82rem; }
.chat-note, .chat-history-return { flex: none; margin: 5px 0 0; color: var(--chat-muted); font-size: .77rem; }
.chat-history-return { padding: 0 12px 8px; }
.chat-admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chat-admin-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-permission label { min-width: 155px; }
.chat-admin-guests { margin-bottom: 10px; }
.chat-admin-guests summary { font-weight: 750; cursor: pointer; }
.chat-admin-guest { justify-content: space-between; padding-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .chat-message.is-new { animation: chat-message-in .22s ease-out; }
}
@keyframes chat-message-in { from { opacity: 0; transform: translateY(4px); } }
@media (max-width:760px) {
  .chat-page { width: calc(100% - 10px); padding-block: 4px; }
  .chat-panel-head p, .chat-page > .chat-note, .chat-shortcut { display: none; }
  .chat-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; grid-template-areas: "people" "stream" "composer"; }
  .chat-roster { max-height: min(30dvh,235px); border-inline-start: 0; border-bottom: 1px solid var(--chat-line); }
  .chat-roster summary { cursor: pointer; }
  .chat-roster summary::before { content: "▸"; display: inline-block; margin-inline-end: 5px; color: var(--chat-accent); }
  .chat-roster[open] summary::before { transform: rotate(90deg); }
  .chat-composer { padding-bottom: max(5px,env(safe-area-inset-bottom)); }
}

.chat-quote, .chat-reply-draft {
  margin: 2px 0 3px;
  padding: 4px 8px;
  border-inline-start: 2px solid #c284aa;
  border-radius: 4px;
  background: #463144;
  color: var(--chat-muted);
  font-size: .78rem;
}
.chat-quote { width: fit-content; max-width: 100%; }
.chat-quote strong, .chat-reply-draft strong { color: var(--chat-accent); }
.chat-quote span, .chat-reply-draft p { display: block; margin: 0; overflow-wrap: anywhere; }
.chat-reply-draft { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-reply-draft div { min-width: 0; }
.chat-reply-draft button { flex-shrink: 0; }
.chat-log-delete { margin-bottom: 10px; }
.chat-log-delete summary { cursor: pointer; font-weight: 750; }
.chat-log-delete form { margin-top: 7px; align-items: center; justify-content: space-between; }
.chat-log-select { display: inline-flex; gap: 5px; align-items: center; margin-bottom: 5px; }
.chat-log-delete .button.danger { background: #9c2c38; border-color: #9c2c38; color: #fff; }
.chat-log-delete .button.danger:hover { background: #78212a; }

/* Homepage and public masthead */
.header-with-lookup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2.4vw, 34px);
  min-height: 84px;
  padding-block: 12px;
}
.header-with-lookup .brand { min-width: 0; overflow-wrap: anywhere; }
.masthead-search {
  display: flex;
  min-width: 0;
  width: min(100%, 520px);
  justify-self: center;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid #d9c2d0;
  border-radius: 12px;
  background: #fcf7fa;
}
.masthead-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px #f0e2ea;
}
.masthead-keyword { flex: 1; min-width: 0; }
.masthead-search input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  outline-offset: -3px;
  font-size: 1rem;
}
.masthead-search .button {
  min-height: 38px;
  padding: 5px 13px;
  border-radius: 8px;
  gap: 8px;
  font-size: .87rem;
  box-shadow: none;
}
.masthead-search-icon {
  display: inline-block;
  position: relative;
  width: 12px;
  height: 12px;
  margin-inline-end: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.masthead-search-icon::after {
  position: absolute;
  width: 6px;
  height: 2px;
  inset: 8px auto auto 7px;
  background: currentColor;
  transform: rotate(45deg);
  content: "";
}
.site-header .menu { background: #f5ebf1; }
.site-header .main-nav a[aria-current="page"] {
  background: #fff9fc;
  box-shadow: inset 0 -2px #aa688e;
}
.portal-home { padding-top: clamp(17px, 3vw, 34px); }
.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e3cfd9;
  border-radius: 23px;
  background: linear-gradient(125deg, #fffdf9 5%, #fbf0f1 68%, #f5e7ef);
  box-shadow: 0 14px 38px #59294512;
}
.portal-hero .hero-inner {
  align-self: center;
  padding: clamp(25px, 3vw, 40px) clamp(24px, 3.6vw, 52px);
}
.portal-hero h1 {
  color: var(--navy);
  font-size: clamp(1.75rem, 3.35vw, 3rem);
  line-height: 1.09;
  letter-spacing: -.044em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.portal-hero .hero-place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #7e4729;
  font-size: .71rem;
  font-weight: 820;
  letter-spacing: .14em;
}
.portal-hero .hero-place::before {
  width: 19px;
  height: 2px;
  background: #b47044;
  content: "";
}
.portal-hero .hero-intro {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: clamp(.94rem, 1.4vw, 1.1rem);
  overflow-wrap: anywhere;
}
.portal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-actions .button { white-space: normal; }
.portal-visual {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 280px;
  margin: 9px;
  overflow: hidden;
  border-radius: 15px;
  background: #331b30;
}
.portal-visual .hero-stage { position: relative; height: 100%; }
.portal-visual :is(.portal-photo, .hero-ads, .hero-ad) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.portal-visual .portal-photo { object-fit: cover; object-position: 61% center; }
.portal-visual .hero-ads { pointer-events: none; }
.portal-visual .hero-ad { display: grid; place-items: center; pointer-events: auto; }
.portal-visual .hero-ad img { width: 100%; height: 100%; object-fit: contain; }
.portal-visual [hidden] { display: none !important; }
.portal-visual .hero-controls {
  position: absolute;
  inset: auto 8px 8px auto;
  width: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  color: #fff;
  background: #281529e8;
}
.portal-visual .hero-controls .button {
  min-width: 32px;
  min-height: 32px;
  padding: 2px 7px;
  color: #fff;
  border-color: #97758c;
  background: transparent;
  box-shadow: none;
}
.portal-visual .hero-controls .button:hover { background: #693a55; }
.portal-visual .hero-controls span { min-width: 34px; text-align: center; font-size: .72rem; }
.portal-lookup { margin-top: 15px; }
.portal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
  border: 1px solid #e2cfd9;
  border-radius: 13px;
  background: #fffcfa;
  text-align: start;
  box-shadow: none;
}
.portal-tools h2 { color: var(--teal-dark); font-size: .92rem; }
.portal-tools > a { margin: 0 0 0 auto; }
.portal-tools :is(#lookup-results,.lookup-status) { flex: 0 0 100%; min-width: 0; }
.portal-news {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(250px, 1fr);
  gap: clamp(15px, 2.5vw, 28px);
  align-items: start;
  margin-top: clamp(24px, 3.6vw, 42px);
}
.portal-news-single { grid-template-columns: minmax(0, 1fr); }
.portal-news .community-feed { min-width: 0; padding: 0; }
.portal-news .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-latest { padding: 18px; background: #fffaf8; }
.portal-latest h2 {
  padding-bottom: 11px;
  border-bottom: 2px solid #d8abbf;
  color: var(--teal-dark);
  font-size: clamp(1.04rem, 1.8vw, 1.35rem);
}
.portal-latest ul { margin: 0; padding: 0; list-style: none; }
.portal-latest li + li { border-top: 1px solid #eddee5; }
.portal-latest li a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-block: 10px;
  color: var(--ink);
  text-decoration: none;
}
.portal-latest li a:hover strong { color: var(--teal); text-decoration: underline; }
.portal-latest li img {
  width: 62px;
  height: 62px;
  border-radius: 9px;
  object-fit: cover;
}
.portal-latest li strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: .88rem;
  line-height: 1.32;
}
.portal-latest li small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
@media (max-width: 1020px) {
  .header-with-lookup { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .header-with-lookup .masthead-search {
    grid-area: 2 / 1 / auto / -1;
    justify-self: stretch;
    width: 100%;
  }
  .header-with-lookup .account-nav { grid-column: 2; grid-row: 1; }
}
@media (max-width: 820px) {
  .portal-news { grid-template-columns: minmax(0, 1fr); }
  .portal-latest ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 16px; }
  .portal-latest li + li { border-top: 0; }
  .portal-latest li { border-bottom: 1px solid #eddee5; }
}
@media (max-width: 720px) {
  .header-with-lookup { grid-template-columns: minmax(0, 1fr) auto; }
  .header-with-lookup .menu-toggle { grid-column: 2; grid-row: 1; }
  .header-with-lookup .account-nav { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; margin: 0; }
  .header-with-lookup .brand-logo { width: 36px; height: 36px; }
  .portal-hero { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
  .portal-hero .hero-inner { padding: 19px 16px 11px; }
  .portal-hero .hero-intro { margin: 10px 0 13px; }
  .portal-visual { min-height: 0; aspect-ratio: 2 / 1; margin: 8px; border-radius: 10px; }
  .portal-tools > a { margin-left: 0; }
}
@media (max-width: 600px) {
  .portal-news .post-grid, .portal-latest ul { grid-template-columns: minmax(0, 1fr); }
}

/* Grouped navigation and two-tier site footer */
.site-header .main-nav {
  overflow: visible;
  flex-wrap: wrap;
  gap: 5px clamp(5px, 1vw, 12px);
  padding-block: 6px;
}
.nav-group { position: relative; min-width: 0; }
.site-header .main-nav > a,
.nav-group > summary {
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
  line-height: 1.3;
}
.nav-group > summary {
  gap: 8px;
  list-style: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  content: "";
}
.nav-group[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.site-header .main-nav > a:is(:hover,:focus-visible,[aria-current]),
.nav-group > summary:is(:hover,:focus-visible),
.nav-group:is([open],[data-current]) > summary {
  border-color: #c99eb7;
  background: #fffafd;
  color: var(--teal-dark);
  text-shadow: 0 .3px currentColor;
  box-shadow: inset 0 -2px #c18ba9;
}
.nav-dropdown {
  position: absolute;
  z-index: 9;
  inset: calc(100% + 4px) auto auto 0;
  display: grid;
  width: max-content;
  min-width: 185px;
  max-width: min(285px, 80vw);
  gap: 3px;
  padding: 6px;
  border: 1px solid #d7b9ca;
  border-radius: 12px;
  background: #fffafc;
  box-shadow: 0 10px 24px #43223a25;
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 5px 8px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nav-dropdown a img { flex: none; border-radius: 5px; object-fit: cover; }
.nav-dropdown .nav-group-all { color: var(--teal-dark); border-bottom: 1px solid #eedde6; }

.site-footer {
  margin-top: 27px;
  border-top: 3px solid #be855a;
  background: #30202e;
  color: #f7edf3;
}
.footer-main {
  display: grid;
  grid-template-columns: minmax(205px, .9fr) minmax(0, 1.35fr) minmax(205px, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding-block: clamp(24px, 3.2vw, 40px);
}
.footer-brand { display: flex; gap: 11px; align-items: center; font-weight: 830; line-height: 1.3; text-decoration: none; }
.footer-brand img { flex: none; padding: 4px; border-radius: 11px; background: #fff8f0; }
.footer-brand small { display: block; margin-top: 4px; color: #f4d19f; font-size: .66rem; letter-spacing: .08em; }
.site-footer a { color: #fff3f9; }
.site-footer a:hover { color: #f5ce9a; text-decoration: underline; }
.footer-intro { max-width: 52ch; margin: 0; color: #eadce6; font-size: .91rem; }
.footer-contact {
  display: grid;
  justify-items: start;
  gap: 4px;
  font-style: normal;
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.footer-contact a { font-weight: 710; text-decoration-color: #ab849f; }
.footer-bar { border-top: 1px solid #8b5a77; background: #542b47; }
.footer-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-block: 13px;
  font-size: .8rem;
}
.footer-bar-inner p { margin: 0; }
.footer-bar-inner nav { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.footer-bar-inner nav a { padding-block: 3px; text-decoration: none; }
@media (prefers-reduced-motion: no-preference) {
  .site-header .main-nav > a, .nav-group > summary {
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  .nav-group[open] > .nav-dropdown { animation: nav-reveal .16s ease-out both; }
  @keyframes nav-reveal { from { opacity: .35; transform: translateY(-3px); } }
}
@media (max-width: 850px) {
  .footer-main { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .footer-contact { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .site-header .main-nav { align-items: start; }
  .nav-group[open] { grid-column: 1 / -1; }
  .nav-dropdown {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    margin-top: 4px;
    box-shadow: none;
  }
  .site-footer { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
}
@media (max-width: 525px) {
  .footer-main { grid-template-columns: minmax(0,1fr); }
  .footer-bar-inner { align-items: start; padding-block: 12px; }
}

/* Compact property results */
.lookup-results-head {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 12px;
  margin: 10px 0 10px;
}
.lookup-results-head h3 { font-size: 1.04rem; }
.lookup-results-head span { margin-inline-start: auto; white-space: nowrap; }
.lookup .lookup-result-term {
  max-width: 100%;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .77rem;
  overflow-wrap: anywhere;
}
.lookup-results-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 10px;
}
.lookup-card {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0,1fr);
  gap: 9px;
  margin: 0;
  padding: clamp(11px,1.5vw,16px);
  border: 1px solid var(--accent-border);
  border-top: 3px solid #b985a2;
  border-radius: 13px;
  background: #fffefd;
  box-shadow: 0 4px 12px #4525380b;
  overflow-wrap: anywhere;
}
.lookup-card:focus-within { border-color: #9c6484; }
.lookup-card-head h4 {
  margin: 0;
  line-height: 1.2;
  font-size: clamp(1.05rem,1.5vw,1.36rem);
}
.lookup .lookup-place {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 0 0 5px;
  font-size: .73rem;
  font-weight: 650;
}
.lookup-zone { padding: 2px 6px; font-size: inherit; }
.lookup .lookup-type { margin: 3px 0 0; font-size: .8rem; }
.lookup-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.lookup-codes > div {
  flex: 1 1 100px;
  padding: 5px 9px;
  border: 1px solid #ebdce5;
  border-radius: 8px;
  background: #f9f0f5;
}
.lookup-codes dt, .lookup-metadata dt { color: var(--muted); font-size: .74rem; }
.lookup-codes dd, .lookup-metadata dd { margin: 0; font-weight: 720; }
.lookup-codes dd { color: var(--teal-dark); font-size: 1rem; }
.lookup-card-links { display: flex; flex-wrap: wrap; gap: 5px; }
.lookup-card-links .button {
  min-height: 34px;
  gap: 6px;
  padding: 5px 8px;
  font-size: .75rem;
  white-space: normal;
  text-align: center;
  box-shadow: none;
}
.lookup-card-links .action-arrow { flex: none; }
.lookup-card-details { border-top: 1px solid #eee1e7; }
.lookup-card-details summary {
  width: fit-content;
  min-height: 32px;
  padding-top: 6px;
  color: var(--teal-dark);
  font-size: .8rem;
}
.lookup-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
  gap: 5px;
  margin: 3px 0 0;
}
.lookup-metadata div { display: block; padding: 5px 7px; border: 0; border-radius: 6px; background: var(--page); }
.lookup-metadata dd { font-size: .82rem; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .lookup-card { transition: box-shadow .18s ease, border-color .18s ease; }
  .lookup-card:hover { border-color: #b985a2; box-shadow: 0 6px 17px #45253817; }
}
@media (max-width: 690px) {
  .lookup-results-grid { grid-template-columns: minmax(0,1fr); }
}
