/* thinq-widgets.css
   Shared frame + tokens for thinqOS essay widgets.
   Include once per page, before any widget snippet. */

:root {
  --tw-bg: var(--bg, #05070d);
  --tw-panel: var(--panel, #0c111d);
  --tw-panel-2: #111929;
  --tw-border: rgba(255,255,255,.08);
  --tw-border-soft: rgba(255,255,255,.05);
  --tw-text: var(--ink, #eef3fb);
  --tw-muted: var(--ink-mute, #7e8ba4);
  --tw-faint: #5e6a82;
  --tw-blue: var(--cyan, #5bc8ff);
  --tw-cyan: #8ad8ff;
  --tw-purple: var(--violet, #a78bfa);
  --tw-amber: #f2b14d;
  --tw-green: #43d97b;
  --tw-red: #f0564f;
  --tw-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- frame ---- */
.tw {
  margin: 56px 0;
  border: 1px solid var(--tw-border);
  border-radius: 16px;
  background: var(--tw-panel);
  overflow: hidden;
}
.tw, .tw * { box-sizing: border-box; }

.tw-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tw-border-soft);
}
.tw-dots { display: inline-flex; gap: 6px; }
.tw-dots i { width: 9px; height: 9px; border-radius: 50%; background: #222b3d; }
.tw-name { font-family: var(--tw-mono); font-size: 13px; color: var(--tw-muted); letter-spacing: .02em; }
.tw-stat { margin-left: auto; font-family: var(--tw-mono); font-size: 13px; color: var(--tw-faint); }
.tw-stat b { color: var(--tw-blue); font-weight: 600; }

.tw-stage { padding: 10px 14px 4px; }
.tw-stage svg { display: block; width: 100%; height: auto; }

.tw-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 16px; }
.tw-pill, .tw-action {
  font-family: var(--tw-mono);
  font-size: 12.5px;
  color: var(--tw-muted);
  background: none;
  border: 1px solid var(--tw-border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .2s, color .2s;
}
.tw-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--tw-faint); transition: background .2s, box-shadow .2s; }
.tw-pill:hover, .tw-action:hover { border-color: var(--tw-blue); color: var(--tw-text); }
.tw-pill[aria-pressed="true"] { border-color: var(--tw-blue); color: var(--tw-text); }
.tw-pill[aria-pressed="true"] i { background: var(--tw-green); box-shadow: 0 0 8px var(--tw-green); }
.tw-action { border-color: #3a2630; color: #d9909a; }
.tw-action:hover { border-color: var(--tw-red); color: #ffb3ad; }

.tw-cap {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--tw-border-soft);
  font-family: var(--tw-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--tw-muted);
  min-height: 48px;
}
.tw-cap b { color: var(--tw-blue); font-weight: 600; }
.tw-cap b.tw-bad { color: var(--tw-red); }
.tw-cap b.tw-ok { color: var(--tw-green); }

/* focus visibility for keyboard users */
.tw [tabindex]:focus-visible, .tw button:focus-visible {
  outline: 1.5px solid var(--tw-blue);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 560px) {
  .tw { margin: 40px -4px; border-radius: 12px; }
  .tw-stat { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tw *, .tw *::before, .tw *::after {
    animation: none !important;
    transition-duration: 0s !important;
  }
}
