/* WifloShare – shared styles for all pages */
:root{
  --bg:#F4F5F7; --surface:#FFFFFF; --surface-2:#F8F9FA;
  --text:#14161A; --text-2:#5B616E; --line:#E3E5E9; --line-2:#D3D6DC;
  --brand:#0B5FFF; --brand-hover:#0950D9; --brand-soft:#E8F0FF;
  --ok:#12805C; --ok-soft:#E3F5EE; --warn:#8A5200; --warn-soft:#FFF4E0; --err:#C0262D; --err-soft:#FDECEC;
  --radius:12px; --radius-sm:8px;
  --mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}
/* dark palette: follows the device setting unless the visitor picks a theme */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){--bg:#0E1013;--surface:#171A1F;--surface-2:#1D2127;--text:#ECEEF1;--text-2:#9AA1AD;--line:#272B33;--line-2:#333843;
    --brand:#4C8DFF;--brand-hover:#6B9FFF;--brand-soft:#16233B;--ok:#4CC79B;--ok-soft:#12291F;--warn:#F2B755;--warn-soft:#2B2213;--err:#FF7A80;--err-soft:#2E1517}
}
:root[data-theme="dark"]{--bg:#0E1013;--surface:#171A1F;--surface-2:#1D2127;--text:#ECEEF1;--text-2:#9AA1AD;--line:#272B33;--line-2:#333843;
    --brand:#4C8DFF;--brand-hover:#6B9FFF;--brand-soft:#16233B;--ok:#4CC79B;--ok-soft:#12291F;--warn:#F2B755;--warn-soft:#2B2213;--err:#FF7A80;--err-soft:#2E1517}
:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark}}

/* theme switch */
.theme-btn{width:40px;padding:0;flex:none}
.theme-btn .sun{display:none}
:root[data-theme="dark"] .theme-btn .sun{display:block}
:root[data-theme="dark"] .theme-btn .moon{display:none}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .theme-btn .sun{display:block}
  :root:not([data-theme="light"]) .theme-btn .moon{display:none}
}
.nav .actions{display:flex;align-items:center;gap:8px}
@media (max-width:640px){.theme-btn{width:44px}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:400 15px/1.55 "Geist",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;overflow-x:hidden}
a{color:var(--brand);text-decoration:none}a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.wrap{max-width:1080px;margin:0 auto;padding:0 20px}
@media (max-width:480px){.wrap{padding:0 16px}}
.hidden{display:none!important}

/* header */
header{background:var(--surface);border-bottom:1px solid var(--line)}
.nav{display:flex;align-items:center;gap:28px;height:60px}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:17px;color:var(--text);letter-spacing:-.01em}
.brand:hover{text-decoration:none}
.brand svg{width:26px;height:26px}
.nav ul{display:flex;gap:22px;list-style:none;margin:0;padding:0}
.nav ul a{color:var(--text-2);font-weight:500}
.nav ul a:hover,.nav ul a[aria-current]{color:var(--text);text-decoration:none}
.nav .spacer{flex:1}
@media (max-width:720px){.nav ul{display:none}.nav{height:56px}}

/* buttons & inputs */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:var(--radius-sm);border:1px solid transparent;
  font:600 14px "Geist",system-ui,sans-serif;cursor:pointer;background:var(--brand);color:#fff;white-space:nowrap;text-decoration:none}
.btn:hover{background:var(--brand-hover);text-decoration:none}
.btn:disabled{opacity:.5;cursor:default}
.btn.secondary{background:var(--surface);color:var(--text);border-color:var(--line-2)}
.btn.secondary:hover{background:var(--surface-2)}
.btn.ghost{background:transparent;color:var(--text-2);border-color:transparent;padding:0 10px}
.btn.ghost:hover{background:var(--surface-2);color:var(--text)}
.btn.block{width:100%}
.btn svg{width:16px;height:16px}
.input,.textarea{padding:0 12px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:500 14px "Geist",system-ui,sans-serif;min-width:0;width:100%}
.input{height:40px}
.textarea{padding:10px 12px;font:500 12.5px/1.45 var(--mono);min-height:120px;resize:vertical}
.input:focus,.textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
/* phones: bigger tap targets, 16px inputs so iOS doesn't zoom */
@media (max-width:640px){
  .btn{height:44px}
  .input{height:44px;font-size:16px}
  .textarea{font-size:16px}
}

/* footer */
footer{border-top:1px solid var(--line);background:var(--surface);padding:28px 0;color:var(--text-2);font-size:13.5px}
footer .wrap{display:flex;flex-wrap:wrap;gap:12px 24px;justify-content:space-between}
footer nav{display:flex;flex-wrap:wrap;gap:8px 20px}
footer a{color:var(--text-2)}
footer a:hover{color:var(--text)}

/* ---------- home page ---------- */
.hero{display:grid;grid-template-columns:1fr 460px;grid-template-areas:"intro app" "checks app" "x app";grid-template-rows:auto auto 1fr;column-gap:56px;align-items:start;padding:56px 0 64px}
.hero-intro{grid-area:intro}.app{grid-area:app}.hero-checks{grid-area:checks}
.hero h1{font-size:clamp(28px,4.4vw,44px);line-height:1.1;letter-spacing:-.025em;margin:0 0 14px;font-weight:700;max-width:17ch}
.hero .lede{font-size:17px;color:var(--text-2);margin:0 0 28px;max-width:46ch}
@media (max-width:900px){
  .hero{grid-template-columns:minmax(0,1fr);grid-template-areas:"intro" "app" "checks";grid-template-rows:auto;row-gap:20px;padding:24px 0 36px}
  .hero .lede{margin-bottom:0;font-size:16px}
}
/* someone opened a share link on a phone: get straight to the file */
@media (max-width:900px){
  body.receiving .hero .lede,body.receiving .hero-checks{display:none}
  body.receiving .hero{padding-top:18px}
}
.checks{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.checks li{display:flex;gap:10px;align-items:flex-start}
.checks svg{flex:none;width:20px;height:20px;color:var(--ok);margin-top:1px}
.checks b{font-weight:600}
.checks span{color:var(--text-2)}

.app{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 1px 2px rgba(16,24,40,.04),0 8px 24px -12px rgba(16,24,40,.12);min-width:0}
.tabs{display:flex;border-bottom:1px solid var(--line);padding:0 8px}
.tab{flex:1;background:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;padding:14px 8px;font:600 14px "Geist",system-ui,sans-serif;color:var(--text-2);cursor:pointer}
.tab[aria-selected="true"]{color:var(--text);border-bottom-color:var(--brand)}
.pane{padding:20px}
@media (max-width:480px){.pane{padding:16px}}

.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;min-height:200px;padding:24px;
  border:1.5px dashed var(--line-2);border-radius:var(--radius);background:var(--surface-2);cursor:pointer;transition:border-color .15s,background .15s}
.drop:hover,.drop.over{border-color:var(--brand);background:var(--brand-soft)}
.drop .ico{width:44px;height:44px;border-radius:10px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;color:var(--brand)}
.drop .ico svg{width:22px;height:22px}
.drop strong{font-size:15px}
.drop small{color:var(--text-2);font-size:13px}
.drop .touch{display:none}
@media (hover:none){.drop .mouse{display:none}.drop .touch{display:inline}.drop{min-height:170px}}

.filerow{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0}
.ftype{flex:none;width:40px;height:40px;border-radius:8px;display:grid;place-items:center;font:600 10px var(--mono);letter-spacing:.02em;background:var(--brand-soft);color:var(--brand)}
.fmeta{flex:1;min-width:0}
.fname{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fsize{color:var(--text-2);font-size:13px}

.label{font-size:13px;font-weight:600;color:var(--text-2);margin:18px 0 8px;display:block}
.code{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 8px 8px 14px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-2)}
.code output{font:600 26px/1 var(--mono);letter-spacing:.18em}
.linkrow{display:flex;gap:8px}
.share{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:start}
.qr{padding:8px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm);line-height:0}
.qr img,.qr canvas{display:block}
/* phones: QR is for the *other* device, so tuck it into a toggle */
.qrtoggle{display:none}
@media (max-width:640px){
  .share{grid-template-columns:minmax(0,1fr)}
  .qrwrap{display:none}
  .qrwrap.open{display:flex;justify-content:center;margin-top:12px}
  .qrwrap .label{display:none}
  .qrtoggle{display:inline-flex;margin-top:10px}
}

.progress{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.prow{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px;flex-wrap:wrap}
.state{display:inline-flex;align-items:center;gap:8px;font-weight:600;font-size:14px}
.dot{width:8px;height:8px;border-radius:50%;background:var(--line-2);flex:none}
.state.wait .dot{background:var(--warn);animation:pulse 1.4s infinite}
.state.live .dot{background:var(--brand)}
.state.ok .dot{background:var(--ok)}
.state.err .dot{background:var(--err)}
.state.err{color:var(--err)}
@keyframes pulse{50%{opacity:.35}}
.track{height:6px;background:var(--surface-2);border:1px solid var(--line);border-radius:99px;overflow:hidden;margin:10px 0 8px}
.track div{height:100%;width:0;background:var(--brand);border-radius:99px;transition:width .2s}
.stats{color:var(--text-2);font-variant-numeric:tabular-nums}
.meta{color:var(--text-2);font-size:12.5px;margin-top:6px;display:flex;gap:6px;align-items:center}
.meta svg{width:14px;height:14px;flex:none}

.notice{display:flex;gap:10px;padding:12px 14px;border-radius:var(--radius-sm);font-size:13.5px;margin-top:14px}
.notice svg{flex:none;width:18px;height:18px;margin-top:1px}
.notice.info{background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}
.notice.warn{background:var(--warn-soft);color:var(--warn)}
.notice.ok{background:var(--ok-soft);color:var(--ok)}
.notice ul{margin:6px 0 10px;padding-left:18px}
.notice b{color:inherit}
.notice a{color:inherit;text-decoration:underline}

.recv-form{display:flex;gap:8px}
.recv-form .input{font:600 18px var(--mono);letter-spacing:.2em;text-transform:uppercase;height:48px;text-align:center}
.recv-form .btn{height:48px}
.hint{color:var(--text-2);font-size:13px;margin:10px 0 0}
.btn.linkbtn{margin-top:12px;padding:0;height:auto;color:var(--brand);font-weight:600}
.btn.linkbtn:hover{background:none;text-decoration:underline;color:var(--brand)}

/* bottom bar inside the app: network mode + relay settings */
.appfoot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding:10px 12px 10px 20px;font-size:13px;color:var(--text-2)}
.appfoot .mode{display:inline-flex;align-items:center;gap:7px;min-width:0}
.appfoot .mode svg{width:16px;height:16px;flex:none}
.appfoot .mode.relay{color:var(--ok);font-weight:600}
@media (max-width:480px){.appfoot{padding-left:16px}}

/* relay settings dialog */
dialog{border:1px solid var(--line);border-radius:var(--radius);padding:0;background:var(--surface);color:var(--text);width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);box-shadow:0 20px 50px -12px rgba(0,0,0,.35)}
dialog::backdrop{background:rgba(10,12,16,.5)}
.dlg-head{display:flex;justify-content:space-between;align-items:center;padding:16px 16px 0 20px}
.dlg-head h2{font-size:18px;margin:0}
.dlg-body{padding:12px 20px 20px}
.dlg-body p{color:var(--text-2);margin:0 0 12px;font-size:14px}
.dlg-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:14px}
.dlg-actions .left{margin-right:auto}

/* home sections */
section.block{padding:64px 0;border-top:1px solid var(--line)}
section.block h2{font-size:26px;letter-spacing:-.02em;margin:0 0 8px}
section.block .sub{color:var(--text-2);margin:0 0 32px;max-width:58ch}
@media (max-width:640px){section.block{padding:44px 0}section.block h2{font-size:22px}}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;list-style:none;padding:0;margin:0;counter-reset:s}
@media (max-width:760px){.steps{grid-template-columns:1fr;gap:12px}}
.steps li{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;counter-increment:s}
.steps li::before{content:counter(s);display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--brand-soft);color:var(--brand);font-weight:700;font-size:13px;margin-bottom:14px}
.steps h3{font-size:16px;margin:0 0 6px}
.steps p{margin:0;color:var(--text-2)}
.modes{display:grid;grid-template-columns:1fr 1fr;gap:20px}
@media (max-width:760px){.modes{grid-template-columns:1fr;gap:12px}}
.mode-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px}
.mode-card h3{display:flex;align-items:center;gap:10px;font-size:17px;margin:0 0 8px}
.mode-card h3 svg{width:22px;height:22px;color:var(--brand)}
.mode-card p{color:var(--text-2);margin:0 0 10px}
.mode-card ul{margin:0;padding-left:18px;color:var(--text-2)}
.tag{display:inline-block;font-size:12px;font-weight:600;border-radius:99px;padding:2px 8px;margin-left:auto}
.tag.free{background:var(--ok-soft);color:var(--ok)}
.tag.setup{background:var(--warn-soft);color:var(--warn)}
.faq{max-width:760px}
.faq details{border-bottom:1px solid var(--line);padding:16px 0}
.faq summary{font-weight:600;cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:16px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--text-2);font-weight:400;font-size:20px;line-height:1}
.faq details[open] summary::after{content:"–"}
.faq p{color:var(--text-2);margin:10px 0 0;max-width:68ch}

/* ---------- ad slots ----------
   Space is reserved so the page doesn't jump when an ad loads.
   Slots are removed entirely until AdSense IDs are set in ads.js. */
.ad-slot{display:block;max-width:970px;margin:0 auto 40px;text-align:center}
.ad-slot .ad-label{display:block;font-size:11.5px;color:var(--text-2);margin-bottom:6px;letter-spacing:.02em}
.ad-slot ins{min-height:100px;background:var(--surface-2);border-radius:var(--radius-sm)}
.ad-gap{padding-top:8px}
@media (max-width:640px){.ad-slot ins{min-height:260px}.ad-slot{margin-bottom:28px}}
/* never squeeze an ad above the Download button on a phone */
@media (max-width:900px){body.receiving .ad-slot{display:none}}
.page .ad-slot{margin:48px 0 0}

/* ---------- text pages (about, privacy, terms, contact, relay guide) ---------- */
.page{max-width:720px;padding:48px 20px 72px}
@media (max-width:480px){.page{padding:28px 16px 56px}}
.page h1{font-size:clamp(28px,5vw,38px);letter-spacing:-.025em;line-height:1.15;margin:0 0 8px}
.page .updated{color:var(--text-2);margin:0 0 32px;font-size:14px}
.page h2{font-size:20px;letter-spacing:-.01em;margin:36px 0 10px}
.page h3{font-size:16px;margin:24px 0 8px}
.page p,.page li{color:var(--text-2);font-size:15.5px;line-height:1.65}
.page p strong,.page li strong{color:var(--text)}
.page ul,.page ol{padding-left:22px}
.page li{margin:6px 0}
.page code{font:500 13px var(--mono);background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:1px 5px;word-break:break-all}
.page pre{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:14px 16px;overflow-x:auto;font:500 12.5px/1.6 var(--mono);color:var(--text)}
.page pre code{background:none;border:0;padding:0;word-break:normal}
.page .card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin:20px 0}
.page .card p{margin:0}
.steps-list{counter-reset:g;list-style:none;padding:0!important}
.steps-list>li{counter-increment:g;position:relative;padding-left:40px;margin:22px 0}
.steps-list>li::before{content:counter(g);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;background:var(--brand-soft);color:var(--brand);font:700 13px/28px "Geist",sans-serif;text-align:center}
.steps-list>li>strong:first-child{display:block;color:var(--text);font-size:16px;margin-bottom:2px}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

.mono{font-family:var(--mono);letter-spacing:.08em}
.people{list-style:none;padding:0;margin:14px 0 0;display:grid;gap:12px}
.people .prow b{font-weight:600;font-size:13.5px}
.people .track{margin:6px 0 0;height:5px}
.flist{list-style:none;padding:0;margin:10px 0 0;max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:var(--radius-sm)}
.flist li{display:flex;align-items:center;gap:10px;padding:7px 12px;font-size:13px;border-top:1px solid var(--line)}
.flist li:first-child{border-top:0}
.flist .n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.flist .z{color:var(--text-2);white-space:nowrap}
.flist .save{font-weight:600;white-space:nowrap}
.btn.danger{color:var(--err)}
.btn.danger:hover{background:var(--err-soft)}
.nav .short{display:none}
@media (max-width:400px){.nav{gap:12px}.nav .long{display:none}.nav .short{display:inline}.nav .actions{gap:4px}.nav .btn.secondary,.nav .actions>.btn:not(.theme-btn){padding:0 12px}}
.uses{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
@media (max-width:900px){.uses{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.uses{grid-template-columns:1fr;gap:12px}}
.uses article{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.uses h3{font-size:16px;margin:0 0 6px}
.uses p{margin:0;color:var(--text-2)}
