/* The launcher page: plain, legible, light or dark as the browser prefers. */

:root {
  color-scheme: light dark;
  --text: #1d1d1f;
  --page: #fbfbf8;
  --muted: #5f6368;
  --line: #d6d6d2;
  --panel: #f0f0ea;
  --warn: #8a5300;
  --bad: #a4001d;
  --good: #1e6b32;
  --button: #1f4f99;
  --button-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e6;
    --page: #151515;
    --muted: #a3a3a0;
    --line: #3b3b39;
    --panel: #212120;
    --warn: #f0b35a;
    --bad: #ff8a8a;
    --good: #86d493;
    --button: #7aa7f0;
    --button-text: #0d1522;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

h2 {
  font-size: 1.15rem;
  margin: 0.25rem 0;
}

.signed-in span {
  color: var(--muted);
  margin-right: 0.5rem;
}

.message {
  background: var(--panel);
  border-left: 4px solid var(--button);
  padding: 0.5rem 0.75rem;
}

.state {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.state h2 {
  text-transform: capitalize;
}

.state-ready h2 {
  color: var(--good);
}

.state-error h2,
.state-needs-attention h2,
.state-not-responding h2 {
  color: var(--bad);
}

.warn {
  color: var(--warn);
}

.bad {
  color: var(--bad);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.facts th {
  width: 9rem;
  color: var(--muted);
  font-weight: normal;
}

form.request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0;
}

.attention,
.base,
.remote {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.checks {
  margin: 0;
  padding-left: 1.1rem;
}

.checks .bad {
  font-weight: bold;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

button,
.button {
  display: inline-block;
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 4px;
  background: var(--button);
  color: var(--button-text);
  text-decoration: none;
  cursor: pointer;
}

button.quiet {
  background: transparent;
  color: var(--button);
  padding: 0;
  text-decoration: underline;
}

button.danger {
  background: var(--bad);
}

input,
select {
  font: inherit;
  padding: 0.2rem 0.3rem;
}

input[type="number"] {
  width: 5rem;
}

code.secret {
  font-size: 1.1rem;
  user-select: all;
}

/* The remote desktop (desktop.html): a bar of controls, and the desktop filling the rest of the
   window, scaled to fit. Touches on the desktop are the desktop's, not the browser's: no
   scrolling, zooming or text selection there. */

body.desktop {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.desktop main {
  max-width: none;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.bar button,
.bar select {
  padding: 0.2rem 0.6rem;
}

.bar button:disabled {
  opacity: 0.5;
  cursor: default;
}

.bar button.latched {
  outline: 3px solid var(--warn);
}

.bar .status {
  flex: 1 1 8rem;
  color: var(--muted);
}

.bar .touch-only {
  display: contents;
}

body.no-touch .bar .touch-only {
  display: none;
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.overlay {
  position: fixed;
  inset: 3rem 1rem auto 1rem;
  max-width: 30rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* The rules above that set display would otherwise show what desktop.js hides. */
[hidden] {
  display: none !important;
}
