/* Ask Hopkins — Hopkins CPA brand (maroon #8B1A1A) */
:root {
  --maroon: #8B1A1A;
  --maroon-dark: #6E1414;
  --tint: #F5F0F0;
  --ink: #24272B;
  --muted: #6B7280;
  --line: #E3DCDC;
  --white: #FFFFFF;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--white);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
a { color: var(--maroon); }
h1 { color: var(--maroon); font-size: 1.6rem; line-height: 1.25; margin: 1.2rem 0 .5rem; }
h2 { color: var(--maroon); font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
code { background: var(--tint); padding: 0 4px; border-radius: 3px; }

.site-header { border-bottom: 3px solid var(--maroon); background: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 44px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--maroon); font-size: 1.15rem; }
.brand-text small { color: var(--muted); font-size: .72rem; }
.site-nav a { margin-left: 14px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.site-nav a:hover { color: var(--maroon); }

.dev-banner { background: #FEF3C7; border: 1px solid #F59E0B; padding: 6px 12px; margin-top: 10px; border-radius: 6px; font-size: .85rem; }

.hero { text-align: center; padding: 26px 0 6px; }
.hero h1 { font-size: 1.9rem; }
.hero .sub { color: var(--muted); max-width: 620px; margin: 0 auto; }

.ask-card { background: var(--tint); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 18px 0 26px; }
.ask-card label { display: block; font-weight: 700; margin-bottom: 6px; }
.ask-card textarea, .ask-card input[type=email], .ask-card input[type=text],
.admin-login input, .review-grid input, .review-grid select, .review-grid textarea, .search-form input {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: var(--white);
}
.ask-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin: 4px 0 8px; }
.email-block { margin: 10px 0; padding: 10px; background: var(--white); border: 1px solid var(--maroon); border-radius: 6px; }
.fine { color: var(--muted); font-size: .8rem; }

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-block; border: 0; border-radius: 6px; padding: 10px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; margin-top: 8px;
}
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-primary:disabled { opacity: .55; cursor: wait; }
.btn-secondary { background: var(--white); color: var(--maroon); border: 1px solid var(--maroon); }
.btn-danger { background: #B91C1C; color: var(--white); }
.ask-error { color: #B91C1C; font-weight: 600; }

.similar-panel, .live-panel { margin-top: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.similar-panel { border: 2px solid #F59E0B; border-left-width: 6px; background: #FFFBEB; box-shadow: 0 2px 10px rgba(245,158,11,.2); scroll-margin-top: 16px; outline: none; }
.similar-panel h3 { margin: 0 0 6px; font-size: 1.15rem; color: #92400E; }
.live-status { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.live-answer { white-space: pre-wrap; }
.notice { background: var(--tint); border-left: 4px solid var(--maroon); padding: 10px 14px; border-radius: 4px; }

.thread-list { list-style: none; padding: 0; }
.thread-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.thread-list .meta { color: var(--muted); font-size: .8rem; margin-left: 8px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--white); }
.cat-card:hover { border-color: var(--maroon); }
.cat-card span { color: var(--muted); font-size: .8rem; }

.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.badge { background: var(--maroon); color: var(--white); border-radius: 999px; padding: 2px 11px; font-size: .75rem; font-weight: 700; text-decoration: none; }
.badge-muted { background: var(--tint); color: var(--ink); border: 1px solid var(--line); }
.orig-q { color: var(--muted); }

.answer { font-size: 1.02rem; }
.answer table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.answer th { background: var(--maroon); color: var(--white); padding: 6px 9px; text-align: left; }
.answer td { border-bottom: 1px solid var(--line); padding: 6px 9px; }
.cite-chip { border: 1px solid var(--maroon); background: var(--tint); color: var(--maroon); border-radius: 4px; font-size: .7rem; font-weight: 700; padding: 0 5px; cursor: pointer; margin-left: 2px; }
.cite-chip:hover { background: var(--maroon); color: var(--white); }
.cite-popover { position: absolute; z-index: 50; max-width: 380px; background: var(--white); border: 1px solid var(--maroon); border-radius: 8px; padding: 12px; box-shadow: 0 6px 22px rgba(0,0,0,.18); font-size: .85rem; }
.cite-popover h4 { margin: 0 0 6px; color: var(--maroon); font-size: .85rem; }
.cite-popover blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--maroon); color: var(--ink); }

.sources ol { padding-left: 20px; }
.sources blockquote { margin: 4px 0 10px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: .88rem; }

.disclaimer-box { margin: 18px 0; padding: 10px 14px; background: var(--tint); border-radius: 6px; font-size: .82rem; color: var(--muted); }
.feedback { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.cta-box { border: 2px solid var(--maroon); border-radius: 10px; padding: 16px; margin: 22px 0; background: var(--white); }
.cta-box p { margin: 6px 0; }

.search-form { display: flex; gap: 10px; margin: 14px 0 20px; }
.search-form .btn-primary { margin-top: 0; white-space: nowrap; }
.subnav { color: var(--muted); }
.how-list li { margin-bottom: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--tint); border-radius: 8px; padding: 12px; }
.stat strong { display: block; font-size: 1.3rem; color: var(--maroon); }
.stat span { color: var(--muted); font-size: .8rem; }
.admin-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.admin-table th { background: var(--maroon); color: var(--white); text-align: left; padding: 6px 9px; }
.admin-table td { border-bottom: 1px solid var(--line); padding: 6px 9px; }
.admin-actions { display: flex; gap: 10px; }
.review-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; }
@media (max-width: 760px) { .review-grid { grid-template-columns: 1fr; } }
.review-grid label { display: block; font-weight: 700; margin-top: 10px; }
.flag { display: inline-block; background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 4px; padding: 1px 7px; font-size: .72rem; }
.flag-block { background: #FEE2E2; border-color: #B91C1C; }
.approve-form { margin-top: 14px; }

.site-footer { margin-top: 40px; border-top: 3px solid var(--maroon); background: var(--tint); padding: 18px 0 26px; }
.site-footer p { margin: 6px 0; font-size: .85rem; }

/* ---- Floating answer-page actions ---- */
.cta-float { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cta-float-btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .92rem; padding: 11px 18px; border-radius: 999px; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.cta-call { background: var(--maroon); color: #FFD34D; }
.cta-call:hover { background: var(--maroon-dark); }
.cta-message { background: var(--maroon); color: var(--white); }
.cta-message:hover { background: var(--maroon-dark); }
.cta-print { background: var(--white); color: var(--maroon); border: 2px solid var(--maroon); }
.cta-print:hover { background: var(--tint); }
.cta-ico { font-size: 1.05rem; line-height: 1; }
.cta-short { display: none; }  /* compact labels appear only on the mobile bar */
@media (max-width: 640px) {
  .cta-float { right: 10px; left: 10px; bottom: 10px; flex-direction: row; }
  .cta-float-btn { flex: 1; padding: 13px 8px; font-size: .9rem; }
  .cta-full { display: none; }
  .cta-short { display: inline; }
}
/* Desktop only: float in the right margin, vertically centered, larger, with
   an attention pulse so they aren't lost. Mobile block above is untouched. */
@media (min-width: 641px) {
  .cta-float { right: 24px; bottom: auto; top: 50%; transform: translateY(-50%); gap: 12px; }
  .cta-float-btn { font-size: 1.08rem; padding: 16px 28px; box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .12s ease; }
  .cta-float-btn:hover { transform: translateY(-2px); }
  .cta-call { animation: ctaPulse 2.6s ease-in-out infinite; }
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 0 0 rgba(139,26,26,.5); }
  55% { box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 0 12px rgba(139,26,26,0); }
}
@media (prefers-reduced-motion: reduce) { .cta-call { animation: none; } }

/* Print-only elements are hidden on screen */
.print-letterhead, .print-footer { display: none; }

/* ---- Branded print / Save-as-PDF theme ---- */
@media print {
  .site-header, .site-footer, .site-nav, .dev-banner, .cta-float,
  .feedback, .cta-box, .notice, .badges, .subnav,
  .thread + section { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .wrap { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: none; }
  .answer a[href]::after, .sources a[href]::after { content: ""; }

  .print-letterhead { display: block; border-bottom: 3px solid #8B1A1A; padding-bottom: 10px; margin-bottom: 16px; position: relative; }
  .print-letterhead img { height: 54px; width: auto; }
  .print-firm { font-size: 9.5pt; color: #333; margin-top: 4px; line-height: 1.35; }
  .print-tagline { position: absolute; top: 0; right: 0; color: #8B1A1A; font-weight: 700; font-size: 12pt; }
  .thread h1 { color: #8B1A1A; font-size: 17pt; }
  .sources { border-top: 1px solid #999; padding-top: 8px; }
  .sources blockquote { color: #333; font-size: 9.5pt; }
  .disclaimer-box { background: #f4f4f4 !important; border: 1px solid #bbb; color: #000; font-size: 9pt; }
  .cite-chip { border: 0; background: none; color: #000; font-weight: 700; }
  .print-footer { display: block; margin-top: 20px; border-top: 1px solid #999; padding-top: 8px; font-size: 8.5pt; color: #444; }
}

/* ---- State Tax Charts ---- */
.chart-table-wrap { overflow-x: auto; margin: 14px 0; }
.chart-table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.chart-table thead th { position: sticky; top: 0; background: var(--maroon); color: var(--white); padding: 9px 11px; text-align: left; z-index: 5; }
.chart-table td { border-bottom: 1px solid var(--line); padding: 10px 11px; vertical-align: top; }
.chart-table tbody tr:nth-child(even) { background: var(--tint); }
.cell-state { white-space: nowrap; }
.cell-verified { white-space: nowrap; color: var(--muted); font-size: .82rem; }
.cell-btn { background: none; border: 0; font: inherit; text-align: left; color: var(--ink); cursor: pointer; padding: 0; text-decoration: underline dotted var(--maroon); text-underline-offset: 3px; }
.cell-btn:hover { color: var(--maroon); }
.badge-warn { display: inline-block; background: #FEF3C7; color: #92400E; border: 1px solid #F59E0B; border-radius: 999px; padding: 0 8px; font-size: .7rem; font-weight: 700; }
.state-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chip { border: 1px solid var(--maroon); background: var(--white); color: var(--maroon); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: .8rem; cursor: pointer; }
.chip.is-on { background: var(--maroon); color: var(--white); }
.chart-popover { max-width: 420px; }
.chart-popover h4 { margin: 0 0 6px; color: var(--maroon); font-size: .9rem; }
.chart-popover p { margin: 0 0 8px; font-size: .86rem; }
.pop-cite { color: var(--muted); font-size: .78rem; }
.pop-fine { color: var(--muted); font-size: .72rem; }
@media (max-width: 640px) {
  .chart-popover { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; max-width: none; border-radius: 14px 14px 0 0; border-width: 2px 0 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.3); padding: 16px; }
}

.admin-nav { display: flex; gap: 16px; align-items: center; background: var(--maroon); border-radius: 8px; padding: 9px 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.admin-nav a { color: var(--white); text-decoration: none; font-weight: 700; font-size: .9rem; }
.admin-nav a:hover { text-decoration: underline; }
.inline-form { display: inline; margin-left: auto; }
.linklike { background: none; border: 0; color: var(--white); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: underline; padding: 0; }

.info-tip { position: relative; display: inline-block; margin-left: 6px; color: var(--maroon); cursor: help; font-weight: 700; outline: none; }
.info-tip:focus { text-decoration: underline; }
.info-tip .tip-text {
  visibility: hidden; opacity: 0; transition: opacity .15s;
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  width: 250px; background: var(--ink); color: var(--white);
  padding: 9px 11px; border-radius: 7px; font-size: .76rem; font-weight: 400;
  line-height: 1.4; z-index: 40; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.info-tip .tip-text a { color: #F2C4C4; }
.info-tip:hover .tip-text, .info-tip:focus .tip-text, .info-tip:focus-within .tip-text { visibility: visible; opacity: 1; }

mark { background: #FFE58A; padding: 0 2px; border-radius: 2px; }
.btn-source { background: var(--maroon); color: #FFD34D; }
.btn-source:hover { background: var(--maroon-dark); color: #FFE58A; }
.source-body {
  background: var(--white); border: 1px solid var(--line);
  border-left: 4px solid var(--maroon); border-radius: 8px; padding: 16px 18px;
  font-size: .95rem; line-height: 1.65; margin: 14px 0;
}
.source-body p { margin: 0 0 11px; }
.source-body p:last-child { margin-bottom: 0; }
.quote-fallback { margin: 12px 0; padding: 10px 14px; background: #FFF7DC; border-left: 4px solid #E4B70F; border-radius: 4px; }
.pop-link { display: block; margin-top: 8px; font-weight: 700; }
