/* ---------------------------------------------------------------------------
   Trogon.Cloud — additions to admin.css.

   admin.css is the PSCNET portal's stylesheet, copied unchanged from
   Malayalam GK so it can be copied across again. Anything this app needs
   on top lives here, prefixed tv-.
--------------------------------------------------------------------------- */

/* Brand colours: navy and gold, shared with trogon.cloud. admin.css reads
   every accent shade from the --ac-* scale and the top bar from --bar, so
   replacing the tokens here re-colours the whole app without editing it.
   Gold is kept for small details (the brand, the active marker). */
@font-face { font-family: "Plus Jakarta Sans"; src: url("/theme/fonts/plus-jakarta-sans-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --ac-50:  #f2f5fa;
  --ac-100: #e4e9f3;
  --ac-200: #c9d2e6;
  --ac-300: #9fafcf;
  --ac-400: #6a80ad;
  --ac-500: #3a5288;
  --ac-600: #1a2c52;
  --ac-700: #0f1f3d;
  --ac-800: #0b1730;
  --ac-900: #08132a;
  --ac-950: #050c1c;

  --ring: rgba(26, 44, 82, .22);

  --bar:      #0f1f3d;
  --bar-text: #f5f7fb;
  --bar-soft: rgba(245, 247, 251, .6);
  --bar-dim:  rgba(245, 247, 251, .42);

  --tv-gold:      #d9b45a;
  --tv-gold-deep: #b8913a;
}

/* The sign-in page's wash, in the brand colour instead of indigo. */
.auth::before {
  background:
    radial-gradient(70% 46% at 50% -4%, rgba(217, 180, 90, .14) 0%, transparent 68%),
    linear-gradient(180deg, #fbfaf6 0%, var(--bg) 46%);
}

/* Brand: a play mark beside "Trogon.Cloud", with the panel (Admin or
   Studio) as the line under it. */
.tv-brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.tv-mark {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 9px;
}
.tv-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tv-brand-name {
  font-family: "Plus Jakarta Sans", var(--font, sans-serif);
  font-size: 16.5px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ac-700); white-space: nowrap;
}
.tv-brand-dot { color: var(--tv-gold-deep); }
.tv-brand-sub {
  margin-top: 3px;
  font-size: 10px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted);
}
.tv-brand-sub::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 5px; height: 5px; margin: -2px 6px 0 0;
  border-radius: 50%; background: var(--tv-gold);
}

/* Sidebar: the brand gets its own band above the menu. */
.sidebar-brand.tv-brand {
  margin: 10px 12px 6px; padding: 10px;
  border-radius: 14px;
  background: var(--ac-50);
  border: 1px solid var(--ac-100);
}
.sidebar-brand.tv-brand:hover { border-color: var(--ac-200); }

/* Sign-in card: a larger mark stacked over the name. */
.tv-brand-lg { flex-direction: column; gap: 14px; margin-bottom: 22px; }
.tv-brand-lg .tv-mark { width: 60px; height: 60px; border-radius: 14px; }
.tv-brand-lg .tv-brand-text { align-items: center; }
.tv-brand-lg .tv-brand-name { font-size: 24px; }
.tv-brand-lg .tv-brand-sub { margin-top: 5px; font-size: 10.5px; }

/* Rows that open their own page, drawn like plain rows. */
a.tv-link-row { color: inherit; text-decoration: none; }
a.tv-link-row:hover .row-title { color: var(--accent); }

/* Dashboard: two equal panels on wide screens. */
@media (min-width: 1100px) { .panel-grid.tv-even { grid-template-columns: 1fr 1fr; } }

/* Forms on the account screen. */
.tv-form { display: grid; gap: 14px; padding-bottom: 16px; }
.tv-actions { display: flex; gap: 10px; padding-bottom: 16px; }

/* ---------------------------------------------------------------------------
   Step 2: customers, projects, folders, people.
--------------------------------------------------------------------------- */

/* Lists. Each sets its own columns on the shared .alist-head / .arow grid. */
.alist-head.tv-clist, .arow.tv-clist { grid-template-columns: minmax(0, 1fr) 90px 90px 104px; }
.alist-head.tv-plist, .arow.tv-plist { grid-template-columns: minmax(0, 1fr) minmax(0, 200px) 80px 104px; }
.alist-head.tv-plist-own, .arow.tv-plist-own { grid-template-columns: minmax(0, 1fr) 110px 80px 104px; }
.alist-head.tv-ulist, .arow.tv-ulist { grid-template-columns: 34px minmax(0, 1fr) 80px 150px 96px; }
.alist-head.tv-slist, .arow.tv-slist { grid-template-columns: 34px minmax(0, 1fr) 120px minmax(0, 220px) 96px; }
.tv-cell-end, .alist-head .tv-cell-end { text-align: right; }
.arow .row-meta { overflow: hidden; text-overflow: ellipsis; }
.arow .is-none { color: var(--n-400); }
@media (max-width: 760px) {
  .alist-head.tv-clist, .arow.tv-clist,
  .alist-head.tv-plist, .arow.tv-plist,
  .alist-head.tv-plist-own, .arow.tv-plist-own { grid-template-columns: minmax(0, 1fr) 96px; }
  .tv-clist > :nth-child(2), .tv-clist > :nth-child(3),
  .tv-plist > :nth-child(2), .tv-plist > :nth-child(3),
  .tv-plist-own > :nth-child(2), .tv-plist-own > :nth-child(3) { display: none; }
  .alist-head.tv-ulist, .arow.tv-ulist,
  .alist-head.tv-slist, .arow.tv-slist { grid-template-columns: 34px minmax(0, 1fr) 96px; }
  .tv-ulist > :nth-child(3), .tv-ulist > :nth-child(4),
  .tv-slist > :nth-child(3), .tv-slist > :nth-child(4) { display: none; }
}

/* A panel whose list runs edge to edge under its heading. */
.panel-body.tv-flush { padding: 0; }
.panel-head .a-btn { flex: none; }

/* Facts about a record, label above value. */
.tv-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px 22px; margin: 0; padding: 0 18px 18px; }
.tv-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tv-facts dd { margin: 3px 0 0; font-size: 13.5px; color: var(--text); }
.tv-code {
  display: inline-block; padding: 2px 7px; border-radius: var(--radius-sm);
  background: var(--n-100); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}

/* Project tabs: Folders (where a project opens) and Details. Underlined
   rather than segmented, because they switch the whole page body. */
.tv-tabs {
  display: flex; gap: 2px;
  margin-bottom: -4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tv-tab {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: -1px; padding: 9px 14px 11px;
  border-bottom: 2px solid transparent;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  color: var(--muted); text-decoration: none;
  transition: color .14s ease, border-color .14s ease;
}
.tv-tab:hover { color: var(--text); text-decoration: none; }
.tv-tab.is-on { color: var(--ac-700); border-bottom-color: var(--tv-gold); }
.tv-tab .nav-icon, .tv-tab-icon { width: 16px; height: 16px; flex: none; color: currentColor; }
.tv-tab-icon { color: var(--tv-gold-deep); }
.tv-tab.is-on .seg-count { color: var(--ac-700); background: var(--accent-soft); }

/* Folder browser: the tree on the left, the open folder's contents on the
   right. Below 900px the tree goes and the path above the title does its
   job. */
.tv-explorer { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 460px; }
.tv-explorer-side { display: none; }
@media (min-width: 900px) {
  .tv-explorer { grid-template-columns: 264px minmax(0, 1fr); }
  .tv-explorer-side {
    display: block;
    padding: 12px 10px 18px;
    background: var(--surface-2);
    border-right: 1px solid var(--divider);
  }
}

.tv-node {
  display: flex; align-items: center; gap: 6px;
  min-height: 32px; margin: 1px 0;
  padding: 0 10px 0 calc(4px + var(--depth, 0) * 16px);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-soft); text-decoration: none;
}
.tv-node:hover { background: var(--n-100); color: var(--text); text-decoration: none; }
.tv-node.is-on {
  background: var(--surface); color: var(--ac-700); font-weight: 600;
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border);
}
.tv-node-caret { width: 14px; height: 14px; flex: none; color: var(--n-400); }
.tv-node-caret svg { display: block; width: 14px; height: 14px; transition: transform .15s ease; }
.tv-node.is-expanded .tv-node-caret svg { transform: rotate(90deg); }
.tv-node-icon, .tv-node .nav-icon { width: 17px; height: 17px; flex: none; }
.tv-node-icon { color: var(--tv-gold-deep); }
.tv-node-root .nav-icon { color: var(--ac-500); }
.tv-node-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tv-explorer-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 18px 20px 20px; }
.tv-explorer-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}
.tv-explorer-where { min-width: 0; }
.tv-explorer-where .crumbs { margin-bottom: 6px; }
.tv-explorer-title {
  font-family: "Plus Jakarta Sans", var(--font, sans-serif);
  font-size: 18px; font-weight: 700; letter-spacing: -.025em; color: var(--ac-700);
  overflow-wrap: anywhere;
}
.tv-explorer-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tv-explorer-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tv-folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.tv-folder-card {
  position: relative;
  display: grid; gap: 2px; align-content: start;
  padding: 14px 14px 13px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tv-folder-card:hover { border-color: var(--ac-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.tv-folder-card:has(.tv-folder-card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tv-folder-card-icon { width: 36px; height: 36px; margin-bottom: 8px; color: var(--tv-gold-deep); }
.tv-folder-card-link {
  font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-folder-card-link:hover { color: var(--text); text-decoration: none; }
.tv-folder-card-link:focus-visible { outline: none; }
/* The whole card is the link; the edit button sits above it. */
.tv-folder-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tv-folder-card-meta { font-size: 12px; color: var(--muted); }
.tv-folder-card-edit {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  opacity: 0; transition: opacity .12s ease;
}
.tv-folder-card:hover .tv-folder-card-edit, .tv-folder-card:focus-within .tv-folder-card-edit { opacity: 1; }
@media (hover: none) { .tv-folder-card-edit { opacity: 1; } }

.tv-explorer-empty {
  flex: 1;
  display: grid; justify-items: center; align-content: center; gap: 6px;
  padding: 36px 20px 28px;
  text-align: center;
  border: 1.5px dashed var(--n-200); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
}
.tv-explorer-empty-icon { width: 52px; height: 52px; margin-bottom: 6px; color: var(--tv-gold); }
.tv-explorer-empty-title { font-size: 15px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.tv-explorer-empty-text { max-width: 420px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.tv-explorer-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
/* Why uploads aren't open yet: a small card under the empty state's
   buttons, apart from them, so it reads as news rather than an action. */
.tv-soon {
  display: flex; align-items: flex-start; gap: 14px;
  width: min(460px, 100%); margin-top: 26px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
  text-align: left;
}
.tv-soon-icon {
  position: relative; display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--ac-700); color: var(--tv-gold);
}
.tv-soon-icon > svg { width: 22px; height: 22px; }
.tv-soon-badge {
  position: absolute; right: -5px; bottom: -5px;
  display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; border: 2px solid var(--surface);
  background: var(--tv-gold); color: var(--ac-800);
}
.tv-soon-badge svg { width: 12px; height: 12px; }
.tv-soon-body { display: grid; gap: 4px; min-width: 0; }
.tv-soon-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.tv-soon-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 8px; border-radius: 999px;
  background: #fbf4e2; color: var(--tv-gold-deep);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.tv-soon-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tv-gold-deep); animation: tv-pulse 1.6s ease-in-out infinite; }
.tv-soon-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-soft); }
.tv-soon-help { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.tv-soon-help a { font-weight: 600; color: var(--ac-700); }
.tv-soon-action { justify-self: start; margin-top: 8px; }
.tv-explorer-empty .tv-soon-action { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .tv-soon-dot { animation: none; } }

.tv-explorer-videos {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto; padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--ac-50); color: var(--ac-600);
  font-size: 12.5px;
}
.tv-explorer-videos .nav-icon { width: 16px; height: 16px; color: currentColor; }

/* A small form over the page, in a native <dialog>. */
.tv-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.tv-dialog::backdrop { background: rgba(8, 19, 42, .5); backdrop-filter: blur(2px); }
.tv-dialog[open] { animation: tv-dialog-in .16s ease-out; }
@keyframes tv-dialog-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .tv-dialog[open] { animation: none; } }
.tv-dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 4px 20px; }
.tv-dialog-icon {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--ac-50); color: var(--tv-gold-deep);
}
.tv-dialog-icon svg { width: 22px; height: 22px; }
.tv-dialog-heading { flex: 1; min-width: 0; }
.tv-dialog-title { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.tv-dialog-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.tv-dialog-sub strong { color: var(--text-soft); font-weight: 600; }
.tv-dialog-x { flex: none; margin-top: -4px; }
.tv-dialog-body { display: grid; gap: 14px; padding: 18px 20px 20px; }
.tv-dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--divider);
}

/* Where a new folder goes, at the head of its dialog: the project, then
   the open folder's path. */
.tv-dialog-where {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
  margin-top: 4px;
  font-size: 12.5px; color: var(--muted);
}
.tv-where-step { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.tv-where-in { margin-right: 2px; }
.tv-where-step:last-child { color: var(--text); font-weight: 600; }
.tv-where-sep { width: 12px; height: 12px; flex: none; color: var(--n-400); }
.tv-where-icon { width: 15px; height: 15px; flex: none; color: var(--tv-gold-deep); }
.tv-dialog-tip { margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); }
.tv-dialog-tip[hidden] { display: none; }
@media (max-width: 479px) { .tv-dialog-tip { display: none; } }
kbd {
  display: inline-block; min-width: 20px;
  padding: 1px 5px;
  font: 600 11px/1.5 var(--font, sans-serif); text-align: center;
  color: var(--text-soft); background: var(--surface);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--border), 0 1px 0 var(--n-200);
}

/* Naming new folders: one, or a list of them. */
.tv-newf { display: grid; gap: 14px; }
.tv-newf-mode { justify-self: start; }
.tv-newf-pane { display: grid; gap: 10px; }
.tv-newf-pane[hidden] { display: none; }
.tv-newf textarea { min-height: 150px; resize: vertical; font-family: inherit; line-height: 1.6; }
.tv-newf-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tv-newf-quick-label { margin-right: 2px; font-size: 12px; color: var(--muted); }
.tv-chip {
  display: inline-flex; align-items: center;
  min-height: 26px; padding: 0 10px;
  font: 500 12.5px/1 var(--font, sans-serif);
  color: var(--text-soft); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.tv-chip:hover { border-color: var(--ac-300, var(--ac-200)); background: var(--ac-50); color: var(--ac-700); }
.tv-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tv-newf-count { min-height: 18px; font-size: 12.5px; font-weight: 600; color: var(--ac-700); font-variant-numeric: tabular-nums; }
.tv-newf-count.is-over { color: var(--danger, #b42318); }

/* The grid ends in a tile that makes a folder where you are. */
.tv-folder-card-add {
  align-content: center;
  border: 1.5px dashed var(--n-300); background: transparent;
}
.tv-folder-card-add:hover { background: var(--surface); border-color: var(--ac-400); }
.tv-folder-card-add .tv-folder-card-link { display: flex; align-items: center; gap: 10px; color: var(--ac-700); }
.tv-folder-card-plus {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--ac-50); color: var(--ac-700);
}
.tv-folder-card-plus svg { width: 18px; height: 18px; }
.tv-folder-card-add:hover .tv-folder-card-plus { background: var(--ac-700); color: var(--tv-gold); }
.tv-folder-card-add .tv-folder-card-meta { padding-left: 46px; margin-top: -8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Folders just made, until the next page. */
.tv-folder-card.is-new { border-color: var(--tv-gold); box-shadow: 0 0 0 3px rgba(217, 180, 90, .2); }
.tv-folder-card-new {
  position: absolute; top: 12px; left: 56px;
  padding: 1px 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #8f6d1f; background: rgba(217, 180, 90, .18);
  border-radius: 999px;
}

/* A busy icon-only button shows the spinner in place of its icon. */
.a-btn-icon[aria-busy="true"] > svg { display: none; }

/* Forms. */
.tv-pair { display: grid; gap: 14px; }
@media (min-width: 760px) { .tv-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
/* A long choice ends in an ellipsis instead of widening its column. */
.tv-pair > .a-field, .tv-simple .a-field { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.tv-form-top { padding-top: 4px; }

/* A password shown once, with buttons to copy it. */
.tv-secret-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tv-secret-value {
  flex: 1 1 220px; max-width: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em;
}
.tv-secret { margin-bottom: 18px; }
.tv-form-after { margin-top: 18px; }

/* Project access: one row per project with a three-way choice. */
.tv-access { display: grid; gap: 0; padding: 0 0 8px; }
.tv-access-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--divider);
}
.tv-access-name { flex: 1; min-width: 160px; font-size: 13.5px; font-weight: 500; }
.tv-access-name .pill { margin-left: 6px; vertical-align: 1px; }
/* A segmented control made of radios: here, and in .tv-choice on forms. */
.tv-access .seg-item, .tv-choice .seg-item { cursor: pointer; }
.tv-access .seg-item input, .tv-choice .seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.tv-access .seg-item:has(input:checked), .tv-choice .seg-item:has(input:checked) {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.tv-access .seg-item:has(input:focus-visible), .tv-choice .seg-item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.tv-choice { align-self: start; justify-self: start; }

/* Staff assignments: a customer, then its projects under it. */
.tv-assign { display: grid; gap: 0; padding: 0 0 8px; }
.tv-assign-group { padding: 12px 18px; border-top: 1px solid var(--divider); }
.tv-assign-customer { font-weight: 600; color: var(--text); }
.tv-assign-projects { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 0 26px; }
.tv-assign-projects .is-covered { opacity: .55; }
.tv-assign-none { margin: 8px 0 0 26px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Sign-in screens. Admin and Studio look nothing alike on purpose, so a
   customer never wonders whether they are on Trogon's console:
   Admin is dark and closed; Studio is light, with the product beside it.
--------------------------------------------------------------------------- */
.tv-auth-alert { margin-top: 20px; }
.admin-auth .auth-title { font-family: "Plus Jakarta Sans", var(--font, sans-serif); }

/* Admin: a navy page, a gold rule across the top, one compact card. */
body.tv-auth-admin { background: #08132a; }
.tv-console {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 20px 28px;
  border-top: 3px solid var(--tv-gold);
}
.tv-console-bar {
  width: 100%; max-width: 1120px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px;
}
.tv-brand-dark .tv-brand-name { color: #fff; }
.tv-brand-dark .tv-brand-dot { color: var(--tv-gold); }
.tv-brand-dark .tv-brand-sub { color: rgba(245, 247, 251, .55); }
.tv-brand-dark .tv-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.tv-console-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(217, 180, 90, .45); border-radius: 999px;
  color: var(--tv-gold);
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.tv-console-badge svg { width: 13px; height: 13px; }
.tv-console-card {
  width: 100%; max-width: 400px;
  margin: auto 0;
  padding: 30px 32px 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
}
.tv-console-head { display: flex; align-items: flex-start; gap: 14px; }
.tv-console-icon {
  flex: none; width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--ac-700); color: var(--tv-gold);
}
.tv-console-icon svg { width: 22px; height: 22px; }
.tv-console-head .auth-title { font-size: 19px; line-height: 1.25; }
.tv-console-head .auth-title-sub { margin-top: 4px; font-size: 13px; }
.tv-console-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--divider);
  font-size: 12px; color: var(--muted);
}
.tv-console-note svg { width: 14px; height: 14px; flex: none; }
.tv-console .auth-alt { margin-top: 16px; padding-top: 0; border-top: 0; }
.tv-console-foot {
  margin-top: 28px;
  font-size: 12px; color: rgba(245, 247, 251, .42);
}
@media (max-width: 520px) {
  .tv-console-bar { padding: 16px 0; }
  .tv-console-bar .tv-brand-sub { display: none; }
  .tv-console-card { padding: 24px 22px 20px; }
}

/* Studio: a soft grey page with the brand on top, the form on a white
   card in the middle and the legal links at the foot. */
body.tv-auth-studio { background: #f3f5f9; }
.tv-split {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 24px;
}
@media (min-width: 760px) { .tv-split { padding: 28px 44px; } }
.tv-split-main { flex: 1; display: flex; flex-direction: column; }
.tv-split-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tv-split-help {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text-soft); text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.tv-split-help:hover { border-color: var(--n-300); color: var(--text); }
.tv-split-help svg { width: 15px; height: 15px; }

.tv-split-form {
  width: 100%; max-width: 440px;
  margin: 40px auto;
  padding: 40px 40px 32px;
  background: var(--surface);
  border: 1px solid #e6e9f0;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 31, 61, .04), 0 18px 40px -18px rgba(15, 31, 61, .18);
}
@media (min-height: 700px) { .tv-split-form { margin-block: auto; } }
@media (max-width: 520px) { .tv-split-form { padding: 30px 22px 24px; border-radius: 16px; } }
.tv-split-form .auth-title { font-size: 28px; line-height: 1.15; letter-spacing: -.035em; color: var(--ac-700); }
.tv-split-form .auth-title-sub { margin-top: 10px; font-size: 14.5px; line-height: 1.5; }
.tv-split-form .a-form { margin-top: 30px; gap: 16px; }
.tv-split-form .a-btn-primary { margin-top: 4px; }
.tv-split-form .auth-alt { text-align: left; }
.tv-split-note {
  margin: 28px -40px -32px; padding: 18px 40px 20px;
  border-radius: 0 0 17px 17px;
  background: #fafbfc;
  border-top: 1px solid var(--divider);
  font-size: 13px; line-height: 1.55; color: var(--muted);
}
.tv-split-note a { font-weight: 600; white-space: nowrap; }
.tv-split-note a::after { content: " \2192"; }

.tv-split-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.tv-split-foot nav { display: flex; gap: 18px; }
.tv-split-foot a { color: var(--muted); text-decoration: none; }
.tv-split-foot a:hover { color: var(--text); }
@media (max-width: 520px) { .tv-split-note { margin-inline: -22px; margin-bottom: -24px; padding-inline: 22px; } }

/* ---------------------------------------------------------------------------
   Step 3: provider accounts, storage and streaming configuration.
--------------------------------------------------------------------------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.is-none { color: var(--n-400); }

.alist-head.tv-pvlist, .arow.tv-pvlist { grid-template-columns: minmax(0, 1fr) 120px 80px 104px; }
.alist-head.tv-stlist, .arow.tv-stlist { grid-template-columns: minmax(0, 1fr) 80px 130px; }
@media (max-width: 760px) {
  .alist-head.tv-pvlist, .arow.tv-pvlist { grid-template-columns: minmax(0, 1fr) 104px; }
  .tv-pvlist > :nth-child(2), .tv-pvlist > :nth-child(3) { display: none; }
  .alist-head.tv-stlist, .arow.tv-stlist { grid-template-columns: minmax(0, 1fr) 130px; }
  .tv-stlist > :nth-child(2) { display: none; }
}

/* Facts in one column, for a narrow side panel; or in wider cells. */
.tv-facts-one { grid-template-columns: minmax(0, 1fr); }
.tv-facts-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tv-facts dd .tv-code { overflow-wrap: anywhere; }

/* Capabilities: ticked on the form, listed on the account. */
.tv-caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 24px; padding-bottom: 12px; }
.a-check.tv-cap { align-items: flex-start; }
.a-check.tv-cap input { margin-top: 2px; flex: none; }
.tv-cap-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.tv-cap-text { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.tv-cap-list { display: grid; gap: 12px; margin: 0; padding: 0 18px 18px; list-style: none; }
.tv-cap-list li { display: flex; align-items: flex-start; gap: 10px; }
.tv-cap-list li:not(.is-allowed) .tv-cap-name { color: var(--muted); font-weight: 500; }
.tv-cap-mark {
  display: grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%; background: var(--n-100); color: var(--n-400);
}
.tv-cap-mark svg { width: 12px; height: 12px; }
.is-allowed .tv-cap-mark { background: var(--success-bg); color: var(--success); }

/* Buckets on a storage connection, with their own buttons. */
.row.tv-bucket { gap: 12px; flex-wrap: wrap; }
.tv-bucket .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tv-bucket-purpose { font-size: 12px; font-weight: 500; color: var(--muted); }
.tv-bucket-error { color: var(--danger); }
.tv-bucket-actions { display: flex; align-items: center; gap: 6px; }
.tv-bucket-add {
  display: grid; gap: 12px; align-items: end;
  padding: 16px 18px 18px; border-top: 1px solid var(--divider);
}
@media (min-width: 760px) { .tv-bucket-add { grid-template-columns: minmax(0, 1fr) 200px auto; } }
.tv-bucket-add .a-hint, .tv-bucket-add .a-error { grid-column: 1 / -1; }

/* The streaming setup form: one plain column, the rarely changed options
   folded away under "More options". */
.tv-simple { max-width: 640px; }
.tv-simple-body { display: grid; gap: 18px; padding: 22px 22px 20px; }
.tv-simple-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--divider); background: var(--surface-2);
}
.tv-simple-note { font-size: 12px; color: var(--muted); }
.tv-setup-empty {
  margin: 0; padding: 10px 12px; border: 1px dashed var(--n-300); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--muted);
}
.tv-setup-empty a { font-weight: 600; white-space: nowrap; }
.tv-setup-empty a::after { content: " \2192"; }
.tv-more { border-top: 1px solid var(--divider); padding-top: 14px; }
.tv-more summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--ac-700);
}
.tv-more summary::-webkit-details-marker { display: none; }
.tv-more summary::before { content: "+"; width: 12px; font-weight: 700; }
.tv-more[open] summary::before { content: "\2212"; }
.tv-more-body { display: grid; gap: 18px; padding-top: 16px; }
.tv-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; padding-top: 2px; }
.tv-simple-group { display: grid; gap: 18px; }
.tv-simple-group[hidden] { display: none; }
.tv-simple-value { font-size: 14px; font-weight: 600; color: var(--text); }
.tv-caps.tv-caps-simple { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; padding-bottom: 0; }
.tv-unit { position: relative; display: block; max-width: 160px; }
.tv-unit .a-input { padding-right: 42px; }
.tv-unit-label {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  font-size: 12.5px; font-weight: 600; color: var(--muted); pointer-events: none;
}
.tv-count-warn { color: var(--warn-700); background: var(--warn-bg); }

/* Configuration history, newest first. */
.tv-history { margin: 0; padding: 0 18px 18px; list-style: none; }
.tv-history-item { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--divider); margin-left: 5px; }
.tv-history-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tv-history-item::before {
  content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--tv-gold);
}
.tv-history-head { display: flex; align-items: center; gap: 8px; }
.tv-history-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.tv-history-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.tv-history-changes { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-soft); }
.tv-history-label { font-weight: 600; color: var(--text); margin-right: 4px; }
.tv-history-changes del { color: var(--muted); text-decoration-color: var(--n-300); }
.tv-history-changes ins { text-decoration: none; color: var(--text); }

/* ---------------------------------------------------------------------------
   Videos (Step 4): the uploader, the library, a video's page and its
   timeline, and videos inside the folder browser.
--------------------------------------------------------------------------- */
.tv-muted { color: var(--muted); }
.tv-break { overflow-wrap: anywhere; }

/* Videos filed in the open folder, under its folders. */
.tv-videos { margin-top: 22px; }
.tv-folder-grid + .tv-videos { padding-top: 18px; border-top: 1px solid var(--divider); }
.tv-videos-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.tv-videos-title .nav-icon { width: 15px; height: 15px; color: var(--tv-gold-deep); }
.tv-video-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tv-video-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.tv-video-row:hover { border-color: var(--ac-200); box-shadow: var(--shadow-sm); text-decoration: none; }
.tv-video-thumb {
  display: grid; place-items: center; flex: none;
  width: 64px; height: 38px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--ac-700), var(--ac-500)); color: var(--tv-gold);
}
.tv-video-thumb svg { width: 16px; height: 16px; }
.tv-video-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.tv-video-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-video-meta { font-size: 12px; color: var(--muted); }
.tv-explorer-videos a { margin-left: auto; font-weight: 600; }

/* The video library. */
.alist-head.tv-vlist, .arow.tv-vlist { grid-template-columns: minmax(0, 1fr) minmax(0, 240px) 90px 140px; }
@media (max-width: 760px) {
  .alist-head.tv-vlist, .arow.tv-vlist { grid-template-columns: minmax(0, 1fr) 130px; }
  .tv-vlist > :nth-child(2), .tv-vlist > :nth-child(3) { display: none; }
}

/* The upload page: the uploader beside what the project takes. */
.tv-upload { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .tv-upload { grid-template-columns: minmax(0, 1fr) 320px; } }
.tv-upload-where { max-width: 460px; padding-top: 18px; }
.tv-uploader { padding: 0 18px 18px; }
.tv-upload-noscript { padding: 30px; text-align: center; color: var(--muted); }
.tv-upload-steps { display: grid; gap: 8px; margin: 0; padding: 0 18px 0 38px; font-size: 13px; line-height: 1.5; color: var(--text-soft); }
.tv-upload-steps strong { color: var(--text); }
.tv-upload-aside-note { margin: 14px 18px 18px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ac-50); font-size: 12.5px; line-height: 1.5; color: var(--ac-600); }
.tv-upload-done { display: grid; gap: 2px; margin: 0; padding: 0 10px 12px; list-style: none; }
.tv-upload-done-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: var(--radius-sm); font-size: 13px; }
.tv-upload-done-item a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tv-upload-done-item:hover { background: var(--surface-2); }

/* Uppy's dashboard, in the app's type and the brand's colours. */
.tv-uploader .uppy-Root { font-family: inherit; }
.tv-uploader .uppy-Dashboard-inner { border-color: var(--border); border-radius: var(--radius); background: var(--surface-2); }
.tv-uploader .uppy-Dashboard-AddFiles { border-color: var(--ac-200); border-radius: calc(var(--radius) - 4px); }
.tv-uploader .uppy-Dashboard-AddFiles-title { font-size: 17px; font-weight: 600; color: var(--text); }
.tv-uploader .uppy-Dashboard-browse,
.tv-uploader .uppy-Dashboard-browse:hover,
.tv-uploader .uppy-DashboardContent-addMore,
.tv-uploader .uppy-DashboardContent-back { color: var(--tv-gold-deep); }
.tv-uploader .uppy-Dashboard-browse:hover { border-bottom-color: var(--tv-gold-deep); }
.tv-uploader .uppy-Dashboard-note { color: var(--muted); }
.tv-uploader .uppy-c-btn-primary,
.tv-uploader .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload,
.tv-uploader .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover { background-color: var(--ac-700); border-radius: var(--radius-sm); font-weight: 600; }
.tv-uploader .uppy-c-btn-primary:hover,
.tv-uploader .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover { background-color: var(--ac-800); }
.tv-uploader .uppy-c-btn-primary:focus,
.tv-uploader .uppy-StatusBar-actionBtn--upload:focus { box-shadow: 0 0 0 3px var(--ring); }
.tv-uploader .uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload,
.tv-uploader .uppy-StatusBar-actionBtn--uploadNewlyAdded { color: var(--tv-gold-deep); }
.tv-uploader .uppy-StatusBar-progress { background-color: var(--ac-600); }
.tv-uploader .uppy-StatusBar.is-complete .uppy-StatusBar-progress { background-color: var(--success); }
.tv-uploader .uppy-Dashboard-Item-progressIndicator,
.tv-uploader .UppyIcon-progressCircle { color: var(--ac-600); }
.tv-uploader .uppy-DashboardContent-bar,
.tv-uploader .uppy-StatusBar { border-color: var(--divider); }
.tv-uploader .uppy-Dashboard-Item-name { font-weight: 600; }
/* A video's tile: Uppy paints it green by file type; navy and gold here. */
.tv-uploader .uppy-Dashboard-Item-previewInnerWrap { background-color: var(--ac-700) !important; }
.tv-uploader .uppy-Dashboard-Item-previewIconBg rect,
.tv-uploader .uppy-Dashboard-Item-previewIconBg path { fill: rgba(255, 255, 255, .08); }
.tv-uploader .uppy-Dashboard-Item-previewIcon svg,
.tv-uploader .uppy-Dashboard-Item-previewIcon svg path { color: var(--tv-gold) !important; fill: var(--tv-gold) !important; }

/* A video's timeline: one row per stage, joined by a line. */
.tv-timeline { margin: 0; padding: 4px 18px 18px; list-style: none; }
.tv-step { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tv-step:last-child { padding-bottom: 0; }
.tv-step::before {
  content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px;
  width: 2px; background: var(--divider);
}
.tv-step:last-child::before { display: none; }
.tv-step.is-done::before { background: var(--ac-200); }
.tv-step-dot {
  position: relative; display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--n-300); background: var(--surface); color: #fff;
}
.tv-step-dot svg { width: 13px; height: 13px; }
.tv-step.is-done .tv-step-dot { border-color: var(--ac-700); background: var(--ac-700); color: var(--tv-gold); }
.tv-step.is-active .tv-step-dot { border-color: var(--tv-gold); }
.tv-step.is-active .tv-step-dot::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tv-gold-deep);
  animation: tv-pulse 1.4s ease-in-out infinite;
}
.tv-step.is-failed .tv-step-dot { border-color: var(--danger); background: var(--danger); }
.tv-step.is-skipped .tv-step-dot { border-style: dashed; }
.tv-step-body { min-width: 0; padding-top: 2px; }
.tv-step-name { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.tv-step-status { margin: 2px 0 0; font-size: 12.5px; color: var(--text-soft); }
.tv-step.is-failed .tv-step-status { color: var(--danger); }
.tv-step.is-waiting .tv-step-name { color: var(--muted); }
.tv-step-detail { color: var(--muted); }
.tv-step-internal { margin: 6px 0 0; }
.tv-step-internal .tv-code { font-size: 11.5px; overflow-wrap: anywhere; }

.tv-live-dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%;
  background: var(--tv-gold-deep); vertical-align: 1px; animation: tv-pulse 1.4s ease-in-out infinite;
}
@keyframes tv-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .tv-live-dot, .tv-step.is-active .tv-step-dot::after { animation: none; } }

/* Every attempt, for Trogon: folded away under the timeline. */
.tv-attempts { border-top: 1px solid var(--divider); }
.tv-attempts summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px;
  font-size: 12.5px; font-weight: 600; color: var(--text-soft); cursor: pointer;
}
.tv-attempts summary:hover { color: var(--text); }
.tv-attempt { align-items: center; }
.tv-attempt-n { font-weight: 500; color: var(--muted); }
.tv-attempt-error { color: var(--danger); white-space: normal; }
