:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c2230; --muted: #667085; --line: #e3e6ec;
  --accent: #2f6fed; --accent-ink: #fff; --ok: #1f8a4c; --ok-bg: #e6f4ec; --wait: #8a5a00; --wait-bg: #fdf3dc;
  --bad: #c0362c; --field: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b2029; --ink: #e7eaf0; --muted: #98a2b3; --line: #2c3340;
    --accent: #5b8ff9; --accent-ink: #0b1020; --ok: #5fd08e; --ok-bg: #173226; --wait: #f0c060; --wait-bg: #3a2f14;
    --bad: #ff7b70; --field: #12151b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 24px; }
.top { max-width: 1040px; margin: 0 auto; padding: 20px 16px; display: flex; justify-content: space-between; align-items: center; }
.brand { color: var(--ink); text-decoration: none; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--accent); }
.lock { width: 18px; height: 18px; display: inline-block; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 16px 32px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 18px; }
.narrow { max-width: 560px; margin: 40px auto; }
.center { text-align: center; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid .card { margin-bottom: 0; }
.grid + .card { margin-top: 18px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .narrow { margin: 16px auto; } }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 8px; }
label.inline input, label.inline select { display: inline-block; width: auto; margin: 0; }
input[type=number] { width: 72px !important; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
button { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--muted); padding: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input[type=text] { flex: 1; min-width: 180px; margin: 0; }
form .row + .row { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 17px; font-weight: 600; padding: 10px 14px; background: var(--bg); border-radius: 8px; }
.msg { min-height: 1.2em; margin: 10px 0 0; color: var(--bad); font-size: 14px; }
.msg.ok { color: var(--ok); }
.result, .out { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.out textarea { margin-bottom: 10px; }
.copied { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--ok-bg); }
.copied p { margin: 0 0 10px; color: var(--ok); }
details.gen { margin: -4px 0 14px; }
details.gen summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.gen-box { margin-top: 10px; padding: 12px; background: var(--bg); border-radius: 8px; }
.gen-box .row + .row { margin-top: 10px; }
table { width: 100%; border-collapse: collapse; }
td { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:first-child td { border-top: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button { margin-left: 4px; }
tr.opened td { border-top: 0; padding-top: 0; }
tr.opened textarea { margin-bottom: 8px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.who { margin-top: 4px; }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
@media (max-width: 600px) {
  td { display: block; border-top: 0; padding: 4px 0; }
  tr[data-id] td:first-child { border-top: 1px solid var(--line); padding-top: 12px; }
  td.actions { text-align: left; }
  td.actions button { margin: 4px 4px 0 0; }
}
