:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1d2430; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f5fbf; --accent-text: #ffffff; --danger: #b42318; --ok: #157f3b; --warn: #a15c00;
  --chip-ok: #e6f4ea; --chip-warn: #fff4e0; --chip-bad: #fdeceb; --chip-off: #eef0f3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
h1 { font-size: 18px; margin: 0; }
h1 .sub { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 14px 0 6px; }
.tenant-bar { display: flex; gap: 8px; }
.banner { background: #fff4e0; color: var(--warn); padding: 8px 24px; font-weight: 600; border-bottom: 1px solid #f3d9a8; }
.hidden { display: none; }
.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { white-space: nowrap; flex: none; background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 14px; font-weight: 600; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
main { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.tight { gap: 10px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } main, header { padding-left: 16px; padding-right: 16px; } }
label { display: block; font-weight: 600; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
label.check { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 13px; font-weight: 400; }
label.check input { margin-top: 3px; flex: none; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--text); background: #fff; }
input[type=checkbox] { width: auto; margin: 0; }
textarea { font: 12px/1.4 ui-monospace, Menlo, monospace; }
label.file input { padding: 6px; }
select { width: auto; min-width: 0; max-width: 100%; margin: 0; }
.tenant-bar { min-width: 0; max-width: 100%; }
.tenant-bar select { flex: 1; min-width: 0; }
.tenant-bar button { white-space: nowrap; }
button { background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 6px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
button.ghost { background: #fff; color: var(--accent); }
button.danger { color: var(--danger); border-color: var(--danger); }
button.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code { background: var(--chip-off); padding: 1px 5px; border-radius: 4px; font-size: 12px; word-break: break-all; }
.steps li { margin-bottom: 8px; }
.checks, .problems { list-style: none; padding: 0; margin: 10px 0 0; }
.checks li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.checks li.bad::before { content: "✗ "; color: var(--danger); }
.problems li { color: var(--danger); }
.problems li::before { content: "⚠ "; }
.preview { border: 1px dashed var(--line); border-radius: 6px; padding: 14px; background: #fff; overflow-x: auto; min-height: 60px; color: #000; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tbody tr.clickable:hover { background: #f8fafc; cursor: pointer; }
tr.off td { color: var(--muted); }
.ov { color: var(--accent); font-weight: 600; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--chip-off); color: var(--muted); }
.chip.ok { background: var(--chip-ok); color: var(--ok); }
.chip.warn { background: var(--chip-warn); color: var(--warn); }
.chip.bad { background: var(--chip-bad); color: var(--danger); }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 20px; width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, .35); }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2430; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); }

.login { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.login.hidden { display: none; }
.login-card { width: min(380px, 100%); }
.login-card h1 { margin-bottom: 4px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.hub-card { cursor: pointer; margin: 0; }
.hub-card:hover { border-color: var(--accent); }
.hub-card h3 { font-size: 15px; margin: 0 0 6px; }
.hub-card .row { margin-top: 8px; }

label.file.inline { display: inline-block; margin: 4px 0 0; }
