/* PriVid — dark grey with green accents.
   On phones and tablets the grey backgrounds become true black.

   The greens carry enough saturation to read as active controls: an accent this
   desaturated starts to look like a disabled state, which is misleading on a
   button. Hue stays around 143 so the palette keeps its character. */

:root {
  --bg:         #1e2022;
  --surface:    #26292b;
  --surface-2:  #313538;
  --border:     #3d4247;
  --text:       #e6e9e7;
  --muted:      #9aa3a0;
  --accent:     #75d198;   /* hsl(143 50% 64%) */
  --accent-hi:  #95e4b3;   /* hover / emphasis   */
  --accent-dim: #519e6f;   /* borders, icons     */
  --danger:     #c98b8b;
  --radius: 10px;
  --gap: 1rem;
}

/* Phones and tablets: pure black backgrounds, easier on OLED and in the dark. */
@media (max-width: 900px), (pointer: coarse) {
  :root {
    --bg:        #000000;
    --surface:   #0a0c0b;
    --surface-2: #131715;
    --border:    #242927;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- chrome ---- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap);
  padding: .75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .02em; font-size: 1.15rem; color: var(--text); }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--accent-hi); }

.wrap { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 0 2rem; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; font-weight: 650; }
h2 { font-size: 1.1rem; margin: 0; font-weight: 620; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.wrapcell { word-break: break-word; }
.right { text-align: right; }
.crumb { color: var(--muted); margin: -.5rem 0 1rem; font-size: .9rem; word-break: break-word; }

/* ---- lists ---- */

.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border);
        border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.row + .row { border-top: 1px solid var(--border); }
.row.empty { padding: 1rem; color: var(--muted); }

.row-main {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; min-height: 56px;   /* comfortable tap target */
  color: var(--text);
}
.row-main:hover { background: var(--surface-2); text-decoration: none; }
.row-main:hover .row-title { color: var(--accent-hi); }

.icon { color: var(--accent-dim); width: 1.4rem; text-align: center; flex: none; font-size: 1rem; }
.icon-play { color: var(--accent); }
.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 550; word-break: break-word; }
.row-sub { color: var(--muted); font-size: .82rem; }

.plain { list-style: none; margin: .5rem 0 0; padding: 0; }
.plain li { padding: .2rem 0; }

/* ---- back buttons (top and bottom of every list) ---- */

.backbar { margin: 0 0 1rem; }
.backbar:last-child { margin: 1rem 0 0; }

/* ---- buttons and forms ---- */

button, .button {
  display: inline-block;
  font: inherit; font-size: .9rem;
  padding: .5rem .9rem; min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
button:hover, .button:hover {
  border-color: var(--accent-dim); color: var(--accent-hi); text-decoration: none;
}
button.primary {
  background: var(--accent); border-color: var(--accent); color: #0b1410; font-weight: 600;
}
button.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #0b1410; }
button.danger:hover { border-color: var(--danger); color: var(--danger); }
button.linkish {
  background: none; border: none; padding: 0; min-height: 0; color: var(--muted); font-size: 1rem;
}
button.linkish:hover { color: var(--accent-hi); text-decoration: underline; }
.inline { display: inline; }

.stack { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; }
.stack label { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.stack button { margin-top: 1rem; align-self: flex-start; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--text) !important; margin-top: .75rem !important; }

input[type=text], input[type=password], input:not([type]), select {
  font: inherit;
  padding: .55rem .7rem; min-height: 42px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 100%;
}
input:focus, select:focus { border-color: var(--accent-dim); outline: none; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.filters label { color: var(--muted); font-size: .85rem; }
.filters input, .filters select { width: auto; min-width: 9rem; }

/* ---- cards, tables, tags ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-narrow { max-width: 24rem; margin-inline: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.count { color: var(--accent); font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; margin-top: .85rem; font-size: .9rem; display: block; overflow-x: auto; }
.table th { text-align: left; color: var(--muted); font-weight: 550; font-size: .8rem;
             text-transform: uppercase; letter-spacing: .04em; padding: .4rem .6rem; }
.table td { padding: .55rem .6rem; border-top: 1px solid var(--border); vertical-align: middle; }
.actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.actions button { font-size: .8rem; padding: .35rem .6rem; min-height: 34px; }

.tag { display: inline-block; font-size: .72rem; padding: .12rem .5rem; border-radius: 999px;
        border: 1px solid var(--border); color: var(--muted); }
.tag-live { color: var(--accent); border-color: var(--accent-dim); }
.tag-idle { color: var(--muted); }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; border: 1px solid var(--border); }
.flash-ok    { border-color: var(--accent-dim); color: var(--accent-hi); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.notice { color: var(--accent-hi); font-size: .9rem; }

.code, pre.code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
                  padding: .7rem .8rem; overflow-x: auto; font-size: .85rem; }
code { font-size: .9em; }

/* ---- player ---- */

.video-title { word-break: break-word; }
.player { background: #000; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.player video { display: block; width: 100%; max-height: 78vh; background: #000; }
.video-meta { display: flex; align-items: center; justify-content: space-between;
               gap: 1rem; flex-wrap: wrap; margin: .85rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* An account streaming from more locations than its limit allows. */
.over-limit { color: var(--danger); font-weight: 600; }
