:root {
    --bg:#EEEEF7; --surface:#FFFFFF; --border:#DDDDF0;
    --text-1:#0A0A1E; --text-2:#6060A0; --text-3:#9090C0;
    --accent:#10A37F; --accent-soft:rgba(16,163,127,.12);
    --err:#EF4444; --ok:#10B981; --warn:#F59E0B; --info:#3B82F6;
}
@media (prefers-color-scheme:dark) {
    :root {
        --bg:#07070F; --surface:#111122; --border:#1C1C38;
        --text-1:#DCDCF4; --text-2:#7A7AA8; --text-3:#48487A;
        --accent:#19C37D; --accent-soft:rgba(25,195,125,.14);
    }
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:system-ui,-apple-system,'Segoe UI',sans-serif; background:var(--bg); color:var(--text-1); min-height:100vh; line-height:1.5; }
input, textarea, select, button { font:inherit; color:inherit; }
input, textarea, select {
    width:100%; padding:8px 11px; background:var(--bg); border:1.5px solid var(--border);
    border-radius:10px; outline:none; transition:border-color .15s;
}
input[type=checkbox] { width:auto; }
input:focus, textarea:focus, select:focus { border-color:var(--accent); }
textarea { resize:vertical; }
a { color:var(--accent); }
code { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.85em; background:var(--accent-soft); padding:1px 5px; border-radius:5px; }

.btn { border:none; border-radius:10px; padding:7px 13px; cursor:pointer; font-weight:600; font-size:.8125rem; transition:opacity .15s; background:var(--accent-soft); color:var(--accent); text-decoration:none; display:inline-block; white-space:nowrap; }
.btn:hover { opacity:.85; }
.btn:disabled { opacity:.4; cursor:default; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-danger { background:rgba(239,68,68,.1); color:var(--err); }

.card { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:18px 20px; margin-bottom:16px; }
.logo { font-size:1.375rem; font-weight:800; letter-spacing:-.02em; display:flex; align-items:center; gap:8px; }
.logo span { color:var(--accent); }
.logo-img { width:30px; height:30px; }
.subtitle { font-size:.875rem; color:var(--text-2); }
.muted { color:var(--text-3); }
.small { font-size:.75rem; }

.login-body { display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { width:100%; max-width:360px; padding:32px; display:flex; flex-direction:column; gap:14px; }
.alert { padding:10px 14px; border-radius:8px; font-size:.875rem; background:rgba(239,68,68,.1); color:var(--err); }
.back { text-align:center; font-size:.8125rem; color:var(--text-3); text-decoration:none; }

.wrap { max-width:1150px; margin:0 auto; padding:24px 16px 80px; }
header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
header nav { display:flex; gap:8px; flex-wrap:wrap; }
h2 { font-size:1.05rem; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.inline-form { display:flex; gap:8px; flex-wrap:wrap; }
.inline-form input { width:auto; min-width:150px; }
.grid-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; align-items:end; margin-bottom:14px; }
.grid-form label { display:flex; flex-direction:column; gap:4px; font-size:.75rem; color:var(--text-2); font-weight:600; }
.grid-form label.check { flex-direction:row; align-items:center; gap:6px; padding-bottom:8px; }
.grid-form .wide { grid-column:1 / -1; }
.thumbs { display:flex; gap:8px; flex-wrap:wrap; }
.output img { display:block; max-width:100%; max-height:420px; margin-top:10px; border-radius:10px; }
.live-info { font-size:.8125rem; color:var(--text-2); margin-bottom:10px; }
.live-shot { display:block; width:100%; border-radius:10px; border:1px solid var(--border); }
.live-shot[hidden] { display:none; }
.thumbs:empty { display:none; }
.thumbs img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid var(--border); }
.notice { font-size:.8125rem; color:var(--text-2); background:var(--accent-soft); border-radius:10px; padding:10px 14px; margin-bottom:12px; }

.status-bar { display:flex; align-items:center; gap:8px; justify-content:space-between; font-size:.875rem; flex-wrap:wrap; }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot.ok { background:var(--ok); } .dot.err { background:var(--err); }

.table { width:100%; border-collapse:collapse; font-size:.8125rem; }
.table th { text-align:left; font-size:.6875rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); padding:6px 8px; border-bottom:1px solid var(--border); }
.table td { padding:9px 8px; border-bottom:1px solid var(--border); vertical-align:top; }
.table tr.revoked td { opacity:.55; }
.table td.actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.table.small td { padding:6px 8px; }
.log-content pre { white-space:pre-wrap; font-size:.75rem; margin-top:6px; max-height:300px; overflow:auto; }
@media (max-width:760px) { .table { display:block; overflow-x:auto; } }

.badge { display:inline-block; font-size:.6875rem; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--accent-soft); color:var(--text-2); }
.badge.ok { background:rgba(16,185,129,.14); color:var(--ok); }
.badge.warn { background:rgba(245,158,11,.14); color:var(--warn); }
.badge.err { background:rgba(239,68,68,.12); color:var(--err); }
.badge.info { background:rgba(59,130,246,.12); color:var(--info); }

.output { white-space:pre-wrap; word-break:break-word; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.8125rem; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:12px; max-height:480px; overflow:auto; }

.modal { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:10; }
.modal[hidden], .toast[hidden] { display:none; }
.modal-card { max-width:560px; width:100%; display:flex; flex-direction:column; gap:12px; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--text-1); color:var(--bg); padding:10px 18px; border-radius:10px; font-size:.875rem; z-index:20; max-width:90vw; }
.toast.error { background:var(--err); color:#fff; }

.doc { max-width:900px; }
.doc h2 { margin:26px 0 10px; font-size:1.2rem; }
.doc h3 { margin:18px 0 6px; font-size:1rem; }
.doc p, .doc li { font-size:.9rem; color:var(--text-1); }
.doc ul { padding-left:20px; margin:6px 0; }
.doc table { width:100%; border-collapse:collapse; font-size:.8125rem; margin:10px 0; }
.doc th, .doc td { border:1px solid var(--border); padding:6px 8px; text-align:left; vertical-align:top; }
.doc th { background:var(--accent-soft); }
.tag { font-size:.6875rem; font-weight:700; padding:1px 7px; border-radius:999px; }
.tag.ok { background:rgba(16,185,129,.14); color:var(--ok); }
.tag.warn { background:rgba(245,158,11,.14); color:var(--warn); }
.tag.err { background:rgba(239,68,68,.12); color:var(--err); }
