/* Profiles, albums, account menu, lobby, groups, staff controls. Tokens come from brand.css. */

/* Account menu */
.acct { position: relative; }
.acct > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 3px 12px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary:hover, .acct[open] > summary { border-color: var(--accent); }
.acct > summary:focus-visible { outline: 2px solid var(--bulb); outline-offset: 2px; }
.acct-name { font-weight: 600; font-size: 0.9rem; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .av { object-fit: cover; }
.acct-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 260px; display: grid; gap: 2px;
  padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px #0009;
}
.acct-panel a, .acct-out {
  all: unset; box-sizing: border-box; display: block; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--fg); font: 500 0.95rem var(--body); text-decoration: none; width: 100%;
}
.acct-panel a:hover, .acct-out:hover, .acct-panel a:focus-visible, .acct-out:focus-visible { background: var(--surface-2); outline: none; }
.acct-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.acct-panel .acct-who { display: flex; align-items: center; gap: 12px; padding: 10px; }
.acct-who span { display: grid; gap: 2px; min-width: 0; }
.acct-who b { overflow: hidden; text-overflow: ellipsis; }
.acct-who small { color: var(--muted); font-weight: 400; }
.acct-who .av.big { width: 48px; height: 48px; font-size: 1.3rem; }

@media (max-width: 800px) {
  .nav-links > .acct { order: -5; flex: none; }
  .acct > summary { min-height: 40px; }
  .acct-name { display: none; }
  .acct > summary { padding: 3px; }
  .acct-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 80px); overflow-y: auto; }
}

/* ---- Lobby, composer, spoiler choice ---- */
.lobby-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.lobby-tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.lobby-tabs a.on, .lobby-tabs a:hover { border-color: var(--accent); color: var(--accent); }
.open-composer { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 14px 0; }
.open-composer textarea { width: 100%; resize: vertical; }
.about-label { display: grid; gap: 4px; flex: 1 1 220px; font-size: 0.85rem; color: var(--muted); }
.spoiler-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; border: 0; margin: 0; padding: 0; }
.spoiler-choice legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; padding: 0; }
.spoiler-choice .choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.spoiler-choice .choice span { display: grid; font-size: 0.85rem; color: var(--muted); }
.spoiler-choice .choice b { color: var(--fg); font-size: 0.95rem; }
.spoiler-choice .choice:has(input:checked).ok { border-color: var(--safe); background: color-mix(in srgb, var(--safe) 12%, transparent); }
.spoiler-choice .choice:has(input:checked).warn { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.spoiler-choice .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.spoiler-cover { margin: 8px 0; border: 1px dashed var(--danger); border-radius: 10px; padding: 8px 12px; }
.spoiler-cover > summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.spoiler-cover[open] > summary { margin-bottom: 8px; }
.hidden-note { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 0.9rem; }
.cta-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.cta-card p { margin: 0; flex: 1 1 240px; }

/* ---- Moderation ---- */
.mod-menu { margin: 6px 0; font-size: 0.9rem; }
.mod-menu > summary { cursor: pointer; color: var(--muted); }
.mod-menu[open] { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.mod-menu .form, .mod-panel { display: grid; gap: 8px; margin-top: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.queue-item { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin: 0 0 14px; }
.queue-item .why { margin: 0 0 8px; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }
.queue-photo { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.queue-photo img { border-radius: 8px; object-fit: cover; }
.ep.warn { border-color: var(--danger); }
.tiers ul { margin: 8px 0 0; padding-left: 18px; }

/* ---- Groups ---- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin: 16px 0; }
.group-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--fg); text-decoration: none; }
.group-card:hover { border-color: var(--accent); }
.gc-body { display: grid; gap: 2px; min-width: 0; }
.gc-tag { color: var(--fg); font-size: 0.9rem; }
.g-icon { border-radius: 14px; object-fit: cover; display: block; flex: none; }
.g-icon.ph { display: inline-grid; place-items: center; background: var(--velvet); color: var(--bulb); font: 700 1.6rem var(--display); }
.group-head .prof-av .g-icon { border: 3px solid var(--bg); border-radius: 18px; }
.group-body { margin-top: 18px; display: grid; gap: 14px; }
.rules { display: grid; gap: 6px; padding-left: 22px; }
.inline-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.inline-search input { flex: 1 1 220px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline { display: inline; margin: 0; }
.link.small { font-size: 0.8rem; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.link.danger-link { color: var(--danger); }
.btn.danger { background: var(--danger); color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) { .group-grid { grid-template-columns: 1fr; } .spoiler-choice { grid-template-columns: 1fr; } }
.spoiler-choice input[type="radio"], .edit-card .check input[type="radio"], .edit-card .check input[type="checkbox"] { width: auto; flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.spoiler-choice .choice span { flex: 1; }
.composer-row { align-items: end; flex-wrap: wrap; }
.open-composer input[type="file"] { width: auto; }

/* Keep single-column page grids from growing past the phone screen. */
main.wrap { grid-template-columns: minmax(0, 1fr); }
main.wrap > * { min-width: 0; }
.open-composer .composer-row { display: flex; flex-wrap: wrap; gap: 10px; }
.open-composer .file { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.open-composer { grid-template-columns: minmax(0, 1fr); }
.open-composer > * { min-width: 0; }
.open-composer input[type="file"] { max-width: 100%; }
.open-composer .composer-row .file { flex: 1 1 200px; }
.open-composer input[type="file"] { width: 100%; padding: 6px; }
.inline-search input[type="search"], .inline-search input:not([type]), .inline-search input[type="text"] { min-width: 0; flex: 1 1 160px; width: auto; }
.group-grid { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.g-icon.ph { width: 56px; height: 56px; }
.g-icon.s52 { width: 52px; height: 52px; font-size: 1.4rem; }
.g-icon.s72 { width: 72px; height: 72px; font-size: 2rem; }
.g-icon.s96 { width: 96px; height: 96px; font-size: 2.6rem; border-radius: 18px; }

/* ---- Ratings, taste and the trend desk ---- */
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 0; }
.rate-label { font-size: 0.85rem; color: var(--muted); }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; padding: 2px 3px; font-size: 1.7rem; line-height: 1; color: var(--line); cursor: pointer; }
.star.on { color: var(--accent); }
.stars:hover .star { color: var(--accent); }
.stars .star:hover ~ .star { color: var(--line); }
.star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.crowd b { color: var(--fg); }
.why-line { margin: 14px 0 -6px; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em; }
.taste-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.taste-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.taste-row { display: grid; grid-template-columns: 1fr 90px; gap: 2px 10px; align-items: center; }
.taste-row small { grid-column: 1 / -1; }
.how { display: grid; gap: 8px; padding-left: 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input[type="checkbox"] { width: auto; flex: none; margin-top: 4px; accent-color: var(--accent); }
meter { width: 100%; height: 10px; }
.scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.03em; }
table.data .num, table.data th.num { text-align: right; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line); }
.pill.t-rising { color: var(--safe); border-color: var(--safe); }
.pill.t-cooling { color: var(--danger); border-color: var(--danger); }
.pill.t-new { color: var(--accent); border-color: var(--accent); }
.pill.t-steady { color: var(--fg); }
.pill.t-quiet { color: var(--muted); }
.drop { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.drop li { display: grid; grid-template-columns: 80px 1fr 110px; gap: 10px; align-items: center; }
ul.plain li { display: flex; justify-content: space-between; gap: 12px; }

/* ---- Composer tools, emoji, photos, tags ---- */
.composer-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; position: relative; }
.tool-btn, .emoji > summary, .photo-pick .file { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--fg); font: 600 0.85rem var(--body); cursor: pointer; list-style: none; width: auto; }
.tool-btn:hover, .emoji > summary:hover, .photo-pick .file:hover { border-color: var(--accent); color: var(--accent); }
.emoji > summary::-webkit-details-marker { display: none; }
.emoji { position: relative; }
.emoji-tray { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(330px, 88vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px #0006; display: grid; gap: 4px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-btn { width: 34px; height: 34px; font-size: 1.25rem; line-height: 1; border: 0; background: none; border-radius: 8px; cursor: pointer; padding: 0; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--surface-2); outline: none; }
.photo-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-pick .file input { display: none; }
.photo-preview { display: flex; align-items: center; gap: 8px; }
.photo-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-preview[hidden] { display: none; }
.audience { display: grid; gap: 4px; flex: 1 1 260px; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.audience select { width: 100%; }
.post-btn { margin-left: auto; }
.aud-chip { margin-left: auto; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.tag-list { list-style: none; margin: -4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #0006; display: grid; position: relative; z-index: 15; }
.tag-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.tag-list li.on, .tag-list li:hover { background: var(--surface-2); }
.tag-list small { color: var(--muted); }
a.tag-show { font-weight: 600; }

/* ---- Link cards and YouTube ---- */
.link-card { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin: 10px 0 2px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); color: var(--fg); text-decoration: none; }
.link-card:not(:has(img)) { grid-template-columns: 1fr; }
.link-card:hover { border-color: var(--accent); }
.link-card img { width: 120px; height: 100%; min-height: 90px; object-fit: cover; display: block; }
.lc-body { display: grid; gap: 3px; padding: 10px 12px 10px 0; min-width: 0; align-content: center; }
.link-card:not(:has(img)) .lc-body { padding-left: 12px; }
.lc-site { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }
.lc-desc { color: var(--muted); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-wrap { margin: 10px 0 2px; }
.yt-card { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; padding: 0; cursor: pointer; color: #fff; }
.yt-card img, .yt-blank { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1b1b1b; }
.yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #e62117; font-size: 1.2rem; }
.yt-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; text-align: left; font-weight: 600; background: linear-gradient(transparent, #000c); }
.yt-title small { font-weight: 400; opacity: 0.8; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; display: block; }
.yt-note { margin: 4px 0 0; font-size: 0.8rem; }
@media (max-width: 520px) { .link-card { grid-template-columns: 1fr; } .link-card img { width: 100%; height: 160px; } .lc-body { padding: 0 12px 12px; } .post-btn { width: 100%; justify-content: center; } }

/* ---- Shelf and recommendations ---- */
.shelf-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.shelf-pick .chip { cursor: pointer; background: none; font: inherit; }
.shelf-pick .chip.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.rec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; align-content: start; }
.rec h2 { margin: 0; font-size: 1.1rem; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.block { display: block; }

/* Touch screens: phones and tablets get tap targets near the 44px guideline. Mouse layouts are unchanged. */
@media (pointer: coarse) {
  .tool-btn, .emoji > summary, .photo-pick .file { min-height: 44px; padding-inline: 14px; }
  .emoji-tray { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
  .emoji-btn { width: 44px; height: 44px; }
  .emoji-row { gap: 0; }
  .panel button.x { width: 44px; height: 44px; top: 2px; right: 2px; }
  .foot nav a, .footer-note a { display: inline-block; padding-block: 11px; }
  .foot nav { gap: 4px 16px; }
  .star { min-width: 44px; min-height: 44px; }
  .shelf-pick .chip { min-height: 44px; }
}

/* Touch, continued: every touch device (phone, iPad, Android tablet) at any width. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; } /* below 16px, iOS Safari zooms the page when a field is focused */
  .btn, .btn.small, .btn.ghost { min-height: 44px; }
  summary { min-height: 44px; display: flex; align-items: center; gap: 8px; }
  .report-menu summary { min-height: 44px; display: inline-flex; }
  .post-foot .link, .post-foot a.link, .post-foot button { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 10px; }
  .tick { min-width: 40px; min-height: 40px; }
  .tag-list li { min-height: 44px; display: flex; align-items: center; }
  .search input { font-size: 16px; }
  .mod-menu > summary { min-width: 44px; justify-content: center; }
}

/* Checkboxes and radios are never full-width text fields. Safari stretched the genre-pick checkboxes
   to the chip width, which pushed the page 3px past the screen edge on iPhones. */
input[type="checkbox"], input[type="radio"] { width: auto; max-width: none; padding: 0; flex: none; }
