:root { color-scheme: dark; --bg: #0f1115; --panel: #1a1d24; --panel2: #232733; --line: #2a2f3a; --text: #e8eaee; --muted: #9aa1ad; --accent: #4f8cff; --bad: #ff7b7f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
header { padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
h1 { font-size: 16px; margin: 0; font-weight: 600; }
h2 { font-size: 20px; margin: 0 0 10px; font-weight: 600; overflow-wrap: anywhere; }
a { color: var(--accent); }
p { margin: 0 0 12px; }
.bar { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.bar a { color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.bad { color: var(--bad); }
.center { display: grid; place-items: center; flex: 1; padding: 24px 16px; }
.card { width: 100%; max-width: 26rem; }

label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input:not([type=checkbox]), textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
button, .button { display: inline-block; padding: 8px 14px; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { border-color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.danger { color: var(--bad); }
.small { padding: 3px 9px; font-size: 13px; flex: none; }
.plain { padding: 0; background: none; border: 0; font-size: 13px; color: var(--muted); text-decoration: underline; }

#vault { flex: 1; width: 100%; max-width: 62rem; margin: 0 auto; padding: 16px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tools input[type=search] { flex: 1 1 14rem; width: auto; margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
#list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#list:empty { display: none; }
#list button { display: block; width: 100%; padding: 10px 12px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
#list li:last-child button { border-bottom: 0; }
#list button:hover, #list button[aria-current=true] { background: var(--panel2); }
#list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#list .sub { color: var(--muted); font-size: 13px; }
#detail { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
dl { margin: 0 0 14px; }
dt { font-size: 13px; color: var(--muted); }
dd { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, monospace; }
.notes { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; }

dialog { width: min(30rem, calc(100vw - 32px)); padding: 20px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
dialog::backdrop { background: rgb(0 0 0 / .6); }

@media (max-width: 42rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
  #detail { grid-row: 1; }
  .tools button { flex: 1 1 auto; }
}
