/* FilePile — white + orange + blue. Tribute to filepile.org (~2008). */

:root {
  --bg:           #ffffff;
  --bg-card:      #eeeeee;
  --bg-elev:      #ffffff;
  --text:         #111111;
  --text-muted:   #555555;
  --text-faint:   #999999;
  --border:       #dddddd;
  --border-strong:#aaaaaa;
  --accent:       #ff6600;   /* FP orange */
  --accent-hover: #cc4400;
  --accent-bg:    #fff0e0;
  --blue:         #0055cc;   /* FP link blue */
  --blue-hover:   #003399;
  --warn:         #cc7700;
  --shadow:       0 1px 2px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.14);
  --serif:        "PT Serif", Georgia, "Times New Roman", serif;
  --sans:         -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --mono:         ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 2rem; padding-bottom: 4rem; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---- header ---- */
header.site {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-strong);
  padding: 1.5rem 0;
}
header.site .container {
  display: flex; align-items: baseline; gap: 1.5rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: .2px;
}
.brand:hover { text-decoration: none; color: var(--accent); }
nav.primary { display: flex; gap: 1rem; align-items: baseline; flex: 1; flex-wrap: wrap; }
nav.primary a { color: var(--text); font-size: .95rem; }
nav.primary a:hover { color: var(--accent); }
nav.primary a.cta { color: var(--accent); font-weight: 700; }
nav.primary a.me { color: var(--accent); }
nav.primary .sep { color: var(--text-faint); }
.inline-form { display: inline; }
.linklike {
  background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer;
}
.linklike:hover { color: var(--accent); text-decoration: underline; }

/* ---- flashes ---- */
.flashes { margin-top: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 3px; margin-bottom: .5rem; }
.flash-ok { background: var(--accent-bg); color: var(--text); border: 1px solid var(--border); }
.flash-err { background: #fff0f0; color: #bb0000; border: 1px solid #ffbbbb; }

/* ---- generic ---- */
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.break-all { word-break: break-all; }
.hidden { display: none; }
.mt-1 { margin-top: 1rem; }
.bullets { padding-left: 1.2em; margin: 0; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* ---- forms ---- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
.stack label .muted { font-weight: 400; }
.stack label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.stack input[type=text], .stack input[type=email], .stack input[type=number], .stack textarea, .stack select, .stack input[type=file] {
  font: inherit;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: .55rem .7rem;
  color: var(--text);
  width: 100%;
}
.stack input:disabled { background: var(--bg-card); color: var(--text-faint); }
.stack input:focus, .stack textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; min-height: 4em; }

button, .btn-primary, .btn-secondary, .btn-danger, .btn-pileon {
  font: inherit; cursor: pointer; border-radius: 3px; padding: .55rem 1rem;
  transition: background-color .12s, color .12s, border-color .12s;
}
.btn-primary { background: var(--accent); color: var(--bg-card); border: 0; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; border: 1px solid var(--text); color: var(--text); }
.btn-secondary:hover { background: var(--text); color: var(--bg-card); }
.btn-danger { background: transparent; border: 1px solid #cc2200; color: #cc2200; }
.btn-danger:hover { background: #cc2200; color: #ffffff; }

/* ---- card (used for forms, settings sections) ---- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 3px; padding: 1.25rem; margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

/* ---- the pile (masonry via columns) ---- */
.pile {
  column-count: 1; column-gap: 1.25rem;
}
@media (min-width: 640px)  { .pile { column-count: 2; } }
@media (min-width: 1024px) { .pile { column-count: 3; } }

.pile .card {
  break-inside: avoid;
  padding: 0;
  margin: 0 0 1.25rem;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.pile .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
@media (hover: none) { .pile .card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); } }

.preview { display: block; position: relative; background: var(--bg-elev); }
.preview img { display: block; width: 100%; height: auto; }
.preview .thumb-fallback { padding: 2rem; text-align: center; color: var(--text-muted); background: var(--bg-card); }
.preview .thumb-fallback.large { padding: 3rem 2rem; }
.preview .play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.95); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.is-blurred .preview img,
.is-blurred .preview .thumb-fallback,
.is-blurred .preview .audio-tile { filter: blur(20px); }
.is-blurred.unblurred .preview img,
.is-blurred.unblurred .preview .thumb-fallback,
.is-blurred.unblurred .preview .audio-tile { filter: none; }
.blur-tag {
  position: absolute; bottom: .5rem; left: .5rem;
  background: rgba(0,0,0,.65); color: #ffffff;
  padding: .15rem .5rem; border-radius: 3px; font-size: .75rem;
}

.audio-tile { padding: 1rem; background: var(--bg-card); }
.audio-tile .audio-art { width: 100%; height: auto; display: block; margin-bottom: .5rem; border-radius: 3px; }
.audio-meta { display: flex; gap: .5rem; align-items: center; }

.card .meta {
  padding: .8rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.title-line { color: var(--blue); }
.title-line:hover { color: var(--blue-hover); text-decoration: none; }
.title-line h3.title { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.byline { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.byline a.handle { color: var(--accent); }
.byline a.muted { color: var(--text-faint); }
.counts { display: flex; gap: .9rem; margin-top: .5rem; }
.count {
  display: inline-flex; align-items: center; gap: .25rem; color: var(--text-muted);
  font-size: .85rem; font-variant-numeric: tabular-nums;
}
.count.on { color: var(--accent); font-weight: 700; }
.count:hover { color: var(--accent); text-decoration: none; }
.icon { vertical-align: middle; }

/* ---- pager ---- */
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---- file detail ---- */
.file-detail .preview-full {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  text-align: center;
  overflow: hidden;
}
.preview-full .full-image { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.preview-full video, .preview-full audio { width: 100%; max-height: 70vh; }
.preview-full .pdf-embed { width: 100%; height: 80vh; }
.preview-full .audio-art-full { width: 240px; max-width: 100%; height: auto; margin: 1rem auto 0; display: block; }
.preview-full .thumb-fallback.large { padding: 4rem 2rem; }

.file-title { font-size: 1.8rem; font-weight: 700; margin-bottom: .25rem; }
.meta-strip { margin-bottom: 1rem; }
.description { background: var(--bg-card); border: 1px solid var(--border); border-radius: 3px; padding: 1rem; margin: 1rem 0; }
.description p:first-child { margin-top: 0; }
.description p:last-child { margin-bottom: 0; }

/* ---- reactions: [this is good] / [this is bad] ---- */
.reaction-row {
  display: flex; align-items: baseline; gap: .6rem;
  flex-wrap: wrap; margin: 1.5rem 0;
}
.btn-react {
  font: inherit; cursor: pointer;
  background: transparent; border: 0; padding: 0;
  letter-spacing: -.01em;
  color: var(--text-muted);
  transition: color .1s;
}
.btn-react:hover { text-decoration: none; }
.btn-react-up:hover, .btn-react-up.on { color: var(--blue); font-weight: 700; }
.btn-react-dn:hover, .btn-react-dn.on { color: #cc2200;    font-weight: 700; }
.react-count {
  font-variant-numeric: tabular-nums; color: var(--text-faint);
  margin-right: .75rem; font-size: .9rem;
}
.react-count-up.on { color: var(--blue); font-weight: 700; }
.react-count-dn.on { color: #cc2200;    font-weight: 700; }
/* list row [+N] [-N] — plain text buttons, zero chrome */
.fp-react-up, .fp-react-dn {
  font: inherit;
  font-family: var(--mono); font-size: .78rem;
  color: var(--text-faint);
  background: none; border: none; padding: 0; margin: 0;
  cursor: pointer; outline: none;
}
.fp-react-up:hover, .fp-react-up.on { color: var(--blue); font-weight: 700; text-decoration: none; }
.fp-react-dn:hover, .fp-react-dn.on { color: #cc2200;    font-weight: 700; text-decoration: none; }
.fp-clicks { font-size: .78rem; color: var(--text-faint); }
.fp-del {
  font: inherit; font-family: var(--mono); font-size: .78rem;
  color: var(--text-faint);
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
}
.fp-del:hover { color: #cc2200; font-weight: 700; }

.fp-sum-btn {
  font: inherit; font-family: var(--mono); font-size: .78rem;
  color: var(--text-faint);
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
}
.fp-sum-btn:hover { color: var(--accent); }

.fp-sum-pop {
  position: absolute;
  z-index: 200;
  max-width: 300px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: .45rem .6rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  pointer-events: auto;
}

.voters details summary { cursor: pointer; }
.voter-list { margin: .5rem 0 0; font-size: .9rem; }

/* ---- comments ---- */
.comments { margin-top: 2.5rem; }
.comment-form textarea { font-family: var(--mono); font-size: .9rem; }
.comment-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.comment {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.comment-head { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.comment-actions { margin-left: auto; display: inline-flex; gap: .5rem; }
.comment-body { margin-top: .35rem; }
.comment-body p { margin: .3rem 0; }
.comment-body code { font-family: var(--mono); font-size: .9em; background: var(--accent-bg); padding: .1em .3em; border-radius: 2px; }
.comment-body blockquote { border-left: 3px solid var(--border-strong); margin: .5rem 0; padding: .25rem 0 .25rem 1rem; color: var(--text-muted); }
.comment-body a.mention { background: var(--accent-bg); padding: 0 .25em; border-radius: 2px; }

/* ---- archive ---- */
.archive-list { list-style: none; padding: 0; }
.archive-year { margin-top: 1.5rem; }
.archive-year h2 { border-bottom: 1px solid var(--border); padding-bottom: .25rem; }
.archive-month { display: inline-block; margin-right: 1.25rem; }

/* ---- profile ---- */
.profile-head { margin-bottom: 1.5rem; }
.section-h { margin-top: 2rem; }
.profile-comments { list-style: none; padding: 0; }
.profile-comments li { border-top: 1px solid var(--border); padding: .75rem 0; }

/* ---- settings ---- */
.invite-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.invite-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--border); }
.session-list { list-style: none; padding: 0; }
.session-list li { padding: .5rem 0; border-top: 1px solid var(--border); display: flex; gap: 1rem; align-items: baseline; }

/* ---- admin ---- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table .row-actions { display: flex; gap: .5rem; }
.table tr.disabled { opacity: .5; }
.badge { background: var(--accent-bg); color: var(--accent); padding: .05em .4em; border-radius: 2px; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.invite-tree { padding-left: 1.25rem; }
.admin-files { list-style: none; padding: 0; }
.admin-files li { padding: .35rem 0; border-top: 1px solid var(--border); display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }

/* ---- empty states ---- */
.empty {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: 3px;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---- footer ---- */
.site-footer { margin: 3rem auto 1.5rem; color: var(--text-faint); font-size: .85rem; text-align: center; }
.footer-rule { cursor: default; }
.footer-rule:hover { color: var(--accent); }

/* ===========================================================
   FilePile-tribute styling (overrides for the homepage list view)
   =========================================================== */

/* Big retro wordmark in the header. Heavy serif, all caps, FP orange,
   tight letter-spacing — channels the 2008 FilePile masthead. */
header.site.fp {
  background: var(--bg);
  border-bottom: 3px solid var(--accent);
  padding: 1.25rem 0 .75rem;
}
header.site.fp .container { align-items: flex-end; }
.wordmark {
  font-family: "Cooper Black", "Antique Olive", Impact, sans-serif;
  font-weight: 900;
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: .85;
  letter-spacing: -.02em;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(204, 68, 0, 0.20);
  display: inline-block;
}
.wordmark:hover { color: var(--accent-hover); text-decoration: none; }

/* Section headers — bold sans, orange */
.fp-section-h {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--accent);
  text-transform: lowercase;
  border-bottom: 1px dashed var(--border-strong);
  padding-bottom: .25rem;
  margin: 1.75rem 0 .5rem;
}
.fp-section-h .muted { font-family: var(--sans); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }

/* "how to pile" intro block */
.howto { background: var(--bg-card); border: 1px solid var(--border); border-radius: 3px; padding: 1rem 1.25rem; margin-top: 1rem; }
.howto-list { font-size: .92rem; color: var(--text); margin: .25rem 0 .25rem 1.1rem; padding: 0; }
.howto-list li { margin: .15rem 0; }
.howto-list a { color: var(--accent); font-weight: 600; }

/* The pile — single dense column, numbered list */
.fplist {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.fprow {
  display: grid;
  grid-template-columns: 2rem 80px 1fr;
  gap: .65rem;
  padding: .5rem .25rem;
  border-bottom: 1px dotted var(--border);
  align-items: center;
}
.fprow:hover { background: var(--bg-card); }
.fp-n {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text-faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fp-thumb {
  width: 80px; height: 60px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.fp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-kind {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
}
.fp-body { min-width: 0; }
.fp-title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue);
  text-decoration: none;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-title:hover { color: var(--blue-hover); text-decoration: underline; }
.fp-meta {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .1rem;
}
.fp-meta a { color: var(--text-muted); }
.fp-meta a:hover { color: var(--accent); text-decoration: underline; }
.fp-meta .fp-handle { color: var(--accent); font-weight: 600; }
.fp-meta .fp-pile.on { color: var(--accent); font-weight: 700; }
.fp-kind-tag {
  font-family: var(--mono);
  font-size: .7rem;
  background: var(--accent-bg);
  padding: 0 .35em;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}

/* Blur preserves visual interest but obscures */
.fprow.is-blurred .fp-thumb img { filter: blur(8px); }


@media (max-width: 640px) {
  .fprow { grid-template-columns: 1.6rem 64px 1fr; gap: .5rem; padding: .55rem .15rem; }
  .fp-thumb { width: 64px; height: 48px; }
  .fp-title { font-size: .95rem; }
  .fp-meta { font-size: .75rem; }
  .wordmark { font-size: clamp(2.2rem, 12vw, 3rem); }
}

/* ---- processing banner (file detail — while thumbnail/title is pending) ---- */
/* ---- global processing status bar (layout, polls /queue/status) ---- */
/* ====== Forum new-message badge ====== */
.nav-forum { position: relative; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; top: -1px; margin-left: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 1;
  letter-spacing: 0;
}

.proc-bar {
  background: var(--accent-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: .3rem 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.proc-bar-spinner {
  display: inline-block;
  font-size: .95rem;
  animation: proc-spin 1.1s linear infinite;
  flex-shrink: 0;
}

.proc-banner {
  display: flex; align-items: center; gap: .6rem;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 3px;
  padding: .65rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--text);
}
.proc-spinner {
  display: inline-block;
  font-size: 1.1rem;
  animation: proc-spin 1.1s linear infinite;
}
@keyframes proc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- pile position badge (file detail) ---- */
.pile-pos { color: var(--text-muted); }
.pile-pos-hot { color: var(--accent); font-weight: 700; }

/* ---- live auto-refresh toggle ---- */
.pile-liverow { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 .75rem; }
.btn-live {
  font: inherit; font-size: .8rem; cursor: pointer; background: transparent;
  border: 1px solid var(--border-strong); color: var(--text-muted); border-radius: 2px;
  padding: .2rem .6rem; transition: all .12s;
}
.btn-live:hover { border-color: var(--accent); color: var(--accent); }
.btn-live.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* ====== 4-quadrant homepage ====== */
.quads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1.75rem;
  margin: 1.25rem 0 1rem;
}
.quad {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}
.quad-h {
  font-family: "Cooper Black", "Antique Olive", Impact, sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--accent);
  text-transform: lowercase;
  margin: 0 0 .5rem;
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: .25rem;
}
.quad-h a { color: inherit; text-decoration: none; }
.quad-h a:hover { color: var(--accent-hover); text-decoration: none; }
.quad-list { margin: 0; padding: 0; }
.quad-list .fprow { border-color: var(--border); padding: .35rem .15rem; gap: .55rem; grid-template-columns: 1.6rem 64px 1fr; }
.quad-list .fp-title { font-size: .92rem; }
.quad-list .fp-meta { font-size: .72rem; }
.quad-list .fp-thumb { width: 64px; height: 48px; }
.quad-list .fp-n { font-size: .75rem; }
.quad-more { display: inline-block; margin-top: .5rem; color: var(--accent); font-size: .85rem; }
.empty-quad { padding: 1.5rem 0; }

/* Per-pile accent strip on the top of each quadrant */
.quad-music  { border-top: 4px solid var(--accent); }    /* orange */
.quad-video  { border-top: 4px solid var(--blue); }      /* blue */
.quad-images { border-top: 4px solid #3a9e28; }          /* green */
.quad-text   { border-top: 4px solid #7744bb; }          /* purple */

/* Desktop 2×2: text top-left, video top-right, music bottom-left, images bottom-right */
.quad-text   { order: 1; }
.quad-video  { order: 2; }
.quad-music  { order: 3; }
.quad-images { order: 4; }

@media (max-width: 720px) {
  .quads { grid-template-columns: 1fr; gap: 1rem; }
  .quad { min-height: 0; }
  /* On phones, single-column: text, video, images, music */
  .quad-text   { order: 1; }
  .quad-video  { order: 2; }
  .quad-images { order: 3; }
  .quad-music  { order: 4; }
}

/* ====== Link card on file detail ====== */
.link-card {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  display: flex; flex-direction: column; gap: .75rem;
  align-items: center; justify-content: center;
  text-align: center;
}
.link-card .link-host { font-family: var(--mono); }
.link-card .link-url {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--blue);
  word-break: break-all;
}
.link-card .link-url:hover { text-decoration: underline; }
.fp-link-host {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-muted);
  background: var(--accent-bg);
  padding: 0 .35em;
  border-radius: 2px;
  margin-left: .35em;
  vertical-align: middle;
}

/* ====== Upload form mode picker ====== */
.up-mode {
  border: 1px solid var(--border);
  padding: .75rem 1rem;
  border-radius: 3px;
  background: var(--bg-card);
}
.up-mode legend { padding: 0 .35rem; font-weight: 600; color: var(--text-muted); }
.up-sect { padding: .2rem 0; }
.up-sect + .up-sect { margin-top: .35rem; }
.up-label { font-weight: 700; }
.up-label-file { color: var(--blue); }
.up-label-link { color: var(--accent); }
.up-body { margin: .35rem 0 .35rem 1.5rem; }
.up-body input[type=url] { font: inherit; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 3px; padding: .5rem .7rem; color: var(--text); width: 100%; }
.up-body input[type=url]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
/* JS adds .mode-file or .mode-link to the fieldset to hide the inactive section */
.up-mode.mode-file #mode-link { display: none; }
.up-mode.mode-link #mode-file { display: none; }
/* File drop zone */
.file-drop {
  position: relative; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 3px;
  padding: .75rem 1rem; text-align: center;
  background: var(--bg-elev); color: var(--text-muted);
  transition: border-color .12s, background .12s;
  user-select: none;
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--blue); color: var(--text);
  background: color-mix(in srgb, var(--blue) 5%, var(--bg-elev));
}
.file-drop.has-file { border-style: solid; border-color: var(--blue); color: var(--text); }
/* file input is display:none; the <label> handles clicks natively */

/* ====== Video embed (YouTube / Vimeo) ====== */
.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.link-card-compact {
  padding: .6rem 1rem;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
  text-align: left;
  gap: .5rem;
}
.link-card-compact .link-url { font-size: .9rem; font-family: var(--sans); }

/* ====== Forum ====== */
.threadlist { list-style: none; padding: 0; margin: .5rem 0 0; }
.thread-row {
  padding: .6rem .25rem;
  border-bottom: 1px dotted var(--border);
}
.threadlist.compact .thread-row { padding: .35rem .15rem; }
.thread-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue);
  text-decoration: none;
  display: block;
  line-height: 1.2;
}
.thread-title:hover { color: var(--blue-hover); text-decoration: underline; }
.thread-meta { display: block; margin-top: .15rem; }
.forum-strip { margin-top: 1.5rem; }
.thread-page { max-width: 760px; margin: 0 auto; }
.thread-op {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.thread-op h1 { margin: 0 0 .25rem; }
.thread-op .op-meta { color: var(--text-muted); font-size: .85rem; margin-bottom: .75rem; }
.post-list { list-style: none; padding: 0; }
.post { padding: .85rem 0; border-top: 1px solid var(--border); }
.post:first-child { border-top: 0; }
.post-head { color: var(--text-muted); font-size: .85rem; margin-bottom: .35rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.post-head .author { color: var(--accent); font-weight: 600; }
.post-body p { margin: .3rem 0; }
.post-body code { font-family: var(--mono); background: var(--accent-bg); padding: .1em .3em; border-radius: 2px; }
.post-body blockquote { border-left: 3px solid var(--border-strong); margin: .5rem 0; padding: .25rem 0 .25rem 1rem; color: var(--text-muted); }
.reply-form { margin-top: 1.25rem; }
.reply-form textarea { font-family: var(--mono); font-size: .9rem; }

/* ---- iphone-friendly tweaks ---- */
@media (max-width: 640px) {
  header.site { padding: 1rem 0; }
  header.site .container { gap: .75rem; }
  nav.primary { gap: .7rem; font-size: .9rem; }
  nav.primary a { padding: .25rem 0; }
  .stack input[type=text], .stack input[type=email], .stack input[type=number], .stack textarea {
    font-size: 16px; /* prevent iOS zoom */
  }
  .pile { column-gap: .75rem; }
  .pile .card { margin-bottom: .75rem; }
  .table { font-size: .8rem; }
}
