:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;     /* slightly off-surface (cards inside cards, post-preview, etc.) */
  --surface-hover: #f1f5f9; /* hover state on buttons / menu items */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --accent: #0085ff;
  --accent-hover: #0066cc;
  --accent-soft: #eff6ff;
  --danger: #e11d48;
  --danger-hover: #be123c;
  --danger-soft: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #9f1239;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --toast-bg: rgba(15, 23, 42, 0.92);
  --toast-fg: #ffffff;
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-toast: 0 4px 12px rgba(0, 0, 0, 0.18);
  --radius: 10px;
  --radius-lg: 14px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #15213a;
  --surface-2: #0f1a2e;
  --surface-hover: #23304d;
  --border: #25334f;
  --border-strong: #3b4a6b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent: #4aa8ff;
  --accent-hover: #7cbcff;
  --accent-soft: #19355c;
  --danger: #fb7185;
  --danger-hover: #f43f5e;
  --danger-soft: #3f0e1a;
  --danger-border: #6b1b2d;
  --danger-text: #fda4af;
  --warning-soft: #3a2c0a;
  --warning-border: #b45309;
  --warning-text: #fde68a;
  --toast-bg: rgba(226, 232, 240, 0.95);
  --toast-fg: #0b1220;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-toast: 0 4px 16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard Variable",
    Pretendard, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font: inherit;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; opacity: 0.5; }

input, button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Layout — header and footer stay visible while the main area scrolls. */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.brand-emoji {
  font-size: 20px;
  line-height: 1;
}
.nav { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.nav a, .nav .pill {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
}
.nav a:hover { background: var(--surface-hover); text-decoration: none; }
.nav .session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 8px;
}
.nav .session img {
  width: 22px; height: 22px; border-radius: 50%;
}
.nav .session button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 2px 4px;
  font-size: 12px;
}
.nav .session button:hover { color: var(--text); }
.nav .session-name {
  color: var(--text);
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav .session-handle {
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .nav .session-name { display: none; }
}

/* Language picker (globe icon + popover menu). */
.lang-picker { position: relative; display: inline-flex; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.lang-btn:hover { color: var(--text); background: var(--surface-hover); }
.lang-btn[aria-expanded='true'] { color: var(--text); background: var(--surface-hover); }
.lang-btn svg { display: block; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-md);
  min-width: 140px;
  display: flex;
  flex-direction: column;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.lang-option:hover { background: var(--surface-hover); }
.lang-option.active { font-weight: 600; }
.lang-option .lang-check {
  display: inline-block;
  width: 14px;
  color: var(--accent);
  font-weight: 700;
}

/* Tool picker — solid down-triangle button + dropdown of tool links. */
.tool-picker { position: relative; display: inline-flex; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}
.tool-btn:hover,
.tool-btn[aria-expanded='true'] {
  color: var(--text);
  background: var(--surface-hover);
}
.tool-btn-tri { transform: translateY(1px); }
.tool-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-md);
  min-width: 180px;
  display: flex;
  flex-direction: column;
}
.tool-menu[hidden] { display: none; }
.tool-option {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.tool-option:hover { background: var(--surface-hover); text-decoration: none; }
.tool-option.active { font-weight: 600; background: var(--accent-soft); color: var(--accent-hover); }
.tool-option.disabled { color: var(--text-faint); cursor: not-allowed; }
.tool-option.disabled:hover { background: transparent; }
.tool-option .tool-icon { font-size: 16px; width: 20px; text-align: center; }
.tool-option .tool-tag {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
}

/* Theme toggle (moon / sun) — same shape as the language picker. */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.theme-btn:hover { color: var(--text); background: var(--surface-hover); }
.theme-btn svg { display: block; }

/* Account picker — person-pictogram button + popover with name and
 * sign-out. Replaces the inline "avatar + name + @handle + logout"
 * pill that overflowed on narrow viewports. */
.session-picker { position: relative; display: inline-flex; }
.session-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.session-btn:hover,
.session-btn[aria-expanded='true'] {
  color: var(--text);
  background: var(--surface-hover);
}
.session-btn svg { display: block; }
.session-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.session-menu[hidden] { display: none; }
.session-menu-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border);
}
.session-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.session-menu-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.session-menu-who strong {
  font-size: 14px;
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-menu-handle {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-menu-logout {
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
  color: var(--danger);
  cursor: pointer;
}
.session-menu-logout:hover { background: var(--surface-hover); }

main {
  flex: 1;
}
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  position: sticky;
  bottom: 0;
  z-index: 50;
}
.site-footer .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
}
.site-footer .foot-line { margin: 0; }
.site-footer .foot-line + .foot-line { margin-top: 4px; }
.site-footer .attribution { color: var(--text-faint); }
.site-footer .attribution a { color: var(--text-muted); }
.site-footer .attribution a:hover { color: var(--accent); }

/* Cloud (블스구름) */
.cloud-advanced { margin-top: 12px; }
.cloud-advanced > summary {
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.cloud-tokenizer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.cloud-tokenizer-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}
.cloud-tokenizer-option:hover { background: var(--surface-hover); }
.cloud-tokenizer-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cloud-tokenizer-head strong { font-size: 14px; }
.cloud-tokenizer-option .hint { margin: 0; }
.cloud-canvas-wrap {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.cloud-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.cloud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.cloud-actions .hint.ok { color: #059669; }
[data-theme="dark"] .cloud-actions .hint.ok { color: #6ee7b7; }

/* Reaction tool (블스리액션) — two-pane layout: posts left, reactions
 * stream right. Stacks vertically on phones. */
.reaction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 760px) {
  .reaction-grid { grid-template-columns: 1fr; }
}
.reaction-left,
.reaction-right {
  padding: 14px;
  max-height: 70vh;
  overflow-y: auto;
}
.reaction-pane-title { margin: 0 0 10px; font-size: 16px; }
.reaction-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reaction-post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.reaction-post:hover,
.reaction-post:focus {
  background: var(--surface-hover);
  outline: none;
}
.reaction-post.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.reaction-post-meta,
.reaction-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
/* Match the cleaner sample list — solid pill background around each
 * tag (reply / images / video / external / quote / repost) so they
 * read as distinct chips rather than runs of plain text. */
.reaction-post-meta .badge,
.reaction-item-head .badge,
.reaction-item .badge {
  background: var(--surface-hover);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.reaction-foot {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-faint);
}
.reaction-time { font-variant-numeric: tabular-nums; }
.reaction-link {
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 0 4px;
}
.reaction-link:hover { color: var(--accent); text-decoration: none; }
.reaction-text {
  margin: 4px 0;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reaction-text-sm {
  margin: 4px 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reaction-text.empty { color: var(--text-faint); font-style: italic; }
.reaction-post-counts {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.reaction-post-counts .sep { color: var(--text-faint); }
.reaction-selected-head {
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.reaction-stream {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reaction-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface-2);
}
.reaction-item-who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

/* Limit tool */
.limit-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .limit-grid { grid-template-columns: 1fr; }
}
.limit-card { padding: 14px; }
.limit-card-title { margin: 0 0 2px; font-size: 14px; }
.limit-card-nsid {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.limit-bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.limit-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}
.limit-bar-green { background: #10b981; }
.limit-bar-yellow { background: #f59e0b; }
.limit-bar-red { background: var(--danger); }
.limit-numbers { margin: 0 0 4px; font-size: 13px; }
.limit-numbers strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.limit-detail {
  margin: 4px 0 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.limit-cors-banner {
  margin-bottom: 14px;
  border-left: 4px solid var(--warning, #f59e0b);
}
.limit-cors-banner h3 { margin: 0 0 8px; font-size: 15px; }
.limit-cors-banner p { margin: 6px 0; }

/* Masking tool — composer + public decoder route */
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.panel-head h2 { margin: 0; }
.row.gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-row { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.hint.ok { color: #059669; }
[data-theme="dark"] .hint.ok { color: #6ee7b7; }
.hint.err { color: var(--danger); }
.pill.warn { background: var(--danger); color: #fff; }

.composer-extra-section {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.masking-modes {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
@media (max-width: 600px) {
  .masking-modes { grid-template-columns: 1fr; }
}
.masking-modes legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.masking-mode-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.masking-mode-sample {
  display: inline-block;
  min-width: 4.5em;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 4px;
}
.masking-add-btn { border-color: var(--border); }

/* Inline highlight + × overlay on each masked span in the body */
.mirror-mask {
  background: rgba(212, 24, 61, 0.20);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(212, 24, 61, 0.35) inset;
}
[data-theme="dark"] .mirror-mask {
  background: rgba(248, 113, 133, 0.28);
  box-shadow: 0 0 0 1px rgba(248, 113, 133, 0.45) inset;
}
.masking-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.masking-span-remove {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger, #d4183d);
  color: #fff;
  border: 1.5px solid var(--surface, #fff);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.masking-span-remove:hover { background: var(--danger-hover, #b91c3c); }

.masking-preview-text {
  white-space: pre-wrap;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  min-height: 3em;
}
.masking-anchor-preview {
  color: var(--accent, #0085ff);
  text-decoration: underline;
}
.masking-unmask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.masking-unmask-reply {
  margin-top: 16px;
}
.masking-target-prompt h3 { margin: 0 0 6px; font-size: 16px; }
.masking-target-prompt p.hint { margin: 0 0 10px; }

/* Rhythm — day-of-week × hour heatmap */
.rhythm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.rhythm-progress { margin: 0; min-height: 1.2em; }
.rhythm-progress.err { color: var(--danger); }
.rhythm-heatmap { margin: 14px 0 8px; overflow-x: auto; }
.rhythm-grid {
  border-collapse: separate;
  border-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.rhythm-grid th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 0;
}
.rhythm-th-corner { width: 32px; height: 16px; }
.rhythm-th-hour { width: 18px; height: 16px; }
.rhythm-th-day {
  width: 32px;
  text-align: right !important;
  padding-right: 6px !important;
  font-size: 12px !important;
}
.rhythm-cell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--surface-2);
  transition: transform 0.1s;
}
.rhythm-cell.filled:hover {
  transform: scale(1.25);
  outline: 1px solid var(--accent);
}
.rhythm-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
}
.rhythm-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}
.rhythm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.rhythm-stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 14px;
}
.rhythm-stat-label { font-size: 12px; color: var(--text-muted); }
.rhythm-stat-value {
  font-size: 18px;
  font-weight: 600;
  margin: 2px 0;
}
.rhythm-stat-sub { font-size: 12px; }
.rhythm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.rhythm-actions .hint.ok { color: #059669; }
.rhythm-actions .hint.err { color: var(--danger); }
[data-theme="dark"] .rhythm-actions .hint.ok { color: #6ee7b7; }
.masking-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.masking-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  max-width: 100%;
}
.masking-chip.orphaned {
  border-color: var(--danger);
  color: var(--danger);
  text-decoration: line-through;
}
.masking-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.masking-chip-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
}
.masking-chip-remove:hover { color: var(--danger); }

.masking-preview-text {
  white-space: pre-wrap;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.5;
  min-height: 4em;
}
.masking-anchor-preview {
  color: var(--link, #0085ff);
  text-decoration: underline;
}
.masking-revealed-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
  padding: 8px 4px;
}
.masking-revealed {
  background: #fde68a;
  color: #111;
  padding: 0 3px;
  border-radius: 3px;
}
[data-theme="dark"] .masking-revealed {
  background: #b45309;
  color: #fff;
}

/* Footer share row */
.site-footer .inner { text-align: center; }
.footer-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.share-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.share-btn.share-bluesky:hover { color: #0085ff; border-color: #0085ff; }
.share-btn.share-x:hover { color: #000; border-color: #000; }
.share-btn.share-threads:hover { color: #000; border-color: #000; }
.share-btn.share-instagram:hover { color: #c13584; border-color: #c13584; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 8px);
  background: var(--toast-bg);
  color: var(--toast-fg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow-toast);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error { background: #9f1239; }

/* Components */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-hover); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface-hover); border-color: var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn.ghost { background: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }

.input {
  width: 100%;
  box-sizing: border-box; /* keep border+padding inside the declared width */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  min-width: 0; /* let flex/grid shrink the input below content-min-width */
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 133, 255, 0.15);
}
.input.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.field { display: block; margin-bottom: 12px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hint { font-size: 12px; color: var(--text-muted); }

.input-with-button {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-with-button .input { flex: 1 1 auto; min-width: 0; }
.input-with-button .btn { flex: 0 0 auto; white-space: nowrap; }

.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--danger);
}
.field-error[hidden] { display: none; }

.banner {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}
.banner.error {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
  color: var(--danger-text);
}
.banner.warn {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
.banner.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* ───── Composer ───── */
.composer { padding: 16px; }
.composer-section { margin-bottom: 16px; }
.composer-section:last-of-type { margin-bottom: 0; }
.composer-top { margin-bottom: 16px; }
/* Layered textarea: mirror behind, transparent textarea on top so the
 * red over-limit highlight shines through. Mirror and textarea MUST share
 * the same padding / font / line-height for offsets to line up. */
.composer-textarea-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.composer-textarea-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 133, 255, 0.15);
}
.composer-textarea-mirror,
.composer-textarea {
  /* shared layout — keep in lockstep */
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.composer-textarea-mirror {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  color: transparent;          /* invisible; only backgrounds show */
  pointer-events: none;
  overflow: hidden;             /* scroll synced via JS to textarea */
}
.mirror-ok { background: transparent; }
.mirror-over {
  background: rgba(225, 29, 72, 0.22);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.25);
}
.mirror-link {
  background: rgba(0, 133, 255, 0.10);
  border-radius: 2px;
  box-shadow: 0 1px 0 0 var(--accent);
}
.composer-textarea {
  position: relative;           /* sit on top of the mirror */
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  display: block;
}
.composer-textarea::placeholder { color: var(--text-faint); }
.body-counter {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.body-counter.over { color: var(--danger); font-weight: 600; }
.composer-section .section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.composer-section .section-head .field-label { margin: 0; }

/* Image grid: 2x2 thumbnails with alt-text input below each. */
.composer-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.composer-images:empty { display: none; }
.image-cell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--border);
}
.image-alt {
  font-size: 12px;
  padding: 4px 6px;
}
.image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.image-remove:hover { background: rgba(15, 23, 42, 0.9); }

/* Post-link preview card */
.post-preview-slot:empty { display: none; }
.post-preview-slot { margin-top: 8px; }
.post-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-2);
}
.post-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.post-preview-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.post-preview-who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.post-preview-handle {
  color: var(--text-muted);
  font-size: 12px;
}
.post-preview-text {
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.postref-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.postref-actions[hidden] { display: none; }

.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Link-facet editor (블스링커) */
.composer-link-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.composer-link-toolbar .hint { color: var(--warning-text); }
.link-edit-panel {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.link-edit-panel[hidden] { display: none; }
.link-edit-panel .link-selected {
  margin: 0 0 8px;
  font-size: 13px;
  word-break: break-word;
}
.link-edit-panel .field { margin-bottom: 0; }
.link-edit-panel .modal-actions { margin-top: 10px; }
.link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.link-chips:empty + .hint { display: block; }
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
}
.link-chip:hover { background: #dbeafe; }
.link-chip.orphaned {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
.link-chip .chip-text {
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-chip .chip-sep { color: var(--text-faint); }
.link-chip .chip-url {
  color: var(--text-muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
}
.link-chip .chip-warn { color: var(--warning-text); font-size: 11px; }

/* ───── Time machine: date/time block ───── */
.datetime-block {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  margin-bottom: 4px;
}
.datetime-body { margin: 10px 0; }
.datetime-picker-row {
  /* Two equal-width columns ("vertical strips") on one row. Each strip
   * gets exactly half the container; the date/time inputs themselves
   * are sized to ~2/3 of their strip (sitting left-aligned) so the
   * native pickers don't visually crash into each other.
   * box-sizing + min-width:0 on the cell keeps the native chrome from
   * overflowing the column. */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.datetime-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.datetime-cell .field-label { font-size: 12px; }
.datetime-cell .input[type="date"],
.datetime-cell .input[type="time"] {
  width: 66.67%;
}
.datetime-format-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.datetime-manual-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}
.datetime-manual-row .input { padding: 6px 8px; }
.ampm-cell { justify-content: flex-end; }
.datetime-tz-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.datetime-tz-row .input { flex: 1; min-width: 200px; }
.datetime-preview {
  margin: 10px 0 0;
  font-size: 12px;
}
.datetime-preview code { font-size: 12px; }
.field-label.inline { margin: 0; font-weight: 500; color: var(--text-muted); }

/* ───── Drawing (raffle) ───── */
.drawing-stats {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.drawing-stats .stat-label { color: var(--text-muted); margin-right: 2px; }
.drawing-stats .sep { color: var(--text-faint); }
.drawing-stats .hint { color: var(--text-faint); font-size: 12px; }
.drawing-results { margin-top: 16px; padding: 16px; }
.drawing-results h2 { margin: 0 0 10px; font-size: 18px; }
.winners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.winners-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface-2);
}
.winners-list .post-preview-avatar { width: 28px; height: 28px; }
.winners-list strong { font-size: 14px; }

.count-clamp {
  margin: 6px 0 0;
  color: var(--warning-text);
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.count-clamp[hidden] { display: none; }

/* Recent-posts picker modal */
.picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.picker-item:hover, .picker-item:focus {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.picker-text {
  margin: 0 0 6px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.picker-meta {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.picker-meta .sep { color: var(--text-faint); }

/* Home grid */
.hero { margin-bottom: 28px; }
.hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.hero p { margin: 0; color: var(--text-muted); }

.tool-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
.tool {
  display: block;
  color: var(--text);
}
.tool .card { height: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.tool[href]:hover { text-decoration: none; }
.tool[href]:hover .card {
  border-color: #bae6fd;
  box-shadow: var(--shadow-md);
}
.tool .head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.tool .icon {
  width: 32px; height: 32px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.tool h2 { margin: 0; font-size: 16px; }
.tool .tag {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-hover);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
}
.tool.disabled .card { opacity: 0.55; }
.tool p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* Login form */
.login {
  max-width: 420px;
  margin: 24px auto;
}
.login h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.login p { margin: 0 0 16px; color: var(--text-muted); }

.auth-section {
  display: block;
  margin-bottom: 28px;
}
.auth-section .login { margin-top: 0; margin-bottom: 0; }

/* Tool pages: shown when no session exists. */
.login-prompt {
  max-width: 460px;
  margin: 24px auto;
  text-align: center;
}
.login-prompt h2 { margin: 0 0 8px; font-size: 18px; }
.login-prompt p { margin: 0 0 16px; color: var(--text-muted); }
.login-prompt .btn { display: inline-flex; }

/* Cleaner */
.cleaner-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}
.cleaner-toolbar h1 { margin: 0 0 4px; font-size: 22px; }
.cleaner-toolbar p { margin: 0; color: var(--text-muted); font-size: 13px; }
.cleaner-toolbar .actions { display: flex; gap: 8px; }
.tool-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-title-row h1 { margin: 0; }

.cleaner-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .cleaner-grid { grid-template-columns: 320px 1fr; }
}

.scope-toggle {
  display: inline-flex;
  background: var(--surface-hover);
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 10px;
  font-size: 12px;
}
.scope-with-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.scope-with-inputs .scope-toggle { margin-bottom: 0; }
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-range .input { margin: 0; }
.date-sep {
  color: var(--text-faint);
  font-weight: 500;
}
.scope-toggle .scope-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.scope-toggle .scope-btn:hover { color: var(--text); }
.scope-toggle .scope-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.chip-all { font-weight: 700; }
.chip-all.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.preview-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}
.preview-action .preview-btn {
  min-width: 280px;
  padding: 10px 18px;
  font-size: 14px;
}
.preview-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
  text-align: center;
}

.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.mode-section .mode-toggle { margin-top: 2px; }
.mode-toggle .mode {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.mode-toggle .mode + .mode { border-left: 1px solid var(--border); }
.mode-toggle .mode:hover { color: var(--text); }
.mode-toggle .mode.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* fieldset reset — the wrapper around all filter sections gains
 * `disabled` when mode === 'all', natively disabling every input/button
 * inside without per-element wiring. */
.filter-body {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.filter-body:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.filter-body:disabled .chip { cursor: not-allowed; }

.filter-section { margin-bottom: 18px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-section .section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.filter-section .section-head h3 { margin: 0; }

.info-btn {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--text-faint);
  background: transparent;
  border-radius: 50%;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  color: var(--text-faint);
  cursor: pointer;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  flex: 0 0 auto;
}
.info-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
/* Option-level info marks (next to a filter/section heading) are smaller
 * than the title-level mark next to a tool's H1. */
.section-head .info-btn {
  width: 13px;
  height: 13px;
  font-size: 9px;
}
.filter-section .row { display: flex; gap: 8px; align-items: center; }
/* Two date inputs side-by-side. iOS Safari ignores width/min-width on
 * <input type='date'> while keeping its picker chrome — strip the
 * native chrome with -webkit-appearance: none and pin a hard 100px
 * width so two fit on a row even on the narrowest phones. */
.filter-section .grid-2 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-section .grid-2 > * { flex: 0 0 auto; }
.filter-section .grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.filter-section input[type='date'] {
  appearance: none;
  -webkit-appearance: none;
  width: 100px;
  min-width: 0;
  max-width: 100px;
  box-sizing: border-box;
}
.radio-row { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.radio-row label { display: inline-flex; align-items: center; gap: 4px; }

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.option-row + .option-row { margin-top: 6px; }
.option-row input[type='checkbox'] { flex: 0 0 auto; cursor: pointer; }

/* Announcement option, rendered as a section-style header row. The
 * heading + info button + checkbox cluster together on the left so the
 * checkbox sits right next to the (i) button. */
.announce-section {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.announce-section .section-head { margin-bottom: 0; }
.announce-section .section-head h3 { margin: 0; }
.announce-checkbox { flex: 0 0 auto; cursor: pointer; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.result-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.result-bar strong { color: var(--text); }
.result-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Indeterminate "streaming" progress bar — a thin sliding ticker since
 * we don't know the total count until the stream completes. */
.progress.indeterminate { position: relative; overflow: hidden; }
.progress.indeterminate > .bar {
  position: absolute;
  width: 30%;
  height: 100%;
  background: var(--accent);
  animation: progress-indet 1.2s linear infinite;
}
@keyframes progress-indet {
  from { left: -30%; }
  to   { left: 100%; }
}

.posts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.posts-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.posts-header label { display: inline-flex; align-items: center; gap: 8px; }
.posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.post {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.post:first-child { border-top: 0; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.post-meta .badge {
  background: var(--surface-hover);
  padding: 1px 6px;
  border-radius: 4px;
}
.post-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.post-text.empty { color: var(--text-faint); font-style: italic; }
.post-stats {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-muted);
}
.post-stats span::before { content: ""; margin-right: 4px; }
.post-stats .like::before { content: "♡"; }
.post-stats .rt::before { content: "↻"; }
.post-stats .reply::before { content: "💬"; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

/* Modal */
dialog.modal {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-md);
  max-width: 420px;
  width: calc(100% - 32px);
}
dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.4);
}
.modal-body { padding: 22px; }
.modal-body h3 { margin: 0 0 8px; font-size: 17px; }
.modal-body h3.warn { color: var(--danger); }
.modal-body p { margin: 0 0 16px; color: var(--text-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.sample-block {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 16px;
}
.sample-label {
  margin: 0 0 6px !important;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sample-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--text);
}
.sample-list li {
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sample-list li.more { color: var(--text-muted); font-style: italic; }

.stat-row {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
}
.stat {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: center;
  min-width: 0;
}
.stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.live-lines { margin: 12px 0 0; }
.live-section { font-size: 12px; line-height: 1.5; }
.live-section + .live-section { margin-top: 10px; }
.live-section .live-lbl {
  font-weight: 600;
  margin-bottom: 3px;
}
.live-section.deleted .live-lbl { color: var(--danger); }
.live-section.remaining .live-lbl { color: var(--text-muted); }
.live-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.live-section li {
  padding: 1px 0 1px 14px;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.live-section li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--text-faint);
}

.progress {
  height: 8px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
}
.progress > .bar {
  height: 100%;
  background: var(--danger);
  transition: width 0.2s ease;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
