/* Phone first. One shape for controls. */
:root {
  --ink: #1f2328;
  --muted: #5d6670;
  --line: #d9dde2;
  --page: #f5f6f8;
  --card: #ffffff;
  --brand: #1f4e79;
  --ok: #1d7a3e;
  --bad: #b3261e;
  --radius: 8px;
  --control: 40px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 8px 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.small { color: var(--muted); font-size: 0.875rem; }
.empty { color: var(--muted); }

.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--brand); color: #fff;
}
.brand { color: #fff; font-weight: 600; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.nav a, .nav .link { color: #fff; text-decoration: none; font-size: 0.95rem; }
.nav form { margin: 0; }

button, .button, .small-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control); padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: inherit; text-decoration: none; cursor: pointer;
}
button.secondary, .small-button {
  background: #eef2f6; color: var(--brand); border-color: #c9d3de;
}
.small-button { min-height: 32px; padding: 0 10px; font-size: 0.875rem; }
button.link { background: none; border: 0; padding: 0; min-height: 0; }
input, select {
  min-height: var(--control); padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius); font: inherit; background: #fff; width: 100%;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 0; }
legend { color: var(--muted); font-size: 0.9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: auto; min-height: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.narrow { max-width: 420px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.toolbar label { flex: 1 1 140px; }
.notice { background: #e8f1fb; border: 1px solid #b9d3ee; border-radius: var(--radius); padding: 10px 12px; }
.notice.error { background: #fdecea; border-color: #f2b8b5; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; letter-spacing: 1px; user-select: all; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tile .caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px 4px; }
.tile .caption strong { flex: 1 1 100%; }
.tile > .small-button { margin: 4px 10px 10px; align-self: flex-start; }
.tile.large { max-width: 960px; margin-bottom: 16px; }
.screen { position: relative; background: #111; aspect-ratio: 16 / 9; }
.screen video { width: 100%; height: 100%; display: block; object-fit: contain; }
.screen .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tile.playing .play { top: auto; bottom: 8px; left: auto; right: 8px; transform: none; opacity: 0.85; }
.tile.failed .screen { background: #3a1d1b; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.8rem; background: #eef2f6; color: var(--muted); }
.pill.ok { background: #e6f4ea; color: var(--ok); }
.pill.bad { background: #fdecea; color: var(--bad); }

.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; margin: 12px 0; }
.hour { text-align: center; padding: 6px 0; border-radius: 6px; font-size: 0.8rem; text-decoration: none; border: 1px solid var(--line); color: var(--muted); }
.hour.full { background: #e6f4ea; color: var(--ok); border-color: #b7dfc2; }
.hour.part { background: #fff6e0; color: #8a5a00; border-color: #f0d79a; }
.hour.none { pointer-events: none; opacity: 0.5; }
.playback { width: 100%; max-width: 960px; background: #111; border-radius: var(--radius); margin-bottom: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
tr.muted td { color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plain li form { flex: 1 1 240px; }
.problems { color: var(--bad); }
