/* ThoughtSift by HumanAmp — Share Landing Page Styles (HumanAmp "wet note" tokens)
   Bic pen aesthetic: stroke #1a1a2e, bg #f5f5f0
   Page chrome: HumanAmp ink #2B2A28 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:root {
  --ts-bg: #2B2A28;
  --ts-surface: #3B3936;
  --ts-text: #F7F1EE;
  --ts-text-dim: #B9B2AC;
  --ts-accent: #E77D70;
  --ts-accent-hover: #E86F5E;
  --ts-accent-soft: rgba(231, 125, 112, 0.16);
  --ts-bic-stroke: #1a1a2e;
  --ts-bic-bg: #f5f5f0;
  --ts-error: #e04040;
  --ts-success: #40c060;
  --ts-font: 'Manrope', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--ts-font);
  background: var(--ts-bg);
  color: var(--ts-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */

.ts-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ts-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ts-text);
}

/* ---- Main ---- */

.ts-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.ts-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---- Loading ---- */

.ts-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--ts-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ts-loading-text {
  color: var(--ts-text-dim);
  font-size: 14px;
}

/* ---- Error ---- */

.ts-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(224, 64, 64, 0.15);
  color: var(--ts-error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.ts-error-text {
  color: var(--ts-text-dim);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ---- Expired ---- */

.ts-expired-icon { margin-bottom: 20px; opacity: 0.6; }

.ts-expired-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ts-expired-text {
  color: var(--ts-text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.ts-expired-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--ts-text-dim);
  letter-spacing: 0;
  opacity: 0.5;
}

/* ---- PIN gate ---- */

.ts-pin-icon { margin-bottom: 16px; opacity: 0.7; }

.ts-pin-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ts-pin-text {
  color: var(--ts-text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

.ts-pin-form {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

.ts-pin-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 18px;
  font-family: var(--ts-font);
  letter-spacing: 0;
  text-align: center;
  background: var(--ts-surface);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--ts-text);
  outline: none;
  transition: border-color 0.2s;
}

.ts-pin-input:focus {
  border-color: var(--ts-accent);
}

.ts-pin-error {
  color: var(--ts-error);
  font-size: 13px;
  margin-top: 12px;
}

.ts-pin-lockout {
  color: var(--ts-error);
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  padding: 12px 20px;
  background: rgba(224, 64, 64, 0.1);
  border-radius: 8px;
}

/* ---- Buttons ---- */

.ts-btn {
  font-family: var(--ts-font);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.15s, opacity 0.15s;
}

.ts-btn:disabled { opacity: 0.5; cursor: default; }

.ts-btn-primary {
  background: var(--ts-accent);
  color: #fff;
}

.ts-btn-primary:hover:not(:disabled) { background: var(--ts-accent-hover); }

.ts-btn-secondary {
  background: var(--ts-surface);
  color: var(--ts-text);
  border: 1px solid rgba(255,255,255,0.1);
}

.ts-btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.08); }

/* ---- Diagram section ---- */

.ts-diagram-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.ts-sift-metadata {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  color: var(--ts-text-dim);
  font-size: 12px;
  letter-spacing: 0;
}

.ts-diagram-created {
  font-size: 12px;
  color: var(--ts-text-dim);
  text-align: center;
  letter-spacing: 0;
}

/* Tag chips + Diagram/Image toggle on one row (saves a row of vertical space). */
.ts-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  width: 100%;
  margin: -6px 0 16px;
}
/* The two children no longer own their own row / bottom margin inside the row. */
.ts-header-controls > .ts-sift-tags,
.ts-header-controls > .ts-renderer-tabs,
.ts-header-controls > .ts-sift-metadata {
  width: auto;
  margin: 0;
}

.ts-sift-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.ts-sift-tags::before {
  content: "Tags:";
  color: var(--ts-text-dim);
  font-size: 12px;
}

.ts-sift-metadata.has-created .ts-sift-tags::before {
  content: "\00B7 Tags:";
}

.ts-sift-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--ts-text);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---- Renderer tabs ---- */

.ts-renderer-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
  width: 100%;
}

.ts-tab {
  font-family: var(--ts-font);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: var(--ts-surface);
  color: var(--ts-text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ts-tab:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  color: var(--ts-text);
}

.ts-tab.active {
  background: var(--ts-accent);
  color: #fff;
  border-color: var(--ts-accent);
}

.ts-renderer-pane {
  width: 100%;
  position: relative;
}

.ts-diagram-preview {
  display: block;
  width: 100%;
  height: auto;
}

.ts-excalidraw-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--ts-text-dim);
  font-size: 13px;
}

/* ---- Intelligence ---- */

.ts-intelligence {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  background: var(--ts-surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  text-align: left;
}

.ts-intelligence-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
  margin-bottom: 10px;
}

.ts-intelligence-summary {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ts-text);
  margin-bottom: 12px;
}

.ts-intelligence-keypoints {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.ts-intelligence-keypoints li {
  padding: 6px 0 6px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ts-text);
  position: relative;
}

.ts-intelligence-keypoints li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ts-accent);
  opacity: 0.6;
}

.ts-intelligence-topics {
  margin: 0 0 12px 0;
}

.ts-intelligence-topic {
  margin-bottom: 12px;
}

.ts-intelligence-topic:last-child {
  margin-bottom: 0;
}

.ts-intelligence-topic-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ts-text);
  margin: 0 0 4px 0;
}

.ts-intelligence-topic-points {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ts-intelligence-topic-points li {
  padding: 6px 0 6px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ts-text);
  position: relative;
}

.ts-intelligence-topic-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ts-accent);
  opacity: 0.6;
}

.ts-intelligence-meta {
  font-size: 12px;
  color: var(--ts-text-dim);
}

.ts-intelligence-meta .ts-conf-high {
  color: var(--ts-accent);
}

.ts-intelligence-meta .ts-conf-mid {
  color: #d9a441;
}

.ts-intelligence-meta .ts-conf-low {
  color: #d97a2c;
}

.ts-text-section {
  width: 100%;
  margin-top: 16px;
  padding: 16px;
  background: var(--ts-surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  text-align: left;
}

.ts-text-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ts-text-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
  line-height: 1.4;
}

.ts-text-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ts-text-tab {
  font-family: var(--ts-font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--ts-text-dim);
  cursor: pointer;
}

.ts-text-tab.active {
  background: var(--ts-accent);
  border-color: var(--ts-accent);
  color: #fff;
}

.ts-text-body {
  color: var(--ts-text);
  font-size: 14px;
  line-height: 1.6;
}

.ts-text-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ts-text-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ts-text-block + .ts-text-list {
  margin-top: 12px;
}

.ts-text-list li {
  position: relative;
  padding: 6px 0 6px 16px;
  overflow-wrap: anywhere;
}

.ts-text-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ts-accent);
  opacity: 0.75;
}

.ts-canvas-wrap {
  width: 100%;
  background: var(--ts-bic-bg);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.ts-canvas-wrap canvas {
  display: block;
  width: 100%;
}

.ts-canvas-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.ts-canvas-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  color: rgba(26, 26, 46, 0.35);
  pointer-events: none;
}

/* Download icon overlaid on the image preview (replaces the old button row). */
.ts-image-download {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--ts-text);
  background: rgba(12, 11, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ts-image-download:hover {
  background: rgba(12, 11, 20, 0.85);
  border-color: var(--ts-accent);
  color: var(--ts-accent);
}

/* Full-screen image lightbox. */
.ts-image-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.ts-image-fullscreen[hidden] {
  display: none;
}

.ts-image-fullscreen-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.ts-image-fullscreen-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  color: var(--ts-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
}

.ts-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.ts-image-note {
  color: var(--ts-text-dim);
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 10px;
  text-align: left;
}

.ts-image-controls {
  display: inline-flex;
  gap: 8px;
  flex-shrink: 0;
}

.ts-image-zoom-btn {
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--ts-surface);
  color: var(--ts-text);
  font-family: var(--ts-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ts-image-zoom-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.ts-image-zoom-readout {
  min-width: 58px;
}

.ts-image-stage {
  position: relative;
  width: 100%;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px;
}

.ts-renderer-image {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: top center;
  transition: transform 0.18s ease;
  will-change: transform;
  cursor: zoom-in;
}

/* ---- Audio player ---- */

/* Outer card */
.ts-audio-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 4px 0 16px;
  padding: 14px 16px;
  background: var(--ts-surface);
  border-radius: 12px;
}

/* ---- Compact (idle) state: only a Listen/play affordance is shown.
   Expands to the full transport on first play (JS removes .compact). ---- */
.ts-audio-wrap.compact {
  padding: 8px 14px;
  gap: 0;
}
.ts-audio-wrap.compact .ts-audio-scrub-row { display: none; }
.ts-audio-wrap.compact .ts-audio-transport {
  justify-content: center;
  gap: 10px;
}
.ts-audio-wrap.compact .ts-btn-audio-icon,
.ts-audio-wrap.compact .ts-btn-audio-speed { display: none; }

/* Compact "Listen to summary" label — only visible while collapsed. */
.ts-audio-compact-label {
  display: none;
  font-family: var(--ts-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ts-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  letter-spacing: 0;
}
.ts-audio-compact-label:hover:not(:disabled) { color: var(--ts-accent); }
.ts-audio-compact-label:disabled { opacity: 0.35; cursor: default; }
.ts-audio-wrap.compact .ts-audio-compact-label { display: inline-flex; align-items: center; }

/* Row 1: current time — scrub bar — remaining time */
.ts-audio-scrub-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Progress track (clickable) */
.ts-audio-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  /* Enlarge click target without changing visual height */
  padding: 8px 0;
  margin: -8px 0;
}

.ts-audio-progress-fill {
  height: 4px;
  width: 0;
  background: var(--ts-accent);
  border-radius: 2px;
  transition: width 0.25s linear;
  pointer-events: none;
}

.ts-audio-time {
  font-size: 11px;
  color: var(--ts-text-dim);
  min-width: 34px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Row 2: skip-back — play/pause — skip-fwd — speed */
.ts-audio-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Skip-back and skip-forward icon buttons */
.ts-btn-audio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ts-text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, opacity 0.15s;
  line-height: 0;
}

.ts-btn-audio-icon:hover:not(:disabled) { color: var(--ts-text); }
.ts-btn-audio-icon:disabled { opacity: 0.35; cursor: default; }

/* Large play/pause circle button */
.ts-btn-audio-play {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ts-text);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.15s, opacity 0.15s;
  line-height: 0;
}

.ts-btn-audio-play:hover:not(:disabled) { color: var(--ts-accent); }
.ts-btn-audio-play:disabled { opacity: 0.35; cursor: default; }

/* Playback speed pill — sits at trailing edge */
.ts-btn-audio-speed {
  font-family: var(--ts-font);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: var(--ts-text-dim);
  cursor: pointer;
  padding: 3px 8px;
  min-width: 36px;
  text-align: center;
  transition: color 0.15s, background 0.15s;
  position: absolute;
  right: 16px;
}

.ts-btn-audio-speed:hover:not(:disabled) {
  color: var(--ts-text);
  background: rgba(255,255,255,0.12);
}

.ts-btn-audio-speed:disabled { opacity: 0.35; cursor: default; }

/* Make the transport row position-relative so the speed pill can anchor to it */
.ts-audio-transport { position: relative; }

.ts-audio-error {
  color: var(--ts-text-dim);
  font-size: 13px;
  margin-top: 12px;
}

/* ---- Bullet points ---- */

.ts-bullets {
  width: 100%;
  margin-top: 20px;
  text-align: left;
}

.ts-bullets ul {
  list-style: none;
  padding: 0;
}

.ts-bullet-item {
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ts-text);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeInUp 0.4s ease both;
}

.ts-bullet-item:last-child { border-bottom: none; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Reaction overlay ---- */

.ts-reaction-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.ts-reaction-dialog {
  width: 100%;
  max-width: 400px;
  background: var(--ts-surface);
  border-radius: 16px 16px 12px 12px;
  padding: 20px;
}

.ts-reaction-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.ts-emoji-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ts-emoji-btn {
  font-size: 28px;
  background: none;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.ts-emoji-btn:hover { transform: scale(1.15); }
.ts-emoji-btn.selected { border-color: var(--ts-accent); background: var(--ts-accent-soft); }

.ts-reaction-note {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--ts-font);
  font-size: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--ts-text);
  resize: none;
  height: 60px;
  outline: none;
  margin-bottom: 16px;
}

.ts-reaction-note:focus { border-color: var(--ts-accent); }

.ts-reaction-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- Toast ---- */

.ts-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ts-surface);
  color: var(--ts-text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 200;
  animation: fadeInUp 0.3s ease;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .ts-main { padding: 16px 12px 32px; }
  .ts-diagram-title { font-size: 16px; }
  .ts-emoji-btn { font-size: 24px; padding: 4px 6px; }
  .ts-pin-form { max-width: 240px; }
  .ts-image-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .ts-image-controls {
    width: 100%;
    justify-content: space-between;
  }
  .ts-image-zoom-btn {
    flex: 1;
  }
  .ts-text-header {
    flex-direction: column;
  }
  .ts-text-tabs {
    justify-content: flex-start;
    width: 100%;
  }
  .ts-viewer-wrap #viewer-frame { height: 320px; }
}

/* ---- Unified Viewer (Phase 04) ---- */

.ts-viewer-wrap {
  width: 100%;
  background: var(--ts-bic-bg);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.ts-viewer-wrap #viewer-frame {
  display: block;
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 12px;
  background: var(--ts-bic-bg);
}

.ts-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--ts-text-dim);
  font-size: 13px;
  pointer-events: none;
}

.ts-reaction-hitarea {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: manipulation;
  z-index: 2;
}

.ts-viewer-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
  text-align: center;
  background: var(--ts-bic-bg);
  z-index: 3;
}

.ts-viewer-error p {
  font-size: 14px;
  color: var(--ts-text-dim);
  line-height: 1.5;
}

/* ---- HumanAmp wordmark (INV-69) ---- */
.ts-logo { display: flex; align-items: baseline; gap: 8px; font-weight: 500; letter-spacing: -0.02em; }
.ts-logo b, .ts-expired-brand b { font-weight: 800; }
.ha-mark {
  width: 14px; height: 14px; align-self: center; transform: rotate(-4deg);
  background: linear-gradient(135deg, #E77D70 0 62%, #E4A874 62% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 56%, 56% 100%, 0 100%);
}
.ha-product { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.15em; color: var(--ts-accent); letter-spacing: 0; }

/* Ink on bloom (≈5.2:1) instead of white (≈2.9:1) for accent-filled controls. */
.ts-btn-primary, .ts-tab.active, .ts-text-tab.active { color: #2B2A28; }
