/* Ofertas TV — panel de control para la PC */

:root {
  --bg: #E9ECEF;
  --panel: #FFFFFF;
  --ink: #1C1F23;
  --muted: #5D6570;
  --line: #D5DAE0;
  --red: #D8151B;
  --red-dark: #A90F14;
  --yellow: #FFD200;
  --green: #14803D;
  --focus: 0 0 0 3px rgba(216, 21, 27, 0.28);
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'OTV Texto', var(--ui);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--ui);
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------------------------------------ barra superior */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center;
  height: 64px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; min-width: 0; margin-right: 28px; }
/* la marca usa la misma etiqueta de precio que el TV */
.brand-tag {
  position: relative;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  background: var(--yellow);
  color: #000;
  padding: 5px 14px 6px 26px;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  transform: rotate(-2deg);
  white-space: nowrap;
}
.brand-tag::before {
  content: '';
  position: absolute; left: 10px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%;
  background: var(--panel);
}
.brand-store { margin-left: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.tabs { display: flex; height: 100%; }
.tab {
  border: 0; background: none; cursor: pointer;
  padding: 0 16px;
  height: 100%;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); border-bottom-color: var(--red); }
.tab:focus-visible { outline: none; box-shadow: inset var(--focus); }

.pub { margin-left: auto; display: flex; align-items: center; }
.pub > * { margin-left: 12px; }
.pub-state { color: var(--muted); white-space: nowrap; }
.pub-state.is-dirty { color: var(--ink); font-weight: 600; }
.pub-state.is-dirty::before {
  content: ''; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 2px #C9A400 inset;
  margin-right: 8px; vertical-align: 0;
}
.conn.is-bad { color: var(--red); font-weight: 600; }

.banner {
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--yellow);
  font-weight: 600;
}
.banner > * { margin-right: 12px; }

/* ------------------------------------------------------------ botones */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #AEB5BF; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: transparent; text-decoration: underline; }
.btn-small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-danger { color: var(--red); }
.btn-new { width: 100%; height: 44px; background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-new::before { content: '+'; font-size: 22px; line-height: 1; margin-right: 8px; font-weight: 400; }
.btn-add { width: 100%; height: 48px; border-style: dashed; color: var(--muted); }

/* ------------------------------------------------------------ distribución */

.view { display: flex; align-items: flex-start; min-height: calc(100vh - 64px); }
.list-col {
  position: sticky; top: 64px;
  width: 330px; flex: 0 0 330px;
  height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.list-head { position: relative; padding: 16px; border-bottom: 1px solid var(--line); }
.new-menu {
  position: absolute; left: 16px; right: -260px; top: 64px; z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(20, 24, 30, 0.18);
  padding: 6px;
}
.new-opt {
  display: block; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 8px;
}
.new-opt strong { display: block; }
.new-opt span { color: var(--muted); font-size: 14px; }
.new-opt:hover, .new-opt:focus-visible { background: #F3F4F6; outline: none; }

.slide-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1 1 auto; }
.slide-item {
  position: relative;
  display: flex; align-items: flex-start;
  padding: 8px 8px 8px 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
}
.slide-item:hover { background: #F4F5F7; }
.slide-item.is-on { border-color: var(--red); background: #FFF6F6; }
.slide-item:focus-visible { outline: none; box-shadow: var(--focus); }
.slide-item.is-dim .thumb { opacity: 0.5; }
.slide-item.is-drag { opacity: 0.4; }
.slide-item.is-over { box-shadow: 0 -3px 0 var(--red); }
.pos { width: 22px; flex: 0 0 22px; text-align: center; color: var(--muted); font-size: 13px; padding-top: 2px; }
.thumb { position: relative; width: 132px; flex: 0 0 132px; overflow: hidden; border-radius: 6px; background: #000; margin-right: 10px; }
.thumb .f-ticker-txt { animation: none !important; -webkit-animation: none !important; }
.meta { min-width: 0; flex: 1 1 auto; }
.meta .title { font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta .type { color: var(--muted); font-size: 13px; }
.status { font-size: 13px; font-weight: 600; margin-top: 2px; }
.status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.st-on { color: var(--green); }
.st-later { color: #8A5A00; }
.st-expired, .st-off { color: var(--muted); }
.warn-dot { font-size: 13px; color: var(--red); margin-top: 2px; }
.list-help { margin: 0; padding: 10px 16px 14px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.list-empty { padding: 20px 12px; color: var(--muted); }
.list-empty strong { display: block; color: var(--ink); }

.editor-col { flex: 1 1 auto; min-width: 0; padding: 20px 24px 60px; }
.settings { flex: 1 1 auto; min-width: 0; padding: 20px 24px 60px; max-width: 1500px; }

/* ------------------------------------------------------------ editor */

.toolbar {
  display: flex; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-l { display: flex; align-items: baseline; min-width: 0; margin-right: auto; padding-right: 16px; }
.ed-title {
  font-family: var(--display);
  font-size: 28px; line-height: 1.1;
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ed-type { color: var(--muted); margin-left: 12px; white-space: nowrap; }
.toolbar-r { display: flex; align-items: center; flex-wrap: wrap; }
.toolbar-r > * { margin: 4px 0 4px 8px; }

.ed-grid { display: flex; align-items: flex-start; }
.ed-left { width: 560px; flex: 0 0 560px; }
.ed-right { flex: 1 1 auto; min-width: 0; margin-left: 24px; position: sticky; top: 84px; }
.preview-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.preview { position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #000; box-shadow: 0 0 0 1px var(--line); }
.preview.is-vertical { max-width: 420px; }
.scaler { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; color: var(--muted); padding: 80px; text-align: center; }

.warns {
  margin-top: 14px;
  background: #FFF4CC;
  border: 1px solid #F0D36A;
  border-radius: 10px;
  padding: 10px 14px;
}
.warns ul { margin: 0; padding-left: 18px; }
.warns p { margin: 4px 0; }

.form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.ed-left > .sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.sec { border: 0; margin: 0; padding: 18px 20px 8px; border-top: 1px solid var(--line); min-width: 0; }
.form > .sec:first-child, .form > .items > .sec:first-child { border-top: 0; }
.sec legend {
  float: left; width: 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  padding: 0;
  margin-bottom: 12px;
}
.sec legend + * { clear: both; }
.items .sec { background: #FAFAFB; }

.field { margin-bottom: 14px; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
p.hint { margin: 0 0 10px; }
.calc { font-size: 14px; color: var(--muted); margin: -4px 0 14px; }
.calc.is-ok { color: var(--green); font-weight: 600; }
.row { display: flex; }
.row > .field { flex: 1 1 0; }
.row > .field + .field { margin-left: 14px; }
.inline { display: flex; align-items: center; flex-wrap: wrap; }
.inline > * { margin: 0 8px 8px 0; }
.checks { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
.checks > * { margin-right: 20px; }

input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #C3C9D1;
  border-radius: 8px;
  background: #fff;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #9AA1AB; }
input[type="color"] { width: 54px; height: 40px; padding: 2px; border: 1px solid #C3C9D1; border-radius: 8px; background: #fff; }
.inline input[type="password"] { width: 170px; }
.range-row { display: flex; align-items: center; }
.range-row input[type="range"] { flex: 1 1 auto; margin: 0 10px; accent-color: var(--red); height: 34px; }
.range-val { min-width: 54px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }

.money-wrap { position: relative; }
.money-wrap .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-wrap input { padding-left: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }

.check { display: inline-flex; align-items: center; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--red); }

.days { display: flex; flex-wrap: wrap; }
.day {
  min-width: 52px; height: 36px;
  margin: 0 6px 6px 0;
  border: 1px solid #C3C9D1;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}
.day.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.day:focus-visible { outline: none; box-shadow: var(--focus); }

/* zona para arrastrar fotos */
.drop {
  position: relative;
  height: 170px;
  border: 2px dashed #B9C0CA;
  border-radius: 12px;
  background: #F7F8FA;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
}
.drop:hover, .drop.is-over { border-color: var(--red); background: #FFF6F6; }
.drop:focus-visible { outline: none; box-shadow: var(--focus); }
.drop.has-file { border-style: solid; background: #fff; }
.drop img, .drop video { max-width: 100%; max-height: 100%; object-fit: contain; }
.drop-text strong { display: block; }
.drop-text span { color: var(--muted); font-size: 14px; }
.drop-actions { position: absolute; right: 8px; bottom: 8px; display: flex; }
.drop-actions .btn { margin-left: 6px; }
.drop-progress { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--red); transition: width 0.2s; }
.drop.is-busy { cursor: progress; }
.drop.is-busy::after { content: 'Subiendo…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.85); font-weight: 600; }
.file-hidden { display: none; }

.item-grid { display: flex; }
.item-grid > .field { width: 180px; flex: 0 0 180px; margin-right: 14px; }
.item-grid > .field .drop { height: 180px; }
.item-grid .drop-actions { left: 6px; right: 6px; bottom: 6px; flex-wrap: wrap; justify-content: center; }
.item-grid .drop-actions .btn { height: 28px; padding: 0 8px; font-size: 12px; margin: 2px; }
.item-grid .drop-text .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.item-grid > div:last-child { flex: 1 1 auto; min-width: 0; }
.item-actions { display: flex; justify-content: flex-end; padding-bottom: 12px; }
.item-actions .btn { margin-left: 8px; }
.items { padding: 0; }
.items > .btn-add { margin: 14px 20px; width: calc(100% - 40px); }

/* estado vacío */
.editor-empty { max-width: 760px; padding: 40px 10px; }
.editor-empty h1 { font-family: var(--display); font-size: 34px; line-height: 1.1; margin: 0 0 10px; }
.editor-empty p { color: var(--muted); font-size: 17px; margin: 0 0 24px; max-width: 60ch; }
.type-cards { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.type-card {
  width: calc(50% - 12px); margin: 6px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
}
.type-card strong { display: block; font-size: 17px; margin-bottom: 2px; }
.type-card span { color: var(--muted); }
.type-card:hover { border-color: var(--red); }
.type-card:focus-visible { outline: none; box-shadow: var(--focus); }

/* ------------------------------------------------------------ PIN y avisos */

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 30, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--panel); border-radius: 14px; padding: 26px; width: 100%; max-width: 380px; }
.modal-box h2 { font-family: var(--display); margin: 0 0 6px; font-size: 24px; }
.modal-box p { color: var(--muted); margin: 0 0 14px; }
#pinForm input { font-size: 24px; letter-spacing: 0.3em; text-align: center; height: 52px; margin-bottom: 12px; }
.modal-box .btn { width: 100%; }
.err { color: var(--red) !important; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px);
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px;
  font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 40px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--green); }
.toast.bad { background: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .toast, .drop-progress { transition: none; }
}

/* ------------------------------------------------------------ pantallas más chicas */

@media (max-width: 1280px) {
  .ed-grid { flex-direction: column-reverse; }
  .ed-left { width: 100%; flex-basis: auto; max-width: 720px; }
  .ed-right { position: static; margin: 0 0 16px; width: 100%; max-width: 720px; }
}

@media (max-width: 820px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 12px; }
  .tabs { height: 44px; order: 3; width: 100%; }
  .brand { margin-right: 12px; }
  .brand-store { display: none; }
  .pub-state, .conn { display: none; }
  .view { display: block; }
  .list-col { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .slide-list { display: flex; overflow-x: auto; overflow-y: hidden; }
  .slide-item { flex: 0 0 260px; }
  .new-menu { right: 16px; }
  .list-help { display: none; }
  .editor-col, .settings { padding: 14px 12px 60px; }
  .row { display: block; }
  .row > .field + .field { margin-left: 0; }
  .item-grid { display: block; }
  .item-grid > .field { width: auto; margin-right: 0; }
  .type-card { width: 100%; }
}

/* ------------------------------------------------------------ televisores */

a.btn { text-decoration: none; color: inherit; }
.tvs { max-width: 1000px; }
.tvs-intro h1 { font-family: var(--display); font-size: 30px; line-height: 1.1; margin: 4px 0 8px; }
.tvs-intro p { color: var(--muted); margin: 0 0 18px; max-width: 70ch; font-size: 16px; }
.tvs > .sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.tv-row { display: flex; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.tv-row:first-child { border-top: 0; padding-top: 0; }
.tv-name { flex: 0 0 230px; margin-right: 16px; }
.tv-host { flex: 0 0 180px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tv-st { flex: 1 1 150px; font-weight: 600; font-size: 14px; }
.tv-st::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.tvst-ok { color: var(--green); }
.tvst-old { color: #8A5A00; }
.tvst-down, .tvst-pin { color: var(--red); }
.tvst-self, .tvst-unknown { color: var(--muted); }
.tv-actions { display: flex; flex-wrap: wrap; margin-left: auto; }
.tv-actions .btn { margin: 4px 0 4px 8px; }
.tvs .inline input[type="text"] { width: 230px; }
.tv-found { margin-top: 6px; }
.found-row { display: flex; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.found-row > * { margin-right: 14px; }
.only-tvs { font-size: 13px; margin-top: 2px; }
.tv-chip { padding: 0 14px; }

@media (max-width: 820px) {
  .tv-name, .tv-host { flex-basis: 100%; margin: 0 0 6px; }
  .tv-actions { margin-left: 0; }
  .tv-actions .btn { margin: 4px 8px 4px 0; }
}

/* ------------------------------------------------------------ biblioteca y plantillas */

.lib-modal { align-items: flex-start; overflow-y: auto; }
.lib-box { max-width: 1120px; width: 100%; margin: 32px auto; }
.lib-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lib-head h2 { margin: 0; }
.lib-bar { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.lib-tabs { display: flex; flex-wrap: wrap; margin-right: auto; }
.lib-tab {
  height: 36px; padding: 0 16px; margin: 0 8px 8px 0;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-weight: 600; cursor: pointer;
}
.lib-tab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lib-tab:focus-visible { outline: none; box-shadow: var(--focus); }
.lib-bar input[type="search"] { width: 300px; max-width: 100%; height: 38px; padding: 0 12px; border: 1px solid #C3C9D1; border-radius: 8px; margin-bottom: 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.lib-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.lib-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.lib-item span { margin-top: 4px; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.lib-item:hover { border-color: var(--red); }
.lib-item:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--red); }
.lib-note { margin: 10px 0 12px; }
.drop-lib { margin-top: 10px; }
.tpl-cta { margin-bottom: 6px; }
.new-opt.new-tpl { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; margin-bottom: 4px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; max-height: 64vh; overflow-y: auto; padding: 2px; }
.tpl-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.tpl-prev { position: relative; width: 100%; overflow: hidden; background: #000; }
.tpl-body { display: flex; flex-direction: column; padding: 12px 14px 14px; }
.tpl-body strong { font-size: 16px; }
.tpl-body .btn { align-self: flex-start; margin-top: 10px; }
.lib-box .btn { width: auto; }
.lib-head h2 { white-space: nowrap; }

/* ------------------------------------------------------------ panel central */

.who { display: flex; align-items: center; white-space: nowrap; }
.who-name { font-weight: 600; margin-right: 2px; }
.who-name::before {
  content: ''; display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); margin-right: 8px; vertical-align: -6px;
}

.who-role {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin: 0 2px 0 8px;
}
.super-pick { margin-left: 12px; }
.super-pick select { height: 36px; width: auto; max-width: 240px; font-weight: 700; padding-right: 28px; }
.super-row .super-name { flex: 0 0 260px; }
.user-row .user-name { flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; }
.user-row .user-sel { flex: 0 0 240px; }
.user-row .user-pass { flex: 0 0 100%; margin-top: 8px; }
.role-tag { display: inline-block; align-self: center; line-height: 1.35; white-space: nowrap; font-size: 13px; font-weight: 700; background: #EEF0F3; border-radius: 999px; padding: 4px 10px; }
.role-tag.is-owner { background: var(--yellow); }
.role-help { margin: 0 0 10px; padding-left: 20px; }
.role-help li { margin-bottom: 2px; }
.new-user select { width: 200px; }

.login-box { max-width: 420px; }
.login-box .field { margin-bottom: 12px; }
.login-box .btn { width: 100%; margin-top: 4px; }
.login-tag { display: inline-block; margin-bottom: 14px; }

.tvs .sec h2 { margin: 0; }
.loc-head { display: flex; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.loc-head > div:first-child { margin-right: auto; padding-right: 12px; }
.loc-name { font-family: var(--display); font-size: 22px; line-height: 1.15; }
.loc-edit { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 4px; margin: 6px 0 12px; background: #FAFAFB; }
.tv-row.ctv { align-items: center; }
.tv-row.ctv .tv-name { flex: 0 0 210px; }
.tv-loc { flex: 0 0 190px; margin-right: 14px; }
.tv-details { flex: 0 0 100%; margin-top: 4px; }
.tv-extra { flex: 0 0 100%; }
.tv-screen { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 4px; margin-top: 10px; background: #FAFAFB; }
.pending { margin-bottom: 10px; }
.pend-code { font-family: 'OTV Precio', var(--display); font-size: 30px; letter-spacing: 0.04em; background: var(--yellow); padding: 0 10px; border-radius: 6px; }
.link-row .code-in { width: 130px; font-size: 20px; font-weight: 700; letter-spacing: 0.12em; }
.link-row input[type="text"]:not(.code-in) { width: 200px; }
.link-row select { width: 200px; }
.target-sub { margin: 4px 0 6px; }
.sub-head { font-weight: 700; margin: 14px 0 8px; }
.settings .sec .inline input[type="text"], .settings .sec .inline input[type="password"] { width: 220px; }

.cloud-lock { max-width: 820px; }
.cloud-lock > .sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.cloud-lock a { color: var(--red); font-weight: 600; }
.cloud-lock a.btn { color: #fff; }
.cl-state { font-weight: 700; font-size: 17px; margin: 0 0 10px; }
.cl-state::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: currentColor; vertical-align: 1px; }
.cl-code { font-family: 'OTV Precio', var(--display); font-size: 64px; line-height: 1; background: var(--yellow); display: inline-block; padding: 6px 18px 4px; border-radius: 10px; margin-bottom: 14px; letter-spacing: 0.04em; }
.hint.err { color: var(--red); }

@media (max-width: 820px) {
  .tv-row.ctv .tv-name, .tv-loc { flex-basis: 100%; margin: 0 0 6px; }
  .link-row input, .link-row select { width: 100% !important; }
  .who .who-name, .who .who-role { display: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 0 11px; white-space: nowrap; flex: 0 0 auto; }
  .super-pick { order: 2; margin: 6px 0 0; flex-basis: 100%; }
  .super-pick select { max-width: 100%; }
  .super-row .super-name, .user-row .user-name, .user-row .user-sel { flex-basis: 100%; margin: 0 0 6px; }
}
