/* YoungOnes Signage admin. Brand: YoungOnes brandbook 2026 (colour system, Work Sans, bold uppercase
   headlines). Clean and white: no gradients, stripes or italics. */

@font-face {
  font-family: 'Work Sans';
  src: url('/assets/work-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette */
  --yo-almost-black: #000024;
  --yo-dark-blue: #000440;
  --yo-blue: #26295c;
  --yo-blue-grey: #f1f1f8;
  --yo-turquoise: #10d1bb;
  --yo-red: #bd1818;
  --yo-purple: #8249fd;
  --yo-accent-blue: #659df2;

  /* Semantic tokens (light) */
  --bg: #ffffff;
  --card: #ffffff;
  --ink: var(--yo-dark-blue);
  --ink-soft: var(--yo-blue);
  --muted: #4a4d72;
  --line: #d9dbea;
  --line-strong: #b9bcd6;
  --tint: #e8e9f4;
  --ok-ink: #08766a; /* turquoise darkened for text on white (4.9:1) */
  --ok-bg: rgb(16 209 187 / 0.14);
  --bad-ink: var(--yo-red);
  --bad-bg: rgb(189 24 24 / 0.09);
  --warn-ink: #6a2fe0; /* brand purple darkened for text on white */
  --warn-bg: rgb(130 73 253 / 0.12);
  --focus: var(--yo-turquoise);
  --shadow: none;
  --shadow-hover: 0 8px 24px rgb(0 4 64 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
  accent-color: var(--yo-dark-blue);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family:
    'Work Sans',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--ink);
  text-decoration-color: var(--yo-turquoise);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 0.75em;
}
code,
.mono,
.mono-inline {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
}
code,
.mono-inline {
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
strong {
  font-weight: 700;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
}
.skip:focus {
  top: 12px;
}
.muted {
  color: var(--muted);
}
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.875rem;
}
.fineprint {
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 70ch;
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.logo {
  display: block;
  height: 40px;
  width: auto;
}
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.top nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.top nav a {
  position: relative;
  padding: 24px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms var(--ease);
}
.top nav a:hover,
.top nav a[aria-current='page'] {
  color: var(--ink);
}
.top nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--yo-turquoise);
}
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  flex: none;
}
.who-email {
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who button {
  min-height: 40px;
}

/* ---------- Layout ---------- */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}
.page-head {
  margin: 0 0 28px;
}
.page-head h1 {
  font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
}
.page-head .meta {
  margin-top: 8px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  align-items: start;
}
.two > .card {
  margin-bottom: 0;
}
.two + .card,
.two + .two {
  margin-top: 20px;
}
/* Detail page: two independent columns, so a tall card on one side leaves no gap on the other. */
/* Screen page: live view beside content + settings, then device token beside delete, so each row's
   cards line up. */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    'live content'
    'live settings'
    'token delete';
  gap: 20px;
}
.detail-grid > .card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
/* Buttons sit at the bottom of their card, so they line up with the card next to it. */
.detail-grid > .live > form.actions,
.detail-grid > .token-card > .actions {
  margin-top: auto;
  padding-top: 20px;
}
.detail-grid > .live {
  grid-area: live;
}
.detail-grid > .content {
  grid-area: content;
}
.detail-grid > .settings {
  grid-area: settings;
}
.detail-grid > .token-card {
  grid-area: token;
}
.detail-grid > .danger-zone {
  grid-area: delete;
}

/* ---------- Cards ---------- */

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  color: inherit;
  text-decoration: none;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
}

/* Screen cards on the overview */
.screen {
  padding: 0;
  overflow: hidden;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease);
}
.screen:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}
.screen .shot-wrap {
  border-radius: 0;
}
.screen .shot {
  border-radius: 0;
}
.screen-body {
  padding: 18px 20px 20px;
}
.screen-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.screen-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: break-word;
  min-width: 0;
}
.screen-content {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--ink-soft);
}
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Screenshots */
.shot-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--yo-almost-black);
}
.shot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--yo-almost-black);
  color: rgb(255 255 255 / 0.55);
  font-size: 0.875rem;
}
.shot.empty {
  background: var(--yo-blue-grey);
  color: var(--muted);
}
.shot-age {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgb(0 0 36 / 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Detail page */
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -8px 0 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}
.back:hover {
  color: var(--ink);
}
.back svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 20px 0;
}
.card > .facts:first-child {
  margin-top: 0;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.pending {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.pending::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yo-turquoise);
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.callout {
  border: 1.5px solid var(--yo-turquoise);
}
.danger-zone {
  border-color: rgb(189 24 24 / 0.35);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--tint);
  color: var(--muted);
}
.badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.badge.ok::before {
  background: var(--yo-turquoise);
  opacity: 1;
}
.badge.bad {
  background: var(--bad-bg);
  color: var(--bad-ink);
}
.badge.bad::before {
  opacity: 1;
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.badge.warn::before {
  opacity: 1;
}

/* ---------- Notices ---------- */

.notice {
  padding: 14px 18px;
  margin: 0 0 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yo-turquoise);
  border-radius: var(--radius-sm);
}
.notice.bad {
  border-left-color: var(--yo-red);
}

/* ---------- Buttons ---------- */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}
button:hover,
.button:hover {
  border-color: var(--ink);
}
button:active,
.button:active {
  transform: translateY(1px);
}
button.primary,
.button {
  background: var(--yo-dark-blue);
  border-color: var(--yo-dark-blue);
  color: #fff;
}
button.primary:hover,
.button:hover {
  background: var(--yo-blue);
  border-color: var(--yo-blue);
}
button.danger {
  color: var(--bad-ink);
  border-color: rgb(189 24 24 / 0.5);
}
button.danger:hover {
  background: var(--yo-red);
  border-color: var(--yo-red);
  color: #fff;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.actions form {
  margin: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

/* ---------- Forms ---------- */

.stack {
  display: grid;
  gap: 16px;
  max-width: 640px;
}
.stack > button {
  justify-self: start;
}
label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
}
.inline-form label {
  flex: 1 1 220px;
}
.inline-form.filter {
  margin-bottom: 20px;
}
.inline-form.filter label {
  flex: 0 1 280px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition:
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--yo-turquoise);
  box-shadow: 0 0 0 4px rgb(16 209 187 / 0.25);
}
/* Own chevron instead of the browser's, with room from the right edge. */
select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000440' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  cursor: pointer;
}
input[readonly] {
  background: var(--tint);
}
input[type='radio'],
input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: none;
  box-shadow: none;
}
input[type='file'] {
  padding: 8px;
}
input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--yo-dark-blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
textarea.mono {
  font-size: 0.875rem;
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
fieldset {
  margin: 0;
  padding: 0 16px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
fieldset legend {
  padding: 0 6px;
  margin-left: -6px;
}
fieldset.option {
  transition:
    border-color 160ms var(--ease),
    background-color 160ms var(--ease);
}
fieldset.option:has(> legend:only-child) {
  padding-bottom: 0;
}
fieldset.option:has(> legend input:checked) {
  border-color: var(--yo-turquoise);
}
fieldset.option legend .choice {
  font-weight: 700;
}
/* Each option is a bordered row with its radio inside the box (floated legend). Only the chosen option
   shows its fields; the others fold down to their radio. */
fieldset.option {
  padding: 4px 16px 16px;
}
fieldset.option > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0;
}
fieldset.option:has(> legend input:not(:checked)) {
  padding-bottom: 4px;
}
fieldset.option:hover {
  border-color: var(--line-strong);
}
fieldset.option:has(> legend input:checked) {
  border-color: var(--yo-turquoise);
}
fieldset.option:has(> legend input:not(:checked)) > :not(legend) {
  display: none;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--yo-turquoise);
}
.token input {
  font-size: 0.9375rem;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  padding: 8px 8px 16px;
}
.table-wrap > p {
  padding: 0 16px;
  margin: 12px 0 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
tbody tr {
  transition: background-color 120ms var(--ease);
}
tbody tr:hover {
  background: var(--tint);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.mono {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
td form {
  margin: 0;
}
td.nowrap {
  white-space: nowrap;
}
/* Audit log: one line per entry. */
table.audit td {
  vertical-align: middle;
}
table.audit td.mono {
  font-size: 0.8125rem;
}
td.who-cell {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
td.details {
  min-width: 220px;
}
.kv {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--yo-blue-grey);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.kv .k {
  color: var(--muted);
}

/* ---------- Login ---------- */

body.gate main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px 24px;
}
.login {
  width: 100%;
  max-width: 380px;
  display: grid;
  justify-items: center;
  text-align: center;
}
.login-top .logo {
  height: 88px;
  margin-bottom: 40px;
}
.login h1 {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.login .notice {
  text-align: left;
  width: 100%;
}
.button.google {
  width: 100%;
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}
.button.google:hover {
  background: var(--yo-blue-grey);
  border-color: var(--ink);
}
.login .fineprint {
  margin-top: 16px;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .top-inner {
    flex-wrap: wrap;
    gap: 0 16px;
    padding: 10px 16px 0;
  }
  .top nav {
    order: 3;
    flex-basis: 100%;
    margin: 0 -12px;
  }
  .top nav a {
    padding: 14px 12px;
  }

  .who {
    margin-left: auto;
  }
  .who-email {
    display: none;
  }
  main {
    padding: 24px 16px 56px;
  }
  .card {
    padding: 18px;
  }
  .screen {
    padding: 0;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .facts dd {
    margin-bottom: 10px;
  }
}

/* ---------- Motion ---------- */

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

/* Screen page on one column, in page order: live view, content, settings, token, delete. */
@media (max-width: 920px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
  }
  .detail-grid > .card {
    grid-area: auto;
  }
}

/* Remote login */
.remote-login .rl-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1b2d;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
}
.remote-login .rl-paste {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.remote-login .rl-paste input {
  min-width: 260px;
}
