:root {
  --bg: #f3f3f3; --card: #fff; --ink: #181818; --muted: #5c5c5c; --line: #dddbda;
  --brand: #0b5cab; --brand-dark: #032d60; --accent: #e5f1fb; --warn: #fef3c7; --error: #ba0517;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181d; --card: #1f232a; --ink: #e8e8e8; --muted: #a0a4ab; --line: #343a43; --accent: #1d2c3d; --warn: #3a3218; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--brand-dark); color: #fff; flex-wrap: wrap; }
.bar .brand { color: #fff; font-weight: 600; font-size: 16px; white-space: nowrap; }
.bar .brand span { font-weight: 400; opacity: .8; }
.bar .search { flex: 1; min-width: 220px; }
.bar .search input { width: 100%; padding: 8px 12px; border-radius: 6px; border: 0; font-size: 14px; }
.bar .who { display: flex; align-items: center; gap: 10px; }
.bar .who button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.readonly { margin: 0; padding: 6px 16px; background: var(--warn); font-size: 12px; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--ink); }
.tile span { color: var(--muted); font-size: 12px; }
.columns { columns: 3 220px; padding-left: 18px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head input[type=search] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 220px; background: var(--card); color: var(--ink); }
.button, button.primary { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.fields { display: grid; gap: 8px 24px; }
.fields.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 640px) { .fields.cols-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding: 4px 0 6px; min-height: 38px; }
.field .label { font-size: 12px; color: var(--muted); }
.field .value { overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
details summary { cursor: pointer; }
details summary h2 { display: inline; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--accent); }
.count { background: var(--accent); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.side p { margin: 0 0 10px; }
.note-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.note-form textarea, .note-form input { width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--card); color: var(--ink); }
.note { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.tag { background: var(--accent); border-radius: 4px; padding: 0 6px; font-size: 11px; }
.hits { margin: 0; padding-left: 18px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 12px 0; }
.login { max-width: 380px; margin: 80px auto; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.login input { padding: 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.error { color: var(--error); }
.bar .who-link { color: #fff; }
