:root {
  --bg: #f6f4ee;
  --surface: #fffefa;
  --surface-2: #eeece4;
  --text: #1d201d;
  --muted: #70756f;
  --accent: #1f6b4f;
  --accent-2: #dceee5;
  --danger: #a83b34;
  --line: #dad8d0;
  --shadow: 0 10px 30px rgba(28, 37, 31, .08);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.985); }
#app { min-height: 100dvh; padding-bottom: calc(76px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display:flex; justify-content:space-between; align-items:center; gap:16px; padding: calc(14px + var(--safe-top)) 18px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(0,0,0,.04); }
.topbar h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: -.035em; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 700; font-size: 10px; letter-spacing: .12em; }
#main { width: min(820px, 100%); margin: 0 auto; padding: 14px 14px 30px; }
.view { display:none; animation: fade .14s ease; }
.view.active { display:block; }
@keyframes fade { from { opacity:.5; transform:translateY(3px);} }
.panel, .playlist-card, .song-card, .result-card { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px; margin-bottom: 12px; }
.sticky-panel { position: sticky; top: calc(74px + var(--safe-top)); z-index: 12; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
.search-row { display:flex; gap:8px; align-items:center; }
.input { width:100%; border:1px solid var(--line); background:#fff; color:var(--text); border-radius:13px; padding:12px 13px; outline:none; min-height:44px; }
.input:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow:0 0 0 3px rgba(31,107,79,.10); }
.label { display:block; font-weight:750; margin-bottom:8px; }
.hint { margin:9px 0 0; color:var(--muted); font-size:13px; line-height:1.45; }
.muted { color:var(--muted); }
.small { font-size:12px; }
.hidden { display:none !important; }
.primary-btn, .soft-btn, .danger-btn { border:0; border-radius:12px; min-height:42px; padding:10px 14px; font-weight:750; cursor:pointer; }
.primary-btn { background:var(--accent); color:white; }
.soft-btn { background:var(--surface-2); color:var(--text); }
.danger-btn { background:#f5dedc; color:var(--danger); }
.compact { min-height:40px; padding:9px 12px; white-space:nowrap; }
.icon-btn { width:42px; height:42px; border:0; border-radius:50%; background:var(--surface-2); color:var(--text); font-size:23px; display:grid; place-items:center; cursor:pointer; }
.card-list { display:grid; gap:9px; margin-top:10px; }
.song-card, .result-card, .playlist-card { padding:13px 14px; display:flex; align-items:center; gap:12px; text-align:left; width:100%; cursor:pointer; }
.song-card { color:inherit; text-decoration:none; touch-action:manipulation; -webkit-touch-callout:none; }
.song-card .main, .result-card .main { min-width:0; flex:1; }
.card-title { font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-sub { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.card-badge { font-size:11px; font-weight:800; color:var(--accent); background:var(--accent-2); padding:5px 8px; border-radius:999px; white-space:nowrap; }
.empty-state { text-align:center; padding:70px 24px 30px; color:var(--muted); }
.empty-state h2 { color:var(--text); margin:10px 0 4px; }
.empty-icon { font-size:52px; color:var(--accent); }
.provider-row { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:10px; color:var(--muted); font-size:13px; }
.provider-row label { display:flex; gap:6px; align-items:center; }
.row-between { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.row-end { display:flex; justify-content:flex-end; align-items:center; gap:8px; flex-wrap:wrap; }
.playlist-card { justify-content:space-between; margin-bottom:9px; border:none; }
.playlist-card > div { display:flex; flex-direction:column; gap:4px; }
.playlist-card span { color:var(--muted); font-size:13px; }
.playlist-card.special { background:var(--accent-2); color:var(--accent); }
.settings-grid { display:grid; gap:12px; }
.settings-grid h2 { margin:0 0 2px; font-size:18px; }
.field { display:grid; gap:6px; font-size:13px; font-weight:650; }
.two-cols { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.button-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.steps { margin:0; padding-left:22px; line-height:1.7; }
.danger-zone { border-color:#efd2cf; }
.bottom-nav { position:fixed; z-index:25; left:0; right:0; bottom:0; display:grid; grid-template-columns:repeat(4,1fr); padding:7px 10px calc(7px + var(--safe-bottom)); background:rgba(253,252,248,.92); backdrop-filter:blur(22px); border-top:1px solid var(--line); }
.nav-btn { border:0; background:transparent; display:grid; place-items:center; gap:1px; color:var(--muted); padding:4px; cursor:pointer; }
.nav-btn span { font-size:22px; line-height:1; }
.nav-btn small { font-size:10px; font-weight:700; }
.nav-btn.active { color:var(--accent); }
.song-dialog, .modal-dialog { border:0; padding:0; margin:0; width:100%; max-width:none; height:100%; max-height:none; background:transparent; }
.song-dialog::backdrop, .modal-dialog::backdrop { background:rgba(20,22,20,.34); backdrop-filter:blur(3px); }
.song-shell { background:var(--surface); min-height:100dvh; display:flex; flex-direction:column; padding-top:var(--safe-top); }
.song-header { position:sticky; top:0; z-index:10; display:grid; grid-template-columns:44px 1fr 44px; align-items:center; gap:8px; padding:9px 12px; background:rgba(255,254,250,.94); backdrop-filter:blur(16px); border-bottom:1px solid var(--line); }
.song-heading { min-width:0; text-align:center; display:flex; flex-direction:column; }
.song-heading strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:16px; }
.song-heading span { color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.song-toolbar { position:sticky; top:62px; z-index:9; display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; background:rgba(255,254,250,.94); backdrop-filter:blur(16px); border-bottom:1px solid rgba(0,0,0,.04); }
.segmented { display:flex; border-radius:11px; overflow:hidden; background:var(--surface-2); }
.segmented button { border:0; min-width:38px; min-height:38px; background:transparent; font-weight:800; }
.segmented button + button { border-left:1px solid var(--line); }
.scroll-speed { display:flex; align-items:center; gap:8px; padding:8px 15px; font-size:11px; color:var(--muted); background:var(--surface-2); }
.scroll-speed input { flex:1; }
.song-meta { display:flex; gap:6px; flex-wrap:wrap; padding:10px 16px 0; }
.meta-chip { background:var(--surface-2); border-radius:999px; padding:5px 8px; font-size:11px; color:var(--muted); }
.song-body { --song-font-size: 18px; flex:1; padding:24px 18px 110px; line-height:1.65; font-size:var(--song-font-size); overflow-wrap:anywhere; }
.song-body.font-serif { font-family:Georgia, "Times New Roman", serif; }
.song-body.font-mono { font-family:"SFMono-Regular", Consolas, monospace; }
.song-line { min-height:1.35em; margin:0 0 .15em; display:block; }
.song-line.blank { height:.7em; }
.chord-chunk { display:inline-flex; flex-direction:column; vertical-align:bottom; margin-right:.03em; }
.chord-label { color:var(--accent); font-weight:850; line-height:1.05; font-size:.83em; min-height:1.1em; padding-right:.22em; }
.lyric-fragment { line-height:1.28; white-space:pre-wrap; }
.section-label { display:block; color:var(--accent); font-weight:850; font-size:.76em; text-transform:uppercase; letter-spacing:.06em; margin:1em 0 .35em; }
.comment-line { color:var(--muted); font-style:italic; margin:.55em 0; }
.song-footer { position:fixed; z-index:11; bottom:0; left:0; right:0; display:flex; gap:7px; overflow-x:auto; padding:9px 12px calc(9px + var(--safe-bottom)); background:rgba(255,254,250,.94); border-top:1px solid var(--line); backdrop-filter:blur(17px); }
.song-footer button { flex:0 0 auto; }
.modal-dialog { display:none; place-items:end center; }
.modal-dialog[open] { display:grid; }
.modal-card { width:min(620px,100%); max-height:92dvh; overflow:auto; background:var(--surface); border-radius:22px 22px 0 0; padding:18px; box-shadow:0 -12px 40px rgba(0,0,0,.16); padding-bottom:calc(18px + var(--safe-bottom)); }
.modal-card.large { width:min(760px,100%); }
.modal-card h2 { margin:0; }
.editor { min-height:38dvh; resize:vertical; font-family:"SFMono-Regular", Consolas, monospace; font-size:14px; line-height:1.45; }
.chord-keyboard { display:flex; flex-wrap:wrap; gap:6px; margin-top:-3px; }
.chord-keyboard button { border:0; background:var(--surface-2); border-radius:9px; padding:7px 9px; font-weight:800; }
.danger-link { border:0; background:transparent; color:var(--danger); font-weight:750; margin-right:auto; }
.sheet-dialog { place-items:end center; }
.sheet-card { display:grid; gap:6px; }
.menu-item { border:0; background:var(--surface-2); min-height:50px; border-radius:12px; text-align:left; padding:0 14px; font-weight:750; }
.muted-item { color:var(--muted); }
.toast { position:fixed; z-index:100; left:50%; bottom:calc(88px + var(--safe-bottom)); transform:translate(-50%,20px); opacity:0; pointer-events:none; background:#1f231f; color:white; border-radius:999px; padding:10px 14px; font-size:13px; transition:.2s ease; max-width:90%; text-align:center; box-shadow:var(--shadow); }
.toast.show { opacity:1; transform:translate(-50%,0); }
.result-actions { display:flex; gap:6px; }
.result-actions button { border:0; border-radius:10px; background:var(--surface-2); padding:8px 10px; font-weight:700; }
.playlist-song-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); }
.playlist-song-actions { display:flex; gap:4px; }
.playlist-song-actions button { border:0; background:var(--surface-2); width:35px; height:35px; border-radius:9px; }
@media (min-width: 720px) {
  #main { padding-top:20px; }
  .bottom-nav { left:50%; transform:translateX(-50%); width:min(620px,100%); border:1px solid var(--line); border-bottom:0; border-radius:18px 18px 0 0; }
  .song-shell { width:min(850px,100%); margin:0 auto; box-shadow:0 0 60px rgba(0,0,0,.1); }
  .song-footer { left:50%; transform:translateX(-50%); width:min(850px,100%); }
  .modal-dialog { place-items:center; }
  .modal-card { border-radius:22px; padding-bottom:18px; }
}
/* Runtime component helpers */
.song-shell { height:100dvh; overflow:auto; -webkit-overflow-scrolling:touch; }
.song-card-main { min-width:0; flex:1; display:flex; flex-direction:column; gap:3px; }
.song-card-main strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.song-card-main > span { color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chevron { color:var(--muted); font-size:22px; flex:0 0 auto; }
.playlist-actions { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.playlist-song-main { border:0; background:transparent; padding:4px 0; text-align:left; min-width:0; display:flex; flex-direction:column; gap:3px; }
.playlist-song-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.playlist-song-main span { color:var(--muted); font-size:12px; }
.mini-controls { display:flex; gap:4px; }
.mini-controls button { width:34px; height:34px; border:0; border-radius:9px; background:var(--surface-2); font-weight:800; }
.full { width:100%; margin-bottom:9px; }
button:disabled { opacity:.55; cursor:default; }
.meta-chip.clickable { cursor:pointer; color:var(--accent); font-weight:750; }
.song-body.chords-below .chord-chunk { flex-direction:column-reverse; }
.song-body.two-columns { column-count:2; column-gap:38px; column-rule:1px solid var(--line); }
.song-body.two-columns .song-line, .song-body.two-columns .section-label, .song-body.two-columns .comment-line { break-inside:avoid; }
:root[data-theme="dark"] { --bg:#111411; --surface:#181c18; --surface-2:#252a25; --text:#f1f3ee; --muted:#a1a89f; --accent:#70c79e; --accent-2:#173d2d; --danger:#ff938a; --line:#343a34; --shadow:0 10px 30px rgba(0,0,0,.24); color-scheme:dark; }
:root[data-theme="dark"] .input { background:#1f241f; }
:root[data-theme="dark"] .topbar, :root[data-theme="dark"] .sticky-panel, :root[data-theme="dark"] .bottom-nav, :root[data-theme="dark"] .song-header, :root[data-theme="dark"] .song-toolbar, :root[data-theme="dark"] .song-footer { background:rgba(20,24,20,.94); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --bg:#111411; --surface:#181c18; --surface-2:#252a25; --text:#f1f3ee; --muted:#a1a89f; --accent:#70c79e; --accent-2:#173d2d; --danger:#ff938a; --line:#343a34; --shadow:0 10px 30px rgba(0,0,0,.24); color-scheme:dark; }
  :root:not([data-theme]) .input { background:#1f241f; }
  :root:not([data-theme]) .topbar, :root:not([data-theme]) .sticky-panel, :root:not([data-theme]) .bottom-nav, :root:not([data-theme]) .song-header, :root:not([data-theme]) .song-toolbar, :root:not([data-theme]) .song-footer { background:rgba(20,24,20,.94); }
}
@media (max-width: 650px) { .song-body.two-columns { column-count:1; } }

/* Clickable chord diagrams (v1.8) */
button.chord-label {
  appearance:none; -webkit-appearance:none; border:0; background:transparent; margin:0;
  padding:0 .22em 0 0; color:var(--accent); font:inherit; font-size:.83em; font-weight:850;
  line-height:1.05; min-height:1.1em; cursor:pointer; text-align:left; border-radius:.25em;
  touch-action:manipulation;
}
button.chord-label:active { transform:none; background:var(--accent-2); }
button.chord-label:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.chord-sheet { position:fixed; inset:0; z-index:60; display:grid; align-items:end; }
.chord-sheet-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; border-radius:0; background:rgba(10,12,10,.46); backdrop-filter:blur(2px); }
.chord-sheet-backdrop:active { transform:none; }
.chord-sheet-card {
  position:relative; z-index:1; width:min(520px,100%); margin:0 auto; background:var(--surface);
  border-radius:24px 24px 0 0; padding:16px 18px calc(18px + var(--safe-bottom));
  box-shadow:0 -18px 48px rgba(0,0,0,.2); max-height:min(78dvh,620px); overflow:auto;
}
.chord-sheet-head { align-items:flex-start; }
.chord-sheet-head h2 { margin:2px 0 0; font-size:20px; }
.chord-sheet-subtitle { margin:4px 0 0; color:var(--muted); font-size:12px; }
.chord-sheet-status { min-height:20px; margin:8px 0 0; color:var(--muted); font-size:12px; line-height:1.35; text-align:center; }
.chord-diagram-stage { min-height:300px; display:grid; place-items:center; padding:2px 0 0; }
.chord-svg { width:min(290px,82vw); height:auto; overflow:visible; color:var(--text); }
.chord-svg-title { fill:var(--text); font:800 21px -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif; }
.chord-string, .chord-fret { stroke:var(--muted); stroke-width:1.5; opacity:.78; }
.chord-nut { stroke:var(--text); stroke-width:6; }
.chord-dot { fill:var(--accent); }
.chord-open { fill:none; stroke:var(--text); stroke-width:2.5; }
.chord-string-state, .chord-string-name, .chord-fret-number { fill:var(--muted); font:700 14px -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif; }
.chord-string-state { fill:var(--text); font-size:19px; }
.chord-string-name { font-size:12px; }
.chord-fret-number { font-size:12px; }
.chord-voicing-controls { display:flex; align-items:center; justify-content:center; gap:15px; margin-top:0; }
.chord-voicing-controls span { min-width:86px; text-align:center; font-size:13px; color:var(--muted); font-weight:700; }
.chord-voicing-controls button { width:46px; font-size:24px; padding:3px 8px; }

@media (min-width:720px) {
  .chord-sheet { align-items:center; padding:20px; }
  .chord-sheet-card { border-radius:24px; padding-bottom:18px; }
}

/* Táborák realtime sharing (v1.9) */
.bottom-nav { grid-template-columns:repeat(5,1fr); }
.campfire-hero { display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:start; background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--accent-2) 42%,var(--surface))); }
.campfire-hero h2 { margin:0 0 4px; font-size:22px; line-height:1.1; }
.campfire-hero .label { margin-bottom:4px; color:var(--accent); }
.campfire-flame { width:54px; height:54px; border-radius:18px; display:grid; place-items:center; font-size:31px; background:var(--accent-2); }
.live-join-row { display:grid; grid-template-columns:1fr auto; gap:8px; }
.live-code-input { text-transform:uppercase; letter-spacing:.18em; font-weight:850; font-size:20px; text-align:center; }
.live-session-card { display:grid; gap:15px; overflow:hidden; }
.live-status-pill { display:inline-flex; align-items:center; gap:5px; width:max-content; padding:5px 9px; border-radius:999px; background:var(--accent-2); color:var(--accent); font-size:11px; font-weight:900; letter-spacing:.05em; }
.live-session-card h2 { margin:6px 0 0; }
.live-viewers { min-width:62px; display:flex; flex-direction:column; text-align:right; }
.live-viewers strong { font-size:24px; line-height:1; color:var(--accent); }
.live-viewers span { color:var(--muted); font-size:11px; }
.live-host-invite { display:grid; gap:12px; padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); }
.live-code { text-align:center; font-size:38px; line-height:1; letter-spacing:.2em; padding-left:.2em; font-weight:900; font-variant-numeric:tabular-nums; }
.live-qr { width:min(260px,78vw); aspect-ratio:1; margin:0 auto; display:grid; place-items:center; background:white; border-radius:16px; padding:10px; overflow:hidden; }
.live-qr svg, .live-qr img, .live-qr table { width:100% !important; height:100% !important; }
.live-url { overflow-wrap:anywhere; text-align:center; }
.live-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 0; }
.live-toggle-row > span { display:grid; gap:3px; }
.live-toggle-row small { color:var(--muted); font-weight:400; line-height:1.3; }
.live-toggle-row input { width:24px; height:24px; accent-color:var(--accent); }
.live-now { display:grid; gap:4px; padding:14px; border-radius:16px; background:var(--accent-2); }
.live-now > strong { font-size:20px; }
.live-now-actions { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.live-connection-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:currentColor; }
.settings-divider { height:1px; background:var(--line); margin:2px 0; }
@media (max-width:390px) {
  .live-code { font-size:32px; }
  .nav-btn small { font-size:9px; }
  .nav-btn span { font-size:20px; }
}

/* v2.0 – peer-to-peer device synchronization */
.sync-active { display:grid; gap:14px; }
.sync-qr { margin-top:8px; }
.sync-code { font-size:1.55rem; letter-spacing:.16em; margin:8px auto 10px; text-align:center; }
.sync-progress { width:100%; height:10px; accent-color:var(--accent, #1f6b4f); }
.sync-badge { white-space:nowrap; }
#syncHostInvite { display:grid; gap:10px; justify-items:center; }
#syncHostInvite.hidden { display:none; }


/* First-run welcome */
.welcome-card { width:min(620px,calc(100% - 24px)); border-radius:24px; display:grid; gap:13px; }
.welcome-card p { margin:0; line-height:1.5; }
.welcome-mark { font-size:40px; line-height:1; }
.welcome-warning { display:grid; gap:6px; padding:13px 14px; border-radius:14px; background:var(--surface-2); line-height:1.45; }
.welcome-warning span { color:var(--muted); font-size:14px; }
.welcome-punch { text-align:center; padding-top:2px; }
.welcome-actions { display:grid; grid-template-columns:1fr 1.25fr; gap:10px; margin-top:3px; }
@media (max-width:520px) { .welcome-actions { grid-template-columns:1fr; } .welcome-card { max-height:90dvh; } }

/* v2.0.2: pair an installed PWA by short code instead of opening the QR in a separate browser data container. */
.sync-join-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 9px; }
.sync-join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.sync-join-row .code-input { min-width: 0; text-align: center; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 1.05rem; }
.sync-code-help { max-width: 34rem; margin: 6px auto 10px; text-align: center; }
@media (max-width: 430px) { .sync-join-row { grid-template-columns: 1fr; } }


/* v2.1 – in-app QR scanner for pairing the actual installed PWA data container */
.sync-idle { display:grid; gap:12px; }
.sync-primary-actions { display:grid; grid-template-columns:1.25fr 1fr; gap:9px; }
.sync-scan-btn { font-weight:850; }
.sync-scan-help { line-height:1.45; }
@media (max-width:520px) { .sync-primary-actions { grid-template-columns:1fr; } }

.sync-scanner-dialog {
  width:100%; height:100%; max-width:none; max-height:none; margin:0; padding:0; border:0;
  background:#090b09; color:#fff;
}
.sync-scanner-dialog::backdrop { background:#090b09; }
.sync-scanner-shell { min-height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr) auto auto; gap:14px; padding:calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); }
.sync-scanner-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.sync-scanner-header h2 { margin:0; font-size:23px; }
.sync-scanner-header p { margin:4px 0 0; color:#b8c0b8; font-size:13px; }
.sync-scanner-close { color:#fff; background:rgba(255,255,255,.13); flex:0 0 auto; }
.sync-camera-stage { position:relative; overflow:hidden; width:100%; max-width:620px; min-height:330px; margin:auto; border-radius:24px; background:#151915; }
.sync-camera-stage video { width:100%; height:100%; min-height:330px; object-fit:cover; display:block; }
.sync-camera-shade { position:absolute; inset:0; box-shadow:inset 0 0 0 999px rgba(0,0,0,.18); pointer-events:none; }
.sync-camera-frame { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(68vw,290px); aspect-ratio:1; pointer-events:none; }
.sync-camera-frame span { position:absolute; width:44px; height:44px; border-color:#fff; border-style:solid; filter:drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.sync-camera-frame span:nth-child(1) { left:0; top:0; border-width:4px 0 0 4px; border-radius:13px 0 0 0; }
.sync-camera-frame span:nth-child(2) { right:0; top:0; border-width:4px 4px 0 0; border-radius:0 13px 0 0; }
.sync-camera-frame span:nth-child(3) { left:0; bottom:0; border-width:0 0 4px 4px; border-radius:0 0 0 13px; }
.sync-camera-frame span:nth-child(4) { right:0; bottom:0; border-width:0 4px 4px 0; border-radius:0 0 13px 0; }
.sync-camera-starting { position:absolute; inset:0; display:grid; place-items:center; background:#151915; color:#d9ded9; font-weight:750; }
.sync-scanner-status { width:min(620px,100%); margin:0 auto; min-height:42px; text-align:center; color:#d9ded9; font-size:14px; line-height:1.45; display:grid; place-items:center; }
.sync-scanner-shell > .soft-btn { width:min(620px,100%); margin:0 auto; color:#fff; background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.18); }
@media (min-width:720px) {
  .sync-scanner-shell { padding-left:24px; padding-right:24px; }
  .sync-camera-stage, .sync-camera-stage video { min-height:460px; }
}


/* v2.2 – remote announcements controlled by announcement.json on GitHub Pages */
.announcement-card { width:min(590px,calc(100% - 24px)); border-radius:24px; display:grid; gap:12px; }
.announcement-top { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; min-height:44px; }
.announcement-icon { font-size:40px; line-height:1; }
.announcement-close { flex:0 0 auto; }
.announcement-priority { width:max-content; padding:5px 9px; border-radius:999px; background:var(--accent-2); color:var(--accent); font-size:11px; font-weight:900; letter-spacing:.08em; }
.announcement-card h2 { margin:0; font-size:24px; line-height:1.15; }
.announcement-message { margin:0; white-space:pre-line; line-height:1.55; }
.announcement-actions { display:grid; grid-template-columns:1fr 1.25fr; gap:9px; margin-top:4px; }
.announcement-actions .hidden { display:none; }
.announcement-dialog.important .announcement-card { border:2px solid color-mix(in srgb,var(--accent) 45%,var(--line)); }
@media (max-width:520px) { .announcement-actions { grid-template-columns:1fr; } .announcement-card { max-height:90dvh; overflow:auto; } }

/* v3.0: optional user-owned cloud backup/sync */
.cloud-sync-heading { align-items:flex-start; gap:14px; }
.cloud-sync-heading > div:first-child { min-width:0; }
.cloud-sync-heading .hint { margin:5px 0 0; }
.cloud-sync-badge { flex:0 0 auto; display:inline-flex; align-items:center; min-height:28px; padding:5px 10px; border-radius:999px; background:var(--soft); border:1px solid var(--line); color:var(--muted); font-size:11px; font-weight:850; white-space:nowrap; }
.cloud-sync-badge.active { background:var(--accent-2); border-color:transparent; color:var(--accent); }
.cloud-provider-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px; border:1px solid var(--line); border-radius:16px; background:var(--card); }
.cloud-provider-card.selected { border-color:color-mix(in srgb, var(--accent) 42%, var(--line)); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 9%, transparent); }
.cloud-provider-main { display:flex; gap:11px; align-items:center; min-width:0; }
.cloud-provider-main > div:last-child { min-width:0; }
.cloud-provider-main strong { display:block; margin-bottom:2px; }
.cloud-provider-logo { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; flex:0 0 auto; font-size:22px; font-weight:900; background:var(--soft); border:1px solid var(--line); }
.google-logo { font-family:Arial,sans-serif; font-size:20px; }
.apple-logo { font-size:25px; line-height:1; }
.cloud-provider-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.apple-cloudkit-button:empty { display:none; }
.apple-cloudkit-button { min-height:0; }
#cloudSyncStatus { line-height:1.45; }
#cloudSyncMeta { padding-top:2px; }
@media (max-width:620px) {
  .cloud-sync-heading { align-items:flex-start; }
  .cloud-provider-card { align-items:flex-start; flex-direction:column; }
  .cloud-provider-actions { width:100%; justify-content:stretch; }
  .cloud-provider-actions > button { flex:1 1 auto; }
}
