/* Drop — UI styles */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #15181d;
  --muted: #6b7280;
  --accent: #3b5bfd;
  --accent-ink: #ffffff;
  --accent-soft: #eef1ff;
  --ok: #12a150;
  --ok-soft: #e7f7ee;
  --warn: #c27c0e;
  --warn-soft: #fff5e0;
  --danger: #dc3545;
  --danger-soft: #fdecee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --tabbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --border: #2a2f38;
    --text: #eef0f3;
    --muted: #9aa3af;
    --accent: #6d86ff;
    --accent-soft: #1d2440;
    --ok: #3ccf7b;
    --ok-soft: #12291c;
    --warn: #f0b44c;
    --warn-soft: #2d2412;
    --danger: #ff6b78;
    --danger-soft: #331a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.hidden { display: none !important; }

/* ---------- top bar & tab bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 58px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #5b7bff, #3b5bfd 55%, #7a4dff); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2.4; }
.topnav { display: flex; gap: 4px; }
.topnav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 550; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
.topbar .me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.badge-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

.tabbar { display: none; }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; height: 52px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .topnav { display: none; }
  .tabbar {
    display: flex; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a svg.i { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .badge-count { position: absolute; top: 7px; left: calc(50% + 6px); }
  main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
}

/* ---------- layout ---------- */
main { padding: 24px; }
.page { max-width: 1240px; margin: 0 auto; }
.page.narrow { max-width: 680px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
@media (max-width: 760px) {
  main { padding: 14px 12px; }
  .page-head h1 { font-size: 22px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.send-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(380px, 1.1fr); gap: 24px; align-items: start; }
.send-grid > .compose { position: sticky; top: 82px; }
@media (max-width: 1020px) { .send-grid { grid-template-columns: 1fr; } .send-grid > .compose { position: static; } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: background .15s, transform .05s, opacity .15s; white-space: nowrap; text-decoration: none;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--border)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.outline { background: transparent; border-color: var(--border); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn.sm svg.i { width: 15px; height: 15px; }
.btn.lg { padding: 13px 18px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 7px; }

label.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
label.field .hint { font-weight: 400; }
.input, textarea.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); outline: none; font-size: 15px; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.55; }
@media (max-width: 760px) { .input, textarea.input { font-size: 16px; } }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; font-weight: 550; user-select: none; }
.switch input { appearance: none; width: 36px; height: 21px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px #0003; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(15px); }

/* ---------- pills, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill svg.i { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
.dot.online { background: var(--ok); }
.dot.off { background: var(--border); }

/* ---------- banners ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner b { color: inherit; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .empty-icon svg.i { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin: 0 0 4px; font-size: 16px; }

/* ---------- inbox cards ---------- */
.drop-card { padding: 14px; margin-bottom: 14px; }
.drop-card.unseen { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.drop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.drop-head .from { font-weight: 650; color: var(--text); }
.caption-box { position: relative; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6; }
.caption-box.clamp { max-height: 9.6em; overflow: hidden; }
.caption-box.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(transparent, var(--surface-2)); border-radius: 0 0 12px 12px; }
.caption-actions { display: flex; gap: 8px; margin-top: 8px; }
.caption-actions .btn { flex: 1; }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2, .media-grid.n4 { grid-template-columns: repeat(2, 1fr); }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; border: 0; padding: 0; }
.media-grid.n1 .tile { aspect-ratio: auto; max-height: 420px; min-height: 160px; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 .tile img, .media-grid.n1 .tile video { object-fit: contain; max-height: 420px; background: #000; }
.tile .tile-badge { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 650; }
.tile .tile-badge svg.i { width: 12px; height: 12px; }
.tile .tile-state { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.tile .tile-state svg.i { width: 13px; height: 13px; }
.tile .tile-state.ready { background: var(--ok); }
.tile .tile-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .2s; }
.tile.file-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; color: var(--muted); }
.tile.file-tile svg.i { width: 26px; height: 26px; }
.tile.file-tile .fname { font-size: 11px; line-height: 1.3; word-break: break-all; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tile .play span { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; color: #fff; backdrop-filter: blur(4px); }
.tile .play svg.i { width: 18px; height: 18px; fill: #fff; stroke: none; margin-left: 2px; }

.drop-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.drop-actions .btn.lg { position: relative; overflow: hidden; }
.drop-actions .btn .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.7); transition: width .2s; }
.drop-status { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- compose ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px 16px; text-align: center; cursor: pointer;
  color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 8px; color: var(--accent); }
.dropzone strong { color: var(--text); display: block; }
.ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.ctile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.ctile img, .ctile video { width: 100%; height: 100%; object-fit: cover; }
.ctile .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ctile .x svg.i { width: 13px; height: 13px; }
.ctile .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctile .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.ctile .ph svg.i { width: 26px; height: 26px; }
.ctile .up { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }

.recips { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.recips-head { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.recips-head .input { padding: 7px 10px; font-size: 14px; background: var(--surface); }
.recips-list { max-height: 264px; overflow: auto; }
.recip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.recip:last-child { border-bottom: 0; }
.recip:hover { background: var(--surface-2); }
.recip input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.recip .who { flex: 1; min-width: 0; }
.recip .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recip .who span { font-size: 12px; color: var(--muted); }
.per-caption { display: grid; gap: 10px; }
.per-caption label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.per-caption textarea { min-height: 80px; }

.upload-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.upload-bar > i { display: block; height: 100%; background: var(--accent); transition: width .2s; }

/* ---------- sent list ---------- */
.sent-card { padding: 14px 16px; margin-bottom: 12px; }
.sent-top { display: flex; gap: 12px; align-items: flex-start; }
.sent-thumbs { display: flex; gap: 4px; flex: none; }
.sent-thumbs .st { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); position: relative; }
.sent-thumbs .st img { width: 100%; height: 100%; object-fit: cover; }
.sent-thumbs .st .more { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.sent-cap { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.sent-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.rtable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.rtable th { text-align: center; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 0 4px 6px; text-transform: uppercase; letter-spacing: .04em; }
.rtable th:first-child { text-align: left; }
.rtable td { padding: 7px 4px; border-top: 1px solid var(--border); text-align: center; }
.rtable td:first-child { text-align: left; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--border); }
.tick.on { background: var(--ok-soft); color: var(--ok); }
.tick svg.i { width: 13px; height: 13px; stroke-width: 3; }
.sent-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.notes { margin-top: 8px; display: grid; gap: 4px; }

/* ---------- members ---------- */
.members { overflow: hidden; }
.member { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.member:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px; flex: none; }
.member .name { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.member .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.member.disabled { opacity: .55; }
@media (max-width: 760px) {
  .member { grid-template-columns: auto 1fr; }
  .member .acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px 24px; }
.auth-card .brand { justify-content: center; font-size: 22px; margin-bottom: 6px; }
.auth-card .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-card form { display: grid; gap: 14px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 1em; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, .5); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px; animation: pop .18s; }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal form { display: grid; gap: 14px; margin-top: 14px; }
.qr { background: #fff; border-radius: 14px; padding: 14px; margin: 16px auto 12px; width: min(280px, 100%); }
.qr svg, .qr img { width: 100%; height: auto; display: block; }
.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: .06em; text-align: center; padding: 14px; background: var(--surface-2); border-radius: 12px; margin: 14px 0 6px; user-select: all; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; color: #fff; animation: fade .15s; }
.viewer-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
.viewer-top .title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.viewer-body { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; touch-action: pan-y; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body audio { width: min(420px, 90vw); }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.viewer-nav.prev { left: 10px; } .viewer-nav.next { right: 10px; }
.viewer-bottom { display: flex; gap: 8px; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.viewer-bottom .btn { flex: 1; }
.viewer .btn.ghost { color: #fff; }
.viewer .btn.ghost:hover { background: rgba(255,255,255,.12); }
.viewer .btn:not(.primary):not(.ghost) { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 70; background: #15181d; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { #toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); } }
@media (prefers-color-scheme: dark) { #toast { background: #eef0f3; color: #15181d; } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) { .hide-sm { display: none; } }
