/* OnlyBills — site styles. Inlined into index.html by scripts/prerender.mjs; linked from other pages. */

:root {
  --bg: #0d0d10;
  --surface: #16161b;
  --surface-2: #1f1f26;
  --border: #2b2b35;
  --text: #f3f3f6;
  --muted: #a3a3b1;
  --accent: #ff6b3d;
  --accent-2: #ff9472;
  --on-accent: #160904;
  --green: #3ddc84;
  --red: #c8102e;
  --gold: #ffc53d;
  --radius: 14px;
  --wrap: 1320px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.skip-link:focus { top: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.link { padding: 0; border: 0; background: none; font-weight: 700; text-align: left; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-weight: 800; font-size: 22px; letter-spacing: -.03em; text-decoration: none; }
.logo img { display: block; width: 43px; height: 28px; }
.logo b { color: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(13, 13, 16, .94); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.header-row { display: flex; align-items: center; gap: 16px; height: 64px; }
.search { display: flex; flex: 1; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 16px; border: 1px solid var(--border); border-right: 0; border-radius: 999px 0 0 999px; background: var(--surface); color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }
.search button { display: grid; place-items: center; width: 50px; height: 40px; border: 1px solid var(--border); border-radius: 0 999px 999px 0; background: var(--surface-2); }
.search svg { width: 18px; height: 18px; }
.auth { display: flex; gap: 8px; flex-shrink: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 10px 14px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 700; }
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 12px; }
  .logo { font-size: 20px; }
  .auth { margin-left: auto; }
  .auth .btn { height: 36px; padding: 0 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
}

/* Hero + categories */
.hero { padding: 26px 0 4px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.hero p { max-width: 760px; margin: 0; color: var(--muted); }
.chips { display: flex; gap: 8px; margin: 0 -16px; padding: 18px 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; }
.chip:hover { border-color: var(--accent); color: var(--accent-2); }
.chip small { color: var(--muted); font-weight: 500; font-size: 12px; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 56px; }
@media (min-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.feed-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.feed-head h2 { margin: 0; font-size: 19px; }
.feed-head p { margin: 0; font-size: 14px; }
.bill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px 18px; }
.more { display: flex; justify-content: center; margin-top: 32px; }

/* Bill card */
.bill { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius); background: linear-gradient(140deg, var(--k1), var(--k2)); }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent 45%); pointer-events: none; }
.paper { position: absolute; top: 12%; left: 17%; right: 17%; height: 110%; padding: 12px 14px; border-radius: 6px; background: #f7f4ec; color: #1d1d22; text-align: left; font: 600 11px/1.35 var(--mono); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); transform: rotate(-4deg); transition: transform .25s ease; }
.thumb:hover .paper { transform: rotate(-1deg) translateY(-4px) scale(1.02); }
.paper-head { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; border-bottom: 1px dashed #c9c3b4; font: 800 12px/1.2 var(--font); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.paper-supplier { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.paper-lines { display: block; height: 30px; margin: 9px 0 8px; background:
  linear-gradient(#ddd7c8, #ddd7c8) 0 0 / 82% 3px no-repeat,
  linear-gradient(#ddd7c8, #ddd7c8) 0 9px / 58% 3px no-repeat,
  linear-gradient(#ddd7c8, #ddd7c8) 0 18px / 70% 3px no-repeat,
  linear-gradient(#ddd7c8, #ddd7c8) 0 27px / 40% 3px no-repeat; }
.paper-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #5e5a4d; font-size: 10px; text-transform: uppercase; }
.paper-total b { color: #1d1d22; font: 800 19px/1 var(--font); letter-spacing: -.01em; }
.blur { filter: blur(6px); user-select: none; }
.stamp { position: absolute; right: 10px; top: 50%; padding: 3px 8px; border: 3px solid var(--red); border-radius: 6px; color: var(--red); font: 900 14px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; transform: rotate(-14deg); opacity: .9; }
.badge { position: absolute; z-index: 1; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .8); color: #fff; font: 700 12px/1.25 var(--font); }
.badge-days { right: 8px; bottom: 8px; }
.badge-fee { left: 8px; bottom: 8px; color: var(--gold); }
.badge-corner { top: 8px; right: 8px; }
.badge-free { background: var(--green); color: #03170b; }

.bill-body { display: flex; gap: 10px; }
.avatar-btn { flex-shrink: 0; align-self: flex-start; padding: 0; border: 0; border-radius: 50%; background: none; }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; font: 800 16px/1 var(--font); text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.bill-info { min-width: 0; }
.bill-title { display: -webkit-box; margin: 0 0 2px; overflow: hidden; font-size: 15px; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bill-by { margin: 0; color: var(--muted); font-size: 13px; }
.bill-by .link { color: var(--muted); }
.bill-by .link:hover { color: var(--text); }
.verified { color: var(--green); font-weight: 600; font-size: 12px; white-space: nowrap; }
.bill-stats { display: flex; flex-wrap: wrap; margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.bill-stats span + span::before { content: "·"; margin: 0 7px; }
.tags { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 4px 0 0; color: var(--accent-2); font-size: 13px; }
.bill-actions { display: flex; gap: 8px; margin-top: auto; }
.bill-actions .btn-accent { flex: 1; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel > h2 { margin: 0 0 14px; font-size: 17px; }
.bill-featured .thumb { aspect-ratio: 4 / 3; }
.bill-featured .bill-title { font-size: 17px; -webkit-line-clamp: 3; }
.bill-featured .bill-by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.botd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 4px; }
.botd-stats div { padding: 8px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.botd-stats dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.botd-stats dd { margin: 0; font-weight: 800; font-size: 18px; }
.top-list, .comment-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.top-list { gap: 14px; }
.top-biller { display: grid; grid-template-columns: 18px 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rank { color: var(--muted); font-weight: 800; text-align: center; }
.top-biller:first-child .rank { color: var(--gold); }
.top-info { min-width: 0; }
.top-info .link { display: block; max-width: 100%; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.top-info p { margin: 0; color: var(--muted); font-size: 12px; }
.comment-list { gap: 16px; }
.comment { display: flex; gap: 10px; }
.comment p { margin: 0; font-size: 14px; }
.comment .comment-meta { color: var(--muted); font-size: 12px; }
.comment-meta b { color: var(--text); }
.comment-meta .link { color: var(--muted); font-size: 12px; }

/* Footer */
.site-footer { padding: 36px 0 44px; border-top: 1px solid var(--border); background: #09090b; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px 40px; }
.site-footer h2 { margin: 0 0 8px; color: var(--text); font-size: 15px; }
.site-footer p { margin: 8px 0 0; }
.footer-links { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-links a, .footer-links .link { color: var(--text); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.disclaimer { margin-top: 28px !important; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }

/* Dialogs */
dialog { width: min(440px, calc(100vw - 32px)); max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(5, 5, 8, .8); backdrop-filter: blur(6px); }
.dialog-body { max-height: calc(100dvh - 34px); padding: 28px 24px 22px; overflow-y: auto; }
.dialog-body h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.dialog-body > p, .dialog-body [data-state] > p { margin: 0; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 22px; line-height: 1; }
.dialog-emoji { margin-bottom: 10px; font-size: 40px; line-height: 1; }
.center { text-align: center; }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.fine { margin-top: 14px !important; color: var(--muted); font-size: 12px; text-align: center; }
.roles { display: grid; gap: 8px; margin: 18px 0 12px; padding: 0; border: 0; }
.role { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-weight: 600; cursor: pointer; }
.role:has(input:checked) { border-color: var(--accent); background: rgba(255, 107, 61, .1); }
.role input { accent-color: var(--accent); }
.field input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; }
.field input:focus { border-color: var(--accent); outline: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts-box { display: flex; justify-content: center; min-height: 65px; margin: 12px 0 0; }
.form-error { min-height: 20px; margin: 8px 0 !important; color: #ff6b81; font-size: 14px; }

/* Cookie banner (fixed, so it never shifts layout) */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: 600px; margin: 0 auto; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.cookie[hidden] { display: none; }
.cookie p { flex: 1 1 280px; margin: 0; font-size: 14px; }
.cookie-actions { display: flex; gap: 8px; }

/* Simple content pages (privacy, 404) */
.page { max-width: 760px; padding-top: 40px; padding-bottom: 64px; }
.page h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; }
.page h2 { margin-top: 32px; font-size: 20px; }
.page p, .page li { color: #d6d6de; }
.page a { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
