/* Base tokens and components are copied from SightGlass / Upload Assistant so
   the tools look like one family. Roundhouse-specific pieces follow below. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #5b6472;
  --line: #dde2e9;
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --ok: #1a7f4b;
  --err: #c0392b;
  --placeholder: #a9b1bd;
  /* Heat ramps: retention lost (warm) and regained by rewatches (cool),
     diverging from a neutral grey, so "nothing happened" reads as no colour. */
  --heat-0: #eef1f5;
  --heat-drop-1: #f6c9a6;
  --heat-drop-2: #e3825c;
  --heat-drop-3: #c0392b;
  --heat-gain-3: #2456d6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
/* The analysis page needs the room for transcript + retention graph. */
.wrap.wide { max-width: 1240px; }
header.site { margin-bottom: 1.5rem; }
header.site h1 { margin: 0; font-size: 1.6rem; flex: 1 1 auto; min-width: 0; }
header.site p { margin: .25rem 0 0; color: var(--muted); }
.site-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-title-row .btn { flex: 0 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card-head h2 { margin: 0; }
label.field { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
label.field input[type="text"],
label.field input[type="url"],
label.field input[type="password"] {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .65rem;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
::placeholder { color: var(--placeholder); opacity: 1; font-weight: 400; }

button, .btn {
  display: inline-block;
  font: inherit;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  padding: .55rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--accent);
}
/* Secondary buttons fill blue on hover so a click is unmistakable. */
button:hover:not(:disabled), .btn:hover {
  background: #1c46b0;
  border-color: #1c46b0;
  color: #fff;
}
button:active:not(:disabled), .btn:active {
  background: #16358f;
  border-color: #16358f;
  color: #fff;
  transform: translateY(1px);
}
button:focus-visible, .btn:focus-visible {
  outline: 3px solid rgba(36, 86, 214, .35);
  outline-offset: 2px;
}
button:disabled { opacity: .5; cursor: default; }
button.small, .btn.small { padding: .3rem .7rem; font-size: .82rem; }
/* Destructive secondary: outlined red, fills red on hover — same treatment as
   Upload Assistant's link-warning button. */
button.danger {
  background: #fff;
  border-color: var(--err);
  color: var(--err);
}
button.danger:hover:not(:disabled) {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}
button.danger:active:not(:disabled) { background: #8c2818; border-color: #8c2818; }
.toolbar { display: flex; gap: .5rem; margin: .5rem 0 0; flex-wrap: wrap; align-items: center; }

.error {
  background: #fdecea;
  border: 1px solid #f5c6c1;
  color: var(--err);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.success {
  background: #eaf7ee;
  border: 1px solid #bfe3c9;
  color: var(--ok);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.warn {
  background: #fff8e6;
  border: 1px solid #f0d9a0;
  color: #8a6100;
  border-radius: 8px;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  font-size: .88rem;
}
.warn code { font-size: .82rem; }
.note {
  background: #eef4ff;
  border: 1px solid #cfdefb;
  color: #23438f;
  border-radius: 8px;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  font-size: .88rem;
}
.formerror {
  background: #fdecea;
  border: 1px solid #f5c6c1;
  color: var(--err);
  border-radius: 8px;
  padding: .7rem .9rem;
  margin-bottom: .9rem;
  font-size: .9rem;
  font-weight: 600;
}
.invalid, input.invalid {
  border-color: var(--err) !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}
.pill {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: .7rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem .55rem;
}
.pill-success { color: #fff; background: var(--ok); border-color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
a { color: var(--accent); }

/* Progress indicator shown below the submit button while working */
.progress {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .85rem;
  color: var(--muted);
  font-size: .9rem;
}
.wheel {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .wheel { animation-duration: 2.4s; }
}

/* ---------- Accounts, admin and legal pages (shared with Upload Assistant) ---------- */
.signout {
  display: flex; align-items: center; gap: .75rem; flex: 0 0 auto;
  color: var(--muted); font-size: .85rem;
}
.signout span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 560px) { .signout span { display: none; } }
.login-wrap { max-width: 460px; }
.login-note { margin: 0 0 1rem; color: var(--muted); }
.login-note a { color: var(--accent); font-weight: 600; }
.legal { max-width: 720px; }
.legal .card h2 { margin: 1.6rem 0 .5rem; font-size: 1.02rem; }
.legal .card p, .legal .card li { line-height: 1.6; }
.legal .card ul { padding-left: 1.2rem; }
.legal .card li { margin-bottom: .5rem; }
.legal .card a, .legal-foot a { color: var(--accent); }
.legal-foot { text-align: center; color: var(--muted); font-size: .85rem; }
.legal-foot + .legal-foot { margin-top: -.4rem; }
.notice {
  background: #f1f9f4; border: 1px solid #cfe6d6; color: var(--ok);
  border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}
.row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; }
.row3 { display: grid; grid-template-columns: 1.08fr 0.52fr 2.4fr; gap: 1rem; align-items: start; }
.admin-row { grid-template-columns: 2fr 1fr 2fr; }
.row2.admin-row { grid-template-columns: 1fr 3fr; }
@media (max-width: 760px) {
  .row2, .row3, .admin-row, .row2.admin-row { grid-template-columns: 1fr; }
}
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line);
}
.admin-table th { color: var(--muted); font-size: .78rem; font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table a { color: var(--accent); font-weight: 600; text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }
/* The client list keeps every row to a single line, whatever is in it. Column
   widths are fixed, so nothing can push the table wider than its card; text that
   does not fit is cut off with an ellipsis instead of wrapping. */
.clients-table { table-layout: fixed; }
.clients-table th, .clients-table td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clients-table th:nth-child(1) { width: 26%; }
.clients-table th:nth-child(4) { width: 12%; }
.clients-table .more { color: var(--muted); margin-left: .35rem; }
.admin-actions { text-align: right; white-space: nowrap; }
.admin-actions form { display: inline-block; margin-left: .4rem; }
.admin-add { margin-top: 1.25rem; }
.admin-headbtns { display: flex; gap: .5rem; flex: 0 0 auto; }
.admin-headbtns form { margin: 0; }
.viewing-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.viewing-banner button { flex: 0 0 auto; }

