:root { color-scheme: light dark; }
body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; margin: 0; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
header { border-bottom: 1px solid #ddd3; }
.header-flex { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.branding { display: grid; gap: 4px; }
.subline { margin: 6px 0 0 0 !important; }
@media (max-width: 800px) {
  .subline { display: none; }
}
.branding h1 { margin: 0; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.branding h1 a { text-decoration: none; }
.container h1 a { color: inherit; text-decoration: none; }
.container h1 a:hover { text-decoration: underline; }
.muted { color: #666; margin: 0 0 8px 0; font-size: 13px; }
/* Ensure the results summary has balanced vertical spacing */
.results-summary { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-filter { font-size: 13px; color: #555; white-space: nowrap; }
.results-filter a { color: inherit; }
.results-filter a.selected { font-weight: 600; text-decoration: none; }
.results-filter .sep { margin: 0 6px; opacity: 0.6; }
.top-links { font-size: 13px; color: #555; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 10px; }
.top-links .user-line { white-space: nowrap; }
.top-links a { color: inherit; }
.top-links .sep { margin: 0 6px; opacity: 0.6; }
.top-links .api-key { font-size: 12px; color: #666; }
.top-links .api-key .token { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }
.small-links { font-size: 12px; margin-left: 8px; color: #666; }
.small-links a { color: inherit; }
.small-links .sep { margin: 0 6px; opacity: 0.6; }
.ios-note { margin-top: 12px; }
.btn-row { display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
/* Span full width across both columns when needed (e.g., public view) */
.span2 { grid-column: 1 / -1; }
/* Vertical spacing between stacked sections on non-grid pages (e.g., settings) */
.container:not(.grid) > section + section { margin-top: 48px; }
form { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-size: 13px; }
input, textarea { padding: 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px; background: transparent; color: inherit; }
label.inline { display: inline-flex; align-items: center; gap: 6px; }
button { padding: 8px 12px; font-size: 14px; border-radius: 6px; border: 1px solid #888; background: #eee; color: #111; cursor: pointer; }
@media (prefers-color-scheme: dark) { button { background: #333; color: #eee; border-color: #777; } }
/* Reusable button style for prominent actions */
.btn { display: inline-block; padding: 8px 12px; font-size: 14px; border-radius: 6px; background: #111; color: #fff !important; text-decoration: none; border: none; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
@media (prefers-color-scheme: dark) { .btn { background: #000; color: #fff !important; } }
button.btn { border: none; }
/* Token display */
.token-display { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; padding: 10px 12px; border: 1px solid #ddd3; border-radius: 6px; background: #f6f7f8; color: inherit; display: inline-block; }
@media (prefers-color-scheme: dark) { .token-display { background: #1b1d1f; border-color: #333; } }
.error { color: #b00020; }
.ok { color: #0a7f2e; }
.results { display: grid; gap: 12px; margin-top: 12px; }
.card { border: 1px solid #ddd3; border-radius: 8px; padding: 12px; }
.card.private { background: #f6f7f8; }
@media (prefers-color-scheme: dark) { .card.private { background: #202225; } }
.card h3 { margin: 0 0 6px 0; font-size: 16px; }
/* Allow grid children to shrink so long strings don't expand layout */
.grid > * { min-width: 0; }
.card { min-width: 0; }
.archive-link { display:none; }
.icon { display:none; }
.edit-form { display: grid; gap: 8px; margin: 8px 0; }
.edit-form .actions { display: flex; gap: 8px; }
.url { color: #666; font-size: 12px; margin: 0 0 6px 0; overflow-wrap: anywhere; word-break: break-word; }
.url.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.referrer { color: #999; font-size: 12px; margin: 0 0 6px 0; display: flex; gap: 4px; align-items: baseline; }
.referrer .ref-link { display: inline-block; min-width: 0; text-decoration: none; border-bottom: 1px solid currentColor; line-height: 1; }
.referrer .ref-link a { display: inline-block; max-width: 100%; color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; vertical-align: bottom; }
.action-links { margin: 6px 0 0 0; font-size: 13px; color: #555; }
.action-links a { color: inherit; }
.action-links .sep { margin: 0 6px; opacity: 0.6; }
.excerpt { margin: 6px 0; white-space: pre-wrap; }
mark { background: #fff3b0; color: inherit; padding: 0 2px; border-radius: 2px; }
.meta { color: #777; font-size: 12px; margin: 8px 0 0 0; }
.desc { margin: 6px 0 0; color: #444; }
.desc blockquote { margin: 8px 0; padding-left: 10px; border-left: 3px solid #ddd; }
@media (prefers-color-scheme: dark) { .desc { color: #ddd; } .desc blockquote { border-left-color: #444; } }
.auth-links { margin-top: 8px; font-size: 13px; }
/* Underline all links globally */
a { text-decoration: underline; }
/* Pagination links should match surrounding text color (no purple visited) */
.pager a,
.pager a:visited { color: inherit; }
/* Bookmark title link: use browser default link color for both states (avoid purple visited) */
.card h3 a,
.card h3 a:visited { color: blue; overflow-wrap: break-word; }

.pager { margin-top: 16px; font-size: 13px; color: #555; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pager .sep { margin: 0 6px; opacity: 0.6; }
.pager .muted { color: #999; text-decoration: none; }
.pager .pages a, .pager .sizes a { margin: 0 4px; }
.pager .pages .muted, .pager .sizes .muted { margin: 0 4px; }
.pager .sizes > span:first-child { margin-right: 4px; }
