:root {
  --bg: #f4f1e8;
  --panel: #ffffff;
  --ink: #1d1d28;
  --muted: #5d5d6e;
  --line: #d8d3c4;
  --accent: #1f3f99;
  --accent-ink: #ffffff;
  --link: #1f3f99;
  --visited: #6b2f8f;
  --mark: #fff27a;
  --top: #10225a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151c;
    --panel: #1d1f29;
    --ink: #e8e6df;
    --muted: #a3a2ae;
    --line: #34374a;
    --accent: #6f8fff;
    --accent-ink: #0d0f18;
    --link: #8fa8ff;
    --visited: #c79bea;
    --mark: #6b5f00;
    --top: #0b1333;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Verdana, Tahoma, "DejaVu Sans", sans-serif;
}
a { color: var(--link); }
a:visited { color: var(--visited); }
mark { background: var(--mark); color: inherit; padding: 0 2px; }

header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 10px 16px; background: var(--top); color: #fff;
}
header.top a { color: #fff; text-decoration: none; }
header.top .brand { font: bold 20px/1 "Comic Sans MS", "Comic Neue", cursive; color: #ffe14d; }
header.top nav { display: flex; gap: 18px; }
header.top nav a:hover { text-decoration: underline; }

main { max-width: 1180px; margin: 0 auto; padding: 16px; }
footer { max-width: 1180px; margin: 24px auto; padding: 0 16px; color: var(--muted); font-size: 13px; }

h1 { font-size: 26px; margin: 8px 0 12px; }
h2 { font-size: 20px; margin: 28px 0 10px; }
h3 { font-size: 17px; margin: 0 0 4px; }
.small { color: var(--muted); font-size: 13px; font-weight: normal; }

.finder { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.finder textarea {
  width: 100%; font: 16px/1.4 "Courier New", monospace; padding: 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
button, .button {
  display: inline-block; margin-top: 10px; padding: 9px 22px; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink) !important; font: bold 15px Verdana, sans-serif;
  text-decoration: none; cursor: pointer;
}

.result {
  display: grid; grid-template-columns: 200px 1fr; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin: 10px 0;
}
.result img, .result .noshot { width: 200px; height: 150px; object-fit: cover; border: 1px solid var(--line); display: block; }
.result .shotwrap img { border: 0; }
.result .shotwrap { width: 200px; border: 1px solid var(--line); }
.shotwrap { position: relative; overflow: hidden; }
.stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  padding: 4px 12px; border: 4px double #c8102e; border-radius: 6px;
  background: rgba(255, 255, 255, .78); color: #c8102e;
  font: bold 17px/1.1 "Courier New", Courier, monospace; letter-spacing: 2px;
  text-transform: uppercase; white-space: nowrap; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(200, 16, 46, .25);
}
.bigshot .stamp { font-size: 34px; border-width: 6px; padding: 8px 24px; }
.result .stamp { font-size: 13px; padding: 3px 8px; }

.addr { margin: 0 0 6px; color: var(--muted); font-size: 14px; word-break: break-all; }
.why { margin: 4px 0; padding-left: 18px; font-size: 14px; }
.aka { font-size: 14px; margin: 4px 0; }
.snip { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.seeds { columns: 2 280px; font-size: 14px; }

.noshot {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 8px, var(--panel) 8px, var(--panel) 16px);
  color: var(--muted); font-size: 12px;
}

.center { text-align: center; }
.crumbs { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }

.hood { border-top: 1px solid var(--line); padding: 18px 0 8px; }
.hood h2 { text-align: center; margin: 0 0 4px; font-size: 24px; }
.hood h2 a { text-decoration: none; }
.blurb { text-align: center; font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.suburbs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 18px;
  max-width: 760px; margin: 0 auto;
}
.suburbs a { font-size: 14px; padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suburbs .empty, .hood h2 .empty { color: var(--muted); opacity: .6; }
.suburbs > * { font-size: 14px; padding: 2px 0; }
.suburbs a span { color: var(--muted); font-size: 12px; }

.ggrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.gcard img, .gcard .noshot { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.gtitle { display: flex; gap: 6px; padding: 8px 10px 2px; font-size: 15px; }
.gtitle a { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.gtitle a:hover { text-decoration: underline; }
.gmeta { padding: 0 10px 10px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound { font-size: 14px; }
@media (max-width: 900px) { .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .suburbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ggrid { grid-template-columns: 1fr; } .suburbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; margin: 14px 0; }
.pager a.on { font-weight: bold; text-decoration: none; color: var(--ink); }
.bigshot img { max-width: 100%; border: 1px solid var(--line); }

@media (max-width: 600px) {
  .result { grid-template-columns: 1fr; }
  .result img, .result .noshot, .result .shotwrap { width: 100%; height: auto; aspect-ratio: 4 / 3; }
}

/* "files only" sites: a few files and no page */
.fonly { position: relative; }
.fonly img { image-rendering: auto; background: var(--bg); object-fit: contain !important; }
.fobadge {
  position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 3px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px;
}
.noshot.fonly { flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 8px; }
.noshot.fonly ul { margin: 0; padding-left: 16px; font-size: 12px; color: var(--ink); text-align: left; }
.noshot.fonly li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.listing { border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.listing td { padding: 3px 18px 3px 0; border-bottom: 1px solid var(--line); }
.pics { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
.pics img { max-width: 240px; max-height: 180px; border: 1px solid var(--line); background: var(--panel); }

/* web search */
.wsearch { display: flex; gap: 8px; margin: 8px 0; }
.wsearch input {
  flex: 1; min-width: 0; font: 17px/1.4 Verdana, sans-serif; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink);
}
.wsearch button { margin-top: 0; }
.syntax { font-size: 14px; margin: 4px 0 12px; }
.syntax summary { cursor: pointer; color: var(--link); }
.syntax td { padding: 2px 16px 2px 0; vertical-align: top; }
.werr { color: #c8102e; }
.wres { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wres h3 { font-size: 18px; margin: 0 0 2px; font-weight: normal; }
.wthumb img, .wthumb .noshot, .wthumb .shotwrap { width: 160px; height: 120px; object-fit: cover; display: block; border: 1px solid var(--line); }
.wthumb .shotwrap img { border: 0; }
.wthumb .stamp { font-size: 11px; padding: 2px 6px; border-width: 3px; }
.waddr { margin: 0; font-size: 13px; color: #1a7f37; word-break: break-all; }
.wsnip { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 600px) { .wres { grid-template-columns: 1fr; } .wthumb img, .wthumb .noshot, .wthumb .shotwrap { width: 100%; height: auto; aspect-ratio: 4 / 3; } }

/* media browser */
.kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.kinds a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px; font-size: 14px; text-decoration: none; background: var(--panel); }
.kinds a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.kinds a span { opacity: .7; font-size: 12px; }
.mfilter { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.mfilter input[type=text], .mfilter select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); font-size: 14px;
}
.mfilter button { margin-top: 0; padding: 6px 18px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mtile { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.mtile img {
  width: 100%; height: 150px; object-fit: contain; display: block;
  background: repeating-conic-gradient(var(--bg) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px;
}
.mtile figcaption { padding: 4px 8px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtile figcaption span { color: var(--muted); }
.mlist { list-style: none; padding: 0; }
.mlist li { padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
.mlist .small { display: block; }
.mlist audio, .mlist video { display: block; margin-top: 6px; max-width: 100%; }
.mprev { margin: 6px 0 0; padding: 8px; max-height: 9em; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; word-break: break-word; }

.fres .pics { margin: .4em 0; }
.fres .pics img { max-height: 90px; }
.fnames { font-size: .9em; line-height: 1.6; word-break: break-word; }
