/* Nexstar Intranet — the look.
 *
 * Each business sets --accent when you enter it, and everything that carries
 * brand colour reads from that one variable. Adding a third business is a row
 * in a table, not a stylesheet.
 */

:root {
  --accent: #1e3a5f;
  --ink:    #16202b;
  --ink-2:  #495867;
  --ink-3:  #8996a4;
  --line:   #dde3ea;
  --line-2: #eef2f6;
  --panel:  #ffffff;
  --ground: #f4f6f9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22,32,43,.06), 0 8px 24px rgba(22,32,43,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; }

.dim { color: var(--ink-3); }
.linkbtn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--accent); font-weight: 600; text-decoration: underline; font-size: 12px;
}

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { color: #a4342b; }
.btn.danger.ghost { background: none; }
.btn.danger.ghost:hover { border-color: #a4342b; }

/* ------------------------------------------------------------- sign in */

.gate, .pick {
  min-height: 100%; display: grid; place-items: center; padding: 40px 20px;
}
.gatecard {
  width: 100%; max-width: 380px; background: var(--panel); border-radius: 14px;
  box-shadow: var(--shadow); padding: 30px 26px; text-align: center;
}
.gatelogo { width: 150px; margin-bottom: 14px; }
.gatetitle { font-size: 20px; font-weight: 700; }
.gatesub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 16px; }
.gateinput {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 14px; outline: none; margin-bottom: 10px;
}
.gateinput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,95,.10); }
.gatelist { max-height: 320px; overflow: auto; text-align: left; }
.gatename {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 11px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--line-2);
}
.gatename:hover { background: var(--line-2); }
.gatewho { font-weight: 700; margin-bottom: 8px; }
.gateerr { color: #a4342b; font-size: 12.5px; margin-bottom: 8px; }

/* ------------------------------ both businesses, on one surface */

.pick { align-content: center; }
.picklogo { width: 190px; margin: 0 auto 6px; display: block; }
.picktitle {
  font-size: 22px; font-weight: 700; text-align: center; margin: 6px 0 26px; color: var(--ink);
}
.pickrow {
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; max-width: 760px;
}
.brandcard {
  --accent: #1e3a5f;
  width: 300px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 26px; cursor: pointer; text-align: left;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
  border-top: 4px solid var(--accent);
}
.brandcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(22,32,43,.07), 0 14px 34px rgba(22,32,43,.12);
  border-color: var(--accent);
}
.brandmark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em;
  margin-bottom: 14px;
}
.brandmark.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; margin: 0; }
.brandname { font-size: 18px; font-weight: 700; }
.brandtag { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.brandmeta { color: var(--ink-3); font-size: 11.5px; margin-top: 14px; }
.pickfoot {
  margin-top: 28px; display: flex; gap: 14px; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 12.5px;
}

/* ------------------------------------------------------------ the shell */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 236px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidehome {
  display: block; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--line-2); background: none;
  padding: 15px 14px 13px; cursor: pointer;
}
.sidehome:hover { background: var(--line-2); }
/* Both marks, one above the other — the site belongs to both businesses and
   says so before you have clicked anything. */
.sidemarks { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
/* The two wordmarks are drawn to different proportions — Nexstar stacks a
   second line under itself — so matching their heights makes Nexstar read as
   the smaller of the two. They are sized to look equal instead of measure it. */
.sidemark { width: auto; max-width: 100%; object-fit: contain; height: 21px; }
.sidemark[alt^="Nexstar"] { height: 27px; }

.navgroup {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--accent); margin: 14px 0 4px; padding: 0 10px;
}
.navgroup:first-child { margin-top: 2px; }

.nav { flex: 1; overflow: auto; padding: 10px 8px; }
.navitem {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px;
}
.navitem:hover { background: var(--line-2); color: var(--ink); }
.navitem.on { background: var(--accent); color: #fff; font-weight: 600; }
.navitem.sub { padding-left: 26px; font-size: 13px; }
.navitem.dragover { box-shadow: inset 0 2px 0 var(--accent); }
.navicon { width: 16px; text-align: center; flex: none; }
.navlabel { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navhome {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em;
  opacity: .65; flex: none;
}
.navadd {
  width: 100%; text-align: left; border: 1px dashed var(--line); background: none;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-3);
  font-size: 12.5px; margin-top: 8px;
}
.navadd:hover { border-color: var(--accent); color: var(--accent); }

.sidefoot { border-top: 1px solid var(--line-2); padding: 12px 14px; }
.faces { display: flex; margin-bottom: 10px; }
.face {
  display: grid; place-items: center; width: 25px; height: 25px; margin-left: -6px;
  border-radius: 50%; background: var(--ink-3); color: #fff; border: 2px solid var(--panel);
  font-size: 9.5px; font-weight: 700;
}
.face:first-child { margin-left: 0; }
.face.lg { width: 38px; height: 38px; font-size: 13px; background: var(--accent); margin: 0 0 8px; }
.sideme { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.sideme-n { font-size: 12.5px; font-weight: 600; }

/* -------------------------------------------------------------- a page */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pagehead {
  padding: 30px 44px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: relative;
}
.pagetitle { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.pagetitle.editable:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.pagemeta { color: var(--ink-3); font-size: 12px; margin-top: 5px; }
.pagetools { position: absolute; top: 26px; right: 40px; display: flex; gap: 8px; }

.sheet {
  flex: 1; padding: 26px 44px 90px; max-width: 1000px; width: 100%;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 22px;
}
.empty {
  width: 100%; color: var(--ink-3); background: var(--panel); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 28px; text-align: center; font-size: 13.5px;
}

.block { width: 100%; position: relative; margin: 14px 0; }
.block.half { width: calc(50% - 11px); }
.block.dragging { opacity: .35; }

/* Where the block will land, drawn before it lands there. A bar across the top
   or bottom edge means it stacks; a bar down one side means the two will sit
   beside each other. The bar is painted on a pseudo-element so it can sit in
   the gutter between blocks without taking up any layout space of its own. */
.block[data-zone]::after {
  content: ""; position: absolute; background: var(--accent); border-radius: 3px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  pointer-events: none; z-index: 4;
}
.block[data-zone="above"]::after { left: 0; right: 0; top: -8px; height: 3px; }
.block[data-zone="below"]::after { left: 0; right: 0; bottom: -8px; height: 3px; }
.block[data-zone="left"]::after  { top: 0; bottom: 0; left: -12px; width: 3px; }
.block[data-zone="right"]::after { top: 0; bottom: 0; right: -12px; width: 3px; }
/* The side zones are the ones nobody expects, so say what they do. */
.block[data-zone="left"]  .blockbody,
.block[data-zone="right"] .blockbody { opacity: .75; }

.handle {
  position: absolute; top: -10px; right: 0; display: none; gap: 4px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 5px; box-shadow: var(--shadow); z-index: 3;
}
.block:hover .handle { display: flex; }
.grip { cursor: grab; color: var(--ink-3); padding: 0 3px; }
.hbtn {
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
  padding: 2px 5px; border-radius: 5px; font-size: 12px;
}
.hbtn:hover { background: var(--line-2); }
.hbtn.danger { color: #a4342b; }

.editable:focus { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.editable:empty::before {
  content: attr(data-ph); color: var(--ink-3); pointer-events: none;
}

/* ------------------------------------------------------------- blocks */

.bh {
  font-size: 17px; font-weight: 700; margin: 12px 0 2px; padding-bottom: 7px;
  border-bottom: 2px solid var(--accent); display: inline-block; min-width: 60px;
}
.btext {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; line-height: 1.65;
}
.btext p { margin: 0 0 10px; }
.btext p:last-child { margin-bottom: 0; }
.btext ul, .btext ol { margin: 0 0 10px; padding-left: 22px; }

.bcallout {
  border-radius: var(--radius); padding: 14px 16px; border-left: 4px solid;
  position: relative;
}
.bcallout.tone-note { background: #eef4fb; border-color: #4a7fbd; }
.bcallout.tone-warn { background: #fff7e6; border-color: #d29a2b; }
.bcallout.tone-good { background: #eef7ec; border-color: #4f9a48; }
/* The tone chips sit over the callout, so the text is given room to clear
   them rather than running underneath. */
.tones { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; }
.bcallout:has(.tones) .bcallout-t { padding-right: 130px; }
@supports not selector(:has(*)) { .bcallout .bcallout-t { padding-right: 0; } }
.tone {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  font-size: 10px; padding: 2px 8px; cursor: pointer; color: var(--ink-2);
}
.tone.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.bdiv { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.bbrand {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 4px 0 12px; border-bottom: 3px solid var(--accent);
}
.bbrand-mark { height: 30px; width: auto; align-self: flex-start; object-fit: contain; }
.bbrand-mark[alt^="Nexstar"] { height: 40px; }
.bbrand-tag { color: var(--ink-3); font-size: 12.5px; }
.bbrand-pick { position: absolute; top: 0; right: 0; display: flex; gap: 4px; }

.blinks { display: flex; flex-wrap: wrap; gap: 10px; }
.linkcard {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-width: 190px; flex: 1 1 190px; max-width: 260px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; text-decoration: none; color: var(--ink); cursor: pointer;
  border-left: 3px solid var(--accent);
}
.linkcard:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.linklabel { font-weight: 650; font-size: 13.5px; }
.linknote { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkadd {
  border: 1px dashed var(--line); background: none; border-radius: var(--radius);
  padding: 13px 15px; cursor: pointer; color: var(--ink-3); font-size: 12.5px;
}
.linkadd:hover { border-color: var(--accent); color: var(--accent); }
.linkx {
  position: absolute; top: 5px; right: 6px; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 11px; padding: 2px 4px; border-radius: 4px;
}
.linkx:hover { background: #fdecea; color: #a4342b; }

.bann { display: flex; flex-direction: column; gap: 10px; }
.annrow {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.annwhen { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.anntitle { font-weight: 650; font-size: 14.5px; margin-top: 2px; }
.annbody { color: var(--ink-2); margin-top: 5px; font-size: 13.5px; }
.annby { color: var(--ink-3); font-size: 11.5px; margin-top: 7px; }

.bfiles { display: flex; flex-direction: column; gap: 6px; }
.filerow {
  position: relative; display: flex; align-items: baseline; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
}
.filename { font-weight: 600; font-size: 13.5px; text-decoration: none; }
.filename:hover { text-decoration: underline; }
.filemeta { color: var(--ink-3); font-size: 11.5px; margin-left: auto; }
.filedrop {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px;
  text-align: center; color: var(--ink-3); cursor: pointer; font-size: 12.5px; background: var(--panel);
}
.filedrop:hover, .filedrop.over { border-color: var(--accent); color: var(--accent); background: #f6f9fd; }

/* ---- a picture ---- */
.bimg { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bimg-i {
  display: block; max-width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line-2);
}
.bimg-cap { color: var(--ink-3); font-size: 12.5px; }

/* ---- a checklist ---- */
.bcheck { display: flex; flex-direction: column; gap: 2px; }
/* Positioned, because .linkx is absolute and would otherwise fly to the
   top-right corner of the whole block instead of sitting on its own row. */
.checkrow {
  position: relative; display: flex; align-items: baseline; gap: 9px;
  padding: 5px 26px 5px 6px; border-radius: 7px; font-size: 13.5px;
}
.checkrow .linkx { top: 50%; transform: translateY(-50%); }
.checkrow:hover { background: var(--line-2); }
.checkbox {
  flex: none; width: 17px; height: 17px; border: 1.5px solid var(--line);
  border-radius: 5px; background: var(--panel); cursor: pointer; padding: 0;
  font-size: 11px; line-height: 1; color: #fff; align-self: center;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox.on { background: var(--accent); border-color: var(--accent); }
.checktext { flex: 1; min-width: 0; }
/* Struck through, not hidden — the point of a checklist is seeing what is done. */
.checkrow.done .checktext { color: var(--ink-3); text-decoration: line-through; }
.checkby { color: var(--ink-3); font-size: 11.5px; flex: none; }

/* ---- a table ---- */
/* Wide tables scroll inside their own block rather than pushing the page sideways. */
.btablewrap { display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.btable { border-collapse: collapse; width: 100%; font-size: 13px; }
.btable th, .btable td {
  border: 1px solid var(--line); padding: 7px 9px; text-align: left;
  vertical-align: top; min-width: 90px;
}
.btable th { background: var(--line-2); font-weight: 650; }
.btable td.trowx { border: 0; padding: 0 0 0 6px; min-width: 0; width: 1px; }
.btable td.trowx .linkx { position: static; }
.btabletools { display: flex; gap: 6px; }
.btabletools .linkadd { width: auto; }

.bdir { display: flex; flex-wrap: wrap; gap: 10px; }
.dircard {
  display: flex; flex-direction: column; width: 168px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px;
}
.dirname { font-weight: 650; font-size: 13.5px; }
.dirrole { color: var(--ink-2); font-size: 12px; }
.dirmail { color: var(--ink-3); font-size: 11.5px; margin-top: 4px; word-break: break-all; }

.bembed iframe {
  width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}

/* --------------------------------------------------------- adding one */

.adder { width: 100%; margin: 16px 0 0; position: relative; }
.adderbtn {
  width: 100%; border: 1px dashed var(--line); background: none; border-radius: var(--radius);
  padding: 11px; cursor: pointer; color: var(--ink-3); font-size: 13px;
}
.adderbtn:hover { border-color: var(--accent); color: var(--accent); }

/* A + lives in the gap above every block. Showing thirteen dashed boxes down
   the page would be worse than the problem it solves, so the gap keeps its
   height — the page must not jump as the pointer crosses it — and only draws
   itself when you are actually in it. */
.adder.gap { margin: 0; height: 22px; display: flex; align-items: center; }
.adder.gap .adderbtn {
  padding: 0; height: 22px; line-height: 20px; border-color: transparent;
  opacity: 0; transition: opacity .12s ease; font-size: 15px;
}
.adder.gap:hover .adderbtn,
.adder.gap:focus-within .adderbtn { opacity: 1; border-color: var(--line); }
.adder.gap .addermenu { top: auto; bottom: 100%; margin: 0 0 6px; }
.addermenu {
  position: absolute; z-index: 6; left: 0; right: 0; top: 100%; margin-top: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px;
}
.addermenu[hidden] { display: none; }
.adderkind {
  display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0;
  background: none; padding: 9px 11px; border-radius: 8px; cursor: pointer;
}
.adderkind:hover { background: var(--line-2); }
.adderkind b { font-size: 13px; font-weight: 650; }
.adderkind span { color: var(--ink-3); font-size: 11.5px; }

/* ------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: #16202b; color: #fff; padding: 10px 15px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow); transition: opacity .5s, transform .5s;
}
.toast.err { background: #8f2d23; }
.toast.go { opacity: 0; transform: translateY(6px); }

/* ------------------------------------------------------------- narrow */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: column; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; }
  .navitem { width: auto; }
  .pagehead, .sheet { padding-left: 18px; padding-right: 18px; }
  .pagetools { position: static; margin-top: 12px; }
  .block.half { width: 100%; }
}
