:root {
  --navy: #003e79; --on-navy: #fff; --accent: #1f7fd1; --on-accent: #fff;
  --navy-2: color-mix(in srgb, var(--navy) 82%, white); --accent-d: color-mix(in srgb, var(--accent) 85%, black);
  --bg: #f5f7fb; --card: #fff; --text: #1b2333; --muted: #667085; --line: #e3e8f0;
  --ok: #1a7f4b; --ok-bg: #e5f5ec; --warn: #9a6200; --warn-bg: #fff4dd; --bad: #b42318; --bad-bg: #fde8e7;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--navy-2); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; } h2 { font-size: 1.25rem; margin: 1.4em 0 .6em; } h3 { font-size: 1.05rem; margin: 1em 0 .4em; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 12px; }

.topbar { background: var(--navy); color: var(--on-navy); display: flex; align-items: center; gap: 16px; padding: 0 16px; min-height: 56px; position: sticky; top: 0; z-index: 10; }
.brand { color: var(--on-navy); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 1.05rem; white-space: nowrap; }
.brand-logo { height: 34px; max-width: 180px; object-fit: contain; display: block; }
.brand-logo.big { height: 64px; max-width: 260px; margin: 0 auto; }
.logo-band { background: var(--navy); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.logo-preview { background: var(--navy); border-radius: 8px; padding: 16px; display: grid; place-items: center; min-height: 90px; margin-bottom: 10px; }
.logo-preview img { max-height: 70px; max-width: 100%; }
.logo { background: var(--accent); color: var(--on-accent); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; }
#nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
#nav a, #nav button { color: var(--on-navy); opacity: .85; text-decoration: none; padding: 8px 10px; border-radius: 8px; background: none; border: 0; font: inherit; cursor: pointer; }
#nav a:hover, #nav button:hover { background: color-mix(in srgb, var(--on-navy) 10%, transparent); opacity: 1; }
#nav a.active { background: color-mix(in srgb, var(--on-navy) 16%, transparent); opacity: 1; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: var(--on-navy); font-size: 1.4rem; cursor: pointer; }
@media (max-width: 1120px) {
  .menu-btn { display: block; }
  #nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px; }
  #nav.open { display: flex; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { margin-top: 0; }
a.card { display: block; text-decoration: none; color: inherit; } a.card:hover { border-color: var(--navy-2); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .n { font-size: 1.7rem; font-weight: 700; color: var(--navy); } .tile .l { color: var(--muted); font-size: .85rem; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: var(--on-navy); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); } .btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: #fff; color: var(--navy); } .btn.secondary:hover { background: #eef2f8; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } .btn.accent:hover { background: var(--accent-d); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f1b4ae; } .btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

form .field { margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; font: inherit; background: #fff; color: inherit; }
textarea { min-height: 180px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db7e0; border-color: var(--navy-2); }
.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
.inline-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.auth-wrap { max-width: 420px; margin: 6vh auto; }
.auth-wrap .brand-big { text-align: center; margin-bottom: 18px; }
.auth-wrap .brand-big .logo { width: 54px; height: 54px; font-size: 1.8rem; margin: 0 auto 10px; border-radius: 14px; }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert.error { background: var(--bad-bg); color: var(--bad); } .alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.info { background: #e8effa; color: var(--navy-2); }

.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eef2f8; color: var(--navy-2); font-weight: 600; white-space: nowrap; }
.badge.beginner { background: #e5f5ec; color: #1a7f4b; } .badge.intermediate { background: #e8effa; color: #1d4ed8; }
.badge.advanced { background: #fff4dd; color: #9a6200; } .badge.expert { background: #fde8e7; color: #b42318; }
.badge.completed, .badge.active { background: var(--ok-bg); color: var(--ok); } .badge.in_progress, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.rejected, .badge.disabled { background: var(--bad-bg); color: var(--bad); } .badge.draft { background: #eee; color: #555; }

.bar { height: 8px; background: #e9edf4; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-2)); }
.bar.done > span { background: var(--ok); }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfd; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f7f9fc; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-color: var(--accent); font-weight: 600; }

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { border-bottom: 1px solid var(--line); }
.lesson-list a { display: flex; gap: 10px; padding: 10px 4px; text-decoration: none; color: inherit; align-items: center; }
.lesson-list a:hover { background: #f7f9fc; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd6e2; display: grid; place-items: center; font-size: .8rem; flex: none; }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }

.prose { line-height: 1.7; } .prose img { max-width: 100%; } .prose pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow: auto; }
.prose code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; } .prose pre code { background: none; padding: 0; }
.prose table { border: 1px solid var(--line); } .prose blockquote { border-left: 4px solid var(--accent); margin: 0; padding: 4px 14px; background: #fffaf3; }
.video { position: relative; padding-top: 56.25%; margin: 12px 0; } .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
video { max-width: 100%; border-radius: 8px; }

.question { margin-bottom: 18px; } .question .opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; font-weight: normal; cursor: pointer; }
.question .opt:hover { background: #f7f9fc; } .question.right { border-left: 4px solid var(--ok); padding-left: 10px; } .question.wrong { border-left: 4px solid var(--bad); padding-left: 10px; }

.editor-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: #fff; }
.editor-item summary { cursor: pointer; font-weight: 600; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--on-navy); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 50; max-width: 90vw; }
.toast.error { background: var(--bad); }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; width: 200px; }


/* ---------- Home ---------- */
.sections { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
a.section-tile { display: flex; gap: 14px; align-items: center; }
.section-tile h3 { margin: 0 0 2px; }
.section-icon { font-size: 1.9rem; width: 52px; height: 52px; border-radius: 12px; background: #eef2f8; display: grid; place-items: center; flex: none; }

/* ---------- Compliance ---------- */
.stack > .field { margin-bottom: 0; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; box-shadow: 0 -4px 14px rgba(16,24,40,.08); }
form .sticky-actions, .sticky-actions:not(.card) { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; flex-wrap: wrap; }
[data-save-status].error, .error[data-save-status] { color: var(--bad); }
input[type=date], input[type=search], input[type=time] { width: 100%; padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; font: inherit; background: #fff; color: inherit; }
.stack textarea, .field textarea[data-k], .check-comment { font-family: inherit; }

.photo-strip { display: flex; flex-direction: column; gap: 8px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #eef2f8; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(17,24,39,.75); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }

.sig { position: relative; border: 1px dashed #b8c2d3; border-radius: 8px; background: #fff; max-width: 520px; touch-action: none; }
.sig canvas { display: block; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #b8c2d3; pointer-events: none; font-size: 1.1rem; }
.sig-clear { position: absolute; right: 8px; top: 6px; }

details.folder { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.folder summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; }
details.folder summary::-webkit-details-marker { display: none; }
details.folder[open] summary { border-bottom: 1px solid var(--line); }
details.folder > :not(summary) { margin-left: 14px; margin-right: 14px; }
.file-list { list-style: none; padding: 0; margin: 8px 0; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.file-list li:last-child { border-bottom: 0; }
.file-list a { word-break: break-word; }
.file-actions { white-space: nowrap; }
.file-actions label.linkbtn { cursor: pointer; display: inline; margin: 0; font-weight: normal; }
.file-list li.folder-form { justify-content: flex-start; align-items: center; }
.file-list li.folder-form .small { margin-left: auto; }
.folder-actions { margin-bottom: 12px; gap: 8px; }
details.folder .new-form { margin-bottom: 12px; background: var(--bg, #f5f7fa); }
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.video-status { margin: -4px 0 12px; }
.prose video + .video-status { margin-top: 6px; }
.vchip { margin-left: 8px; font-size: .75rem; }
.vc-video .chips, .vc-q .chips { margin: 4px 0 10px; }
.vc-video label.chip-btn { cursor: pointer; font-weight: normal; }

.snag { border-left: 4px solid var(--line); }
.snag:has(.pr-high) { border-left-color: var(--bad); } .snag:has(.pr-medium) { border-left-color: #e0a100; } .snag:has(.pr-low) { border-left-color: var(--ok); }
select.pill { width: auto; border-radius: 99px; padding: 5px 12px; font-weight: 600; font-size: .85rem; }
.pr-high { background: var(--bad-bg); color: var(--bad); border-color: #f1b4ae; }
.pr-medium { background: var(--warn-bg); color: var(--warn); border-color: #f0d49a; }
.pr-low { background: var(--ok-bg); color: var(--ok); border-color: #a9dcc0; }

.risk-row { gap: 8px; }
select.score { width: auto; padding: 5px 8px; }
.risk { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.risk.low { background: var(--ok-bg); color: var(--ok); } .risk.medium { background: var(--warn-bg); color: var(--warn); } .risk.high { background: var(--bad-bg); color: var(--bad); }
.step { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.step textarea { flex: 1; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-weight: 700; flex: none; margin-top: 6px; }
.step-tools { display: flex; flex-direction: column; gap: 2px; }
.step-tools .linkbtn { text-decoration: none; font-size: 1.1rem; padding: 0 6px; }
.ppe { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; background: #fff; }
.chip:has(input:checked) { background: #e8effa; border-color: var(--navy-2); color: var(--navy); font-weight: 600; }

.form-heading { margin: 1.2em 0 .2em; padding-bottom: 4px; border-bottom: 2px solid var(--accent); font-size: 1.1rem; }
.form-heading:first-child { margin-top: 0; }
.req { color: var(--bad); margin-left: 3px; }
.check-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; }
.check-item .check-comment { grid-column: 1 / -1; padding: 7px 10px; border: 1px solid #e3e8f0; border-radius: 8px; font: inherit; font-size: .9rem; }
.check-q { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid #cfd6e2; border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-left: 1px solid #cfd6e2; background: #fff; color: var(--muted); }
.seg label:first-child span { border-left: 0; }
.seg input:focus-visible + span { outline: 2px solid #9db7e0; outline-offset: -2px; }
.seg-yes input:checked + span, .seg-pass input:checked + span { background: var(--ok); color: #fff; }
.seg-no input:checked + span, .seg-fail input:checked + span { background: var(--bad); color: #fff; }
.seg-na input:checked + span { background: #667085; color: #fff; }
.seg input:disabled + span { cursor: default; }
#score { font-weight: 600; }

/* ---------- Standards ---------- */
.search-card { margin-bottom: 8px; }
.search-row { display: flex; gap: 10px; margin-bottom: 6px; }
.search-row input { flex: 3; } .search-row select { flex: 2; width: auto; }
.cat-head { color: var(--muted); text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.std-card h3 { margin: 6px 0; } .std-card h3 a { text-decoration: none; color: var(--navy); }
.hit-doc { margin-bottom: 12px; } .hit-doc h3 { margin-bottom: 6px; }
a.hit { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
a.hit:hover .hit-text { color: var(--navy); }
.hit-page { flex: none; width: 64px; font-size: .8rem; font-weight: 700; color: var(--navy-2); padding-top: 2px; }
.hit-text { font-size: .92rem; }
mark { background: #ffe58a; color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- Admin builder ---------- */
.builder-field { margin-bottom: 10px; padding: 12px 14px; }
.builder-field.is-heading { background: #f3f6fb; border-left: 4px solid var(--accent); }
.builder-field .field { margin-bottom: 8px; }
.builder-field textarea { min-height: 70px; font-family: inherit; }
.builder-field .check { margin-top: 26px; }
.builder-field .field.grow, .inline-fields .field.grow { grid-column: span 2; }
.add-field { gap: 6px; margin: 6px 0 4px; }
.pack-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.pack-row input { flex: 1; }
.folder-icon { font-size: 1.2rem; }


/* ---------- Devices gallery ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); }
.chip-btn.on { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.g-item { position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #e9edf4; cursor: pointer; aspect-ratio: 4 / 3; text-align: left; font: inherit; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item:hover img { transform: scale(1.03); } .g-item img { transition: transform .2s; }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; display: flex; flex-direction: column; font-size: .85rem; line-height: 1.3; }
.g-cap span { opacity: .85; font-size: .78rem; }
body.no-scroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(10,15,25,.86); display: grid; place-items: center; padding: 16px; }
.lb-inner { background: var(--card); border-radius: var(--radius); width: min(1000px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.lb-close { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.lb-img { position: relative; background: #111; display: grid; place-items: center; min-height: 200px; }
.lb-img img { max-width: 100%; max-height: 65vh; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); font-size: 1.6rem; cursor: pointer; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.lb-info { padding: 12px 16px 16px; } .lb-info h3 { margin: 0 0 4px; }
.lb-edit { margin-top: 12px; }
#picked .thumb { width: 84px; height: 84px; }

/* ---------- Admin: backups and job pack ---------- */
.steps { padding-left: 20px; margin: 0; } .steps li { margin-bottom: 6px; }
.pack-group { margin-top: 12px; }
.pack-group .file-list li { align-items: center; }
code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; font-size: .85em; word-break: break-word; }
.help-note { background: #f3f6fb; border-left: 4px solid var(--accent); }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .container { padding: 16px 12px 48px; }
  h1 { font-size: 1.4rem; }
  /* 16px stops iPhones zooming in when a field is tapped */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea { font-size: 16px; }
  .btn { min-height: 44px; justify-content: center; }
  .btn.sm { min-height: 40px; padding: 6px 12px; }
  .linkbtn { padding: 8px 0; }
  .grid, .tiles { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .inline-fields { grid-template-columns: 1fr; }
  .inline-fields .field { max-width: none !important; }
  .row.spread > .row { width: 100%; }
  .question .opt { padding: 12px; }
  .question .opt input { width: 20px; height: 20px; flex: none; }
  input[type=radio], input[type=checkbox] { width: 20px; height: 20px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
  #nav a, #nav button { padding: 12px 14px; text-align: left; }

  /* Tables become a stack of cards */
  .table-wrap { border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap table { background: none; }
  .table-wrap thead, .table-wrap tr:has(> th) { display: none; }
  .table-wrap tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
  .table-wrap td { border: 0; padding: 6px 0; display: flex; gap: 12px; align-items: center; min-width: 0 !important; }
  .table-wrap td[data-label]::before { content: attr(data-label); flex: 0 0 38%; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
  .table-wrap td:first-child { font-size: 1.02rem; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td > select { flex: 1; }
  .table-wrap td > .bar, .table-wrap td > div { flex: 1; }
  .table-wrap td:empty { display: none; }
  .table-wrap td.right { justify-content: flex-start; }
  .table-wrap td.empty { display: block; }

  .sections { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; } .search-row select { width: 100%; }
  .check-item { grid-template-columns: 1fr; }
  .seg { display: flex; } .seg label { flex: 1; text-align: center; } .seg span { padding: 11px 6px; }
  .thumb { width: calc(33.3% - 6px); height: auto; aspect-ratio: 1; }
  .builder-field .field.grow, .inline-fields .field.grow { grid-column: auto; }
  .pack-row .btn.sm { min-width: 40px; padding: 6px; }
  .sticky-actions { position: static; box-shadow: var(--shadow); }
  .sticky-actions .btn { flex: 1; }
  .sticky-actions [data-save-status] { flex-basis: 100%; order: -1; }
  .builder-field .check { margin-top: 0; }
  .hit-page { width: 52px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lightbox { padding: 0; }
  .lb-inner { border-radius: 0; height: 100%; }
  .lb-img img { max-height: 55vh; }
}

/* Accounts, email and server */
.temp-pw code.pw { font-size: 1.1rem; background: #f2f4f7; padding: 4px 8px; border-radius: 6px; letter-spacing: .5px; user-select: all; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 0; width: 38%; vertical-align: top; }
table.kv td { padding: 6px 0; word-break: break-word; }

/* Training structure */
.section-head { margin: 14px 0 8px; font-size: 1rem; color: var(--navy); }
.req-picker { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.req-group { margin-top: 10px; }
.req-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.req-list.courses { max-height: 220px; overflow: auto; flex-direction: column; flex-wrap: nowrap; }
.req-opt { font-weight: normal; margin: 0; }
.resume-note { margin: 4px 0 10px; }
.btn.disabled { opacity: .55; pointer-events: none; }

/* Admin → Logs */
pre.log { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: #f4f6fa; border-radius: 6px; padding: 8px; margin: 6px 0 0; max-height: 320px; overflow: auto; color: #1f2937; }
.log-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-height: 420px; overflow: auto; padding: 10px; }
.log-line { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.log-line.warn { color: #9a6700; } .log-line.error { color: var(--bad); }
table.mail-log td { vertical-align: top; overflow-wrap: anywhere; }
#logFilter select { width: auto; max-width: 100%; }
.log-line, pre.log { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .table-wrap table.mail-log td:last-child { display: block; }
  .table-wrap table.mail-log td:last-child::before { display: none; }
  .table-wrap table.mail-log td:last-child > * { margin-top: 4px; }
}
