/* ── VerbaSave Stories (24h) ─────────────────────────────────────────────── */

/* Row at the top of the feed */
.stories-row { display: flex; gap: 14px; padding: 14px 16px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.stories-row[hidden] { display: none; }
.story-item { flex-shrink: 0; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none;
  padding: 0; cursor: pointer; color: var(--text-2); font: inherit; }
.story-ring { position: relative; width: 64px; height: 64px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, var(--accent-1), var(--accent-2), var(--accent-1)); }
.story-item.seen .story-ring { background: var(--border-hi); }
.story-item.empty .story-ring { background: var(--surface-2); }
.story-ring .dm-av { width: 100% !important; height: 100% !important; border: 3px solid var(--bg); font-size: 16px; }
.story-plus { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-1); color: #fff;
  border: 3px solid var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; line-height: 1; }
.story-name { font-size: 12px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-item:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 3px; border-radius: 12px; }

/* Viewer */
.sv-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(4, 6, 10, .92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sv-card { position: relative; width: min(400px, 100%); aspect-ratio: 9 / 16; max-height: calc(100vh - 32px); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; color: #fff; user-select: none; }
.sv-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.sv-top { position: relative; z-index: 2; padding: 12px 12px 0; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.sv-bars { display: flex; gap: 4px; }
.sv-bar { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; background: #fff; }
.sv-bar.done i { width: 100%; }
.sv-bar.active i { animation: svFill var(--sv-dur, 5s) linear forwards; }
.sv-card.paused .sv-bar.active i { animation-play-state: paused; }
@keyframes svFill { to { width: 100%; } }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 10px 0 12px; font-weight: 700; font-size: 14px; }
.sv-head a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.sv-head .dm-av { border: 2px solid #fff; }
.sv-time { opacity: .75; font-weight: 500; }
.sv-close { margin-left: auto; border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sv-tap { position: absolute; inset: 0; z-index: 1; display: flex; }
.sv-tap button { flex: 1; border: 0; background: none; cursor: pointer; }
.sv-tap button:first-child { flex: 0 0 32%; }
/* Text sits at the author's chosen height (--ty), same as in the composer preview */
.sv-text { position: absolute; z-index: 2; left: 0; right: 0; top: var(--ty, 50%); transform: translateY(-50%); padding: 0 22px;
  text-align: center; font-size: 22px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0,0,0,.35); pointer-events: none; }
.sv-has-media .sv-text span, .sc-has-media .sc-preview-text span {
  background: rgba(0,0,0,.5); padding: 3px 10px; border-radius: 8px; text-shadow: none;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sv-bottom { position: relative; z-index: 2; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.sv-article { display: block; background: rgba(0,0,0,.4); backdrop-filter: blur(10px); border-radius: 14px; padding: 12px 14px; color: #fff; text-decoration: none; }
.sv-article small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.sv-article strong { display: block; font-size: 16px; line-height: 1.3; margin: 4px 0 2px; }
.sv-article span { font-size: 12px; opacity: .8; }
.sv-owner { display: flex; gap: 8px; }
.sv-owner button { flex: 1; border: 0; border-radius: 12px; padding: 10px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(8px); }
.sv-owner button.danger { color: #ffb4b4; }
.sv-viewers { background: rgba(0,0,0,.55); backdrop-filter: blur(10px); border-radius: 14px; padding: 10px 12px; max-height: 180px; overflow-y: auto; font-size: 13px; }
.sv-viewers div { display: flex; align-items: center; gap: 8px; padding: 4px 0; }

/* Composer */
.sc-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sc-modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); color: var(--text-1);
  border: 1px solid var(--border); border-radius: 18px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 20px; }
.sc-preview { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; display: flex; color: #fff; background: #000; }
.sc-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-preview-text { position: absolute; left: 0; right: 0; top: var(--ty, 50%); transform: translateY(-50%); padding: 0 14px;
  text-align: center; font-weight: 800; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: grab; touch-action: none; user-select: none; }
.sc-preview-text:active { cursor: grabbing; }
.sc-preview-text:empty { display: none; }
.sc-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sc-form h3 { font-size: 17px; font-weight: 800; margin: 0; display: flex; align-items: center; justify-content: space-between; }
.sc-form label { font-size: 12px; font-weight: 700; color: var(--text-2); display: block; margin-bottom: 6px; }
.sc-form textarea, .sc-form select { width: 100%; background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border-hi);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; outline: none; }
.sc-form textarea { resize: vertical; min-height: 70px; }
.sc-form textarea:focus, .sc-form select:focus { border-color: var(--accent-1); }
.sc-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.sc-swatch[aria-pressed="true"] { border-color: var(--text-1); box-shadow: 0 0 0 2px var(--surface) inset; }
.sc-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sc-btn { border: 1px solid var(--border-hi); background: none; color: var(--text-1); border-radius: 10px; padding: 9px 14px; font: inherit;
  font-weight: 700; font-size: 13px; cursor: pointer; }
.sc-publish { border: 0; border-radius: 12px; padding: 12px; font: inherit; font-weight: 800; font-size: 14px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); }
.sc-publish:disabled { opacity: .5; cursor: default; }
.sc-note { font-size: 12px; color: var(--text-3); }
.sc-error { font-size: 12px; font-weight: 600; color: var(--danger); min-height: 16px; }
.sc-x { border: 0; background: none; color: var(--text-2); font-size: 24px; line-height: 1; cursor: pointer; }
@media (max-width: 640px) {
  .sc-modal { grid-template-columns: minmax(0, 1fr); }
  .sc-preview { width: 160px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { .sv-bar.active i { animation: none; width: 100%; } }
