/* TV create -- the phone's create sheet, dressed as the TV page.

   Same order and fields as templates/partials/create.html; only the look is
   the TV's: white and black, Archivo wide for anything you press, Plex Mono
   for labels, 2px black borders, orange only on the one action that drops a
   byte. A right-hand panel over the page, so the TV stays in view behind it.
   Uses the tokens from tv.css. No !important. */

.tvc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.42);
  animation: tvc-fade 0.14s ease;
}
@keyframes tvc-fade { from { opacity: 0; } }

.tvc {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  width: min(480px, var(--pane-w, 100vw));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border-left: 2px solid var(--ink);
  font-family: Inter, system-ui, sans-serif;
  animation: tvc-in 0.18s cubic-bezier(0.2, 0, 0.2, 1);
}
@keyframes tvc-in { from { transform: translateX(28px); opacity: 0; } }

/* ------------------------------------------------------------------ head */

.tvc-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 2px solid var(--ink);
}
.tvc-head__cancel {
  justify-self: start;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
  padding: 6px 0;
}
.tvc-head__title { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#tvc-heading {
  font-family: var(--wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
#tvc-state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.tvc-head__gear {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tvc-scroll { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px 40px; }

/* ------------------------------------------------------- shared pieces */

.tvc-label, .tvc-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}
.tvc-eyebrow {
  display: flex;
  justify-content: space-between;
  margin: 18px 2px 8px;
}

.tvc-card {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 12px;
  background: var(--paper);
}

.tvc-input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}
.tvc-input::placeholder, .tvc-caption::placeholder { color: var(--dim); }
.tvc-input:focus { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12); }
.tvc-input--bare { border: 0; padding: 4px 2px; }
.tvc-input--bare:focus { box-shadow: none; }

.tvc-caption {
  width: 100%;
  border: 0;
  outline: none;
  resize: vertical;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
  min-height: 96px;
}

.tvc-help { margin: 8px 2px 0; font-size: 12px; color: var(--dim); line-height: 1.4; }

.tvc-link {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 0;
}

.tvc-pill {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--wide);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}

.tvc-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #d92d20;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

/* ---------------------------------------------------------------- source */

.tvc-source {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  margin-top: 14px;
}
.tvc-source__btn {
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--wide);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}
.tvc-source__btn.is-active { background: var(--ink); color: var(--paper); }

.tvc-types { margin-top: 16px; }
.tvc-types__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.tvc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tvc-chip.is-selected { background: var(--ink); color: var(--paper); }
.tvc-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  overflow: hidden;
}
.tvc-mark svg { width: 12px; height: 12px; fill: currentColor; }

/* ----------------------------------------------------------------- media */

.tvc-upload {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 132px;
  padding: 18px;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  background: var(--paper-2);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.tvc-upload:hover, .tvc-upload:focus-within { background: var(--paper); border-color: #ff6200; transform: translateY(-1px); }
.tvc-upload__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.tvc-upload__copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tvc-upload__title { font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvc-upload__meta { font-size: 12px; color: var(--dim); }
.tvc-upload__action {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--wide);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.tvc-upload__action span { font-family: Inter, system-ui, sans-serif; font-size: 20px; line-height: 1; }

.tvc-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.tvc-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  border: 0;
  padding: 0;
}
.tvc-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tvc-tile__badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
}
.tvc-tile__badge:empty { display: none; }
.tvc-tile__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.tvc-tile--add {
  border: 2px dashed var(--ink);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
}
.tvc-tile__plus { font-size: 22px; font-family: var(--wide); font-weight: 900; }

.tvc-msg {
  margin-top: 10px;
  font-size: 13px;
  color: #b42318;
}
.tvc-msg.is-ok { color: #067647; }

.tvc-storage {
  margin-top: 10px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.tvc-storage.is-nudge { background: var(--ink); color: var(--paper); }

.tvc-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
}
.tvc-or::before, .tvc-or::after { content: ""; flex: 1; border-top: 2px solid var(--paper-2); }

.tvc-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
}
.tvc-drop small { color: var(--dim); font-size: 11px; }
.tvc-drop--small { padding: 12px; }

.tvc-audio { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tvc-audio audio { width: 100%; }
.tvc-audio__info { margin: 0; font-size: 12px; color: var(--dim); }
.tvc-audio__cover { display: flex; align-items: center; gap: 12px; }
.tvc-audio__cover img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }

/* ---------------------------------------------------------- link preview */

.tvc-preview { margin-top: 12px; }
.tvc-lp { border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.tvc-lp__bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tvc-lp__status { color: #067647; }
.tvc-lp__frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.tvc-lp__frame.is-tall { aspect-ratio: 9 / 16; max-height: 520px; margin: 0 auto; }
.tvc-lp__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------------------ post */

.tvc-foot { margin-top: 18px; }
.tvc-post {
  width: 100%;
  height: 54px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--dim);
  font-family: var(--wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.tvc-post.is-ready { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }
.tvc-post:disabled { opacity: 0.55; cursor: default; }
.tvc-foot__note { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--dim); }

/* ------------------------------------------------------------ more options */

.tvc-more { margin-top: 22px; border-top: 2px solid var(--ink); }
.tvc-more__summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 16px 2px;
  cursor: pointer;
  font-family: var(--wide);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 13px;
  text-transform: uppercase;
}
.tvc-more__summary::-webkit-details-marker { display: none; }
.tvc-more__body { display: flex; flex-direction: column; gap: 22px; padding-bottom: 8px; }

.tvc-season__head { align-items: center; }
.tvc-season__head .tvc-link { letter-spacing: normal; text-transform: none; }
.tvc-publish__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tvc-dd { position: relative; }
.tvc-dd__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
/* The season's cover beside its name, in the field and in the list. */
.tvc-dd__cover {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper-2);
}
.tvc-dd__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tvc-dd__words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tvc-dd__chev { flex: 0 0 auto; font-size: 16px; }
.tvc-dd__btn:disabled { cursor: default; opacity: 1; }
.tvc-season.is-readonly .tvc-dd__btn { border-style: dashed; }
.tvc-dd__title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvc-dd__meta { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.tvc-dd__panel {
  margin-top: 8px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tvc-dd__auto {
  border: 0;
  background: var(--paper-2);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.tvc-dd__list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.tvc-dd__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.tvc-dd__item:hover { background: var(--paper-2); }
.tvc-dd__item.is-selected { background: var(--ink); color: var(--paper); }
.tvc-dd__item-title { font-weight: 600; font-size: 14px; }
.tvc-dd__item-meta { font-family: var(--mono); font-size: 11px; opacity: 0.7; }
.tvc-dd__empty { padding: 10px 12px; font-size: 13px; color: var(--dim); }
.tvc-season__auto { display: none; } /* the field's own meta line says where Auto lands */
.tvc-dd__chev[hidden] { display: none; }

.tvc-connect {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.tvc-publish__grid { display: flex; flex-direction: column; gap: 6px; }
.tvc-pt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.tvc-pt.is-selected { background: var(--ink); color: var(--paper); }
.tvc-pt.is-disconnected { border-style: dashed; }
.tvc-pt__icon { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; display: inline-flex; }
.tvc-pt__icon img { width: 100%; height: 100%; object-fit: cover; }
.tvc-pt__icon .tvc-mark { width: 30px; height: 30px; border-radius: 8px; }
.tvc-pt__icon .tvc-mark svg { width: 16px; height: 16px; }
.tvc-pt__copy { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tvc-pt__name { font-weight: 700; font-size: 14px; }
.tvc-pt__handle { font-family: var(--mono); font-size: 11px; opacity: 0.7; }
.tvc-pt__go { font-weight: 800; }
.tvc-publish__note { margin-top: 8px; font-size: 12px; color: var(--dim); }
.tvc-publish__note.is-warn { color: #b42318; }
/* Short on posts: one plain line and the way to get more (tv-create.js
   renderCreditNotice; the sheet is desktop/publish-credits-sheet.js). */
.tvc-credit {
  margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.tvc-credit[hidden] { display: none !important; }
.tvc-credit__text { font-size: 13px; line-height: 1.35; color: var(--dim); min-width: 0; }
.tvc-credit__text b { color: var(--ink); font-weight: 600; }
.tvc-credit__btn {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.tvc-credit__btn:hover { filter: brightness(1.1); }
.tvc-publish__results { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.tvc-pr { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 2px; }
.tvc-pr.is-ok span:last-child { color: #067647; }
.tvc-pr.is-fail span:last-child { color: #b42318; }
.tvc-pr.is-pending span:last-child { color: var(--dim); }

/* ------------------------------------------------------------------ auth */

.tvc-posting { display: flex; align-items: center; gap: 12px; }
.tvc-posting__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); }
.tvc-posting__copy { display: flex; flex-direction: column; gap: 2px; }
.tvc-posting__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.tvc-posting__name { font-weight: 700; font-size: 15px; }
.tvc-posting__meta { font-size: 12px; color: var(--dim); }

.tvc-rows { padding: 0; }
.tvc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.tvc-row + .tvc-row { border-top: 2px solid var(--paper-2); }
.tvc-row span { width: 40px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--dim); }
.tvc-row input { flex: 1; border: 0; outline: none; font: inherit; font-size: 15px; background: transparent; color: var(--ink); }

.tvc-gate { display: flex; flex-direction: column; gap: 4px; }
.tvc-gate__title {
  margin: 0;
  font-family: var(--wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 22px;
  text-transform: uppercase;
}
.tvc-gate__copy { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--dim); }
.tvc-gate .tvc-post { margin-top: 14px; }

/* -------------------------------------------------------------- settings */

.tvc-settings { display: flex; flex-direction: column; gap: 22px; }
.tvc-set h4 {
  margin: 0;
  font-family: var(--wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 15px;
  text-transform: uppercase;
}
.tvc-set h5 { margin: 12px 0 8px; font-size: 13px; }
.tvc-set p { margin: 4px 0 10px; font-size: 13px; color: var(--dim); }
.tvc-radio, .tvc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
}
.tvc-check { justify-content: space-between; }
.tvc-radio input, .tvc-check input { accent-color: var(--ink); width: 18px; height: 18px; }
.tvc-set__row { display: flex; gap: 8px; }

/* ------------------------------------------------------------ new season */

.tvc-ns { z-index: 80; }
.tvc-ns__card {
  width: min(440px, calc(var(--pane-w, 100vw) - 32px));
  max-height: calc(var(--pane-h, 100vh) - 48px);
  overflow-y: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}
.tvc-ns__top { display: flex; justify-content: space-between; align-items: flex-start; }
.tvc-ns__kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.tvc-ns__heading { font-family: var(--wide); font-weight: 900; font-stretch: 125%; font-size: 24px; text-transform: uppercase; }
.tvc-ns__top .tvc-head__cancel { font-size: 22px; }
.tvc-ns__preview { border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; }
.tvc-ns__thumb { height: 120px; background: var(--paper-2) center / cover no-repeat; }
.tvc-ns__title { padding: 10px 14px 0; font-weight: 700; }
.tvc-ns__desc { padding: 2px 14px 12px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.tvc-field { display: flex; flex-direction: column; gap: 6px; }
.tvc-field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.tvc-ns__actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }

/* Anything above that sets display outranks the hidden attribute. */
.tvc[hidden],
.tvc-backdrop[hidden],
.tvc-ns[hidden],
.tvc-sec[hidden],
.tvc-types[hidden],
.tvc-preview[hidden],
.tvc-audio[hidden],
.tvc-audio__cover[hidden],
.tvc-drop[hidden],
.tvc-dd__panel[hidden],
.tvc-publish[hidden],
.tvc-publish__grid[hidden],
.tvc-publish__note[hidden],
.tvc-publish__results[hidden],
.tvc-connect[hidden],
.tvc-link[hidden],
.tvc-season[hidden],
.tvc-settings[hidden],
.tvc-error[hidden],
.tvc-msg[hidden],
.tvc-storage[hidden],
.tvc-head__gear[hidden],
#tvc-form[hidden],
#tvc-compose[hidden],
#tvc-media-preview[hidden],
.tvc-set__code[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tvc, .tvc-backdrop { animation: none; }
}
