/* Drop's phone UI. One column, iOS system font, no web fonts: the phone can
   reach the PC and nothing else, so anything not embedded would simply be
   missing. Light and dark both come from prefers-color-scheme; there is no
   theme switch because iOS already has one. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --dim: #6c6c70;
  --line: #d8d8dd;
  --accent: #1b62f0;
  --accent-text: #ffffff;
  --ok: #178a4c;
  --err: #c22e2e;
  --err-bg: #fdecec;
  --warn: #b06400;
  --track: #e4e4ea;
  /* 44 pt is Apple's minimum tap target; every button below inherits it. */
  --tap: 44px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --card: #1c1c1f;
    --text: #f2f2f7;
    --dim: #9a9aa0;
    --line: #2e2e33;
    --accent: #4f8bff;
    --accent-text: #06132b;
    --ok: #3ddc84;
    --err: #ff6b6b;
    --err-bg: #33161a;
    --warn: #f0a33c;
    --track: #303036;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  /* iOS grabs the whole viewport in standalone mode; the insets keep content
     clear of the notch and the home indicator. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.head { margin: 6px 2px 0; }
.head h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.head-sub { margin: 2px 0 0; color: var(--dim); font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* The transport chip, DESIGN-TRANSPORTS 1.4. It is never empty: "Connecting"
   is a state, not the absence of one, and a page served over a relay must not
   be able to look like a LAN page by saying nothing. */
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.chip.t-resolving { color: var(--dim); }

/* Direct is the ordinary case and is deliberately the quietest. */
.chip.t-direct { color: var(--dim); }

.chip.t-overlay,
.chip.t-hotspot {
  color: var(--accent);
  border-color: var(--accent);
}

/* Amber for the relay: the bytes leave the LAN. */
.chip.t-relay {
  color: var(--warn);
  border-color: var(--warn);
}

/* Amber with a red outline for the relay path that is not end-to-end. */
.chip.t-relay-plain {
  color: var(--warn);
  border-color: var(--err);
  border-width: 2px;
}

.chip.t-offline {
  color: var(--err);
  border-color: var(--err);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--line);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* The picker. The input itself is off-screen rather than display:none so it
   stays focusable and so a programmatic file drop still targets a laid-out
   element; the label is the whole tap target. */
#picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 12px;
  min-height: 132px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.target.over { border-color: var(--accent); background: rgba(27, 98, 240, 0.08); }
.target-main { font-size: 17px; font-weight: 600; color: var(--text); }
.target-sub { font-size: 13px; color: var(--dim); }

.btn {
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary { background: var(--accent); color: var(--accent-text); border-color: transparent; width: 100%; }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.btn:active { opacity: 0.7; }

textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  margin-bottom: 10px;
  resize: vertical;
}

.status { margin: 8px 0 0; font-size: 13px; color: var(--dim); min-height: 1.2em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.banner {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--err-bg);
  color: var(--err);
  font-size: 14px;
  font-weight: 600;
}

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}
.list .row:first-child { border-top: none; padding-top: 0; }

.row-name { font-size: 15px; word-break: break-word; }
.row-meta { grid-column: 1 / 2; font-size: 13px; color: var(--dim); }
.row-meta.err { color: var(--err); }
.row-actions { grid-column: 2 / 3; grid-row: 1 / 3; display: flex; gap: 6px; }

/* A native <progress> would style differently on every engine; a div and a
   width are predictable and one line of script. */
.bar { grid-column: 1 / 3; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s linear; }
.row.done .bar > i { background: var(--ok); }
.row.failed .bar > i { background: var(--err); }

.file-link { color: var(--accent); text-decoration: none; font-size: 15px; word-break: break-word; }

.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: var(--dim);
  font-size: 13px;
}
.url { word-break: break-all; }
