/* Developer — minimal, black and white, square. */
:root {
  --ink: #000;
  --paper: #fff;
  --soft: #f4f4f4;
  --line: #000;
  --hair: #d9d9d9;
  --muted: #5c5c5c;
  --font: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
::selection { background: var(--ink); color: var(--paper); }
.aurora { display: none; }
#app { min-height: 100vh; }

/* ---------- Opening: the owner's name, typed out */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--paper); transition: opacity 0.4s ease, visibility 0.4s; }
.splash.gone { opacity: 0; visibility: hidden; }
.splash .stack { padding: 0 20px; text-align: left; }
.splash .name { font: 500 clamp(36px, 8vw, 72px)/1.05 var(--font); letter-spacing: -0.03em; margin: 0; display: flex; flex-wrap: wrap; }
.splash .name span { opacity: 0; animation: type 0.01s steps(1) forwards; }
.splash .name .gap { width: 0.6em; }
.splash .name::after { content: ""; width: 0.55em; height: 0.95em; margin-left: 4px; background: var(--ink); align-self: center; animation: blink 0.9s steps(1) infinite; }
.splash .role { margin-top: 14px; color: var(--muted); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0; animation: type 0.01s 1.1s forwards; }
@keyframes type { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; transition: background 0.12s, color 0.12s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { border-color: var(--hair); color: #aaa; cursor: default; background: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #333; }
.btn.danger.solid { background: var(--ink); color: var(--paper); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { border-color: var(--line); background: var(--paper); color: var(--ink); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.wide { width: 100%; height: 42px; }
.btn svg { width: 15px; height: 15px; flex: none; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: var(--paper); outline: none; }
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 28px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 10px center; }
.input:focus { box-shadow: inset 0 0 0 1px var(--ink); }
.input:disabled { border-color: var(--hair); color: #aaa; }
.mono { font-family: var(--font); }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: #999; }
.hint { font-size: 12px; color: var(--muted); margin: -4px 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; white-space: nowrap; }
.check input { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1px solid var(--ink); margin: 0; background: var(--paper); }
.check input:checked { background: var(--ink); box-shadow: inset 0 0 0 2px var(--paper); }

.pill { display: inline-block; padding: 1px 7px; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--ink); white-space: nowrap; }
.pill::before { content: none; }
.pill.active { background: var(--paper); }
.pill.void, .pill.revoked { background: var(--ink); color: var(--paper); }
.pill.expired { color: var(--muted); border-style: dashed; }

/* ---------- Sign in */
.center { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.card { width: min(420px, 100%); border: 1px solid var(--line); padding: 32px 28px 26px; animation: rise 0.35s ease both; }
.logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 22px; background: var(--ink); color: var(--paper); }
.logo svg { width: 22px; height: 22px; }
.card h1 { font: 500 28px/1.1 var(--font); letter-spacing: -0.03em; margin: 0 0 6px; }
.card .by { color: var(--muted); margin: 0 0 22px; }
.card .by b { color: var(--ink); font-weight: 500; }
.feature { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--hair); color: var(--muted); font-size: 13px; }
.feature b { color: var(--ink); font-weight: 500; }
.feature svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink); }
.card .actions { margin-top: 22px; display: grid; gap: 10px; }
.back { background: none; border: 0; cursor: pointer; padding: 0; margin-bottom: 20px; display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.back svg { width: 14px; height: 14px; }
.back:hover { color: var(--ink); }
.step-title { font: 500 22px/1.2 var(--font); letter-spacing: -0.02em; margin: 0 0 6px; }
.passport-badge { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; margin-bottom: 18px; border: 1px solid var(--line); }
.passport-badge i { width: 22px; height: 22px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-style: normal; font-size: 10px; }
.footer-note { text-align: center; color: #999; font-size: 12px; margin-top: 22px; }

/* ---------- Layout: sidebar + content */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 26px 0 20px; }
.brand { padding: 0 24px 26px; }
.brand b { display: block; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: grid; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 24px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--muted); }
.nav button:hover { color: var(--ink); background: var(--soft); }
.nav button.on { color: var(--paper); background: var(--ink); }
.nav .count { margin-left: auto; font-size: 12px; }
.nav .sep { height: 1px; background: var(--hair); margin: 10px 24px; }
.side-foot { margin-top: auto; padding: 16px 24px 0; border-top: 1px solid var(--hair); font-size: 12px; color: var(--muted); }
.side-foot b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }

.content { min-width: 0; padding: 40px 48px 80px; max-width: 1120px; }
.page { animation: rise 0.25s ease both; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.hello h2 { font: 500 30px/1.1 var(--font); letter-spacing: -0.04em; margin: 0; }
.hello p { margin: 8px 0 0; color: var(--muted); max-width: 620px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--line); margin-bottom: 28px; }
.stat { padding: 16px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 30px; font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.panel { border: 1px solid var(--line); margin-bottom: 28px; }
.panel > h3 { margin: 0; padding: 12px 16px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.panel > h3 svg { width: 14px; height: 14px; }
.panel .panel-body { padding: 16px; }
.quick p { margin: 0 0 14px; color: var(--muted); }
.quick p b { color: var(--ink); font-weight: 500; }
.quick .row { flex-wrap: wrap; }
.quick .row .input { flex: 1 1 220px; }
.quick select.input { flex: 0 1 240px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.two .panel { margin-bottom: 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h3 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.section-head .row { flex-wrap: wrap; }

.table { border: 1px solid var(--line); overflow: hidden; }
.table table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-top: 1px solid var(--hair); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--soft); }
.table .ico { width: 30px; height: 30px; display: grid; place-items: center; font-size: 16px; border: 1px solid var(--hair); filter: grayscale(1); }
.table .name { font-weight: 500; }
.table .desc { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 26px; margin-bottom: 8px; filter: grayscale(1); }
.list-lines { display: grid; }
.list-lines .li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hair); cursor: pointer; }
.list-lines .li:first-child { border-top: 0; padding-top: 0; }
.list-lines .li:hover b { text-decoration: underline; }
.list-lines .li .e { filter: grayscale(1); }
.list-lines .li b { font-weight: 500; }
.list-lines .li small { display: block; color: var(--muted); font-size: 12px; }
.list-lines .li .pill { margin-left: auto; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 0; background: var(--paper); border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { display: none; }
  .nav { display: flex; overflow-x: auto; width: 100%; }
  .nav button { width: auto; height: 46px; padding: 0 14px; white-space: nowrap; flex: none; }
  .nav .count, .nav .sep, .side-foot { display: none; }
  .content { padding: 26px 16px 60px; }
  .two { grid-template-columns: 1fr; gap: 20px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 12px; padding: 12px 14px; border-top: 1px solid var(--hair); }
  .table tbody tr:first-child { border-top: 0; }
  .table td { padding: 0; border: 0; }
  .table td.hide-sm { display: none; }
  .table td:first-child { grid-row: span 2; }
  .table .desc { max-width: none; white-space: normal; }
  .table.plain tr { grid-template-columns: 1fr auto; }
  .table.plain td:first-child { grid-row: auto; }
}

/* ---------- Detail panel */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.12); opacity: 0; transition: opacity 0.2s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; transform: translateX(100%); transition: transform 0.28s ease; }
.drawer.show { transform: none; }
.close-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 18px; line-height: 1; }
.close-x:hover { background: var(--ink); color: var(--paper); }
.drawer header { padding: 26px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer .hero-icon { width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; border: 1px solid var(--line); margin-bottom: 14px; filter: grayscale(1); }
.drawer h3 { margin: 0 0 8px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; padding-right: 40px; }
.drawer .body { padding: 18px 24px 26px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 22px; font-size: 13px; align-items: center; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.meta dd .btn { margin-left: 8px; }
.actions-list { display: grid; border: 1px solid var(--line); }
.action { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--hair); background: var(--paper); cursor: pointer; text-align: left; }
.action:first-child { border-top: 0; }
.action:hover { background: var(--ink); color: var(--paper); }
.action:hover small { color: #bbb; }
.action .a-icon { width: 16px; display: grid; place-items: center; flex: none; }
.action .a-icon svg { width: 16px; height: 16px; }
.action b { display: block; font-weight: 500; font-size: 13px; }
.action small { color: var(--muted); font-size: 12px; }
.action .tag { margin-left: auto; font-size: 10px; letter-spacing: 0.12em; border: 1px solid currentColor; padding: 0 5px; }
.action:disabled { color: #aaa; cursor: default; background: var(--paper); }
.action:disabled small { color: #ccc; }

/* ---------- Dialogs */
.modal-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.18); opacity: 0; transition: opacity 0.18s; overflow-y: auto; }
.modal-wrap.show { opacity: 1; }
.modal { width: min(540px, 100%); background: var(--paper); border: 1px solid var(--line); margin: auto; transform: translateY(8px); transition: transform 0.2s ease; }
.modal-wrap.show .modal { transform: none; }
.modal.wide { width: min(760px, 100%); }
.modal header { padding: 22px 24px 0; }
.modal header h3 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.modal header h3:empty { display: none; }
.modal header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.modal .content { padding: 18px 24px; }
.modal footer { padding: 0 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.alert-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--ink); color: var(--paper); }
.alert-icon svg { width: 22px; height: 22px; }
.modal.alert { width: min(400px, 100%); text-align: center; }
.modal.alert footer { justify-content: center; }

.icons { display: flex; flex-wrap: wrap; gap: 6px; }
.icons button { width: 36px; height: 36px; border: 1px solid var(--hair); background: var(--paper); font-size: 17px; cursor: pointer; filter: grayscale(1); }
.icons button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.fields { border: 1px solid var(--line); margin-bottom: 10px; }
.fields .f-head, .fields .f-row { display: grid; grid-template-columns: 1.1fr 0.85fr 1.3fr 32px; gap: 8px; align-items: center; padding: 8px 10px; }
.fields .f-head { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.fields .f-row + .f-row { border-top: 1px solid var(--hair); }
.fields .input { height: 32px; font-size: 13px; }
.fields .none { padding: 12px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--hair); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .fields .f-head { display: none; }
  .fields .f-row { grid-template-columns: 1fr 1fr 32px; }
  .fields .f-row .val { grid-column: 1 / 3; }
}

.secret-box { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--line); font-size: 15px; word-break: break-all; margin-bottom: 12px; }
.secret-box span { flex: 1; }
.success-mark { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--ink); color: var(--paper); }
.success-mark svg { width: 22px; height: 22px; }
.kv { display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--line); font-size: 13px; }
.kv div { padding: 8px 10px; border-bottom: 1px solid var(--hair); overflow-wrap: anywhere; }
.kv div:nth-child(odd) { color: var(--muted); white-space: nowrap; }
.kv div:nth-last-child(-n + 2) { border-bottom: 0; }
.list-plain { display: grid; gap: 6px; }
.drop { border: 1px dashed var(--line); padding: 24px; text-align: center; cursor: pointer; margin-bottom: 12px; display: grid; justify-items: center; gap: 4px; color: var(--muted); }
.drop svg { width: 20px; height: 20px; color: var(--ink); }
.drop b { color: var(--ink); font-weight: 500; }
.drop:hover, .drop.over { background: var(--soft); }
pre.payload { white-space: pre-wrap; font: 12px/1.5 var(--font); padding: 10px; border: 1px solid var(--hair); background: var(--soft); }
details summary { cursor: pointer; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.settings-grid .panel { margin: 0; }

/* ---------- Toasts */
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 6px; width: min(380px, calc(100vw - 40px)); }
.toast { padding: 11px 14px; background: var(--ink); color: var(--paper); font-size: 13px; display: flex; gap: 10px; align-items: center; animation: rise 0.2s ease both; }
.toast.bad { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.toast svg { width: 15px; height: 15px; flex: none; }
.spin { width: 13px; height: 13px; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
