:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f6feb; --accent-text: #fff; --danger: #c62828; --ok-bg: #e8f5e9; --err-bg: #fdecea;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2128; --text: #e6e8eb; --muted: #9aa3ad; --line: #2c323b;
    --accent: #4c8dff; --danger: #ef5350; --ok-bg: #1f3324; --err-bg: #3a2020; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.top { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
nav a { text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 460px; }
.card.danger { border-color: var(--danger); }
dl { margin: 0 0 .8rem; } dt { color: var(--muted); font-size: .85rem; } dd { margin: 0 0 .4rem; overflow-wrap: anywhere; }
label { display: block; margin: .6rem 0 .2rem; font-weight: 600; }
.label { display: block; margin: .6rem 0 .2rem; font-weight: 600; }
label.check { font-weight: normal; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem;
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.help { display: block; color: var(--muted); margin-bottom: .4rem; }
.field { margin-bottom: .4rem; }
button, .button { display: inline-block; margin-top: .8rem; padding: .5rem 1rem; font: inherit; font-weight: 600;
  color: var(--accent-text); background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; }
button.small, .button.small { padding: .3rem .8rem; font-size: .9rem; }
button.danger { background: var(--danger); }
button.link { background: none; color: var(--accent); padding: 0; margin: 0; font-weight: normal; }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); }
.muted, tr.muted td { color: var(--muted); }
.flash { padding: .6rem .9rem; border-radius: 6px; background: var(--ok-bg); }
.flash.error { background: var(--err-bg); }
.user strong { display: block; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  td { border: 0; padding: .15rem .7rem; }
}
.secret { display: flex; gap: .6rem; align-items: center; }
.secret input { flex: 1; }
.secret .reveal { margin-top: .25rem; white-space: nowrap; }
