:root { --bg: #fff; --text: #1f2328; --muted: #656d76; --line: #d0d7de; --soft: #f6f8fa; --link: #0969da; --btn: #0969da; --btn-text: #fff; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --text: #e6edf3; --muted: #8d96a0; --line: #30363d; --soft: #161b22; --link: #4493f8; --btn: #1f6feb; --btn-text: #fff; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--link); }
header.site { border-bottom: 1px solid var(--line); }
header.site div { max-width: 1000px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; }
header.site .name { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; margin-right: auto; }
header.site a:not(.name) { text-decoration: none; }
header.site a[aria-current] { color: var(--text); font-weight: 600; }
main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 40px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
textarea, input, select, button { font: inherit; color: inherit; }
textarea { display: block; width: 100%; height: 360px; padding: 12px; resize: vertical; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow: auto; }
input, select { padding: 7px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
button { padding: 7px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-text); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.row .right { margin-left: auto; }
#status { min-height: 24px; margin: 10px 0 0; }
#status button { margin-left: 8px; padding: 3px 10px; }
#snips { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
#snips li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
#snips span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filters input { flex: 1 1 200px; }
#list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.card { display: grid; gap: 2px; padding: 0 0 10px; overflow: hidden; text-align: left; background: var(--bg); }
.card img, .tile { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; margin-bottom: 6px; background: var(--soft); }
.tile { display: grid; place-items: center; font-size: 36px; font-weight: 700; color: var(--muted); }
.card strong, .card span { padding: 0 10px; }
.card span { color: var(--muted); font-size: 14px; }
footer.site { max-width: 1000px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
dialog { width: min(960px, calc(100% - 32px)); height: min(680px, 90vh); padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); overflow: hidden; }
dialog[open] { display: grid; grid-template-rows: auto 1fr; }
dialog div { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; }
dialog iframe { width: 100%; height: 100%; border: 0; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.wide { overflow-x: auto; }
