/* Drop Hub — phone app */
:root {
  --bg: #f2f3f7; --bg2: #ffffff; --text: #10131a; --muted: #6b7280; --line: #e4e6ec; --soft: #eceef3;
  --accent: #2f6df6; --ok: #22a95b; --bad: #e0453a;
  --tabbar: rgba(255, 255, 255, 0.86);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --bg2: #161b26; --text: #eef1f7; --muted: #8f98a8; --line: #242b38; --soft: #1e2532; --accent: #4f86ff; --tabbar: rgba(17, 21, 30, 0.86); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
code { font: 12.5px ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
code.nw { white-space: nowrap; word-break: normal; }
p { margin: 6px 0; }

/* buttons */
button { font: inherit; color: inherit; }
.btn-primary, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; border: 0;
  padding: 12px 18px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn { background: var(--soft); color: var(--text); }
.btn-primary.small, .btn.small { padding: 8px 13px; font-size: 14px; border-radius: 10px; }
.btn.danger { color: var(--bad); }
.btn-primary:active, .btn:active, .tile:active { transform: scale(0.97); }

/* ---------- join ---------- */
.join-screen { min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-t) + 48px) 22px calc(var(--safe-b) + 24px);
  background: radial-gradient(120% 60% at 50% 0%, #2f6df633, transparent 70%), var(--bg); }
.join-hero { text-align: center; margin-bottom: 26px; }
.join-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 12px 30px #2f6df655; }
.join-hero h1 { font-size: 30px; margin: 16px 0 4px; letter-spacing: -0.02em; }
.join-hero p { color: var(--muted); margin: 0; }
.join-card { background: var(--bg2); border-radius: 22px; padding: 22px 18px; max-width: 420px; margin: 0 auto; box-shadow: 0 1px 0 var(--line); }
.join-card h2 { margin: 0 0 6px; font-size: 20px; }
.code-input, .name-input { display: block; width: 100%; border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 14px; font: inherit; -webkit-appearance: none; appearance: none; outline: none; }
.code-input { font-size: 32px; font-weight: 700; letter-spacing: 0.18em; text-align: center; padding: 14px; margin: 16px 0 10px; font-variant-numeric: tabular-nums; }
.name-input { font-size: 17px; padding: 13px 14px; margin-bottom: 14px; }
.code-input:focus, .name-input:focus { border-color: var(--accent); }
.join-card .btn-primary { width: 100%; padding: 15px; font-size: 17px; border-radius: 14px; }
.join-msg { min-height: 1.4em; text-align: center; color: var(--bad); font-size: 15px; margin-top: 12px; }
.join-msg.ok { color: var(--ok); }

/* ---------- app frame ---------- */
#app { min-height: 100vh; padding-bottom: calc(var(--safe-b) + 84px); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 11px; align-items: center;
  padding: calc(var(--safe-t) + 10px) 18px 10px; background: var(--bg); }
.top-logo { width: 38px; height: 38px; border-radius: 10px; }
.top-name { font-weight: 700; font-size: 17px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px #22a95b33; }
.dot.off { background: var(--bad); }

.tab { padding: 4px 18px 20px; max-width: 560px; margin: 0 auto; }
.tab-title { font-size: 30px; letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.15; }
.where { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.where b { color: var(--text); font-weight: 600; }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 18px;
  min-height: 128px; padding: 16px; border: 0; border-radius: 22px; color: #fff; text-align: left; cursor: pointer; overflow: hidden;
  font-weight: 700; font-size: 17px; line-height: 1.2; box-shadow: 0 8px 22px -10px var(--shadow, #0006); }
.tile input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tile-ic { width: 44px; height: 44px; border-radius: 13px; background: #ffffff2e; display: grid; place-items: center; }
.tile-ic svg { width: 26px; height: 26px; }
.t-blue { background: linear-gradient(140deg, #3b82f6, #2f5ee8); --shadow: #2f6df6aa; }
.t-orange { background: linear-gradient(140deg, #fb923c, #ef6c1a); --shadow: #ef6c1aaa; }
.t-green { background: linear-gradient(140deg, #34c77b, #13a05a); --shadow: #13a05aaa; }
.t-purple { background: linear-gradient(140deg, #a46bff, #7a45f0); --shadow: #7a45f0aa; }
.tile:disabled { opacity: 0.45; }

.hint-card { display: block; width: 100%; text-align: left; margin-top: 16px; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--line);
  background: var(--bg2); cursor: pointer; }
.hint-card b { display: block; margin-bottom: 2px; }
.hint-card span { color: var(--muted); font-size: 14px; }

/* transfers */
.transfers { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.transfer { padding: 12px 14px; border-radius: 14px; background: var(--bg2); }
.transfer .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin: 8px 0 5px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; border-radius: 3px; }
.transfer.done .bar i { background: var(--ok); }
.transfer.failed .bar i { background: var(--bad); width: 100%; }
.transfer .info { font-size: 13px; color: var(--muted); }

/* lists and cards */
.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--bg2); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.card-head { font-weight: 700; margin-bottom: 6px; }
.item { background: var(--bg2); border-radius: 18px; overflow: hidden; }
.item .preview { display: block; width: 100%; max-height: 380px; object-fit: cover; background: #0002; }
.item-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.item-row { display: flex; gap: 12px; align-items: center; }
.item-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); flex: none; color: var(--accent); }
.item-ic svg { width: 22px; height: 22px; }
.grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 13px; color: var(--muted); }
.textbody { margin: 0; white-space: pre-wrap; word-break: break-word; font: 16px/1.45 inherit; font-family: inherit; max-height: 260px; overflow: auto;
  -webkit-user-select: text; user-select: text; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list.compact { gap: 8px; }
.list.compact .item-body { padding: 10px 12px; }
.clipbox { border: 1.5px solid var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.empty { text-align: center; padding: 26px 10px; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--bg2); color: var(--accent); }
.empty-ic svg { width: 32px; height: 32px; }
.howto { text-align: left; display: inline-block; margin: 4px 0; padding-left: 20px; }

.steps { padding-left: 20px; margin: 8px 0; } .steps li { margin: 9px 0; } .steps ul { padding-left: 16px; margin: 6px 0; }
.copyline { display: flex; gap: 8px; align-items: center; margin-top: 6px; } .copyline code { flex: 1; }
.key { font-size: 10.5px; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(var(--safe-b) + 6px); background: var(--tabbar); border-top: 0.5px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none;
  color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; cursor: pointer; }
.tabbar button.on { color: var(--accent); }
.tabbar svg { width: 25px; height: 25px; }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* text sheet: pinned to the TOP of the screen so the keyboard never covers Send */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: #0008; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(var(--safe-t) + 10px) 10px 10px; animation: fade .15s ease-out; }
.sheet { width: 100%; max-width: 560px; background: var(--bg2); border-radius: 20px; padding: 6px 14px 12px; animation: drop .2s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }
.sheet-title { font-weight: 700; }
.sheet-btn { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 8px 4px; cursor: pointer; }
.sheet-btn.strong { font-weight: 700; background: var(--accent); color: #fff; border-radius: 10px; padding: 7px 16px; }
.sheet-btn:disabled { opacity: 0.5; }
#text { display: block; width: 100%; min-height: 150px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text);
  font: 17px/1.4 inherit; font-family: inherit; padding: 12px; resize: vertical; outline: none; -webkit-appearance: none; appearance: none;
  -webkit-user-select: text; user-select: text; }
#text:focus { border-color: var(--accent); }
.sheet-msg { font-size: 14px; color: var(--muted); margin: 10px 2px 2px; min-height: 1.3em; }
.sheet-msg.ok { color: var(--ok); font-weight: 600; } .sheet-msg.bad { color: var(--bad); font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

/* toast at the top, where the keyboard cannot hide it */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%); z-index: 30; background: #111827f2; color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 15px; max-width: 92vw; box-shadow: 0 8px 28px #0005; text-align: center; }

body.dragging #tab-send .tiles { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: 22px; }

/* ---- online mailbox ---- */
.dot.wait { background: #f5a623; box-shadow: 0 0 0 3px #f5a62333; }
.notice { display: block; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4;
  background: #f5a62318; border: 1px solid #f5a62355; color: var(--text); }
.notice b { font-weight: 700; }
.go-online { display: block; text-decoration: none; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #2f7bff, #7b4dff); box-shadow: 0 6px 18px #2f7bff40; }
.go-online b { display: block; font-size: 16px; margin-bottom: 2px; }
.go-online span { font-size: 14px; opacity: 0.92; }
.status-wait { color: #c98410; }
.status-ok { color: var(--ok); }
.join-pc { max-width: 420px; margin: 14px auto 0; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  background: #2f7bff14; border: 1px solid #2f7bff40; color: var(--text); text-align: center; }
.join-pc a { color: var(--accent); font-weight: 600; }

/* ---- text: where it goes ---- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mode { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
.mode b { font-size: 14px; }
.mode span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.mode.on { border-color: var(--accent); background: #2f7bff18; box-shadow: 0 0 0 3px #2f7bff22; }

/* ---- home fast lane ---- */
.lane-state { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.lane-state.on { background: #22a95b22; color: var(--ok); }
.lane-state.off { background: var(--bg2); color: var(--muted); }
.lane-hint { width: 100%; text-align: left; font: inherit; cursor: pointer; background: #2f7bff14; border-color: #2f7bff40; }
.mode b { white-space: nowrap; font-size: 13px; }

/* ---- always-available files (the phone folder on the PC) ---- */
.kept-head { margin: 22px 2px 10px; display: flex; flex-direction: column; gap: 2px; }
.kept-head b { font-size: 17px; }
.kept-head span { font-size: 13px; color: var(--muted); }
