:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5d6778;
  --border: #dde1e7;
  --accent: #d9601a;
  --accent-text: #ffffff;
  --ok: #1f7a4a;
  --bad: #b3261e;
  --notice-bg: #fff4e5;
  --error-bg: #fdecea;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1b2029;
    --text: #e7eaf0;
    --muted: #9aa3b2;
    --border: #2d3441;
    --accent: #f07a33;
    --accent-text: #12151b;
    --ok: #5fcf8f;
    --bad: #ff8a80;
    --notice-bg: #3a2c16;
    --error-bg: #3b1d1b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .92em; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .01em; }
.brand::before { content: "🦊 "; }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.who { color: var(--muted); }

main { margin: 2rem auto; padding: 0 16px; }
main.narrow { max-width: 460px; }
main.wide { max-width: 1000px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin: 1rem 0;
}
.narrow-card { max-width: 460px; }
.center { text-align: center; }
label { display: block; margin-bottom: .9rem; font-weight: 500; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input:not([type=checkbox]) {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem;
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button {
  display: inline-block; padding: .6rem 1.1rem; font: inherit; font-weight: 600;
  color: var(--accent-text); background: var(--accent); border: 0; border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
button.small { padding: .3rem .6rem; font-size: .85rem; font-weight: 500;
  background: transparent; color: var(--text); border: 1px solid var(--border); }
button.small.danger { color: var(--bad); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
form.inline { display: inline; margin: 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.notice { background: var(--notice-bg); padding: .7rem 1rem; border-radius: 8px; }
.error { background: var(--error-bg); color: var(--bad); padding: .7rem 1rem; border-radius: 8px; }
.steps { padding-left: 1.2rem; }

.qr { background: #fff; border-radius: 8px; max-width: 100%; height: auto; }
.secret, .link-box { word-break: break-all; user-select: all; }
.codes { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.codes code { font-size: 1.05rem; user-select: all; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.tile {
  display: flex; flex-direction: column; gap: .3rem; padding: 1.25rem; min-height: 110px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile-title { font-weight: 700; font-size: 1.1rem; }
.tile-desc { color: var(--muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.warn td { color: var(--bad); }
td.actions { white-space: nowrap; }
.tag { font-size: .8rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--border); }
.tag.ok { color: var(--ok); }
.tag.bad { color: var(--bad); }
