/* Terms of Use dialog and page (.tm-*), cookie banner (.ck-*) and the operator Visitors tab (.vs-*). See consent.mjs. */

/* ---------- Terms of Use dialog (and the #/terms page) ---------- */
.tm-dialog { width: min(780px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); max-height: none; padding: 0; overflow: hidden; }
.tm-dialog[open] { display: flex; flex-direction: column; }
.tm-dialog::backdrop { background: rgba(4, 5, 6, .84); backdrop-filter: blur(10px); }
.tm-terms { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tm-terms[hidden], .tm-declined[hidden] { display: none; }
.tm-head { padding: 26px 30px 18px; border-bottom: .67px solid var(--line-soft); }
.tm-head h2 { margin: 0; font: 650 24px/1.2 var(--font-sans); letter-spacing: -.4px; }
.tm-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.tm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 30px 26px; overscroll-behavior: contain; }
.tm-body:focus { outline: none; }
.tm-body:focus-visible { box-shadow: inset 0 0 0 1px var(--line-strong); }
.tm-notice { margin: 0 0 14px; font: 650 13.5px/1.6 var(--font-sans); letter-spacing: .01em; text-transform: uppercase; color: var(--ink); }
.tm-section { margin-top: 22px; }
.tm-section h3 { margin: 0 0 8px; font: 650 16px/1.3 var(--font-sans); color: var(--ink); }
.tm-section h4 { margin: 12px 0 6px; font: 600 14px/1.3 var(--font-sans); }
.tm-section p, .tm-section li { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.tm-section ul { margin: 0 0 10px; padding-left: 20px; }
.tm-section li { margin-bottom: 6px; }
.tm-foot { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 16px 30px 20px; border-top: .67px solid var(--line-soft); background: var(--panel-lo); }
.tm-check { flex: 1 1 320px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tm-check input, .ck-row input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.tm-check:has(input:checked) { color: var(--ink); }
.tm-buttons { display: flex; gap: 10px; margin-left: auto; }
.tm-buttons .btn, .tm-buttons .btn-accent { min-height: 46px; min-width: 112px; justify-content: center; font-size: 14px; }
.tm-accept:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.tm-declined { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 40px 30px; text-align: center; }
.tm-declined h2 { margin: 0; font: 650 22px/1.25 var(--font-sans); }
.tm-declined p { margin: 0; max-width: 42ch; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.dl-mark { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-tint); border: .67px solid var(--accent-line); color: var(--accent-text); }
.tm-page { max-width: 860px; margin: 0 auto; padding: 0; overflow: hidden; }
.tm-page-head { padding: 28px 32px 18px; border-bottom: .67px solid var(--line-soft); }
.tm-page-head h1 { margin: 0; font: 650 32px/1.15 var(--font-sans); letter-spacing: -.6px; }
.tm-page-head p { margin: 6px 0 0; font-size: 13.5px; }
.tm-page .tm-body { padding: 22px 32px 8px; overflow: visible; }
.tm-page-foot { padding: 0 32px 26px; margin: 0; font-size: 13px; }
@media (max-width: 600px) {
  .tm-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 22px; }
  .tm-head { padding: 20px 20px 14px; }
  .tm-head h2 { font-size: 20px; }
  .tm-body { padding: 16px 20px 20px; }
  .tm-notice { font-size: 12.5px; }
  .tm-section p, .tm-section li { font-size: 13.5px; }
  .tm-foot { padding: 14px 20px 16px; }
  .tm-buttons { width: 100%; }
  .tm-buttons .btn, .tm-buttons .btn-accent { flex: 1; }
  .tm-page-head, .tm-page .tm-body, .tm-page-foot { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Cookie banner ---------- */
.ck-banner { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(760px, calc(100% - 24px));
  display: grid; gap: 12px; padding: 16px 18px; border-radius: 22px; border: .67px solid var(--line); background: linear-gradient(160deg, var(--panel-hi), var(--panel-lo) 85%); box-shadow: var(--shadow-pop); }
.ck-main { display: flex; gap: 16px; align-items: center; }
.ck-text { min-width: 0; flex: 1; }
.ck-text strong { font: 600 14px/1.3 var(--font-sans); }
.ck-text p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.ck-text a { color: var(--accent-text); }
.ck-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ck-link { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ck-link:hover { color: var(--ink); }
.ck-settings { display: grid; gap: 8px; padding-top: 12px; border-top: .67px solid var(--line-soft); }
.ck-settings[hidden] { display: none; }
.ck-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); cursor: pointer; }
.ck-row span { display: grid; gap: 3px; }
.ck-row strong { font-size: 13px; }
.ck-row small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.ck-actions { display: flex; justify-content: flex-end; }
@media (max-width: 780px) {
  /* Above the fixed tabbar (86px tall, 12px from the bottom). */
  .ck-banner { bottom: calc(108px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 140px); overflow-y: auto; }
  .ck-main { flex-direction: column; align-items: stretch; }
  .ck-buttons { justify-content: stretch; }
  .ck-buttons .btn, .ck-buttons .btn-accent { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Operator Visitors tab ---------- */
.vs-periods { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--panel-2); }
.vs-periods .btn[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); }
.vs-chart-wrap { display: grid; gap: 8px; }
.vs-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.vs-key { display: inline-flex; align-items: center; gap: 6px; }
.vs-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.vs-key-people::before { background: var(--accent); }
.vs-key-views::before { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.vs-chart { display: flex; align-items: stretch; gap: 3px; height: 180px; padding: 4px 0; border-bottom: .67px solid var(--line-soft); }
.vs-col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; }
.vs-bar { position: relative; width: 100%; height: 100%; }
.vs-bar span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 1px 1px; min-height: 0; }
.vs-bar-views { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.vs-bar-people { background: var(--accent); left: 22%; right: 22%; }
.vs-col:hover .vs-bar-views { background: color-mix(in srgb, var(--accent) 42%, transparent); }
.vs-axis { display: flex; gap: 3px; font: 500 10.5px/1 var(--font-mono); color: var(--muted); }
.vs-axis span { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: visible; }
.vs-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vs-rank li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 10px; overflow: hidden; font-size: 13px; }
.vs-rank-bar { position: absolute; inset: 0; }
.vs-fill { display: block; height: 100%; background: var(--accent-tint); border-radius: 10px; }
.vs-rank-name { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-rank-name .op-net { gap: 6px; }
.vs-rank-num { position: relative; font: 600 12.5px/1 var(--font-mono); }
.vs-rank-num small { color: var(--muted); font-weight: 500; }
@media (max-width: 600px) { .vs .op-head { flex-wrap: wrap; } .vs .op-actions { flex-wrap: wrap; } .vs-chart { height: 140px; gap: 2px; } }
