/* Page chrome shared by the stack-of-panels pages — Settings, Announcements,
   and (ported from Chess Bender, where they linked this same file) Pro and
   Admin: the sticky title bar, panels, buttons, hints, rows, labels and form
   fields. Colours come from theme.css.

   The name is Chess Bender's — it began as the chrome of its board demo page
   and every screen came to link it. Kept so a page ported from there keeps its
   <link href="demo.css">. Ported 2026-10-01 without the board scaffolding (the
   board column, the resize grip, the move list, the opening name). */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 1rem/1.5 var(--ui-font); /* 16px — 14px until the 2026-10-13 redesign */
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1.125rem;
  background: var(--ui-panel);
  border-bottom: 1px solid var(--ui-line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 800; letter-spacing: 0.02em; font-size: 1rem; font-family: var(--ui-display); }
.grow { flex: 1; }

/* ── panels ─────────────────────────────────────────────────────────────── */

.panel {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg, 1.375rem);
  padding: 1.25rem 1.375rem;
  margin-bottom: 1rem;
}

/* A panel's title: a heading, not the small grey capitals it was. */
.panel h2 {
  margin: 0 0 0.75rem;
  font: 800 1.1875rem/1.25 var(--ui-display, var(--ui-font));
  color: var(--ui-text);
}

.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.625rem;
}

.row.wrap { flex-wrap: wrap; }

.hint {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ui-dim);
  min-height: 1em;
}

.hint.err { color: var(--learn-wrong); }
.hint.ok { color: var(--learn-right); }

/* ── controls ───────────────────────────────────────────────────────────── */

.btn {
  background: var(--ui-btn);
  color: var(--ui-text);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 0.5rem 0.9375rem;
  font: inherit;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) { .btn:hover { background: var(--ui-btn-hover); } }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* The main button: raised on its own darker edge, and pressed down when clicked. */
.btn.primary {
  background: var(--ui-accent-fill, var(--ui-accent));
  color: var(--ui-accent-text);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--ui-accent-deep, transparent);
}
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ui-accent-deep, transparent); }

@media (hover: hover) { .btn.primary:hover { filter: brightness(1.08); } }

/* Smaller, for toolbars. Chess Bender defined this in the screens' own
   stylesheets; it is here now, with the button it modifies. */
.btn.small { padding: 0.375rem 0.75rem; font-size: 0.875rem; }

.btn.danger { color: var(--learn-wrong); border-color: var(--learn-wrong); }
@media (hover: hover) { .btn.danger:hover { background: var(--learn-wrong); color: var(--ui-btn); } }

/* One-line boxes look like the rest (they were the browser's own until 2026-10-13). */
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="url"] {
  background: var(--ui-input-bg);
  color: var(--ui-text);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
}

textarea, select {
  width: 100%;
  background: var(--ui-input-bg);
  color: var(--ui-text);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 0.625rem 0.75rem;
  font: 0.875rem/1.5 var(--ui-mono);
  resize: vertical;
}

select {
  width: auto;
  font-family: var(--ui-font);
  font-size: 0.9375rem; /* 15px */
  padding: 0.5rem 0.625rem;
}

textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--ui-accent);
  outline-offset: -1px;
}

/* A small uppercase label above a control. */
.minilabel {
  display: block;
  font-size: max(0.8125rem, var(--text-min)); /* 13px */
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ui-dim);
  margin: 0.5rem 0 0.25rem;
}
