:root {
  --ink: #1b1916;
  --muted: #5c564e;
  --line: #d9d2c6;
  --bg: #f3eee6;
  --card: #fffcf7;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.35 "Segoe UI", sans-serif;
}

.gate { display: grid; place-items: center; min-height: 100vh; }
.panel header, .panel main { width: min(760px, calc(100% - 24px)); margin: 0 auto; }
.panel header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 8px;
}
.panel header form { margin-left: auto; }
.panel main { display: grid; gap: 10px; padding-bottom: 24px; }
.bar, section, .gate .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.bar { display: grid; gap: 8px; }
.head, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.grid4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
h1, h2, p { margin: 0; }
h2 { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
#status-line, .meta, .hint { color: var(--muted); }
.hint { min-height: 1.2em; }
.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8e1d4;
  font-size: 12px;
  font-weight: 600;
}
.pill.tests { background: #dce8d6; color: #2f5d28; }
.pill.reveille { background: #e8e1d4; }
.pill.sommeil { background: #e8d6d4; color: #6a2f28; }
.pill.campagne,
.pill.actif { background: #d6e4f0; color: #1d4f7a; }
.pill.auto { background: #e8e1d4; color: #4a4035; }
.row-play .play { min-width: 7rem; font-weight: 600; }
.row-play .pause { min-width: 7rem; }
.steps {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}
.steps li { margin: 2px 0; }
.block-title {
  margin: 4px 2px 0;
  font-size: 15px;
  font-weight: 700;
}
#launch { padding: 8px 14px; font-weight: 700; }
#launch:disabled, #stop:disabled { opacity: 0.45; cursor: default; }
.mark { margin: 0 0 4px; font-weight: 700; }
.gate h1 { font-size: 22px; margin-bottom: 10px; }
.gate .card { width: min(320px, calc(100% - 24px)); display: grid; gap: 10px; }
label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.switch { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 600; }
input, button { font: inherit; border-radius: 6px; }
input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
button {
  padding: 6px 10px;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
#log, #like-recent { margin: 6px 0 0; padding-left: 16px; max-height: 140px; overflow: auto; }
.stats { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.stats th, .stats td { text-align: left; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.stats th { color: var(--muted); font-weight: 600; }
.lock-msg { color: #9a2f12; }
.is-off { opacity: 0.45; pointer-events: none; }
@media (max-width: 520px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
}
