/* OmniBeam – soft 3D (neumorphism) theme
   Everything is the same material as the background: surfaces are raised with a dark shadow
   bottom-right and a light shadow top-left, and pressed controls sink in (inset shadows). */
:root {
  --bg: #e6e9f0;
  --sd: #c4c9d6;          /* shadow (dark side) */
  --sl: #ffffff;          /* shadow (light side) */
  --fg: #3b4256;
  --muted: #5d6478;
  --accent: #5248e8;
  --accent-2: #8f7cff;
  --accent-fg: #ffffff;
  --accent-soft: rgba(108, 99, 255, 0.14);
  --border: rgba(59, 66, 86, 0.08);
  --ok: #11703f;
  --danger: #b42727;

  --raise: 8px 8px 16px var(--sd), -8px -8px 16px var(--sl);
  --raise-sm: 4px 4px 9px var(--sd), -4px -4px 9px var(--sl);
  --raise-lg: 14px 14px 28px var(--sd), -14px -14px 28px var(--sl);
  --inset: inset 5px 5px 10px var(--sd), inset -5px -5px 10px var(--sl);
  --inset-sm: inset 3px 3px 6px var(--sd), inset -3px -3px 6px var(--sl);
  --radius: 26px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2b2e38; --sd: #1d1f26; --sl: #393d4a;
    --fg: #dfe2ec; --muted: #969db2;
    --accent: #8c84ff; --accent-2: #a597ff; --accent-soft: rgba(140, 132, 255, 0.16);
    --border: rgba(255, 255, 255, 0.06);
    --ok: #5fd39a; --danger: #ff8a8a;
  }
}
:root[data-theme="dark"] {
  --bg: #2b2e38; --sd: #1d1f26; --sl: #393d4a;
  --fg: #dfe2ec; --muted: #969db2;
  --accent: #8c84ff; --accent-2: #a597ff; --accent-soft: rgba(140, 132, 255, 0.16);
  --border: rgba(255, 255, 255, 0.06);
  --ok: #5fd39a; --danger: #ff8a8a;
}

/* Plus Jakarta Sans (SIL Open Font License, fonts/OFL.txt), served from this site: one variable font file for
   every weight, and the extra Latin letters (Turkish ğ ş ı…) only on pages that use them */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/plus-jakarta-sans-latin.woff2?v=1) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/plus-jakarta-sans-latin-ext.woff2?v=1) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  transition: background 0.3s, color 0.3s;
}
h2, h3 { text-wrap: balance; letter-spacing: -0.025em; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); font-size: 0.88rem; }
.muted.small { font-size: 0.78rem; }
[hidden] { display: none !important; }

header, main, footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 18px 0; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--bg); box-shadow: var(--raise);
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; min-width: 0; }
.brand .logo { flex: none; width: 46px; height: 46px; border-radius: 15px; box-shadow: 3px 3px 8px var(--sd), -3px -3px 8px var(--sl); }
/* Logo colours: the dark "O" turns light in dark mode; the bolt's outline matches the background */
.logo .logo-o { stroke: #3A4154; }
.logo .logo-gap { stroke: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .logo-o { stroke: #dfe2ec; } }
:root[data-theme="dark"] .logo .logo-o { stroke: #dfe2ec; }
.wordmark { font-weight: 800; font-size: 1.62rem; letter-spacing: -0.035em; white-space: nowrap; }
/* Narrow phones: a little smaller so the logo and the header buttons still fit on one line */
@media (max-width: 400px) {
  .brand { gap: 10px; }
  .brand .logo { width: 40px; height: 40px; border-radius: 13px; }
  .wordmark { font-size: 1.4rem; }
}
@media (max-width: 375px) {
  .brand { gap: 8px; }
  .brand .logo { width: 36px; height: 36px; border-radius: 12px; }
  .wordmark { font-size: 1.2rem; }
}
.wordmark span {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.actions { display: flex; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--bg); color: var(--muted); box-shadow: var(--raise-sm);
  transition: box-shadow 0.2s, color 0.2s;
}
.icon-btn:hover { color: var(--accent); }
.icon-btn:active, .icon-btn.active { box-shadow: var(--inset-sm); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Main ---------- */
main {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 34px 26px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--sd) transparent;
}
main::-webkit-scrollbar { width: 8px; }
/* The app fills the first screen; the "learn" section (what OmniBeam is, FAQ) sits below it */
/* A column: the devices (or the "Ready to beam" card) with "Send to everyone" under them, centred on the screen */
.stage { flex: 0 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.stage::before, .stage::after { content: ""; flex: 1 1 0; }
main::-webkit-scrollbar-thumb { background: var(--sd); border-radius: 8px; }
.peers { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; max-width: 920px; margin: 0 auto; }
.peers:empty { display: none; }
.peers:not(:empty) + .empty { display: none; }
.empty {
  text-align: center; width: 100%; max-width: 640px; padding: 24px 30px 24px; border-radius: var(--radius); margin: 0 auto;
  background: var(--bg); box-shadow: var(--raise-lg);
}
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--accent); box-shadow: var(--inset);
}
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: ping 2.4s ease-in-out infinite; }
@keyframes ping { 50% { transform: scale(1.12); } }
.empty h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; }
.empty .lead { color: var(--muted); font-size: 0.98rem; line-height: 1.5; margin: 0 auto 18px; }
.empty .lead b { color: var(--fg); font-weight: 700; }
.hints { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; text-align: start; }
.hint { display: flex; align-items: center; gap: 12px; padding: 10px; padding-inline-end: 14px; border-radius: 18px; box-shadow: var(--inset-sm); min-width: 0; }
.hint > div { min-width: 0; }
.hint-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); box-shadow: var(--raise-sm); }
.hint-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hint div b, .hint div span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint div b { font-size: 0.9rem; font-weight: 700; }
.hint div span { font-size: 0.8rem; color: var(--muted); }
#btn-pair-empty { padding: 12px 30px; }
.intro-link {
  display: flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 6px 12px; border: 0; border-radius: 999px;
  background: none; color: var(--accent); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.intro-link:hover { box-shadow: var(--raise-sm); }
.intro-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* Intro video window: as wide as the video allows on the screen */
.intro-dialog { width: min(960px, calc(100vw - 32px)); padding: 14px; }
.intro-dialog.tall { width: min(420px, calc(100vw - 32px)); }
.intro-dialog video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 130px); border-radius: 18px; background: #000; }
.intro-dialog.tall video { aspect-ratio: 9 / 16; }
.intro-dialog .row { align-items: center; margin-top: 12px; }
.intro-note { margin-inline-end: auto; font-size: 0.85rem; }

@media (max-width: 600px) {
  .hints { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Peer cards ---------- */
.peer {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 152px;
  padding: 20px 10px 16px; border: 0; border-radius: var(--radius); text-align: center;
  background: var(--bg); box-shadow: var(--raise);
  transition: box-shadow 0.25s, transform 0.25s;
  animation: pop 0.4s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
.peer:hover, .peer:focus-visible { box-shadow: var(--raise-lg); transform: translateY(-3px); outline: none; }
.peer:active { box-shadow: var(--inset); transform: none; }
.peer.drag { box-shadow: var(--inset), 0 0 0 3px var(--accent-soft); }

.peer .avatar-wrap {
  position: relative; width: 92px; height: 92px; margin-bottom: 10px; border-radius: 50%;
  display: grid; place-items: center; box-shadow: var(--inset);
}
/* The avatar is the card's button (keyboard, screen readers) */
.peer .peer-main { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.peer .peer-main:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.peer:has(.peer-main:focus-visible) { box-shadow: var(--raise-lg); transform: translateY(-3px); }
.peer .avatar, .me-avatar {
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  box-shadow: 4px 4px 10px var(--sd), -3px -3px 8px var(--sl), inset 0 2px 2px rgba(255, 255, 255, 0.35);
}
.peer .avatar svg, .me-avatar svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.peer .progress { position: absolute; inset: 0; width: 92px; height: 92px; transform: rotate(-90deg); pointer-events: none; }
.peer .progress circle { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 276.5; stroke-dashoffset: 276.5; transition: stroke-dashoffset 0.15s; }
.peer .name { font-weight: 700; font-size: 0.98rem; letter-spacing: -0.02em; }
.peer .device { font-size: 0.8rem; color: var(--muted); }
.peer .status { font-size: 0.8rem; font-weight: 700; color: var(--accent); min-height: 1.1em; }

/* Transfer progress bar (sending and receiving) */
.peer .xfer { width: 100%; margin-top: 6px; padding: 0 4px; text-align: start; }
.peer .xfer[hidden] { display: none; }
.peer .xfer-bar { height: 8px; border-radius: 8px; box-shadow: var(--inset-sm); overflow: hidden; }
.peer .xfer-bar span { display: block; height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.25s linear; }
.peer .xfer-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 0.78rem; }
.peer .xfer-pct { color: var(--accent); font-weight: 800; }
.peer .xfer-speed { color: var(--fg); font-weight: 600; white-space: nowrap; }
.peer .xfer-sub { margin-top: 2px; font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer .xfer-route { font-size: 0.68rem; color: var(--muted); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer.xferring { width: 184px; }
.peer .xfer-route { white-space: normal; overflow-wrap: anywhere; }

/* Hover actions: "Send files" / "Send message" over the card (mouse/trackpad only; touch keeps tap + long-press) */
.peer-actions {
  position: absolute; inset: 0; border-radius: inherit; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.peer-actions button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: 999px; padding: 8px; font-size: 0.82rem; font-weight: 700; white-space: nowrap;
  color: var(--fg); background: var(--bg); box-shadow: var(--raise-sm); transition: color 0.15s, box-shadow 0.15s;
}
.peer-actions button:first-child { color: var(--accent-fg); background: linear-gradient(145deg, var(--accent-2), var(--accent)); }
.peer-actions button:hover { box-shadow: var(--raise); }
.peer-actions button:not(:first-child):hover { color: var(--accent); }
.peer-actions button:active { box-shadow: var(--inset-sm); }
.peer-actions svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .peer-actions { pointer-events: auto; } /* with a mouse the pointer is over the card anyway when clicking */
  .peer:hover .peer-actions, .peer:focus-visible .peer-actions, .peer:has(:focus-visible) .peer-actions { opacity: 1; }
}
/* Reached with the Tab key on a touch screen with a keyboard: show them too */
.peer:has(.peer-actions :focus-visible) .peer-actions { opacity: 1; pointer-events: auto; }
.peer.xferring .peer-actions, .peer.drag .peer-actions, .peer.busy .peer-actions { display: none; }
/* Cancel button on a card while it sends or receives */
.xfer-cancel {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; display: none;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; place-items: center;
  color: var(--muted); background: var(--bg); box-shadow: var(--raise-sm); cursor: pointer;
}
.xfer-cancel svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.xfer-cancel:hover { color: #e5484d; box-shadow: var(--raise); }
.xfer-cancel:active { box-shadow: var(--inset-sm); }
.peer.busy .xfer-cancel { display: grid; }
.send-all { display: block; margin: 18px auto 0; }
.send-all[hidden] { display: none; }

/* ---------- Footer ---------- */
footer {
  display: flex;
  justify-content: center;
  padding: 6px 18px calc(14px + env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 580px;
}

.me-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 26px 10px 10px;
  border-radius: 999px;
  width: 100%;
  max-width: 440px;
  text-align: start;
  background: var(--bg);
  box-shadow: var(--raise);
}

.me-wrap {
  position: relative; width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: grid; place-items: center; box-shadow: var(--inset);
}
.me-avatar { width: 46px; height: 46px; position: relative; z-index: 1; }
.me-avatar svg { width: 22px; height: 22px; }
.me-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
.me-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.me-name {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; margin: 1px 0 2px;
  border: 0; background: none; font-size: 1.08rem; letter-spacing: -0.02em; text-align: start;
}
.me-name b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.me-name:hover svg, .me-name:focus-visible svg { stroke: var(--accent); }
.me-status { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.radar {
  position: absolute; inset: 9px; border-radius: 50%; border: 2px solid var(--accent);
  opacity: 0; animation: radar 3s ease-out infinite;
}
.radar.r2 { animation-delay: 1.5s; }
@keyframes radar { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.9); opacity: 0; } }

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Longer words in some languages: wrap onto two lines instead of running off a phone screen */
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}
.footer-link-btn { white-space: nowrap; }

.footer-link-btn {
  background: none;
  border: 0;
  padding: 2px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.2s;
}

a.footer-link-btn { text-decoration: none; }
select.lang-select { font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; text-align: center; }
select.lang-select option { color: var(--fg); background: var(--bg); }

.footer-link-btn:hover {
  color: var(--accent);
}

.dot-sep {
  opacity: 0.4;
  font-size: 0.75rem;
}

.copyright {
  margin: 0;
  font-size: 0.76rem;
}

.copyright b, .copyright .author-name {
  color: var(--fg);
}

.author-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.author-link:hover {
  color: var(--accent);
}

/* ---------- Dialogs ---------- */
dialog {
  border: 0; border-radius: 30px; padding: 26px; width: min(440px, calc(100vw - 32px));
  background: var(--bg); color: var(--fg);
  box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.18), -10px -10px 30px rgba(255, 255, 255, 0.06);
}
dialog[open] { animation: dlg 0.3s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes dlg { from { transform: scale(0.94); opacity: 0; } }
dialog::backdrop { background: rgba(40, 45, 60, 0.35); }
dialog h3 { margin: 0 0 12px; font-size: 1.2rem; font-weight: 800; }
.row { display: flex; justify-content: flex-end; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

.info-dialog {
  max-width: 480px;
}

.guide-steps {
  margin: 0;
  padding: 14px 18px;
  padding-inline-start: 34px;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  box-shadow: var(--inset);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.guide-steps code {
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--border);
}

.guide-steps:focus { outline: none; }
.guide-steps a { color: var(--accent); font-weight: 700; }
.guide-steps li strong, .guide-steps li .em {
  font-weight: 700;
  color: var(--fg);
}

/* Buttons: raised pills that press in */
.btn {
  border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 800; color: var(--accent-fg);
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 5px 5px 12px var(--sd), -5px -5px 12px var(--sl);
  transition: box-shadow 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.25), inset -3px -3px 7px rgba(255, 255, 255, 0.15); }
.btn.ghost { background: var(--bg); color: var(--fg); }
.btn.ghost:active { box-shadow: var(--inset-sm); }
.btn.small { padding: 8px 16px; font-size: 0.85rem; }
.btn.wide { width: 100%; padding: 15px; }

.file-list { list-style: none; padding: 6px 14px; margin: 0; max-height: 40vh; overflow: auto; border-radius: 18px; box-shadow: var(--inset); }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-list li span:last-child { color: var(--muted); white-space: nowrap; }
.received { display: grid; gap: 14px; max-height: 55vh; overflow: auto; padding: 6px; }
.received .item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; background: var(--bg); box-shadow: var(--raise-sm); }
.received .item img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; }
.received .item .info { flex: 1; min-width: 0; }
.received .item .info div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
/* Received messages in the history dialog */
.messages-title { margin: 14px 4px 0; font-size: 0.95rem; }
.messages-title[hidden] { display: none; }
.received.messages:empty { display: none; }
.received .item.message .msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; text-overflow: clip; }
.paired-row .auto-toggle { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; font-size: 0.8rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.paired-row .auto-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

textarea, .code-box input {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 0; border-radius: 18px; padding: 14px 16px; resize: vertical; box-shadow: var(--inset);
  transition: box-shadow 0.2s;
}
textarea:focus, .code-box input:focus { outline: none; box-shadow: var(--inset), 0 0 0 2px var(--accent); }
textarea::placeholder, input::placeholder { color: var(--muted); }
.text-body { white-space: pre-wrap; word-break: break-word; padding: 14px 16px; border-radius: 18px; max-height: 50vh; overflow: auto; box-shadow: var(--inset); line-height: 1.5; }
.text-body a { color: var(--accent); }
.step { margin: 20px 0 10px; font-size: 0.95rem; }
.code-show {
  font-size: 2.6rem; font-weight: 800; letter-spacing: 0.14em; text-align: center; font-variant-numeric: tabular-nums;
  margin: 6px 0 4px; color: var(--fg);
}
/* (The rules below were missing: the original file ended in the middle of .code-show) */
.code-box { display: flex; gap: 12px; align-items: center; }
.code-box input {
  flex: 1; min-width: 0; padding: 12px 16px; font-size: 1.4rem; font-weight: 800; letter-spacing: 0.3em; text-align: center;
  border-radius: 999px; font-variant-numeric: tabular-nums;
}
.link-row { display: flex; align-items: center; gap: 10px; }
.link-row code {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: 14px; box-shadow: var(--inset-sm);
  font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#public-code { text-transform: uppercase; }
#public-idle .btn.wide { margin-top: 12px; }
#public-active .row { justify-content: center; }
/* Optional password for a public room */
.pass-input {
  display: block; width: 100%; margin-top: 10px; padding: 11px 16px; font: inherit; color: var(--fg); background: var(--bg);
  border: 0; border-radius: 999px; box-shadow: var(--inset); text-align: center;
}
.pass-input:focus { outline: none; box-shadow: var(--inset), 0 0 0 2px var(--accent); }
.public-lock { text-align: center; margin: 0 0 10px; font-size: 0.85rem; }
#paired-list { display: grid; gap: 10px; }
.paired-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px; box-shadow: var(--raise-sm); }
.paired-row span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 1000;
  max-width: min(92vw, 440px); padding: 12px 20px; border-radius: 999px; text-align: center;
  font-size: 0.9rem; font-weight: 700; color: var(--fg); background: var(--bg); box-shadow: var(--raise-lg);
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Pairing QR code (kept black on white so every camera can read it, also in dark mode) */
.pair-qr { width: 176px; margin: 14px auto 6px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--raise-sm); }
.pair-qr:empty { display: none; }
.pair-qr svg { display: block; width: 100%; height: auto; }
.center { text-align: center; }

/* Received-files history */
#btn-history { position: relative; }
#btn-history.has-items::after { content: ''; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.received .item .info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.received .item .info .muted.intact { color: var(--ok); }
.received .item .info .muted.damaged { color: var(--danger); font-weight: 700; }
#dlg-history .row { justify-content: space-between; }
#dlg-history [hidden] { display: none; }

/* iPhone: "Faster Wi-Fi transfers" (allows Safari to share its local address) */
.fast-chip { align-self: flex-start; margin-top: 6px; padding: 6px 12px; border: 0; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--accent); background: var(--bg); box-shadow: var(--raise-sm); }
.fast-chip:active { box-shadow: var(--inset-sm); }
.fast-chip[hidden] { display: none; }
.share-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto 18px; max-width: 560px; padding: 10px 10px 10px 18px; border-radius: 18px; box-shadow: var(--raise-sm); font-weight: 700; color: var(--accent); }
.share-banner[hidden] { display: none; }

/* Right-to-left languages (Arabic): codes and links stay left-to-right; sizes and other mixed text
   take their direction from their first letter so numbers and units stay in order */
[dir=rtl] .code-show, [dir=rtl] .code-box input, [dir=rtl] .link-row code { direction: ltr; }
[dir=rtl] .xfer-sub, [dir=rtl] .xfer-route, [dir=rtl] .xfer-speed, [dir=rtl] .info .muted, [dir=rtl] .file-list span { unicode-bidi: plaintext; }

/* Video / audio previews in the received-files dialog */
.received .item.has-media { flex-wrap: wrap; }
.received .item .preview-media { flex: 1 0 100%; width: 100%; max-height: 40vh; border-radius: 14px; background: #000; }
.received .item audio.preview-media { background: transparent; max-height: none; }

/* ---------- Learn section (below the app) ---------- */
.learn {
  width: 100%; max-width: 760px; margin: 48px auto 8px; padding: 30px 32px; border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--raise); line-height: 1.6;
}
.learn h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; margin: 0 0 10px; text-wrap: balance; }
.learn h2 { font-size: 1.15rem; font-weight: 800; margin: 28px 0 12px; }
.learn-lead { color: var(--muted); margin: 0; }
.learn-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.learn-steps b, .learn-features b { color: var(--fg); }
.learn-steps span, .learn-features span { color: var(--muted); }
.learn-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-features li { padding: 12px 16px; border-radius: 18px; box-shadow: var(--inset-sm); }
.learn-features b, .learn-features span { display: block; }
.learn-features span { font-size: 0.9rem; }
.faq-list { display: grid; gap: 10px; }
.faq { border-radius: 18px; box-shadow: var(--raise-sm); padding: 12px 18px; }
.faq summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
.faq summary:hover { color: var(--accent); }
.faq p { margin: 8px 0 2px; color: var(--muted); }
.learn-links { margin: 24px 0 0; text-align: center; font-size: 0.88rem; }
.learn-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.learn-links a:hover { text-decoration: underline; }
.lang-links a { margin: 0 4px; }
@media (max-width: 600px) {
  .learn { padding: 22px 18px; margin-top: 32px; }
  .learn h1 { font-size: 1.3rem; }
  .learn-features { grid-template-columns: 1fr; }
}

/* ---------- Share buttons (inside the learn section) ---------- */
.share { margin-top: 30px; text-align: center; }
.share h2 { margin-top: 0; }
.share-lead { color: var(--muted); margin: -4px 0 16px; }
.share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-weight: 700; font-size: 0.88rem; text-decoration: none;
  box-shadow: var(--raise-sm); transition: box-shadow 0.2s, color 0.2s;
}
.share-btn:hover { color: var(--accent); }
.share-btn:active, .share-btn.done { box-shadow: var(--inset-sm); color: var(--accent); }
.share-btn svg { width: 18px; height: 18px; flex: none; }
.share-btn .ico { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.share-btn .brand { fill: currentColor; }
.share-btn[data-share="whatsapp"] .brand { fill: #25d366; }
.share-btn[data-share="facebook"] .brand { fill: #0866ff; }
.share-btn[data-share="telegram"] .brand { fill: #26a5e4; }
.share-btn[data-share="linkedin"] .brand { fill: #0a66c2; }
.share-btn[data-share="instagram"] .ico { stroke: #e1306c; }
.share-btn[data-share="instagram"] .ico circle:last-child { fill: #e1306c; }
.share-btn[data-share="snapchat"] .brand { fill: #fffc00; stroke: #222; stroke-width: 1.4; stroke-linejoin: round; }
@media (max-width: 600px) {
  .share-btn span { display: none; }
  .share-btn { padding: 12px; }
  .share-btn[data-share="native"] span, .share-btn[data-share="copy"] span { display: inline; }
}

/* Lead words in the learn section (spans, not <b>, to keep the page's bold-tag count low) */
.learn-steps .lt, .learn-features .lt { color: var(--fg); font-weight: 700; }
.learn-features .lt { font-size: 1rem; }
.copyright .author-name { font-weight: 700; }

/* Seobility score badge at the end of the learn section */
.seo-badge { margin: 18px 0 0; text-align: center; }
.seo-badge img { width: 96px; height: auto; vertical-align: middle; }

/* Network ID next to the device name: opens the connection check */
.net-chip { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.net-chip:empty { display: none; }
/* Connection check dialog */
.check-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.check-list li { position: relative; padding: 10px 14px 10px 40px; border-radius: 16px; box-shadow: var(--inset-sm); }
[dir="rtl"] .check-list li { padding: 10px 40px 10px 14px; }
.check-list li::before { position: absolute; inset-inline-start: 14px; top: 10px; font-weight: 800; }
.check-list .check-ok::before { content: "✓"; color: #0ca30c; }
.check-list .check-warn::before { content: "!"; color: #d97706; }
.check-list .check-bad::before { content: "✕"; color: #d03b3b; }
.check-list .check-info::before, .check-list .check-run::before { content: "i"; color: var(--muted); }
.check-list b { display: block; font-size: 0.95rem; }
.check-list span { display: block; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
/* Speed test result and button on each device row */
.check-list .speed-result { color: var(--fg); font-weight: 600; }
.check-list .speed-result:empty { display: none; }
.check-list li .btn.small { margin-top: 8px; padding: 6px 14px; }
.check-tips h4 { margin: 8px 0 4px; }
.check-tips ul { margin: 0 0 8px; padding-inline-start: 20px; font-size: 0.9rem; }
.check-tips a { color: var(--accent); font-weight: 600; }
/* Share by link dialog */
#dlg-link .field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; font-weight: 600; }
#dlg-link select { padding: 8px 14px; border: 0; border-radius: 999px; background: var(--bg); color: var(--fg); box-shadow: var(--raise-sm); font: inherit; }
#dlg-link .check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; cursor: pointer; }
#dlg-link .small { font-size: 0.8rem; text-align: center; margin-top: 8px; }
#dlg-link h4 { margin: 18px 0 8px; }
#dlg-link .link-bar { height: 8px; border-radius: 99px; box-shadow: var(--inset-sm); overflow: hidden; margin: 12px 0; }
#dlg-link .link-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.2s; }
#dlg-link #link-url { overflow-wrap: anywhere; }
#link-list .item { flex-wrap: wrap; }
#link-list .meta { flex: 1 1 160px; min-width: 0; }
#link-list .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#link-list .fsize { color: var(--muted); font-size: 0.8rem; }
/* "Install OmniBeam" bar */
.install-bar {
  position: fixed; z-index: 40; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); width: min(460px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 22px;
  background: var(--bg); box-shadow: var(--raise-lg); transform: translate(-50%, 140%); transition: transform 0.25s ease;
}
.install-bar.show { transform: translate(-50%, 0); }
.install-bar img { border-radius: 10px; flex: none; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); }
.install-title { font-weight: 800; color: var(--fg); font-size: 0.95rem; }
.install-bar .small-x { width: 34px; height: 34px; flex: none; }
.install-bar .small-x svg { width: 16px; height: 16px; }
/* Header buttons (pair, received files, menu): keep them and the logo on one line on phones */
header .actions { flex: none; }
@media (max-width: 440px) {
  header { margin: 12px 10px 0; padding: 7px 7px 7px 10px; }
  .actions { gap: 4px; }
  .icon-btn { width: 35px; height: 35px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .brand { gap: 7px; }
  .brand .logo { width: 34px; height: 34px; border-radius: 11px; }
  .wordmark { font-size: 1.18rem; }
}
@media (max-width: 370px) {
  .wordmark { font-size: 1rem; }
  .actions { gap: 3px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 17px; height: 17px; }
}
@media (max-width: 340px) {
  .brand .logo { width: 30px; height: 30px; border-radius: 10px; }
  .wordmark { display: none; }
}
/* Trusted devices: badge on the card, greyed card while offline, online dot in the paired list */
.peer .tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); padding: 1px 8px; border-radius: 999px; box-shadow: var(--inset-sm); }
.peer.offline { cursor: pointer; opacity: 0.55; }
.peer.offline .avatar { filter: grayscale(0.8); }
.peer.offline:hover, .peer.offline:focus-visible { transform: none; box-shadow: var(--raise); opacity: 0.75; }
.paired-row .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: 0.45; }
.paired-row .dot.on { background: #1baf7a; opacity: 1; }
.paired-row span { margin-inline-end: auto; }
.paired-row .auto-toggle + .auto-toggle { margin-inline-start: 0; }
.paired-row .auto-toggle input:disabled { opacity: 0.6; }
@media (max-width: 520px) { .paired-row { flex-wrap: wrap; } .paired-row span { flex-basis: calc(100% - 30px); } }
/* Settings dialog */
.choice { display: grid; gap: 8px; margin: 10px 0; }
.choice label { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; box-shadow: var(--raise-sm); cursor: pointer; font-size: 0.92rem; }
.choice label:has(input:checked) { box-shadow: var(--inset-sm); color: var(--accent); font-weight: 700; }
.choice input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; }
/* One-tap QR pairing */
.pair-qr.pair-qr-big { width: 220px; margin-top: 4px; }
.qr-title { margin: 6px 0 2px; }
/* Paired device that's offline with files waiting for it */
.peer.offline.waiting { opacity: 0.85; }
.peer.offline .status:empty { display: none; }

/* First-visit walkthrough */
.tour { max-width: 400px; text-align: center; }
.tour .tour-art { width: 76px; height: 76px; margin: 6px auto 12px; border-radius: 24px; display: grid; place-items: center; color: var(--accent); box-shadow: var(--raise-sm); }
.tour .tour-art svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tour .tour-num { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.tour p.muted { line-height: 1.5; }
.tour-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; box-shadow: var(--inset-sm); transition: background 0.2s, width 0.2s; }
.tour-dots i.on { width: 22px; border-radius: 4px; background: var(--accent); box-shadow: none; }
.tour .row { justify-content: center; }

/* iPhone Shortcut steps */
.shortcut-steps { margin-top: 14px; max-height: min(48vh, 420px); font-size: 0.88rem; }
#shortcut-url { word-break: break-all; }
#dlg-settings a { color: var(--accent); font-weight: 700; }

/* ---------- Menu (the ⋯ button at the top) ---------- */
header { z-index: 20; } /* above main, so the open menu covers the page below */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 30; min-width: 230px; padding: 8px;
  display: grid; gap: 2px; background: var(--bg); border-radius: 20px; box-shadow: var(--raise-lg);
}
[dir="rtl"] .menu { right: auto; left: 0; }
.menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-radius: 14px;
  background: none; color: var(--fg); font: inherit; font-size: 0.95rem; font-weight: 600; text-align: start;
  text-decoration: none; cursor: pointer;
}
.menu-item[hidden] { display: none; }
.menu-item svg { flex: none; width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.menu-item:hover, .menu-item:focus-visible { box-shadow: var(--inset-sm); outline: none; color: var(--accent); }
.menu hr { border: 0; height: 1px; margin: 4px 10px; background: var(--border); }
@media (max-width: 440px) {
  .menu { min-width: 0; width: min(270px, calc(100vw - 24px)); right: -7px; }
  [dir="rtl"] .menu { left: -7px; }
}


/* Accessibility: a clear ring around whatever the keyboard is on, and less movement for people who ask for it */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.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; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
