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

:root {
  --ink: #0e0e0e;
  --ink-soft: #555;
  --ink-faint: #999;
  --paper: #f5f0e8;
  --paper-2: #ede8de;
  --paper-3: #e2ddd3;
  --accent: #d14f2a;
  --accent-2: #1a3a5c;
  --green: #1a6640;
  --green-bg: #d4edd9;
  --border: #c8c2b5;
  --radius: 4px;
}

body {
  font-family: 'Syne', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── AD BANNER TOP ── */
.ad-banner {
  background: var(--paper-3);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.ad-banner .ad-slot {
  display: inline-block;
  width: 728px;
  max-width: 100%;
  height: 90px;
  background: var(--paper-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 0;
  font-size: 12px;
  color: var(--ink-faint);
  gap: 6px;
}

header {
  padding: 48px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
h1 span { color: var(--accent); }
.tagline {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 400;
}

main {
  flex: 1;
  padding: 40px 24px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ── SEARCH BOX ── */
.search-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 32px;
}
.search-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
  display: block;
}
.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.url-prefix {
  padding: 0 14px;
  background: var(--paper-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
}
#handle-input {
  flex: 1;
  padding: 12px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
#handle-input:focus { border-color: var(--accent-2); }
#check-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
#check-btn:hover { background: #b8401f; }
#check-btn:active { transform: scale(0.98); }
#check-btn:disabled { background: var(--ink-faint); cursor: not-allowed; }

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-faint);
}
.hint a { color: var(--accent-2); }

/* ── RESULT AREA ── */
#result-area { display: none; }

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.pub-logo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  object-fit: cover;
  background: var(--paper-2);
  flex-shrink: 0;
}
.pub-logo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.pub-name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.pub-url { font-size: 13px; font-family: 'DM Mono', monospace; color: var(--ink-faint); margin-top: 3px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-note { font-size: 11px; color: var(--ink-faint); margin-top: 6px; }
.stat-card.highlight { border-color: var(--accent); }
.stat-card.highlight .stat-value { color: var(--accent); }
.stat-card.estimate { border-style: dashed; }
.stat-card.estimate .stat-value { color: var(--ink-soft); font-size: 1.6rem; }
.estimate-disclaimer { font-size: 10px; color: var(--ink-faint); margin-top: 8px; font-style: italic; }
.stat-card.listed { border-color: var(--accent-2); }
.stat-card.listed .stat-value { color: var(--accent-2); }

.sub-public-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-yes { background: var(--green-bg); color: var(--green); }
.badge-no  { background: var(--paper-2); color: var(--ink-faint); }

.desc-box {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.action-btn {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: white;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.action-btn:hover { border-color: var(--accent-2); background: var(--paper); }
.action-btn.primary { background: var(--accent-2); color: white; border-color: var(--accent-2); }
.action-btn.primary:hover { background: #122d47; }

/* ── AD SIDEBAR / INLINE ── */
.ad-inline {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--paper-2);
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--ink-faint);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

/* ── ERROR ── */
#error-area {
  display: none;
  background: #fff1ee;
  border: 1.5px solid #f0c0b0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #8b3820;
}
#error-area strong { display: block; margin-bottom: 4px; font-size: 16px; }

/* ── LOADING ── */
#loading-area {
  display: none;
  text-align: center;
  padding: 40px;
  color: var(--ink-faint);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--paper-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}

/* ── BOTTOM AD ── */
.ad-footer-slot {
  width: 728px;
  max-width: 100%;
  height: 90px;
  background: var(--paper-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 12px;
  color: var(--ink-faint);
  gap: 6px;
}
.footer-note { font-size: 12px; color: var(--ink-faint); }

.faq-section {
  border-top: 1px solid var(--border);
  padding: 48px 24px 40px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.faq-heading {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
}
.faq-item {
  border-top: 1px solid var(--border);
}
.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 0;
  text-align: left;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q:hover { color: var(--accent); }
.faq-chevron {
  font-size: 18px;
  color: var(--ink-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq-item.open .faq-chevron { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 0 20px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.faq-a a { color: var(--accent-2); }
.faq-item.open .faq-a { display: block; }

@media (max-width: 520px) {
  .input-row { flex-direction: column; }
  .url-prefix { border-radius: var(--radius) var(--radius) 0 0; border-right: 1.5px solid var(--border); border-bottom: none; }
  #handle-input { border-left: 1.5px solid var(--border); border-top: none; border-radius: 0; }
  #check-btn { border-radius: 0 0 var(--radius) var(--radius); width: 100%; }
}
