:root {
  --paper: #fcfbf9;
  --white: #ffffff;
  --ink: #211f1c;
  --muted: #716c64;
  --faint: #9b958d;
  --line: #e6e1da;
  --coral: #f3ad9f;
  --coral-deep: #eb826e;
  --coral-soft: #fff3ef;
  --green: #1e9a61;
  --shadow: 0 8px 28px rgba(42, 36, 30, 0.06);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.wrap { width: min(calc(100% - 40px), 960px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.header { height: 80px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 720; letter-spacing: -.045em; text-decoration: none; }
.logo-bars { width: 24px; height: 22px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.logo-bars i { display: block; height: 3px; border-radius: 3px; background: var(--ink); }
.logo-bars i:nth-child(1) { width: 10px; margin-left: 8px; background: var(--coral-deep); }
.logo-bars i:nth-child(2) { width: 19px; margin-left: 2px; }
.logo-bars i:nth-child(3) { width: 15px; margin-left: 5px; }
.header nav { display: flex; gap: 22px; }
.header nav button { border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 13px; }
.header nav button:hover { color: var(--ink); }

.intro { padding: 48px 0 32px; text-align: center; }
.live { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 25px; padding: 8px 13px; border: 1px solid #dde9df; border-radius: 999px; background: #f3f8f4; color: #4a5e4f; font-size: 11px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(30,154,97,.09); }
.intro h1 { max-width: 760px; margin: 0 auto; font-size: clamp(46px, 7vw, 68px); font-weight: 720; letter-spacing: -.065em; line-height: .98; }
.intro-copy { max-width: 620px; margin: 20px auto 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.scan-stats { margin: 13px 0 0; color: var(--faint); font-size: 11px; }

.bid-box { max-width: 820px; margin: 0 auto; padding: 34px 0 64px; text-align: center; }
.bid-title-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.bid-box h2 { margin: 0; font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -.06em; }
.amount-control { display: flex; align-items: center; gap: 8px; }
.amount-control > button { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--coral-soft); color: var(--coral-deep); font-size: 18px; line-height: 1; }
.amount-control > button:hover { background: var(--coral); color: var(--ink); }
.amount-control label { display: inline-flex; align-items: baseline; color: var(--coral-deep); }
.amount-control b { font-size: clamp(28px, 4vw, 43px); font-weight: 700; }
.amount-control input { width: 116px; border: 0; outline: 0; padding: 0; background: transparent; color: var(--coral-deep); font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -.055em; }
.amount-control input::-webkit-inner-spin-button { display: none; }
.trend-choice { max-width: 720px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 0; color: var(--muted); font-size: 15px; }
.trend-choice select { min-width: 0; max-width: 650px; border: 0; border-bottom: 1px solid var(--line); outline: 0; padding: 5px 24px 5px 4px; background: transparent; color: var(--ink); font-weight: 620; text-overflow: ellipsis; }
.trend-choice select:focus { border-bottom-color: var(--coral-deep); }

#bid-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 26px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); box-shadow: var(--shadow); }
.field { min-width: 0; position: relative; }
.field-url { display: flex; align-items: center; }
.input-icon { flex: 0 0 auto; margin-left: 13px; color: var(--faint); font-size: 18px; }
.field input { width: 100%; height: 46px; border: 0; outline: 0; padding: 0 13px 0 10px; background: transparent; font-size: 14px; }
.bid-button { min-width: 128px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 15px; border: 0; border-radius: 999px; padding: 0 20px; background: var(--coral); color: var(--white); font-size: 13px; font-weight: 700; white-space: nowrap; }
.bid-button:hover { background: var(--coral-deep); }
.preview-heading { margin: 30px 0 9px; color: var(--faint); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.placement-preview { display: grid; grid-template-columns: 70px minmax(0,1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid #f0c8bf; border-radius: 14px; background: var(--white); color: var(--ink); box-shadow: var(--shadow); text-align: left; }
.preview-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; background: var(--coral-soft); color: var(--coral-deep); }
.preview-label span { font-size: 8px; font-weight: 750; text-transform: uppercase; }
.preview-label strong { margin-top: 3px; font-size: 24px; letter-spacing: -.07em; }
.preview-ad-copy { min-width: 0; align-self: center; padding: 13px 16px; }
.preview-ad-copy > span { color: var(--coral-deep); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.preview-ad-copy > strong { display: block; overflow: hidden; margin-top: 3px; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.placement-preview p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.preview-link { align-self: center; margin-right: 14px; padding: 9px 13px; border-radius: 999px; background: var(--coral-soft); color: var(--coral-deep); font-size: 10px; font-weight: 700; }
.bid-rule { max-width: 670px; margin: 14px auto 0; color: var(--faint); font-size: 11px; line-height: 1.5; }

.board { padding: 18px 0 50px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.board-head h2 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.045em; }
.period { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.period button { min-width: 66px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; }
.period button.active { background: var(--ink); color: var(--white); }
.filters { display: flex; gap: 7px; overflow-x: auto; padding: 18px 0 24px; }
.filters button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: var(--white); color: var(--muted); font-size: 11px; }
.filters button:hover { border-color: #cfc8bf; color: var(--ink); }
.filters button.active { border-color: var(--ink); background: var(--ink); color: var(--white); }

.trend-list { display: grid; gap: 14px; }
.trend { display: grid; grid-template-columns: 72px minmax(0,1fr) 88px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 3px 14px rgba(42,36,30,.025); }
.trend-rank { padding-top: 25px; color: var(--faint); font-size: 25px; font-weight: 650; letter-spacing: -.06em; text-align: center; }
.trend:first-child .trend-rank { color: var(--coral-deep); }
.trend-main { min-width: 0; padding: 23px 0 21px; }
.trend-meta { display: flex; flex-wrap: wrap; gap: 8px 13px; color: var(--faint); font-size: 10px; }
.trend-meta .hot { color: var(--green); font-weight: 700; }
.trend h3 { max-width: 680px; margin: 8px 0 0; font-size: 22px; font-weight: 680; letter-spacing: -.035em; line-height: 1.24; }
.earned-label { margin-top: 18px; color: var(--faint); font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; }
.company-stack { display: grid; gap: 6px; margin-top: 8px; }
.ad-slot { width: 100%; min-height: 78px; display: grid; grid-template-columns: 70px minmax(0,1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid #f0c8bf; border-radius: 12px; padding: 0; background: var(--white); color: var(--ink); text-align: left; }
.ad-slot.available { background: var(--coral-soft); }
.ad-slot:hover { border-color: var(--coral-deep); box-shadow: 0 5px 16px rgba(235,130,110,.1); }
.ad-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(243,173,159,.23); color: var(--coral-deep); }
.ad-rank span { font-size: 7px; font-weight: 750; text-transform: uppercase; }
.ad-rank strong { margin-top: 2px; font-size: 24px; letter-spacing: -.07em; }
.ad-copy { min-width: 0; align-self: center; padding: 11px 15px; }
.ad-copy > span { color: var(--coral-deep); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.ad-copy h4 { overflow: hidden; margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.ad-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.ad-action { align-self: center; margin-right: 14px; padding: 10px 14px; border-radius: 999px; background: var(--coral); color: var(--white); font-size: 10px; font-weight: 700; text-align: center; }
.company-line { min-height: 36px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; border-bottom: 1px solid #eeeae5; color: var(--muted); font-size: 10px; }
.company-line:last-child { border-bottom: 0; }
.company-line .company-rank { color: var(--faint); }
.company-line strong { color: var(--ink); font-size: 11px; }
.company-line small { padding-right: 5px; color: var(--faint); font-size: 9px; }
.no-company { color: var(--muted); font-size: 11px; font-style: italic; }
.sources { margin-top: 13px; }
.sources summary { width: max-content; color: var(--faint); font-size: 10px; cursor: pointer; }
.sources summary:hover { color: var(--ink); }
.source-links { display: grid; gap: 7px; margin-top: 10px; }
.source-links a { color: var(--muted); font-size: 10px; line-height: 1.4; }
.source-links a:hover { color: var(--ink); }
.trend-score { align-self: start; margin: 24px 13px 0 8px; padding: 9px 7px; border-radius: 10px; background: #f7f5f2; text-align: center; }
.trend-score span { display: block; color: var(--faint); font-size: 7px; text-transform: uppercase; }
.trend-score strong { display: block; margin-top: 2px; font-size: 24px; letter-spacing: -.07em; }
.trend-score i { display: block; margin-top: 2px; color: var(--green); font-size: 9px; font-style: normal; font-weight: 700; }
.empty { padding: 45px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); text-align: center; }

.plain-method { margin: 0 0 72px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.plain-method strong { display: block; font-size: 12px; }
.plain-method p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.footer { min-height: 110px; display: grid; grid-template-columns: auto 1fr auto; gap: 25px; align-items: center; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.footer > span { color: var(--ink); font-size: 13px; font-weight: 700; }
.footer p { margin: 0; text-align: center; }
.footer a { color: var(--muted); }

.overline { margin: 0 0 6px; color: var(--coral-deep); font-size: 9px; font-weight: 700; text-transform: uppercase; }
dialog { width: min(calc(100% - 24px), 520px); border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--white); color: var(--ink); box-shadow: 0 22px 70px rgba(33,31,28,.18); }
dialog::backdrop { background: rgba(32,29,26,.55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.dialog-head button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f4f1ed; font-size: 20px; }
dialog > p, dialog li { color: var(--muted); font-size: 12px; line-height: 1.6; }
dialog ol, dialog ul { padding-left: 20px; }
dialog .small { padding: 12px; border-radius: 9px; background: var(--coral-soft); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; max-width: 360px; padding: 13px 16px; border-radius: 10px; background: var(--ink); color: var(--white); box-shadow: var(--shadow); font-size: 11px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .15s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(235,130,110,.35); outline-offset: 2px; }

@media (max-width: 720px) {
  .wrap { width: min(calc(100% - 28px), 960px); }
  .header { height: 68px; }
  .intro { padding-top: 35px; }
  .intro h1 { font-size: 49px; }
  .bid-title-row { flex-wrap: wrap; }
  .trend-choice { align-items: flex-start; }
  .trend-choice select { max-width: calc(100% - 24px); }
  .trend { grid-template-columns: 54px minmax(0,1fr); }
  .trend-main { padding-right: 16px; }
  .trend-score { grid-column: 2; width: max-content; display: flex; align-items: center; gap: 7px; margin: 0 0 20px; padding: 7px 10px; }
  .trend-score span, .trend-score strong, .trend-score i { display: inline; margin: 0; }
}

@media (max-width: 520px) {
  .header nav { gap: 13px; }
  .header nav button { font-size: 11px; }
  .logo { font-size: 15px; }
  .intro { padding-bottom: 22px; }
  .intro h1 { font-size: 43px; }
  .intro-copy { font-size: 15px; }
  .live { font-size: 9px; }
  .bid-box { padding-top: 24px; }
  .bid-box h2 { font-size: 34px; }
  .amount-control input { width: 82px; font-size: 38px; }
  .amount-control b { font-size: 28px; }
  .amount-control > button { width: 28px; height: 28px; }
  .trend-choice { font-size: 13px; }
  #bid-form { grid-template-columns: minmax(0,1fr) 102px; }
  .field input { font-size: 12px; }
  .bid-button { min-width: 0; padding: 0 13px; }
  .bid-button span { display: none; }
  .placement-preview { grid-template-columns: 58px minmax(0,1fr); }
  .preview-link { display: none; }
  .preview-ad-copy { padding: 11px 12px; }
  .board-head h2 { font-size: 29px; }
  .period button { min-width: 54px; }
  .filters { margin-right: -14px; }
  .trend { grid-template-columns: 45px minmax(0,1fr); border-radius: 13px; }
  .trend-rank { padding-top: 23px; font-size: 20px; }
  .trend-main { padding: 20px 13px 16px 0; }
  .trend h3 { font-size: 18px; }
  .ad-slot { grid-template-columns: 55px minmax(0,1fr); }
  .ad-rank strong { font-size: 21px; }
  .ad-action { grid-column: 1 / -1; margin: 0; border-radius: 0; padding: 9px 12px; }
  .company-line { grid-template-columns: 32px minmax(0,1fr); }
  .company-line small { grid-column: 2; padding: 0 0 7px; }
  .trend-score { grid-column: 2; margin-bottom: 16px; }
  .footer { grid-template-columns: 1fr; gap: 10px; padding: 28px 0; }
  .footer p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
