/* Yapping: calm, dense, readable. System fonts (fast), light/dark by device setting. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --border: #dde1e7; --text: #16191d; --text-2: #4a525c; --muted: #6b7480;
  --accent: #2554d8; --accent-ink: #ffffff; --accent-soft: #e6ecfb; --ok: #1b7f4b; --ok-soft: #e3f4ea; --warn: #9a5b00; --warn-soft: #fdf1dc;
  --bad: #b3261e; --bad-soft: #fbe6e4; --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.45;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1116; --surface: #161a21; --surface-2: #1d222b; --border: #2a313c; --text: #e7ebf0; --text-2: #b4bdc8; --muted: #86909c;
    --accent: #7aa2ff; --accent-ink: #0b1020; --accent-soft: #1c2640; --ok: #5fd39a; --ok-soft: #13291f; --warn: #f2b45c; --warn-soft: #2e2413;
    --bad: #ff8a80; --bad-soft: #341a19; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
code, .secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--text); }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; order: 3; width: 100%; }
.nav a { padding: .4rem .7rem; border-radius: 8px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.me { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.me .who small { color: var(--muted); }
@media (min-width: 900px) { .nav { order: 0; width: auto; } .me { margin-left: 0; } }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.panel.highlight { border-color: var(--accent); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

body.bare { display: grid; place-items: start center; min-height: 100vh; padding: 8vh 1rem 2rem; }
.card.narrow { width: 100%; max-width: 440px; }
.card .brand { margin: 0 0 .4rem; color: var(--muted); }

.flash { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--bad-soft); color: var(--bad); }

form.stack { display: grid; gap: .8rem; margin: 0 0 1rem; }
form.inline { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin: .1rem 0; }
.grid-form { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.narrow-form { max-width: 420px; }
label { display: grid; gap: .25rem; font-size: .9rem; color: var(--text-2); }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; min-height: 42px; width: 100%; }
form.inline select { width: auto; min-height: 34px; padding: .3rem .5rem; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label:has(input[type="checkbox"]) { display: inline-flex; gap: .3rem; align-items: center; }
input[type="checkbox"] { width: auto; min-height: 0; }

button, .button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: .55rem 1rem; min-height: 42px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.small { min-height: 32px; padding: .25rem .6rem; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; }
button.copy { margin-left: .4rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.tag { display: inline-block; padding: .05rem .45rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.off { background: var(--surface-2); color: var(--muted); }

.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tiles a { display: grid; gap: .2rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.tiles a:hover { border-color: var(--accent); }
.tiles span { color: var(--muted); font-size: .9rem; }

.steps { padding-left: 1.2rem; display: grid; gap: .6rem; }
.qr { width: 200px; height: 200px; max-width: 100%; border-radius: 6px; }
.secret { display: inline-block; padding: .4rem .6rem; background: var(--surface-2); border-radius: 6px; word-break: break-all; margin-top: .3rem; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem 1rem; }
.linkbox { font-family: ui-monospace, monospace; font-size: .85rem; }
details { margin: 0 0 1rem; }
summary { cursor: pointer; color: var(--accent); }
