/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* hommie-server.eu: the same colours as the server's client (web/src/styles.css), light and dark. */
:root {
  --bg: #f6f7f6; --surface: #ffffff; --surface-2: #eef1ef; --text: #17201d; --muted: #5d6a65; --border: #d9dfdc;
  --accent: #0f766e; --accent-text: #ffffff; --accent-soft: #d6efec; --danger: #b42318; --warn-bg: #fff4d6;
  --warn-text: #6b4e00; --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; --tap: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --surface: #171e1b; --surface-2: #1f2925; --text: #e7eeeb; --muted: #9aa8a2; --border: #2c3833;
    --accent: #2dd4bf; --accent-text: #062b27; --accent-soft: #123b36; --danger: #f97066; --warn-bg: #3a2f10;
    --warn-text: #f5d98a; --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
img, svg, video { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 0 18px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent);
  color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--accent); }
.button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.button.big { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.button.small { min-height: 36px; padding: 0 12px; font-size: .95rem; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.icon-button { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent;
  color: inherit; font-size: 1.6rem; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0;
  z-index: 20; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700;
  font-size: 1.15rem; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a { padding: 10px 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang { padding: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
@media (max-width: 720px) {
  .header-row { gap: 4px 8px; padding-top: 6px; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 6px; }
  .main-nav a { white-space: nowrap; padding: 8px 10px; }
}
.site-footer { margin-top: 64px; padding: 32px 0; background: var(--surface); border-top: 1px solid var(--border);
  font-size: .95rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0; }
.fineprint { color: var(--muted); font-size: .85rem; }
.copyright-note { background: var(--warn-bg); color: var(--warn-text); padding: 10px 14px;
  border-radius: var(--radius); }

/* landing */
.hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.hero-row { display: flex; align-items: center; gap: 32px; }
.hero-text { flex: 1; }
.hero-art { color: var(--text); flex: none; }
@media (max-width: 720px) { .hero-art { display: none; } .hero { padding: 32px 0 24px; } }
.band { padding: 48px 0; }
.band.alt { background: var(--surface); border-block: 1px solid var(--border); }
.cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.features li { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.features .icon { width: 36px; height: 36px; color: var(--accent); margin-bottom: 8px; }
.steps { padding-left: 1.4em; display: grid; gap: 10px; max-width: 70ch; }
.diagram { margin: 24px 0 0; }
.diagram img { width: 100%; height: auto; }
.faq { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; }
.notice { background: var(--warn-bg); color: var(--warn-text); padding: 12px 16px; border-radius: var(--radius); }
.notice a { color: inherit; }
.page-head { padding: 32px 0 8px; }
.error { color: var(--danger); font-weight: 600; }
.success { color: var(--accent); font-weight: 600; font-size: 1.1rem; }

/* library */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 16px; }
.filters .grow { flex: 1 1 260px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); min-height: var(--tap); padding: 0 12px; max-width: 100%; }
textarea { padding: 10px 12px; width: 100%; }
input[type="search"] { width: 100%; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); cursor: pointer; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.view-switch { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-switch button { width: var(--tap); height: var(--tap); border: 0; background: var(--surface); color: var(--muted);
  cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.selection-bar { position: sticky; top: 64px; z-index: 10; display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px;
  padding: 10px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.selection-bar .count { font-weight: 600; margin-right: auto; }
.status { color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; }
.items.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 480px) { .items.grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.item { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; }
.item.selected { outline: 3px solid var(--accent); outline-offset: -1px; }
.item.off { opacity: .6; }
.item .pick { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--surface); border-radius: 6px;
  padding: 4px; display: flex; }
.item .thumb { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--surface-2);
  color: var(--muted);
  border: 0; width: 100%; padding: 0; cursor: pointer; overflow: hidden; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .thumb .icon { width: 40px; height: 40px; }
.item .body { padding: 10px 12px 12px; }
.item .name { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { color: var(--muted); font-size: .85rem; }
.item .tools { display: flex; gap: 10px; margin-top: 6px; font-size: .85rem; flex-wrap: wrap; }
.item .tools a, .item .tools button { color: var(--muted); background: none; border: 0; padding: 0; font: inherit;
  cursor: pointer; text-decoration: underline; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); }
.badge.off { background: var(--warn-bg); color: var(--warn-text); }
.items.list .item { display: grid; grid-template-columns: 40px 96px 1fr; align-items: center; gap: 12px;
  padding: 6px 12px;
  border-radius: 0; border-width: 0 0 1px; }
.items.list .item .pick { position: static; padding: 0; background: none; }
.items.list .item .thumb { aspect-ratio: 16 / 10; border-radius: 6px; }
.items.list .item .body { padding: 4px 0; }
.items.list .item .tools { margin-top: 2px; }
.more { text-align: center; margin-top: 16px; }

/* dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
  max-width: min(96vw, 1100px); width: 100%; }
dialog::backdrop { background: rgb(0 0 0 / 70%); }
.player { background: #000; color: #fff; }
.player-top, .player-bottom { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.player-top strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bottom { justify-content: space-between; }
.player .muted { color: #b8c2be; }
.player .button.ghost { color: #fff; border-color: #fff6; }
.player-stage { display: grid; place-items: center; background: #000; min-height: 200px; }
.player-stage video, .player-stage img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.player-stage audio { width: min(600px, 92%); margin: 40px 0; }
.player-stage .error { color: #ffb4ab; padding: 40px 16px; text-align: center; }
.queue { margin: 0; padding: 4px 12px 12px 36px; max-height: 22vh; overflow: auto; color: #b8c2be; font-size: .9rem; }
.queue li { padding: 3px 0; cursor: pointer; }
.queue li[aria-current="true"] { color: #fff; font-weight: 600; }
.report form, .report > * { padding: 20px; }
.report { max-width: 560px; }
.report label { display: grid; gap: 6px; margin-bottom: 14px; }

/* account, link, admin */
.servers { list-style: none; padding: 0; display: grid; gap: 14px; }
.server { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.server .info { flex: 1 1 240px; }
.server .title { font-size: 1.2rem; font-weight: 700; }
.server .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted);
  margin-right: 6px; }
.server .dot.on { background: #22a35a; }
.server .connect { min-width: 160px; min-height: 56px; font-size: 1.15rem; }
.server .forget { flex-basis: 100%; text-align: right; }
.server .forget button { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer;
  font: inherit; font-size: .9rem; }
.google-button { min-height: 48px; margin: 16px 0; }
.dev-login { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed var(--border); }
.dev-login p { flex-basis: 100%; margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.link-form { display: grid; gap: 10px; margin-top: 16px; }
.link-form label { display: grid; gap: 6px; font-weight: 600; }
.name-field { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.name-field input { flex: 1 1 160px; }
.suffix { color: var(--muted); font-weight: 400; }
.reports { list-style: none; padding: 0; display: grid; gap: 12px; }
.reports li { padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); }
.reports li.done { opacity: .6; }
.reports .details { white-space: pre-wrap; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
.legal { padding-top: 32px; }
@media (max-width: 720px) {
  .selection-bar { top: 104px; gap: 8px; padding: 8px; }
  .selection-bar .button { min-height: 40px; padding: 0 12px; }
}
