:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #dde1e8;
  --accent: #1f5eff; --ok: #137a3a; --bad: #b42318; --warn: #a15c00;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #111827; color: #fff; }
header.top a { color: #fff; text-decoration: none; }
header.top nav { display: flex; gap: 16px; align-items: center; }
header.top .muted { color: #aab1c0; }
.brand { font-weight: 700; }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 24px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.crumbs { color: var(--muted); margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin: 16px 0; }
.card.narrow { max-width: 460px; margin: 40px auto; }
label { display: block; margin: 12px 0; font-weight: 500; }
label.choice { font-weight: 400; margin: 6px 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 0.9rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px 12px; margin: 16px 0; }
fieldset[disabled] { opacity: 0.6; border: 0; padding: 0; }
legend { font-weight: 600; padding: 0 6px; }
button, .button {
  display: inline-block; padding: 8px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none;
}
button.secondary, .button.secondary { background: #e8ebf1; color: var(--text); }
button.danger { background: var(--bad); }
button.small { padding: 4px 10px; font-size: 0.85rem; background: #e8ebf1; color: var(--text); }
button.link { background: none; color: #fff; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.row input { width: auto; flex: 1; margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef1f5; font-weight: 600; font-size: 0.9rem; }
tr.dim td { color: var(--muted); }
td.actions { white-space: nowrap; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; background: #e8ebf1; }
.tag.ok { background: #e3f4e8; color: var(--ok); }
.tag.bad { background: #fde7e5; color: var(--bad); }
.tag.warn { background: #fdf0dc; color: var(--warn); }
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; background: #e3f4e8; color: var(--ok); }
.flash.error { background: #fde7e5; color: var(--bad); }
.flash.warn { background: #fdf0dc; color: var(--warn); }
.flash ul { margin: 0; padding-left: 18px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; }
code.wrap { white-space: pre-wrap; word-break: break-all; font-size: 0.8rem; }
pre { background: #111827; color: #e5e7eb; padding: 12px; border-radius: 8px; overflow-x: auto; }
pre.secret-box { font-size: 1rem; user-select: all; word-break: break-all; white-space: pre-wrap; }
.secret { user-select: all; word-break: break-all; }
img.qr { display: block; margin: 12px auto; background: #fff; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.binding { border-top: 1px solid var(--line); padding: 8px 0; }
.indent { margin-left: 24px; }
.danger-zone { border-color: #f3c3be; }
form.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; padding: 12px 16px; }
form.filters label { margin: 6px 0; font-size: 0.9rem; }
.filter-actions { display: flex; gap: 12px; align-items: center; margin: 6px 0; }
table.activity { font-size: 0.88rem; }
table.activity tr.failed td { background: #fff7f6; }
.error-text { color: var(--bad); word-break: break-word; }
.nowrap { white-space: nowrap; }
