/**
 * studio.css
 * Styles for the offline features (OFFLINE-FEATURES-PLAN.md). Every selector
 * here targets ts-studio-* classes only, so this file cannot change the look
 * of anything that existed before it.
 */

/* ============================================
   TOOLS PANEL (js/studio/studio-panel.js)
   ============================================ */
#tsStudioPanel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ts-studio-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  text-align: left;
  color: inherit;
  font: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
}

.ts-studio-tile:hover,
.ts-studio-tile:focus-visible {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.45);
  outline: none;
}

.ts-studio-tile-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.ts-studio-tile-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ts-studio-tile-label {
  font-weight: 600;
}

.ts-studio-tile-desc {
  font-size: 0.8rem;
  opacity: 0.7;
}

body.light-mode .ts-studio-tile {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ============================================
   FEATURE VIEWS (TSStudioPanel.showView)
   ============================================ */
.ts-studio-view-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.ts-studio-back {
  font: inherit;
  font-size: 0.8rem;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.ts-studio-view-title {
  margin: 0;
  font-size: 1rem;
}

.ts-studio-view-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ts-studio-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.ts-studio-section h4 {
  margin: 0;
  font-size: 0.85rem;
}

.ts-studio-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ts-studio-segmented button {
  flex: 1 1 auto;
  font: inherit;
  font-size: 0.8rem;
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}

.ts-studio-segmented button[aria-checked="true"] {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.65);
  font-weight: 600;
}

.ts-studio-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.ts-studio-row select,
.ts-studio-row input[type="range"] {
  font: inherit;
  max-width: 100%;
}

.ts-studio-legend {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ts-studio-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
}

.ts-studio-hint {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.72;
}

.ts-studio-note {
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.75rem;
  opacity: 0.8;
  border-left: 3px solid rgba(250, 204, 21, 0.65);
}

.ts-studio-primary {
  font: inherit;
  font-weight: 600;
  color: #06210f;
  background: #22c55e;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.ts-studio-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ts-studio-view-body [hidden] {
  display: none !important;
}

body.light-mode .ts-studio-back,
body.light-mode .ts-studio-segmented button,
body.light-mode .ts-studio-section {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}

/* ============================================
   SPEED READING OVERLAY (js/studio/rsvp.js)
   ============================================ */
.ts-rsvp {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(10, 10, 10, 0.94);
  color: #f5f5f5;
  font-family: 'Inter', 'DM Sans', system-ui, sans-serif;
}

.ts-rsvp [hidden] {
  display: none !important;
}

.ts-rsvp-stage {
  width: min(900px, 100%);
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ts-rsvp-tick {
  width: 2px;
  height: 1.25rem;
  background: currentColor;
  opacity: 0.35;
}

.ts-rsvp-word {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: 100%;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.2;
  white-space: pre;
}

.ts-rsvp-left { text-align: right; }
.ts-rsvp-right { text-align: left; }

.ts-rsvp-pivot {
  color: var(--ts-rsvp-pivot, #be123c);
  font-weight: 700;
}

.ts-rsvp-phrase {
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  line-height: 1.3;
  text-align: center;
}

.ts-rsvp-progress {
  width: min(900px, 100%);
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.ts-rsvp-progress-bar {
  width: 0;
  height: 100%;
  background: #22c55e;
}

.ts-rsvp-status {
  font-size: 0.9rem;
  opacity: 0.85;
  text-align: center;
}

.ts-rsvp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ts-rsvp-btn {
  font: inherit;
  font-size: 0.95rem;
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.ts-rsvp-btn:hover,
.ts-rsvp-btn:focus-visible {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.65);
  outline: none;
}

.ts-rsvp-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.ts-rsvp-value {
  min-width: 4.5rem;
}

.ts-rsvp-help {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

@media (max-width: 600px) {
  .ts-rsvp-stage { min-height: 30vh; }
}
