:root {
  --bg: #f4f5f7; --card: #fff; --text: #1e2430; --muted: #6b7280; --line: #dde1e7;
  --accent: #2563eb; --accent-d: #1d4ed8; --danger: #dc2626; --ok: #16a34a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2128; --text: #e6e8ec; --muted: #9aa3b0; --line: #333a45; --accent: #4f8bff; --accent-d: #3b78f0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header h1 { margin: 0; font-size: 18px; }
nav button { background: none; border: 0; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
nav button.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.warn { color: #b45309; font-size: 12px; }
main { padding: 16px 20px; max-width: 1800px; margin: 0 auto; }
.hidden { display: none !important; }
.cols { display: flex; gap: 16px; align-items: flex-start; }
.col { flex: 1 1 0; min-width: 0; }
.col.wide { flex: 1.2 1 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 15px; }
.sticky { position: sticky; top: 64px; }
label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 13px; }
label.check { font-weight: 400; display: flex; gap: 6px; align-items: center; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
.mono, pre { font: 12px/1.5 Consolas, monospace; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }
.hint.inline { display: inline; margin: 0; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > div { flex: 1; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.actions.end { margin: 0; justify-content: flex-end; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent-d); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.danger { background: var(--danger); }
.btn.danger.secondary { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.status { color: var(--muted); font-size: 13px; }
.status.err, .error { color: var(--danger); }
.error { margin-top: 10px; white-space: pre-wrap; }
.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.seg button { flex: 1; background: transparent; border: 0; border-right: 1px solid var(--line); padding: 8px; font: inherit; color: var(--text); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--accent); color: #fff; }
.seg.small button { padding: 5px 4px; font-size: 13px; }
.docbox { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--bg); }
.docbox .t { font-weight: 600; }
.docbox .m { color: var(--muted); font-size: 12px; }
.docbox pre { max-height: 180px; overflow: auto; white-space: pre-wrap; margin: 8px 0 0; }
.articles { margin-top: 8px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.articles .a { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); align-items: center; }
.articles .a:last-child { border: 0; }
.articles .a .tt { flex: 1; }
.articles .a .st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.articles .a .st.ok { color: var(--ok); cursor: pointer; text-decoration: underline; }
.articles .a .st.err { color: var(--danger); }
.articles .a.sel { background: rgba(37, 99, 235, .1); }
.resultHead { display: flex; justify-content: space-between; align-items: baseline; }
.viewport { background: #e9ebef; border-radius: 6px; padding: 8px; }
iframe { width: 100%; height: 640px; border: 0; background: #fff; display: block; }
#tab-gen pre { max-height: 640px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 10px; border-radius: 6px; margin: 0; }
details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--bg); }
.ver { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-top: 10px; }
.ver pre { white-space: pre-wrap; margin: 6px 0 0; max-height: 200px; overflow: auto; }
@media (max-width: 1000px) { .cols { flex-direction: column; } .sticky { position: static; } .col, .col.wide { width: 100%; flex: none; } }
.grow { flex: 1; }
.authcard { max-width: 380px; margin: 60px auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }
