/* The phone remote (TB-985, card N7b), in the Tunnet site's colours as the locked screens have them.
   One accent, Tunnet's blue, for what waits and the one button that says yes; the rest is grey.
   It follows the phone's light or dark setting. */

:root {
  color-scheme: dark;
  --bg: #0a0a0b; --side: #141416; --sunk: #18181b; --line: #232327; --line-2: #2e2e34;
  --text: #fafafa; --text-2: #c4c4cb; --text-3: #8d8d96; --text-4: #6a6a73;
  --accent: #a9c7fb; --accent-bg: #15233d; --accent-ink: #a9c7fb; --accent-line: #1f3a66;
  --on-accent: #0a0a0b; --run: #3b82f6; --bad: #ff6f62; --shade: rgba(0, 0, 0, .55);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff; --side: #f7f7f8; --sunk: #f2f2f4; --line: #e6e6e9; --line-2: #d6d6db;
    --text: #0a0a0b; --text-2: #45454c; --text-3: #70707a; --text-4: #8d8d96;
    --accent: #3b82f6; --accent-bg: #eaf1fe; --accent-ink: #1d5fd1; --accent-line: #c7dafb;
    --on-accent: #ffffff; --bad: #d23c30; --shade: rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }

.app { height: 100%; }
.screen { position: relative; display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto;
  padding-top: env(safe-area-inset-top); }
.boot { margin-top: 40vh; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px 10px; flex: none; }
.bar h1 { margin: 0; font-size: 24px; font-weight: 700; }
.bar .btn { flex: none; padding: 6px 14px; }
.mac { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scroll { flex: 1; overflow-y: auto; padding: 0 14px 18px; -webkit-overflow-scrolling: touch; }
.sec { font-size: 12px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); margin: 16px 4px 6px; }

.card { background: var(--side); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.card.list { padding: 4px 14px; }
.wait { border-color: var(--accent-line); background: var(--accent-bg); }
.k { color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.k.plain { color: var(--text-3); font-weight: 400; }
.t { font-size: 15px; font-weight: 600; margin: 2px 0; overflow-wrap: anywhere; }
.s { color: var(--text-2); font-size: 13px; margin: 0; }
.body { margin: 4px 0 0; color: var(--text-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

.btns { display: flex; gap: 8px; margin-top: 10px; }
.btns.wide { margin: 18px 4px 0; }
.btns.narrow { justify-content: center; }
.btns.narrow .btn { flex: 0 0 140px; }
.btn { flex: 1; text-align: center; border-radius: 10px; padding: 10px 0; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text); cursor: pointer; }
.btn.yes { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .tab:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; }

.li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 2px;
  border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.li:last-child { border-bottom: 0; }
.li-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--text-3); font-size: 12px; }
.li .dim { flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A job: the title wraps, its meta sits under it in grey on its own line. */
.li-job { flex-direction: column; align-items: flex-start; gap: 2px; }
.li-title { overflow-wrap: anywhere; }
.li-job .dim { max-width: 100%; white-space: normal; }
.center { text-align: center; }
.empty { color: var(--text-3); font-size: 14px; margin: 6px 4px 10px; }
.more { margin: 0 4px 8px; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot.on { background: var(--run); }
.dot.off { background: var(--text-4); }

.note { border-color: var(--line-2); }
.note-title { font-weight: 600; }
.note.bad .note-title { color: var(--bad); }
.note .s { margin-top: 2px; overflow-wrap: anywhere; }

.tabs { flex: none; display: flex; border-top: 1px solid var(--line); background: var(--side);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); }
.tab { flex: 1; background: none; border: 0; font-size: 11px; color: var(--text-3); cursor: pointer; padding: 0; }
.tab.cur { color: var(--accent-ink); }
/* The tab icons: 24 px, line drawings in currentColor, 2.2px like the Face ID mark. */
.ic-tab { display: block; position: relative; width: 24px; height: 24px; margin: 0 auto 3px; }
.ic-waiting::before { content: ""; position: absolute; left: 1px; top: 4px; width: 18px; height: 14px;
  border: 2.2px solid currentColor; border-radius: 3px; }
.ic-waiting::after { content: ""; position: absolute; left: 6px; top: 11px; width: 8px; height: 5px;
  border: solid currentColor; border-width: 0 2.2px 2.2px; border-radius: 0 0 3px 3px; }
.ic-room span { position: absolute; width: 8px; height: 8px; border: 2.2px solid currentColor; border-radius: 2px; box-sizing: content-box; }
.ic-room span:nth-child(1) { left: 0; top: 0; }
.ic-room span:nth-child(2) { right: 0; top: 0; }
.ic-room span:nth-child(3) { left: 0; bottom: 0; }
.ic-room span:nth-child(4) { right: 0; bottom: 0; }
.ic-answers::before { content: ""; position: absolute; left: 1px; top: 2px; width: 18px; height: 13px;
  border: 2.2px solid currentColor; border-radius: 4px; }
.ic-answers::after { content: ""; position: absolute; left: 5px; top: 13px; width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 2.2px 2.2px 0; background: var(--side); transform: skewX(-30deg); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: var(--on-accent); font-size: 11px; font-weight: 700; margin-left: 4px; }

/* The sheet that asks for Face ID. */
.sheet-wrap { position: absolute; inset: 0; z-index: 2; }
.shade { position: absolute; inset: 0; background: var(--shade); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto; background: var(--side);
  border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-title { margin: 0; font-size: 17px; font-weight: 600; }
.sheet > .dim { margin: 2px 0 10px; }
.mono { font-family: var(--mono); font-size: 12.5px; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.words { margin: 8px 0 0; white-space: pre-wrap; }
.faceid { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--text-2); font-size: 13px; text-align: center; }
.error { color: var(--bad); font-size: 13px; margin: 8px 0 0; }

/* Linking. */
.cam { margin: 12px 4px; aspect-ratio: 1 / 1; border-radius: 18px; background: var(--sunk); border: 1px solid var(--line);
  position: relative; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam::before, .cam::after { content: ""; position: absolute; z-index: 1; }
.cam::before { inset: 22%; border: 2px solid var(--accent); border-radius: 10px; }
.cam::after { left: 50%; top: 50%; width: 46%; height: 2px; background: var(--accent); transform: translate(-50%, -50%); opacity: .7; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
textarea, input[type="text"] { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; }
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; overflow-wrap: anywhere; }
.pair-code { font-size: 32px; letter-spacing: .12em; font-weight: 600; text-align: center; margin: 10px 0 4px; font-family: var(--mono); }
.waiting-line { margin: 18px 12px; }

/* An answer, and the start. */
.ok { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 20px 6px; }
.ok h3 { margin: 0 0 6px; font-size: 19px; }
.ok p { margin: 0 0 6px; color: var(--text-2); font-size: 14px; }
.ring { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent); display: flex; align-items: center;
  justify-content: center; margin-bottom: 14px; }
.ring.dim-ring { border-color: var(--line-2); }
.refused .ring { border-color: var(--line-2); }
.bang { font-size: 26px; font-weight: 700; color: var(--text-2); }
.mark { width: 64px; height: 64px; margin: 26px 0 16px; display: block; }

/* Icons, drawn here so the page needs no picture of its own. */
.ic-check { width: 12px; height: 22px; border: solid var(--accent); border-width: 0 2.6px 2.6px 0; transform: translateY(-3px) rotate(45deg); border-radius: 1px; }
.ic-wait { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--text-3); position: relative; }
.ic-wait::before { content: ""; position: absolute; left: 10px; top: 4px; width: 2px; height: 9px; background: var(--text-3); border-radius: 1px; }
.ic-wait::after { content: ""; position: absolute; left: 10px; top: 11px; width: 7px; height: 2px; background: var(--text-3); border-radius: 1px; }
.ic-face { width: 54px; height: 54px; position: relative; color: var(--text-2);
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 14px 2.2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 0 / 2.2px 14px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 14px 2.2px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 2.2px 14px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 14px 2.2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 2.2px 14px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 14px 2.2px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 2.2px 14px no-repeat; }
.ic-face-in { position: absolute; left: 17px; top: 19px; width: 20px; height: 18px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 2.2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 2.2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 0 / 2.2px 9px no-repeat; }
.ic-face-in::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 6px;
  border: solid currentColor; border-width: 0 0 2.2px; border-radius: 0 0 10px 10px; }
