/* =========================================================================
   Teleprompter for Meta Ray-Ban Display (MRBD)
   - 600x600 fixed viewport on the glasses (additive waveguide overlay).
   - Pure black = transparent on the display, so we use it as the background.
   - Bright high-contrast colors for foreground; large fonts for readability.
   - All interactive elements get .focusable for D-pad navigation.
   ========================================================================= */

:root {
  --bg: #000000;             /* invisible on glasses, dark on desktop preview */
  --fg: #ffffff;             /* primary text */
  --fg-dim: #bfc7d1;         /* secondary text */
  --muted: #7e8896;          /* tertiary text */
  --accent: #00d4ff;         /* focus ring + primary action */
  --accent-glow: rgba(0, 212, 255, 0.45);
  --accent-warm: #ffd166;    /* lang badge / wpm */
  --success: #4ade80;
  --danger: #ff6b6b;
  --rule: rgba(255, 255, 255, 0.10);
  --card: rgba(255, 255, 255, 0.04);

  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-reading: ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

body {
  /* On the glasses, the runtime gives us 600x600. On desktop, the browser is
     larger; we center the glasses stage and reveal the editor around it. */
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

/* ============ Glasses stage (600x600 — exact MRBD viewport) ============ */
.stage {
  position: relative;
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  flex: 0 0 600px;
  /* Subtle border only on desktop so the user can see the glasses area */
}

@media (min-width: 900px) {
  .stage {
    border: 1px solid var(--rule);
    border-radius: 8px;
    margin: 24px;
  }
  body { overflow: auto; }
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 28px 32px;
}
.view.active { display: flex; }

.hidden { display: none !important; }

/* ============ Library view ============ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.lang-toggle {
  background: transparent;
  color: var(--accent-warm);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  min-height: 36px;
}

.library-meta {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 14px;
}
.library-meta .dot { margin: 0 6px; }

.script-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow: hidden;
}
.script-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
  color: var(--fg);
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 68px;
}
.script-item .si-title {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.script-item .si-meta {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang-pill {
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent-warm);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.empty-icon { font-size: 56px; margin-bottom: 14px; color: var(--fg-dim); }
.empty-icon.big { font-size: 72px; }
.empty-title { font-size: 22px; color: var(--fg-dim); margin-bottom: 8px; }
.empty-sub { font-size: 16px; }

.view-footer {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
}

/* ============ Focusable design system ============ */
.focusable {
  transition: all 150ms ease;
  border: 2px solid transparent;
  outline: none;
  font-family: inherit;
}
.focusable:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15), 0 0 24px var(--accent-glow);
}
.script-item.focusable:focus {
  background: rgba(0, 212, 255, 0.08);
}

button.focusable, .primary, .secondary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  padding: 14px 20px;
  border-radius: 10px;
  min-height: 48px;
}
.primary {
  background: var(--accent);
  color: #001821;
  border: 2px solid var(--accent);
}
.primary.focusable:focus {
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}
.secondary {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--rule);
}
.secondary.focusable:focus { border-color: var(--accent); }
.danger { color: var(--danger); }

.hidden-focus {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ============ Reading view ============ */
#view-reading { padding: 0; }

.reading-overlay {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  font-size: 12px;
}
.reading-overlay-left, .reading-overlay-right {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.lang-badge {
  color: var(--accent-warm);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.reading-title {
  color: var(--fg-dim);
  font-weight: 500;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.control-badge {
  color: var(--fg-dim);
  font-weight: 600;
  opacity: 0.6;
  transition: all 200ms ease;
}
.control-badge.active-control {
  color: var(--accent);
  opacity: 1;
  text-shadow: 0 0 12px var(--accent-glow);
}
.status-badge {
  color: var(--success);
  font-weight: 700;
}

.reading-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 35%;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 212, 255, 0.35) 20%,
    rgba(0, 212, 255, 0.45) 50%,
    rgba(0, 212, 255, 0.35) 80%,
    transparent
  );
  z-index: 2;
  pointer-events: none;
  transition: height 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
/* While the text is animating to a new position (seek/jump), the reading
   line lights up brighter so the eye has a clear anchor to land on. */
.reading-line.pulse {
  height: 4px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 212, 255, 0.75) 15%,
    rgba(0, 212, 255, 1) 50%,
    rgba(0, 212, 255, 0.75) 85%,
    transparent
  );
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.55);
}

.fade-top, .fade-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 2;
  pointer-events: none;
}
.fade-top {
  top: 0;
  background: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0) 100%);
}
.fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, #000 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0) 100%);
}

.reading-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}
.reading-content {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 32px;
  font-family: var(--font-reading);
  font-size: 32px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--fg);
  will-change: transform;
  /* Initial offset placed by JS (push down so first line starts at reading-line) */
}
.reading-content p {
  margin: 0 0 1em 0;
}
.reading-content p.highlight {
  /* Optional emphasis class — unused in v1 but ready for word-tracking */
  color: var(--accent);
}

/* ============ Done view ============ */
.done-card {
  margin: auto;
  text-align: center;
  padding: 24px;
}
.done-icon {
  font-size: 64px;
  color: var(--success);
  margin-bottom: 8px;
}
.done-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}
.done-sub {
  color: var(--muted);
  margin-bottom: 24px;
}
.done-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* =========================================================================
   DESKTOP EDITOR — only shown when viewport is wider than the glasses.
   Hidden by default; revealed at min-width: 900px so it never appears on MRBD.
   ========================================================================= */
.editor { display: none; }

@media (min-width: 900px) {
  body {
    align-items: stretch;
    background: #0a0d11;
  }
  .editor {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 24px 24px 24px 0;
  }
  .editor-shell {
    background: #0f1318;
    border: 1px solid var(--rule);
    border-radius: 8px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .editor-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rule);
  }
  .editor-head h1 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
  }
  .editor-sub {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
  }
  /* Sync banner above the editor body */
  .sync-bar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--rule);
    background: rgba(0, 212, 255, 0.04);
  }
  .sync-state {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
  }
  .sync-state .sync-info { flex: 1; min-width: 0; }
  .sync-title {
    font-size: 13px;
    color: var(--fg);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .sync-title code {
    background: rgba(0, 212, 255, 0.12);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
  }
  .sync-sub {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .sync-status-off { color: var(--accent-warm); font-weight: 700; }
  .sync-status-on  { color: var(--success);    font-weight: 700; }
  .sync-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .sync-url-row input {
    flex: 1;
    font-family: ui-monospace, monospace;
    font-size: 12px;
  }
  .sync-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.10);
    border: 1px solid rgba(255, 107, 107, 0.30);
    border-radius: 4px;
    color: var(--danger);
    font-size: 12px;
  }

  .editor-body {
    flex: 1;
    display: grid;
    grid-template-columns: 220px 1fr 320px;
    overflow: hidden;
  }
  .editor-sidebar {
    border-right: 1px solid var(--rule);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .block { display: block; width: 100%; text-align: center; }
  .editor-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
  }
  .editor-list li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--fg-dim);
    transition: background 120ms ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }
  .editor-list li:hover { background: rgba(255, 255, 255, 0.04); }
  .editor-list li.active {
    background: rgba(0, 212, 255, 0.12);
    color: var(--fg);
  }
  .editor-list .el-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .editor-list .el-lang {
    font-size: 10px;
    color: var(--accent-warm);
    background: rgba(255, 209, 102, 0.10);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
  }
  .editor-storage { font-size: 11px; }

  .editor-form {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .editor-empty {
    margin: auto;
    color: var(--muted);
    text-align: center;
  }
  .editor-fields { display: flex; flex-direction: column; gap: 14px; }
  .field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .field-label { font-size: 12px; color: var(--muted); }
  .field-row { display: flex; gap: 12px; }
  .field-row .field { flex: 1; }
  input[type="text"], input[type="number"], textarea, select {
    background: #0a0d11;
    color: var(--fg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
  }
  textarea {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', monospace;
    line-height: 1.5;
    resize: vertical;
  }
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
  }
  .readonly-value {
    padding: 8px 10px;
    border: 1px dashed var(--rule);
    border-radius: 6px;
    font-size: 14px;
    color: var(--fg-dim);
  }
  .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
  }
  .form-actions-right { display: flex; gap: 8px; }
  .save-indicator { font-size: 12px; }

  .editor-preview {
    border-left: 1px solid var(--rule);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
  }
  .preview-label { font-size: 12px; }
  .preview-frame {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    flex: 0 0 auto;
  }
  .preview-frame iframe {
    width: 600px;
    height: 600px;
    transform: scale(0.5);
    transform-origin: top left;
    border: 0;
    display: block;
  }
  .preview-hints { font-size: 11px; line-height: 1.7; }
  .preview-hints strong { color: var(--fg-dim); margin-right: 4px; }
  kbd {
    background: #1a1f26;
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: ui-monospace, monospace;
    font-size: 10px;
  }
}

.muted { color: var(--muted); }

/* =========================================================================
   PHONE BREAKPOINT — narrow portrait screens (iPhone, Android phone).
   IMPORTANT: must be < 600px because the MRBD glasses report exactly 600px
   viewport width — if this range included 600 the glasses would show the
   editor instead of the teleprompter.
   Also: most editor styles live inside @media (min-width: 900px), so on
   phones they don't cascade through. This block has to fully define the
   phone layout itself, not just override pieces.
   ========================================================================= */
@media (max-width: 500px) {
  html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body {
    align-items: stretch;
    overflow: auto;
    background: #0a0d11;
    min-height: 100vh;
    font-size: 14px;
  }

  /* Hide the glasses stage — phone users edit, they don't read on the phone */
  .stage { display: none; }

  /* Editor takes the full screen */
  .editor {
    display: block !important;
    flex: 1;
    padding: 0;
    min-width: 0;
    width: 100%;
  }
  .editor-shell {
    background: transparent;
    border: none;
    border-radius: 0;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .editor-head {
    /* env(safe-area-inset-top) pushes content below the iOS status bar
       when running as a home-screen PWA (apple-mobile-web-app-capable).
       The dark background still extends to the top of the screen so the
       status bar overlays cleanly. */
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 14px));
    background: #0f1318;
    border-bottom: 1px solid var(--rule);
  }
  .editor-head h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
  }
  /* The desktop-only intro paragraph doesn't apply on a phone */
  .editor-sub { display: none; }

  /* ---- Sync bar ---- */
  .sync-bar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule);
    background: rgba(0, 212, 255, 0.04);
  }
  .sync-state {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sync-info { flex: 1; min-width: 0; }
  .sync-title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--fg);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .sync-title code {
    background: rgba(0, 212, 255, 0.12);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
  }
  .sync-sub {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .sync-status-off { color: var(--accent-warm); font-weight: 700; }
  .sync-status-on  { color: var(--success);    font-weight: 700; }
  .sync-url-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .sync-url-row input {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
    background: #0a0d11;
    color: var(--fg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-family: ui-monospace, monospace;
  }
  .sync-state .primary,
  .sync-state .secondary,
  .sync-url-row .secondary {
    width: 100%;
    font-size: 15px;
    padding: 12px 16px;
    min-height: 44px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
  }
  .sync-state .primary,
  .sync-url-row .primary {
    background: var(--accent);
    color: #001821;
    border: 2px solid var(--accent);
  }
  .sync-state .secondary,
  .sync-url-row .secondary {
    background: transparent;
    color: var(--fg);
    border: 2px solid var(--rule);
  }
  .sync-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.10);
    border: 1px solid rgba(255, 107, 107, 0.30);
    border-radius: 4px;
    color: var(--danger);
    font-size: 12px;
  }

  /* ---- Body as vertical stack ---- */
  .editor-body {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    overflow: visible;
    flex: 1;
  }

  /* ---- Sidebar: vertical, with the script list as a horizontal scroller ---- */
  .editor-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 12px 12px 8px;
    background: #0f1318;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .editor-sidebar .primary {
    width: 100%;
    font-size: 15px;
    padding: 12px;
    min-height: 44px;
    background: var(--accent);
    color: #001821;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
  }
  /* Vertical list — one script per row, full width, no horizontal scroll */
  .editor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    max-height: none;
  }
  .editor-list li {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--fg-dim);
    min-height: 48px;
    transition: background 120ms ease;
  }
  .editor-list li.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--fg);
  }
  .editor-list .el-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: 15px;
  }
  .editor-list .el-lang {
    font-size: 11px;
    color: var(--accent-warm);
    background: rgba(255, 209, 102, 0.10);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
  }
  .editor-storage {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
  }

  /* ---- Form ---- */
  .editor-form {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: visible;
  }
  .editor-fields { display: flex; flex-direction: column; gap: 16px; }
  .field { display: flex; flex-direction: column; gap: 4px; }
  .field-label { font-size: 13px; color: var(--muted); }
  .field-row { display: flex; flex-direction: column; gap: 14px; }

  input[type="text"], input[type="number"], textarea, select {
    background: #0a0d11;
    color: var(--fg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
    width: 100%;
    box-sizing: border-box;
  }
  textarea {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', monospace;
    line-height: 1.5;
    resize: vertical;
    min-height: 260px;
  }
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
  }
  .readonly-value {
    padding: 10px 12px;
    border: 1px dashed var(--rule);
    border-radius: 6px;
    font-size: 14px;
    color: var(--fg-dim);
  }
  .form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    align-items: stretch;
    padding-top: 12px;
    /* Bottom safe area for newer iPhones with home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid var(--rule);
    margin-top: 8px;
  }
  .form-actions-right { display: flex; flex-direction: row; gap: 8px; }
  .form-actions-right .secondary,
  .form-actions-right .primary {
    flex: 1;
    font-size: 15px;
    padding: 12px 16px;
    min-height: 44px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
  }
  .form-actions-right .primary {
    background: var(--accent);
    color: #001821;
    border: 2px solid var(--accent);
  }
  .form-actions-right .secondary {
    background: transparent;
    color: var(--fg);
    border: 2px solid var(--rule);
  }
  .save-indicator {
    font-size: 12px;
    text-align: center;
    color: var(--muted);
  }

  /* No room for the glasses preview on a phone */
  .editor-preview { display: none; }

  /* Empty state */
  .editor-empty {
    margin: 0;
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
  }
  .editor-empty .empty-icon.big { font-size: 56px; margin-bottom: 12px; }
}

/* =========================================================================
   OFFLINE INDICATOR — appears inside the sync bar when network is gone.
   ========================================================================= */
.offline-pill {
  display: inline-block;
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent-warm);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
  letter-spacing: 0.5px;
}
.offline-pill.hidden { display: none; }
