/* The relay's phone page — the tokens of the TV's LAN page (HandoffPage.kt) and mockups 01/02/06. */
@font-face { font-family: Estedad; src: url('/fonts/estedad.ttf') format('truetype'); font-display: swap; }
:root { color-scheme: dark; --bg0: #07080B; --bg1: #0E1117; --surfaceHi: rgba(26,32,41,.86); --hairline: rgba(255,255,255,.08);
        --ink: #F5F1E8; --ink2: #C8CCD4; --muted: #8B93A1; --faint: #566070; --accent: #F4B942; --accentInk: #1B1305;
        --accentGlow: rgba(244,185,66,.35); --track: rgba(255,255,255,.14); --danger: #FF6B5B; --success: #5DD39E; --info: #7DB4FF; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); font: 16px/1.7 Estedad, system-ui, sans-serif; padding: 0 0 40px; min-height: 100vh;
       background: radial-gradient(420px 300px at 100% 0%, rgba(244,185,66,.12), rgba(244,185,66,0) 70%), var(--bg0); }
.wrap { padding: 12px 16px 0; }
.h1 { font-size: 20px; font-weight: 800; margin: 8px 0 0; }

.picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font: 600 13.5px inherit;
        border: 1px solid var(--hairline); background: rgba(255,255,255,.04); color: var(--ink2); }
.chip.on { background: var(--ink); color: var(--bg0); border-color: transparent; }
.chip.add { color: var(--accent); border-style: dashed; border-color: rgba(244,185,66,.45); }
.chip.gone { color: var(--danger); text-decoration: line-through; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.g { background: var(--success); box-shadow: 0 0 0 3px rgba(93,211,158,.18); }
.dot.r { background: var(--danger); } .dot.y { background: var(--accent); }

.tv { margin-top: 12px; border-radius: 20px; padding: 13px 16px; background: var(--surfaceHi); border: 1px solid var(--hairline); }
.tv .top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.badge { margin-inline-start: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
         color: var(--info); background: rgba(125,180,255,.10); border: 1px solid rgba(125,180,255,.25); }
.tv .name { font-size: 18px; font-weight: 700; margin-top: 4px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.tv .name:empty { display: none; }
.bar { position: relative; height: 4px; border-radius: 4px; background: var(--track); margin-top: 9px; direction: ltr; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: var(--accent); }
.row2 { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }
.ctl { display: flex; gap: 8px; margin-top: 10px; }
.ctl button { flex: 1; height: 38px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--hairline);
              font: 600 13px inherit; color: var(--ink); }
.lan { margin-top: 10px; font-size: 12.5px; color: var(--ink2); }
.lan a { color: var(--accent); direction: ltr; unicode-bidi: isolate; }

.seg { display: flex; margin: 16px 0 0; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--hairline); }
.seg button { flex: 1; text-align: center; font: 600 15px/1 inherit; color: var(--muted); padding: 11px 0; border-radius: 10px; border: 0; background: none; }
.seg button[aria-selected=true] { background: var(--ink); color: var(--bg0); }

.lbl { display: block; font-size: 13px; color: var(--muted); margin: 16px 2px 7px; }
.field { position: relative; }
.field input { height: 52px; padding: 0 14px 0 90px; text-align: left; border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px rgba(244,185,66,.15); }
.field .paste { position: absolute; left: 7px; top: 6px; height: 40px; padding: 0 12px; border-radius: 10px; font: 600 13px inherit;
                background: rgba(255,255,255,.10); color: var(--ink2); border: 0; }
input, textarea { width: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--surfaceHi);
                  color: var(--ink); font: 15px/1.5 inherit; }
#code { font-size: 26px; letter-spacing: 6px; text-align: center; }
.hint { font-size: 12px; color: var(--muted); margin: 7px 2px 0; line-height: 1.7; }
.two { display: flex; gap: 8px; }
/* ⚠ width:auto: button.go is width:100% on its own, and a 100%-wide «بعداً» pushed «پخش» off the
   screen and the whole page sideways (caught by the Playwright run at 412 px). */
.two .go { flex: 1 1 auto; width: auto; min-width: 0; }
.two .go.alt { flex: 0 0 auto; padding: 0 14px; font-size: 14px; }
html, body { overflow-x: hidden; }
input, textarea { min-width: 0; }
button.go { margin-top: 12px; width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accentInk);
            font: 800 17px inherit; box-shadow: 0 10px 30px var(--accentGlow); }
button.go.alt { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }
button.go:disabled { opacity: .5; }
button.ghost { margin-top: 10px; width: 100%; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: transparent; color: var(--ink); font: 15px inherit; }

.sec { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 18px 2px 4px; }
.sec b { color: var(--ink2); font-weight: 700; font-size: 14px; }
/* ⭐ A list row is a CARD with a ceiling (owner, 2026-10-05: «کارت‌ها ماکزیمم عرض داشته باشن که صفحه خراب
   نشه»): the text column takes what is left (min-width: 0) and a title is two lines and «…». A
   300-character title, or a bare URL with no spaces, never widens the page on a 360-px phone. */
.it { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 8px; max-width: 100%; border-radius: 14px;
      background: var(--surfaceHi); border: 1px solid var(--hairline); }
.it i { width: 40px; height: 40px; border-radius: 10px; flex: none; background: linear-gradient(135deg, #2b3d63, #d27a4a);
        display: flex; align-items: center; justify-content: center; font: 700 17px/1 inherit; font-style: normal; color: rgba(245,241,232,.85); }
.it .tx { flex: 1 1 auto; min-width: 0; }
.it .t { font-size: 14px; font-weight: 600; line-height: 1.45; unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis;
         display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; word-break: break-word; }
.it .t.stand { color: var(--ink2); }
.it .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it button { flex: none; font: 700 12px inherit; color: var(--accent); background: none; border: 0; padding: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.pager button { flex: none; min-width: 84px; height: 38px; border-radius: 12px; border: 1px solid var(--hairline); background: rgba(255,255,255,.06);
                color: var(--ink); font: 600 13px inherit; }
.pager button:disabled { opacity: .35; }
.pager span { font-size: 12.5px; color: var(--muted); }
.st { flex: none; margin-inline-start: auto; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st.wait { color: var(--accent); background: rgba(244,185,66,.12); }
.st.ok { color: var(--success); background: rgba(93,211,158,.12); }
.st.done { color: var(--ink2); background: rgba(255,255,255,.08); }
.st.bad { color: var(--danger); background: rgba(255,107,91,.12); }

.card { margin-top: 10px; border-radius: 18px; padding: 13px 14px; background: var(--surfaceHi); border: 1px solid var(--hairline); }
.card .r1 { display: flex; align-items: center; gap: 8px; }
.card .n { font-size: 17px; font-weight: 700; unicode-bidi: plaintext; }
.card .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card .acts { display: flex; gap: 8px; margin-top: 10px; }
.card .acts button { flex: 1; height: 36px; border-radius: 11px; font: 600 13px inherit; background: rgba(255,255,255,.07); border: 1px solid var(--hairline); color: var(--ink); }
.card .acts button.danger { color: var(--danger); border-color: rgba(255,107,91,.3); background: rgba(255,107,91,.06); }
.pill { margin-inline-start: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--ink2); }
.pill.on { color: var(--info); background: rgba(125,180,255,.10); }
.note { margin-top: 12px; padding: 11px 13px; border-radius: 14px; font-size: 12.5px; line-height: 1.8; color: var(--ink2);
        background: rgba(125,180,255,.07); border: 1px solid rgba(125,180,255,.2); }
.sas { margin-top: 14px; padding: 14px; border-radius: 16px; border: 1px solid rgba(244,185,66,.45); background: rgba(244,185,66,.06); font-size: 14px; }
.sasn { font-size: 40px; font-weight: 800; color: var(--accent); letter-spacing: 6px; margin: 6px 0; }

.rb { margin-top: 14px; border-radius: 18px; border: 1px solid var(--accent); background: var(--surfaceHi); padding: 12px; }
.rb h2 { font-size: 15px; margin: 0 0 4px; } .rb p { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.rb .shot { position: relative; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; }
.rb img { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }
.rb .row { display: flex; gap: 8px; margin-top: 8px; }
.rb .row button { flex: 1; padding: 10px 0; border-radius: 10px; border: 1px solid var(--hairline); background: rgba(255,255,255,.06); color: var(--ink); font: 600 14px inherit; }
.rb .row button.narrow { flex: none; padding: 0 14px; }
.cards { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cards button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--info); background: rgba(125,180,255,.08); color: var(--ink); font: 600 13px inherit; }

.msg { margin: 14px 16px 0; padding: 10px 12px; border-radius: 10px; display: none; font-size: 14px; }
.msg.ok { background: #16301d; color: #7fd39b; display: block; } .msg.err { background: #301a18; color: #f0928a; display: block; }
.offline { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.8;
           background: rgba(255,107,91,.07); border: 1px solid rgba(255,107,91,.3); color: var(--ink2); }
.offline a { color: var(--accent); direction: ltr; unicode-bidi: isolate; }
/* A long link title must not push the state pill off the screen (Playwright, 412 px). */
.it > div { flex: 1 1 auto; min-width: 0; }
