[hidden] { display: none !important; }
:root {
  --bg: #F1EFE8;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #5d6576;
  --brand: #4269E2;
  --brand-ink: #ffffff;
  --line: #ddd8cc;
  --warn: #a4471a;
  --ok: #2f7a3e;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  min-height: 100vh; display: flex; flex-direction: column;
}
input, textarea, select { -webkit-user-select: text; user-select: text; font: inherit; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.nav { display: flex; gap: 14px; }
.nav a { color: var(--brand); text-decoration: none; font-weight: 600; font-size: 15px; }
.view { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.crumbs { font-size: 14px; margin-bottom: 8px; }
.crumbs a { color: var(--brand); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--ink); text-decoration: none; }
.tile b { display: block; font-size: 17px; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 14px; }
.tile.off { opacity: .55; pointer-events: none; }
.list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a, .list .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.gate { border-left: 6px solid var(--warn); }
.gate h2 { color: var(--warn); margin-top: 0; }
.ok { color: var(--ok); font-weight: 700; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.doc blockquote { margin: 8px 0; padding: 6px 12px; border-left: 4px solid var(--brand); background: #f6f8ff; }
.doc img { max-width: 100%; }
.pages img { display: block; width: 100%; height: auto; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  -webkit-user-drag: none; pointer-events: none; }
.tool { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ask { display: flex; flex-direction: column; gap: 8px; }
.ask textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.msg { padding: 10px 12px; border-radius: 10px; margin: 6px 0; white-space: pre-wrap; }
.msg.user { background: #e8edfc; }
.msg.assistant { background: var(--card); border: 1px solid var(--line); }
.cites { font-size: 14px; margin-top: 6px; }
.cites a { color: var(--brand); }
.agree { max-height: 50vh; overflow: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
table.admin th, table.admin td { border: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.form { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.form input { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.form .full { grid-column: 1 / -1; }
.checks label { margin-right: 12px; white-space: nowrap; }
.wm { position: fixed; inset: 0; z-index: 1000; pointer-events: none; background-repeat: repeat; opacity: 1; }
@media print { body * { display: none !important; } body::after { content: "Printing is disabled for the AES Field Hub."; display: block; } }

/* ---------- Training (Level 1) ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #e8edfc; color: var(--brand); white-space: nowrap; vertical-align: middle; }
.pill.ok { background: #e3f1e5; color: var(--ok); }
.pill.warn { background: #f8e9e1; color: var(--warn); }
.pill.soon { background: #ece9e1; color: var(--muted); }
.step h2 { margin-top: 0; }
.small { font-size: 14px; }
.tvid { display: block; width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.tick { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.tick input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
fieldset.q { border: 1px solid var(--line); }
fieldset.q legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
fieldset.q.unsaved { border-left: 6px solid var(--warn); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.opt:has(input:checked) { border-color: var(--brand); background: #f3f6ff; }
.progress { position: sticky; top: 56px; z-index: 10; background: var(--bg); padding: 6px 0; font-weight: 700; }
