/* ==========================================================================
   Viewer additions — kept in their own file so app.css stays yours to edit.
   Loaded after app.css, so anything here wins on conflict.
   ========================================================================== */

/* Identifies whoever is looking, so a leaked screenshot traces back to an
   account. This is the only copy protection that genuinely works. */
.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;      /* never blocks scrolling or clicks */
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  align-items: center;
  justify-items: center;
  z-index: 2;
}
.watermark span {
  font-family: var(--mono, monospace);
  font-size: .72rem;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(15, 35, 65, .17);
  transform: rotate(-24deg);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* On a dark page the dashboard itself is white, so the tint above suits it.
   Keep the mark legible if the sheet has dark blocks by outlining it faintly. */
@supports (paint-order: stroke) {
  .watermark span { paint-order: stroke fill; }
}

/* Text selection off across member pages. */
.sheet-frame, .sheet-head, .dash-grid { -webkit-user-select: none; user-select: none; }

/* Printing yields a notice rather than the dashboard. */
@media print {
  body * { visibility: hidden !important; }
  body::after {
    content: 'Summit Traders dashboards are for member viewing only and cannot be printed.';
    visibility: visible;
    position: fixed;
    inset: 25% 10% auto 10%;
    font-family: sans-serif;
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
    color: #000;
  }
}

/* --- tier pricing -------------------------------------------------------- */
.price { margin: 0 0 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; }
.price-main {
  font-family: var(--display, sans-serif);
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--snow, #fff);
}
.price-per { font-size: .9rem; color: var(--mist, #888); }
.price-alt { flex-basis: 100%; font-size: .8rem; color: var(--mist, #888); margin-top: .45rem; }
.price-save {
  flex-basis: 100%;
  font-family: var(--mono, monospace);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--band, var(--glacier, #6BC5D8));
  margin-top: .35rem;
}

/* --- account & 2FA ------------------------------------------------------- */
.acct-block { border-top: 1px solid var(--line-soft, #222); padding-top: 1.5rem; margin-top: 1.75rem; }
.acct-block h2 { font-size: 1rem; margin-bottom: .6rem; }
.on-line { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: .3rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok, #6FC08F); }
.dot.off { background: var(--danger, #E0685E); }
.hint { font-size: .82rem; color: var(--mist-dim, #667); margin-bottom: 1rem; }
.inline-form { display: flex; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 150px; }
.step-label {
  font-family: var(--mono, monospace);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mist-dim, #667);
  margin: 1.5rem 0 .4rem;
}
.qr { background: #fff; padding: .8rem; border-radius: 3px; display: inline-block; }
.secret {
  background: var(--base, #0A0F17);
  border: 1px solid var(--line, #223);
  border-radius: 3px;
  padding: .7rem .9rem;
  font-size: .95rem;
  letter-spacing: .12em;
  word-break: break-all;
}
.codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  background: var(--base, #0A0F17);
  border: 1px solid var(--line, #223);
  border-radius: 3px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.codes span {
  font-family: var(--mono, monospace);
  font-size: .92rem;
  letter-spacing: .06em;
  user-select: all;
}

/* ==========================================================================
   Admin tables — fit on one line, no horizontal scrolling to reach Save
   ========================================================================== */

/* Admin screens use the full viewport rather than the reading column. */
.wrap--admin {
  max-width: none;
  width: 96vw;
  margin-inline: auto;
  padding-inline: 0;
}

/* Tighter rows so more columns fit. */
.wrap--admin table { font-size: .82rem; }
.wrap--admin th { padding: .6rem .5rem; font-size: .6rem; letter-spacing: .12em; }
.wrap--admin td { padding: .5rem .5rem; }
.wrap--admin td input[type=text],
.wrap--admin td input[type=number],
.wrap--admin td select { padding: .3rem .4rem; font-size: .78rem; }
.wrap--admin td select { max-width: 110px; }

/* Column widths, chosen so the whole row lands inside the viewport. */
.col-code { width: 62px; }
.col-name { width: 100%; min-width: 120px; }
.col-tab  { width: 108px; }
.col-sort { width: 52px; }

/* The sheet ID is ~44 characters and rarely edited, so it sits truncated and
   grows when you click into it. That alone reclaims most of the overflow. */
.col-sheet {
  width: 96px;
  text-overflow: ellipsis;
  transition: width .15s ease;
}
.col-sheet:focus {
  width: 340px;
  position: relative;
  z-index: 3;
}

/* Save above Del is narrower than the two side by side. */
.row-actions--stacked {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  align-items: stretch;
}
.row-actions--stacked .btn { justify-content: center; padding: .28rem .5rem; }

/* Only fall back to scrolling on genuinely small screens. */
@media (max-width: 1100px) {
  .wrap--admin { width: 100%; padding-inline: var(--pad); }
  .col-sheet { width: 80px; }
}

/* Members table */
.col-note { width: 100%; min-width: 110px; }
.col-date { color: var(--mist-dim); white-space: nowrap; font-size: .74rem; }
.wrap--admin td strong { font-size: .84rem; }

/* Dashboard on small screens: use the height available and let the sheet
   scroll, rather than squeezing it into a short box. */
@media (max-width: 700px) {
  .sheet-frame {
    height: 78vh;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .sheet-frame + .sheet-meta { width: 100vw; margin-left: calc(50% - 50vw); padding-inline: var(--pad); }
  .watermark { grid-template-columns: repeat(2, 1fr); }
  .watermark span { font-size: .6rem; }
}

.noscript-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: var(--strata, #111);
  color: var(--mist, #999);
  font-size: .9rem;
  z-index: 4;
}

/* --- dashboard zoom ------------------------------------------------------ */
.zoomer { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.zoomer button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--snow);
  font-family: var(--mono);
  font-size: .8rem;
  min-width: 38px;
  padding: .42rem .55rem;
  cursor: pointer;
  line-height: 1;
}
.zoomer button:last-child { border-right: 0; }
.zoomer button:hover:not(:disabled) { background: var(--strata-2); }
.zoomer button:disabled { color: var(--mist-dim); cursor: default; }
#zoomFit { min-width: 56px; color: var(--mist); }

/* Pages pan in both directions once zoomed past the container. */
.pdf-pages { overflow: auto; touch-action: pan-x pan-y; }
.pdf-page { max-width: none; margin: 0 auto; }

.pdf-diag {
  display: block;
  margin-top: .3rem;
  font-size: .62rem;
  color: var(--mist-dim);
  letter-spacing: .06em;
  text-transform: none;
}

@media (max-width: 700px) {
  .sheet-actions { width: 100%; justify-content: space-between; }
  .zoomer button { min-width: 44px; padding: .5rem .6rem; font-size: .85rem; }
}

/* Drag-to-pan on desktop once the sheet is wider than the window. */
.pdf-pages { cursor: grab; }
.pdf-pages.is-dragging { cursor: grabbing; }
@media (pointer: coarse) { .pdf-pages { cursor: auto; } }
