/* Live-app additions on top of portal.css. */
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { background: var(--brand-bone); }
.pt { min-height: 100vh; }
.pt-err { margin: 0; padding: 12px 14px; border: 1px solid #c2410c; color: #9a3412; background: rgba(194, 65, 12, 0.06); font-size: 14px; }
[data-theme="ink"] .pt-err { color: #ff9a5c; border-color: #ff9a5c; background: rgba(255, 154, 92, 0.08); }
.pt-loading { min-height: 60vh; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pt-empty { margin-top: 56px; padding: 56px 24px; border: 1px dashed var(--line-strong); display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.pt-empty b { font-family: var(--font-display); font-weight: 750; font-size: 28px; letter-spacing: -0.03em; }
.pt-empty span { color: var(--text-muted); }
.pt-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Player: real video + drawing layer */
.pt-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pt-stage canvas { position: absolute; touch-action: none; pointer-events: none; }
.pt-stage.drawing canvas { pointer-events: auto; cursor: crosshair; }
.pt-stage.drawing { outline: 2px solid var(--signal-cyan); outline-offset: -2px; }
.pt-stage__msg { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pt-tl { cursor: pointer; touch-action: none; user-select: none; }
.pt-tl__hov { position: absolute; top: -4px; transform: translateX(-50%); padding: 1px 6px; font-family: var(--font-mono); font-size: 11px; background: var(--surface-raised); border: 1px solid var(--line-strong); pointer-events: none; white-space: nowrap; }
.pt-select--ink { background: var(--surface); color: var(--text); border-color: var(--line-strong); height: 40px; }
.pt-cm__h .pt-mini { margin-left: 4px; }
.pt-rv { min-height: 100vh; }
.pt-panel { max-height: 100vh; position: sticky; top: 0; }
.pt-list { min-height: 120px; }
@media (max-width: 960px) { .pt-panel { max-height: none; position: static; } }

/* Modal + toast */
.md-scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(7, 7, 7, 0.72); }
.md { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 18px; padding: 28px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.md h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.04em; line-height: 1; }
.md p { margin: 0; color: var(--text-muted); }
.md-row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.md .pt-input { background: var(--surface-raised); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px); padding: 12px 18px; background: var(--brand-ink); color: var(--brand-bone); border: 1px solid #74726c; font-size: 14px; }
.ad-progress { height: 4px; background: var(--line); }
.ad-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--signal-indigo), var(--signal-cyan)); }
.ad-users { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); }
.ad-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 160px auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ad-user:last-child { border-bottom: 0; }
.ad-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-empty { padding: 48px 24px; border: 1px dashed var(--line-strong); text-align: center; color: var(--text-muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ad-row { grid-template-columns: 112px minmax(0, 1.6fr) 150px 110px 120px minmax(0, 1.3fr); }
.ad-row .pt-select { height: 34px; font-size: 13px; }
@media (max-width: 1100px) {
  .ad { grid-template-columns: minmax(0, 1fr); }
  .ad-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .ad-row, .ad-row--head { grid-template-columns: 96px minmax(0, 1fr); }
  .ad-row--head { display: none; }
  .ad-row > :nth-child(n+3) { grid-column: 2; }
  .ad-user { grid-template-columns: minmax(0, 1fr); }
  .ad-access { grid-template-columns: minmax(0, 1fr); }
  .ad-access > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ad-main { padding: 24px 16px 48px; }
}
.ad-side img { align-self: flex-start; height: 22px; width: auto; }
.ad-row { grid-template-columns: 104px minmax(0, 1.5fr) 150px 80px 90px 320px; }
@media (max-width: 1100px) { .ad-row { grid-template-columns: 96px minmax(0, 1fr); } }
