/* Remote Access console.
   One typeface (the system's), one ink colour, hairlines instead of boxes.
   Colour is reserved for state: green is online or allowed, red is refused. */

:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #5b6577;
  --line: #d5dae1;
  --ok: #1b7f4b;
  --no: #b3261e;
  --warn: #8a5a00;
  --focus: #2f6fed;
  --wash: #eef1f6;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10151f;
    --surface: #171d29;
    --ink: #e7ebf3;
    --muted: #9aa5b8;
    --line: #2b3445;
    --ok: #4cc38a;
    --no: #ff8a80;
    --warn: #e2b04a;
    --focus: #7aa7ff;
    --wash: #1e2634;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* Controls */
button, input, select, textarea { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}
textarea { font: 13px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; min-height: 220px; resize: vertical; white-space: pre; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: baseline; color: var(--ink); font-size: 15px; }
.check input { width: auto; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.danger { background: transparent; color: var(--no); border-color: var(--line); font-weight: 500; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }

/* Frame */
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px;
  padding: 14px 20px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top .brand { font-weight: 700; font-size: 16px; padding-bottom: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0 18px; flex: 1; }
.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 0 0 11px; color: var(--muted); cursor: pointer; font-weight: 500;
}
.tabs button[aria-current=page] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 650; }
.who { padding-bottom: 12px; color: var(--muted); font-size: 13px; }
.who button { margin-left: 10px; }
main { max-width: 1120px; margin: 0 auto; padding: 26px 20px 80px; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head .tools input, .head .tools select { width: auto; min-width: 180px; }
.block { margin-top: 38px; }
.block > h2 { margin-bottom: 4px; }
.block > p { margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 68ch; margin: 4px 0 0; }

/* Rows: every list on the site is this one pattern */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.row {
  display: grid; align-items: center; gap: 4px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .main { min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row.device { grid-template-columns: 14px minmax(0, 1.6fr) 120px minmax(0, 1fr) auto; }
.row.simple { grid-template-columns: minmax(0, 1fr) auto; }
.row.log { grid-template-columns: 14px 172px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); font-size: 14px; }
.empty { padding: 28px 16px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); display: inline-block; }
.dot.on { background: var(--ok); border-color: var(--ok); }
.dot.no { background: var(--no); border-color: var(--no); }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.no { color: var(--no); border-color: var(--no); }
.tag.ok { color: var(--ok); border-color: var(--ok); }

/* The access rules read as sentences */
.rule { font-size: 16px; }
.rule b { font-weight: 650; }
.rule .until { color: var(--muted); font-size: 14px; }

/* Figures on the admin overview strip */
.strip { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.strip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.strip .bad b { color: var(--no); }

.narrow { max-width: 380px; }
.narrow .secret { max-width: 100%; }
.steps { margin: 12px 0; padding-left: 22px; max-width: 68ch; }
.steps li { margin: 6px 0; }
.steps li .btn { margin-left: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0 0; }

/* Notices */
.note { padding: 10px 14px; border-left: 3px solid var(--line); background: var(--wash); border-radius: 0 5px 5px 0; margin: 0 0 16px; }
.note.err { border-left-color: var(--no); }
.note.good { border-left-color: var(--ok); }
.note.warn { border-left-color: var(--warn); }
.secret { font: 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; user-select: all; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; display: block; margin: 8px 0; }

/* Sign-in */
.signin { max-width: 380px; margin: 9vh auto 0; padding: 0 20px; }
.signin h1 { margin-bottom: 6px; }
.signin .lede { margin-bottom: 22px; }
.signin .btn { width: 100%; text-align: center; padding: 10px; }
.captcha { display: block; height: 44px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }

/* Dialog */
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 16, 28, 0.55); }
dialog form, dialog .body { padding: 22px; }
dialog h2 { margin-bottom: 14px; }
.foot { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
dialog .foot { justify-content: flex-end; margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.qr { display: block; width: 190px; height: 190px; background: #fff; padding: 8px; border-radius: 6px; border: 1px solid var(--line); margin: 6px 0 10px; }
.qr rect { shape-rendering: crispEdges; }

@media (max-width: 760px) {
  main { padding: 18px 12px 70px; }
  .top { padding: 12px 12px 0; }
  .row.device { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .row.device .c-id, .row.device .c-where { grid-column: 2; }
  .row.device .acts { grid-column: 3; grid-row: 1 / span 3; }
  .row.log { grid-template-columns: 14px minmax(0, 1fr); }
  .row.log > :nth-child(n+3) { grid-column: 2; }
  .grid2 { grid-template-columns: 1fr; }
  .head .tools input, .head .tools select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise 0.14s ease-out; }
  @keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
}
