/* 小镇社交 (town-social.js): her week, album, room and 小手机 on her owner's page. Blue and white, phone first. The colours come from the page's
   own tokens (/join: --g-*, the hosted admin: --fb-*) with the same values as the fallback, so this file reads the same on both. */
:root {
  --ts-brand: var(--g-brand, var(--fb-accent, #4368fb)); --ts-deep: var(--g-brand-deep, var(--fb-accent-deep, #2a48c9));
  --ts-water: var(--g-water, #99bcfb); --ts-sky: var(--g-sky, #eef3ff); --ts-sky2: var(--g-sky-2, var(--fb-accent-soft, #e1e9ff));
  --ts-line: var(--g-line, var(--fb-line, #e5eaf6)); --ts-ink: var(--g-ink, var(--fb-text, #1b2340)); --ts-ink2: var(--g-ink-2, var(--fb-text-2, #48526e));
  --ts-muted: var(--g-muted, var(--fb-muted, #626c89)); --ts-field: var(--g-field, #f8faff);
}
.ts-panel { display: grid; gap: 12px; margin-top: 12px; min-width: 0; }
.ts-panel > * { min-width: 0; }
.ts-panel .ts-block { margin-top: 6px; }
.ts-chips { margin: 0; }
.ts-foot { display: grid; justify-items: center; }
.ts-foot:empty { display: none; }
.ts-count { margin: 0; color: var(--ts-muted); font-size: 13.5px; }
.ts-line { margin: 0; color: var(--ts-ink2); font-size: 13.5px; line-height: 1.65; }

/* 这周: what she spent, then what she did */
.ts-hero { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #fbfcff, #eaf1ff); border: 1px solid rgba(67, 104, 251, .10); }
.ts-hero > small { color: var(--ts-muted); font-size: 12.5px; }
.ts-hero > b { color: var(--ts-deep); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ts-hero-line { margin: 0; color: var(--ts-ink2); font-size: 13.5px; line-height: 1.6; }
.ts-tops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ts-top { padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--ts-line); color: var(--ts-deep); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-kinds { margin-top: 4px; border-top: 1px solid rgba(67, 104, 251, .12); padding-top: 4px; }
.ts-kinds summary { display: flex; align-items: center; min-height: 40px; color: var(--ts-deep); font-size: 13.5px; font-weight: 650; cursor: pointer; list-style: none; }
.ts-kinds summary::-webkit-details-marker, .ts-odd summary::-webkit-details-marker { display: none; }
.ts-kinds summary::after, .ts-odd summary::after { content: ""; width: 7px; height: 7px; margin: 0 4px 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.ts-kinds[open] summary::after, .ts-odd[open] summary::after { transform: rotate(-135deg); }
.ts-kind-list { display: grid; gap: 8px; padding: 4px 0 6px; }
.ts-kind { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; color: var(--ts-ink2); }
.ts-kind b { color: var(--ts-ink); font-variant-numeric: tabular-nums; }
.ts-bar { display: block; height: 8px; border-radius: 999px; background: var(--ts-sky2); overflow: hidden; }
.ts-bar u { display: block; height: 100%; border-radius: 999px; background: var(--ts-brand); text-decoration: none; }
.ts-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ts-tiles div { display: grid; gap: 2px; padding: 12px 6px; border-radius: 16px; background: #fff; border: 1px solid var(--ts-line); text-align: center; }
.ts-tiles small { color: var(--ts-muted); font-size: 12px; }
.ts-tiles b { color: var(--ts-deep); font-size: 19px; font-variant-numeric: tabular-nums; }

/* 相册 */
.ts-album { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ts-card { display: grid; align-content: start; min-width: 0; padding: 0; border: 1px solid var(--ts-line); border-radius: 16px; background: #fff; color: var(--ts-ink);
  font: inherit; text-align: left; overflow: hidden; cursor: pointer; box-shadow: 0 8px 20px -18px rgba(39, 66, 170, .6); }
.ts-card:active { transform: scale(.985); }
.ts-pic { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--ts-sky); overflow: hidden; }
.ts-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ts-count-badge { position: absolute; right: 8px; top: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(27, 35, 64, .64); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 600; }
.ts-cap { display: grid; gap: 2px; min-width: 0; padding: 9px 11px 11px; }
.ts-cap b { font-size: 13.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ts-cap small { color: var(--ts-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ts-card.is-song { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; }
.ts-card.is-song .ts-cap { padding: 0; }
.ts-song-ico, .ts-gift-ico { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--ts-sky2); color: var(--ts-deep); }
.ts-song-ico svg, .ts-gift-ico svg { width: 24px; height: 24px; }
.ts-snap { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; scrollbar-width: thin; }
.ts-snap img { flex: none; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; background: var(--ts-sky); scroll-snap-align: center; }
.ts-song-big { display: grid; justify-items: center; gap: 12px; padding: 18px 12px; border-radius: 16px; background: var(--ts-sky); }
.ts-song-big .ts-song-ico { width: 64px; height: 64px; border-radius: 20px; background: #fff; }
.ts-song-big .ts-song-ico svg { width: 32px; height: 32px; }
.ts-song-big audio { width: 100%; max-width: 420px; }
.ts-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--ts-field); border: 1px solid var(--ts-line); }
.ts-facts dt { color: var(--ts-muted); font-size: 13px; }
.ts-facts dd { margin: 0; color: var(--ts-ink); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ts-sheet { min-width: 0; }
.ts-quote { margin: 0; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--ts-sky); color: var(--ts-ink); font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.ts-odd { border-radius: 16px; border: 1px solid var(--ts-line); background: #fff; overflow: hidden; }
.ts-odd summary { display: flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--ts-ink2); font-size: 13.5px; cursor: pointer; list-style: none; }
.ts-odd .ts-rows { border: 0; border-top: 1px solid var(--ts-line); border-radius: 0; }

/* 房间 */
.ts-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ts-gift { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 14px 12px 12px; border: 1px solid var(--ts-line); border-radius: 16px; background: #fff; color: var(--ts-ink);
  font: inherit; text-align: left; cursor: pointer; box-shadow: 0 8px 20px -18px rgba(39, 66, 170, .6); }
.ts-gift .ts-gift-ico { margin-bottom: 6px; }
.ts-gift b { font-size: 14.5px; }
.ts-gift small { color: var(--ts-muted); font-size: 12px; line-height: 1.5; }
.ts-gift em { margin-top: 2px; color: var(--ts-ink2); font-style: normal; font-size: 12.5px; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ts-gift-big { display: flex; align-items: center; gap: 14px; }
.ts-gift-big .ts-gift-ico { width: 56px; height: 56px; border-radius: 18px; }
.ts-gift-big div { display: grid; gap: 2px; min-width: 0; }
.ts-gift-big b { font-size: 16px; }
.ts-gift-big small { color: var(--ts-muted); font-size: 13px; }

/* 小手机 */
.ts-threads { display: grid; border-radius: 16px; border: 1px solid var(--ts-line); background: #fff; overflow: hidden; }
.ts-thread { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; background: none;
  color: var(--ts-ink); font: inherit; text-align: left; cursor: pointer; }
.ts-thread + .ts-thread { border-top: 1px solid var(--ts-line); }
.ts-thread:hover { background: var(--ts-field); }
.ts-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ts-sky2); color: var(--ts-deep); font-weight: 700; font-size: 16px; }
.ts-thread-text { display: grid; gap: 2px; min-width: 0; }
.ts-thread-text b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-thread-text small { color: var(--ts-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-thread-side { display: grid; justify-items: end; gap: 4px; }
.ts-thread-side time { color: var(--ts-muted); font-size: 11.5px; white-space: nowrap; }
.ts-unread { padding: 1px 8px; border-radius: 999px; background: var(--ts-sky2); color: var(--ts-deep); font-style: normal; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ts-refused { color: var(--ts-muted); background: #fff; border: 1px dashed var(--ts-water); }
.ts-meet-card { display: block; margin-top: 6px; padding: 4px 9px; border-radius: 9px; background: var(--ts-sky2); color: var(--ts-deep); font-size: 12px; font-weight: 600; }
.ts-msg-her .ts-meet-card { background: rgba(255, 255, 255, .24); color: #fff; }
.ts-empty { display: grid; gap: 4px; margin: 4px 0; padding: 22px 16px; border-radius: 16px; background: var(--ts-sky); border: 1px dashed var(--ts-water); color: var(--ts-ink2); font-size: 14px; line-height: 1.6; text-align: center; }
.ts-empty b { color: var(--ts-deep); font-size: 15px; }

@media (min-width: 560px) {
  .ts-album { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ts-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .ts-album { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ts-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .ts-card:active { transform: none; } .ts-kinds summary::after, .ts-odd summary::after { transition: none; } }

/* the pieces this file draws with (so it needs nothing from the page's own stylesheet) */
.ts-note { margin: 6px 0; color: var(--ts-muted); font-size: 13.5px; line-height: 1.6; }
.ts-block { display: grid; gap: 8px; margin-top: 16px; min-width: 0; }
.ts-block h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ts-ink); }
.ts-rows { display: grid; border-radius: 16px; border: 1px solid var(--ts-line); background: #fff; overflow: hidden; }
.ts-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 9px 14px; border: 0; background: none; color: var(--ts-ink); font: inherit; text-align: left; box-sizing: border-box; }
button.ts-row { cursor: pointer; }
.ts-row + .ts-row { border-top: 1px solid var(--ts-line); }
.ts-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ts-row-text b { font-size: 14.5px; overflow-wrap: anywhere; }
.ts-row-text small { color: var(--ts-muted); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ts-tag { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--ts-sky2); color: var(--ts-deep); font-size: 12.5px; font-weight: 600; }
.ts-tabs { display: flex; gap: 2px; width: 100%; padding: 3px; border-radius: 12px; background: var(--ts-sky); border: 1px solid var(--ts-line); box-sizing: border-box; }
.ts-tab { flex: 1 1 0; min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: none; color: var(--ts-ink2); font-family: inherit; font-weight: 600; font-size: 13.5px; line-height: 1; cursor: pointer; }
.ts-tab[aria-selected="true"] { background: #fff; color: var(--ts-deep); box-shadow: 0 1px 3px rgba(22, 40, 90, .12); }
.ts-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0; }
.ts-chips::-webkit-scrollbar { display: none; }
.ts-chip { flex: none; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--ts-line); background: #fff; color: var(--ts-ink2); font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; cursor: pointer; }
.ts-chip[aria-checked="true"] { border-color: var(--ts-water); background: var(--ts-sky2); color: var(--ts-deep); }
.ts-more { min-height: 38px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--ts-water); background: #fff; color: var(--ts-deep); font-family: inherit; font-weight: 600; font-size: 13.5px; line-height: 1; cursor: pointer; }
/* chat (小手机): her words on the right in blue, the friend's on the left */
.ts-chat { display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; padding: 14px 12px 12px; border-radius: 16px; background: linear-gradient(#f6f8fd, #eef3fe); min-height: 120px; }
.ts-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; }
.ts-msg-her { justify-self: end; align-items: flex-end; }
.ts-msg-name { font-size: 11.5px; color: var(--ts-muted); margin: 0 6px 2px; }
.ts-bubble { padding: 8px 12px; border-radius: 16px 16px 16px 5px; background: #fff; color: var(--ts-ink); font-size: 14px; line-height: 1.55; box-shadow: 0 1px 3px rgba(22, 40, 90, .14); overflow-wrap: anywhere; }
.ts-msg-her .ts-bubble { border-radius: 16px 16px 5px 16px; background: var(--ts-brand); color: #fff; }
.ts-msg time { font-size: 10.5px; color: var(--ts-muted); margin: 2px 6px 0; }
.ts-sys { justify-self: center; max-width: 92%; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--ts-muted); font-size: 11.5px; text-align: center; line-height: 1.5; }
