/* AskMe — Twitter-style light theme, pink accent (no framework). */
:root {
  --bg: #f5f8fa;
  --card: #fff;
  --line: #e6ecf0;
  --ink: #14171a;
  --muted: #657786;
  --faint: #aab8c2;
  --acc: #e0245e;
  --acc-soft: #fdf0f5;
  --up: #ea580c;
  --down: #2563eb;
  --ok: #15803d;
  --err: #dc2626;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 42rem; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: inherit; text-decoration: none; }
.brand:hover { color: var(--acc); }
.tagline { font-size: 0.75rem; color: var(--muted); }
.container { width: 100%; max-width: 42rem; margin: 0 auto; padding: 0.75rem 0.75rem 1rem; flex: 1; display: grid; gap: 0.75rem; align-content: start; }
.footer { text-align: center; font-size: 0.75rem; color: var(--faint); padding-bottom: 1.5rem; }

/* composer + generic cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }
h2.sub { font-size: 1rem; margin: 0 0 0.6rem; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.55rem 0.75rem; font-size: 0.9rem; font-family: inherit;
  background: #f7f9fa; color: inherit;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--acc); background: #fff; }
.textarea { resize: vertical; }
.composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.composer-row .select { width: auto; }
.spacer { margin-left: auto; }
.btn {
  border: 0; border-radius: 999px; background: var(--acc); color: #fff;
  font-size: 0.9rem; font-weight: 700; padding: 0.45rem 1.25rem; cursor: pointer;
}
.btn:hover { filter: brightness(0.94); }
.btn:disabled { opacity: 0.5; cursor: default; }
.pick { font-size: 0.85rem; padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: #fff; color: var(--acc); font-weight: 600; }
.pick:hover { background: var(--acc-soft); }
.preview { height: 3rem; width: 3rem; object-fit: cover; border-radius: 0.6rem; border: 1px solid var(--line); }
.hint { font-size: 0.78rem; margin: 0.3rem 0 0; color: var(--muted); }
.hint.err { color: var(--err); }
.hint.ok { color: var(--ok); }

/* search + sort tabs */
.controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 0.6rem 0.8rem; }
.search { flex: 1; min-width: 10rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.85rem; background: #f7f9fa; font-family: inherit; }
.search:focus { outline: none; border-color: var(--acc); background: #fff; }
.tagfilter { width: 6.5rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.75rem; font-size: 0.85rem; background: #f7f9fa; font-family: inherit; }
.sortbtn { border: 0; background: none; font-size: 0.9rem; font-weight: 700; color: var(--muted); padding: 0.4rem 0.6rem; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.sortbtn.on { color: var(--acc); border-bottom-color: var(--acc); }
.sortbtn:hover { color: var(--acc); }

/* tweet timeline */
.feed { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; display: grid; }
.feed > .muted { padding: 1rem; }
.tweet { display: flex; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.tweet:last-child { border-bottom: 0; }
.tweet:hover { background: #fafbfc; }
.ava {
  height: 3rem; width: 3rem; flex-shrink: 0; border-radius: 50%;
  background: #f0f2f5; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; color: var(--faint);
}
.ava.sm { height: 2rem; width: 2rem; font-size: 0.95rem; }
.ava.lg { height: 3.5rem; width: 3.5rem; font-size: 1.6rem; }
.tmain { min-width: 0; flex: 1; }
.thead { display: flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; }
.tname { font-weight: 800; }
.ttime { color: var(--muted); font-size: 0.85rem; }
.ttag { color: var(--acc); font-size: 0.85rem; text-decoration: none; }
.ttag:hover { text-decoration: underline; }
.ttitle { display: block; font-weight: 700; font-size: 1.02rem; color: inherit; text-decoration: none; margin-top: 0.1rem; }
a.ttitle:hover { color: var(--acc); }
h1.qtitle { font-size: 1.35rem; margin: 0.15rem 0 0; line-height: 1.3; }
.tbody { margin: 0.15rem 0 0; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.timg { margin-top: 0.6rem; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0; border: 1px solid var(--line); display: block; background: #eef1f4; opacity: 0; transition: opacity 0.3s ease; cursor: zoom-in; }
.timg.ld { opacity: 1; }
.timg.sm { aspect-ratio: 16 / 9; }
.qimg { margin-top: 0.6rem; max-width: 100%; max-height: 26rem; border-radius: 0; border: 1px solid var(--line); background: #eef1f4; opacity: 0; transition: opacity 0.3s ease; cursor: zoom-in; }
.qimg.ld { opacity: 1; }
.img-fallback { display: block; margin-top: 0.6rem; padding: 1.2rem; text-align: center; font-size: 0.8rem; color: var(--faint); background: #f0f2f5; border: 1px dashed var(--line); border-radius: 1rem; }

/* photo slider: one image at a time, full width */
.car { position: relative; margin-top: 0.6rem; border: 1px solid var(--line); background: #eef1f4; }
.car .timg { margin-top: 0; border: 0; touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20, 23, 26, 0.45); color: #fff; font-size: 1.2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0 0 0.15rem;
}
.car-arrow:hover { background: rgba(20, 23, 26, 0.7); }
.car-arrow.prev { left: 0.5rem; }
.car-arrow.next { right: 0.5rem; }
.car-dots { position: absolute; bottom: 0.5rem; left: 0; right: 0; display: flex; gap: 0.3rem; justify-content: center; pointer-events: none; }
.car-dots span { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: rgba(255, 255, 255, 0.55); pointer-events: auto; cursor: pointer; }
.car-dots span.on { background: #fff; }
.car-count {
  position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.72rem; font-weight: 700;
  color: #fff; background: rgba(20, 23, 26, 0.55); border-radius: 999px; padding: 0.15rem 0.55rem;
}

/* lightbox */
#lightbox { position: fixed; inset: 0; z-index: 100; }
#lightbox[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 14, 0.92); }
.lb-stage { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.lb-img { max-width: 94vw; max-height: 88vh; border-radius: 0.5rem; touch-action: none; cursor: grab; pointer-events: auto; }
.lb-img.zoomed { cursor: grabbing; max-width: none; }
.lb-cap { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #fff; font-size: 0.85rem; }
.lb-x, .lb-nav, .lb-tools button {
  position: absolute; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.1rem;
}
.lb-x:hover, .lb-nav:hover, .lb-tools button:hover { background: rgba(255, 255, 255, 0.25); }
.lb-x { top: 0.9rem; right: 0.9rem; width: 2.4rem; height: 2.4rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem; font-size: 1.6rem; line-height: 1; }
.lb-nav.prev { left: 0.7rem; }
.lb-nav.next { right: 0.7rem; }
.lb-tools { position: absolute; bottom: 2.6rem; left: 0; right: 0; display: flex; gap: 0.5rem; justify-content: center; }
.lb-tools button { position: static; padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.tactions { margin-top: 0.45rem; display: flex; align-items: center; gap: 1.1rem; }
.act { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.act:hover { color: var(--acc); }
.replylink { border: 0; background: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; padding: 0; font-family: inherit; }
.replylink:hover { color: var(--acc); }

/* votes */
.votes { display: inline-flex; align-items: center; gap: 0.15rem; user-select: none; }
.votes button { border: 0; background: none; color: var(--faint); padding: 0.15rem 0.35rem; border-radius: 0.4rem; cursor: pointer; font-size: 0.8rem; }
.votes button:hover { color: var(--acc); background: var(--acc-soft); }
.votes button.active-up { color: var(--up); font-weight: 800; }
.votes button.active-down { color: var(--down); font-weight: 800; }
.votes .score { min-width: 1.4rem; text-align: center; font-size: 0.85rem; color: var(--muted); }

.report, .del { border: 0; background: none; color: var(--faint); font-size: 0.78rem; cursor: pointer; padding: 0; font-family: inherit; }
.report:hover { color: var(--muted); text-decoration: underline; }
.del:hover { color: var(--err); text-decoration: underline; }

/* thread page */
#qbox { display: flex; gap: 0.75rem; }
.muted { font-size: 0.9rem; color: var(--muted); }
.back { font-size: 0.9rem; color: var(--acc); text-decoration: none; font-weight: 600; }
.back:hover { text-decoration: underline; }
.child { display: flex; gap: 0.6rem; margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.linklike { border: 0; background: none; font-size: 0.78rem; text-decoration: underline; cursor: pointer; color: inherit; padding: 0; font-family: inherit; }
