:root {
  --bg: #f6f4fb; --panel: #ffffff; --ink: #1d1b29; --muted: #6b6880; --line: #e3e0ee;
  --accent: #e2457a; --accent-ink: #ffffff; --ok: #1f8a5b; --warn: #b5541c; --danger: #c62f45;
  --radius: 16px; --shadow: 0 6px 24px rgba(40, 20, 80, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14121c; --panel: #1f1c2b; --ink: #f1eefa; --muted: #a29fb6; --line: #34304a;
          --accent: #ff6b9a; --accent-ink: #1a0f17; --ok: #4fd39a; --warn: #f0a46a; --danger: #ff7085;
          --shadow: 0 6px 24px rgba(0, 0, 0, .35); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; }
a { color: var(--accent); }
main { max-width: 960px; margin: 0 auto; padding: 16px 16px 64px; }
main.narrow { max-width: 520px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
             max-width: 960px; margin: 0 auto; }
header.top .brand { font-weight: 800; text-decoration: none; color: var(--ink); }
header.top nav { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px; margin: 14px 0; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
                          border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
button, .button { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
                  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block;
                  text-align: center; }
button.secondary, .button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
button.small { padding: 6px 12px; font-size: 13px; }
button:disabled { opacity: .55; cursor: wait; }
button.wide, .button.wide { width: 100%; }
.message { min-height: 1.4em; font-size: 14px; }
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }
.id { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; list-style: none;
         font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
.codes li { background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; text-align: center; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap;
           border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; border: 1px solid var(--line); }
.pill.admin { color: var(--accent); border-color: currentColor; }
.pill.suspended, .pill.revoked, .pill.expired { color: var(--danger); border-color: currentColor; }
.pill.open { color: var(--ok); border-color: currentColor; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { background: transparent; color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td input[type="number"] { width: 72px; padding: 6px 8px; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { padding: 4px 0; }
.hero { text-align: center; padding: 28px 18px; }
.hero h1 { font-size: 26px; }
.links { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.links a.card { display: block; text-decoration: none; color: var(--ink); margin: 0; }
.links a.card strong { display: block; font-size: 18px; margin-bottom: 4px; }
[hidden] { display: none !important; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
         padding: 18px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 6, 20, .55); }
summary { cursor: pointer; font-weight: 700; }
