/* Neo Core Studio: the channel dashboard in the theneocore.com language.
   Near-black ground, one red accent, Montserrat, soft red light. One dark theme (an internal tool).
   Shape rule: 12px radius on every surface and control; status pills are full pills. */

@font-face {
  font-family: "Montserrat";
  src: url("/static/vendor/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --surface: #0c0c0e;
  --surface-2: #131316;
  --surface-3: #1a1a1e;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-2: rgba(244, 244, 245, 0.74);
  --muted: rgba(244, 244, 245, 0.56);
  --red: #ff2a35;          /* accent for text, borders, focus on the dark ground (5.4:1 on --bg) */
  --red-solid: #e10613;    /* filled buttons: white text 4.9:1 */
  --red-deep: #8b0000;
  --red-tint: rgba(255, 30, 40, 0.1);
  --red-glow: rgba(255, 0, 0, 0.22);
  --ok: #3ddc97;
  --warn: #f5b84b;
  --bad: var(--red);
  --radius: 12px;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --side-w: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
/* The theneocore.com light: one soft red glow, fixed and never repainted on scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 30rem at 72% -10%, rgba(255, 0, 0, 0.13), transparent 70%),
    radial-gradient(40rem 26rem at 0% 110%, rgba(255, 0, 0, 0.06), transparent 70%);
}

a { color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #ff5a62; }
h1, h2, h3 { font-family: var(--sans); color: var(--text); line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 300; letter-spacing: -0.01em; margin: 0.25rem 0 1.25rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.75rem; }
h3 { font-size: 0.72rem; font-weight: 600; margin: 1.25rem 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
h1 small, h2 small { font-weight: 400; font-size: 0.85rem; color: var(--muted); letter-spacing: 0; }
code, .mono, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-3); padding: 0.1em 0.4em; border-radius: 6px; color: var(--text-2); }
small, .small { font-size: 0.84rem; }
.muted { color: var(--muted); }
.block { display: block; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* Shell: sidebar + content */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.is-bare .shell { grid-template-columns: 1fr; }
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.6rem 1rem 1.25rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), rgba(8, 8, 9, 0.82);
}
.is-bare .side { position: static; height: auto; border-right: 0; background: none; align-items: center; padding: 3rem 1rem 0; }
.brand { display: flex; flex-direction: column; gap: 0.2rem; text-decoration: none; padding: 0 0.6rem; }
.stamp { font-weight: 300; font-size: 1.12rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.brand-sub { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--red); }
.brand:hover .stamp { color: #fff; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .tabs a {
  position: relative;
  white-space: nowrap;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav a:hover, .tabs a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: #fff; background: var(--red-tint); box-shadow: inset 0 0 0 1px rgba(255, 42, 53, 0.22); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}
.nav a.nav-kill { color: #ff7a80; }
.nav a.nav-kill:hover { background: var(--red-tint); color: #fff; }
.tabs a[aria-current="page"] { color: #fff; background: var(--red-solid); }
.signout { margin-top: auto; padding: 0 0.35rem; }

.wrap { width: 100%; max-width: 1180px; padding: 2rem 2.25rem 5rem; }
.is-bare .wrap { margin: 0 auto; max-width: 520px; padding: 1rem 16px 4rem; }

/* Cards and layout */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 60%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin: 0 0 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}
.card.narrow { max-width: 460px; margin: 2rem auto; }
.is-bare .card.narrow { margin-top: 1rem; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.5rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.grid-cards .card { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.row > label { flex: 1 1 200px; }
.stack > * + * { margin-top: 0.85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.75rem; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: var(--radius); width: fit-content; background: var(--surface); }
.tabs a { padding: 0.4rem 0.8rem; font-size: 0.86rem; }
.empty { color: var(--muted); margin: 0.25rem 0; padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0 0; border-top: 1px solid var(--line); padding-top: 1rem; }
.stats dt { color: var(--muted); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.stats dd { margin: 0.3rem 0 0; font-size: 1.45rem; font-weight: 300; letter-spacing: -0.01em; }
.stats dd small { color: var(--muted); font-size: 0.8rem; letter-spacing: 0; }
meter { width: 100%; height: 0.4rem; display: block; margin-top: 0.4rem; accent-color: var(--red); }

/* Lists */
.items, .list, .events, .topics { list-style: none; padding: 0; margin: 0; }
.items li, .list li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.items li:last-child, .list li:last-child { border-bottom: 0; }
.items .title, .review-row .title { color: var(--text); font-weight: 500; }
.review-row a { text-decoration: none; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; flex: 1 1 320px; color: var(--text); }
.review-row a:hover .title { color: #fff; }
.list.small li { font-size: 0.86rem; }
.events li { font-size: 0.86rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.ev-error { color: var(--bad); }
.ev-warn { color: var(--warn); }

.alerts ul { margin: 0; padding-left: 1.1rem; }
.alerts li { margin: 0.3rem 0; }
.alert-bad, .alert-bad a { color: var(--bad); }
.alert-warn, .alert-warn a { color: var(--warn); }
.alerts.calm p { margin: 0; color: var(--ok); }

/* Status pills (semantic colour only) */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.6;
  padding: 0 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
  vertical-align: middle;
}
.pill-ok { color: var(--ok); border-color: rgba(61, 220, 151, 0.32); background: rgba(61, 220, 151, 0.08); }
.pill-warn { color: var(--warn); border-color: rgba(245, 184, 75, 0.32); background: rgba(245, 184, 75, 0.08); }
.pill-bad { color: #ff6b73; border-color: rgba(255, 42, 53, 0.4); background: var(--red-tint); }
.pill-gold { color: #fff; border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); }

/* Flash messages */
.flash { border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); }
.flash ul { margin: 0; padding-left: 1.1rem; }
.flash-ok { border-color: rgba(61, 220, 151, 0.35); color: #b8f3d6; background: rgba(61, 220, 151, 0.07); }
.flash-error { border-color: rgba(255, 42, 53, 0.45); color: #ffc2c5; background: rgba(255, 30, 40, 0.09); }
.flash-info { border-color: var(--line-strong); }

/* Forms: label above, field below */
label { display: block; color: var(--text-2); font-size: 0.86rem; font-weight: 500; }
label.inline { display: flex; gap: 0.55rem; align-items: center; color: var(--text); font-weight: 400; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  background: #08080a;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: rgba(244, 244, 245, 0.42); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.24); }
input[type="checkbox"], input[type="radio"] { width: auto; display: inline-block; margin: 0; accent-color: var(--red-solid); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 42, 53, 0.2); }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1rem; margin: 0; }
legend { color: var(--muted); padding: 0 0.35rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; }
.slot { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.slot input { width: auto; }
.title-option { display: flex; gap: 0.6rem; align-items: center; margin: 0.4rem 0; }
.title-option input[type="text"] { margin: 0; }
.inline-form { display: inline; }
details > summary { cursor: pointer; color: var(--red); margin: 0.35rem 0; font-weight: 500; }
.signin .btn-wide { width: 100%; margin-bottom: 0.35rem; }

/* Buttons: neutral by default, red for the one primary action (the theneocore.com button) */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover, button:hover { border-color: rgba(255, 255, 255, 0.28); background: #222227; color: #fff; }
.btn:active, button:active { transform: translateY(1px) scale(0.99); }
.btn-gold {
  color: #fff;
  background: var(--red-solid);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.22), inset 0 1px 3px rgba(255, 255, 255, 0.3), inset 0 -4px 6px rgba(139, 0, 0, 0.32);
}
.btn-gold:hover { background: #f50a18; color: #fff; border-color: transparent; box-shadow: 0 6px 22px rgba(255, 0, 0, 0.32), inset 0 1px 3px rgba(255, 255, 255, 0.34), inset 0 -4px 6px rgba(139, 0, 0, 0.32); }
.btn-danger { color: #ffc2c5; background: var(--red-tint); border-color: rgba(255, 42, 53, 0.45); }
.btn-danger:hover { color: #fff; background: rgba(255, 30, 40, 0.18); border-color: var(--red); }
.btn-small { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-link { background: none; border: 0; color: var(--muted); padding: 0.35rem 0.4rem; box-shadow: none; }
.btn-link:hover { background: none; color: var(--text); }
button[disabled], .btn[disabled] { opacity: 0.42; cursor: not-allowed; transform: none; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table thead th { color: var(--muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; background: var(--surface-2); }
.table .actions form { display: inline; }
.audit .detail { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); word-break: break-all; max-width: 30rem; }
.checks th { text-transform: capitalize; }

/* Review */
.player { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); border: 1px solid var(--line); }
.shorts { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.short { margin: 0; width: 180px; }
.short video { width: 180px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--line); }
.short figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
.missing { padding: 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 0.84rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.thumb { display: flex; flex-direction: column; gap: 0.4rem; width: 220px; color: var(--text); }
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); border: 2px solid var(--line); transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.thumb input:checked + img { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 42, 53, 0.16); }
.short-edit { margin-top: 0.85rem; }
.report, .log {
  white-space: pre-wrap;
  word-break: break-word;
  background: #070708;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  max-height: 28rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-2);
}
.codes ol { columns: 2; font-size: 1.05rem; font-family: var(--mono); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 1rem; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 7.5rem; padding: 0.45rem; transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease); }
.cal-month .cal-day { min-height: 5.75rem; }
.cal-day.outside { opacity: 0.4; }
.cal-day.today { border-color: rgba(255, 42, 53, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 42, 53, 0.25), 0 0 22px -10px var(--red-glow); }
.cal-day.drop-target { border-color: var(--red); background: rgba(255, 30, 40, 0.07); }
.cal-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem; font-weight: 500; }
.cal-day.today .cal-date { color: #fff; }
.cal-date .wd { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.66rem; font-weight: 600; }
.cal-item { font-size: 0.74rem; border-radius: 8px; padding: 0.2rem 0.4rem; margin-bottom: 4px; background: var(--surface-3); border-left: 3px solid var(--line-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.kind-long { border-left-color: var(--red); background: rgba(255, 30, 40, 0.08); }
.cal-item[draggable="true"] { cursor: grab; }
.cal-item[draggable="true"]:active { cursor: grabbing; }
.cal-item.status-scheduled, .cal-item.status-live, .cal-item.status-uploading { opacity: 0.6; }
.cal-item.status-held { border-left-color: var(--warn); }
.cal-title { color: var(--text); }
.legend { font-size: 0.84rem; color: var(--muted); }

/* Topics */
.topics li { border-bottom: 1px solid var(--line); padding: 0.65rem 0; }
.topics li:last-child { border-bottom: 0; }
.topic { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--text); }
.topic input { margin-top: 0.3rem; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; margin-left: 0.3rem; }

/* Kill switch */
.kill.engaged { border-color: rgba(255, 42, 53, 0.55); background: linear-gradient(180deg, rgba(255, 30, 40, 0.12), rgba(255, 30, 40, 0.03)), var(--surface); box-shadow: 0 0 40px -18px var(--red-glow); }

/* htmx */
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Phones and small tablets: the sidebar becomes a top bar with a scrolling nav */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 0.75rem 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 8, 9, 0.94);
    z-index: 10;
  }
  .brand { flex-direction: row; align-items: baseline; gap: 0.6rem; padding: 0; }
  .stamp { font-size: 0.95rem; letter-spacing: 0.26em; }
  .nav { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0.45rem 0.7rem; }
  .nav a[aria-current="page"]::before { display: none; }
  .signout { margin: 0 0 0 auto; padding: 0; }
  .wrap { padding: 1.25rem 16px 4rem; }
  h1 { font-size: 1.4rem; }
}
@media (max-width: 720px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-day { min-height: 0; }
  .cal-month { gap: 3px; }
  .cal-month .cal-day { min-height: 3.5rem; padding: 0.25rem; }
  .cal-month .cal-title, .cal-month .cal-item small { display: none; }
  .short, .short video { width: 140px; }
  .thumb { width: 100%; }
  .codes ol { columns: 1; }
  .tabs { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Fine-tuning after the first look */
.is-bare .shell { grid-template-rows: auto 1fr; align-content: start; }
.is-bare .side { padding-top: 4rem; }
.stats dd { font-size: 1.3rem; }
.stats dd a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255, 42, 53, 0.5); }
.stats dd a:hover { color: #fff; border-bottom-color: var(--red); }
form.row + form, form.row + form.row { margin-top: 0.75rem; }
form > .btn-gold + small, form > .btn + small { margin-left: 0.6rem; }
/* Flex and grid children may shrink below their content (keeps the phone layout inside the screen). */
.shell > *, .side, .nav, .wrap, .card, .row > * { min-width: 0; }
@media (max-width: 860px) {
  .side { max-width: 100vw; }
  .nav { max-width: 100%; }
  .alerts li, .card p { overflow-wrap: anywhere; }
  .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* Videos page */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.row-between h2 { margin: 0; }
.videos-table td:first-child { min-width: 13rem; }
.videos-table td:nth-child(5) { white-space: nowrap; }
