/* hs.css — Biểu thuế HS pages (/hs, /hs/{code}). Loaded per-template via extra_head.
   No inline styles (CSP default-src 'self'): indentation uses .d-0 … .d-6. */

.hs-page { max-width: var(--max-container); }
.hs-lead { color: var(--color-text-muted); max-width: 70ch; }
.hs-muted { color: var(--color-text-muted); }
.hs-vat-source { max-width: 70ch; }
.hs-vat-warn { border-left: 3px solid var(--color-warn-border); padding-left: .75rem; }
.hs-code { font-family: var(--font-mono); white-space: nowrap; }

.hs-banner {
  background: var(--color-badge-yellow);
  border-left: 4px solid var(--color-warn-border);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9375em;
}

.hs-search { display: flex; gap: 8px; margin: 16px 0 24px; max-width: 640px; }
.hs-search input[type="search"] { flex: 1; min-width: 0; padding: 8px 10px; font-size: 1rem;
  border: 1px solid var(--color-border); border-radius: var(--radius); }
.hs-search button { padding: 8px 16px; background: var(--color-brand); color: var(--color-on-brand); border: 0;
  border-radius: var(--radius); cursor: pointer; }

/* Index */
.hs-section { border: 1px solid var(--color-border-light); border-radius: var(--radius); margin-bottom: 8px; }
.hs-section summary { padding: 10px 12px; cursor: pointer; font-weight: 600; }
.hs-section-roman { display: inline-block; min-width: 6.5em; color: var(--color-accent); }
.hs-chapter-list { list-style: none; margin: 0; padding: 0 12px 12px; columns: 1; }
.hs-chapter-list li { padding: 3px 0; break-inside: avoid; }
.hs-special { border: 1px solid var(--color-accent); border-radius: var(--radius); padding: 4px 16px; margin-top: 24px; }
.hs-special h2 { border: 0; }

/* Tree tables */
/* Horizontal scroll only on narrow screens (see mobile block below): an
   overflow container would become the sticky-header scroll root and break
   `position: sticky` on desktop. */
.hs-table-wrap { max-width: 100%; }
.hs-tree, .hs-fta { width: 100%; border-collapse: collapse; font-size: 0.9375em; }
.hs-tree th, .hs-tree td, .hs-fta th, .hs-fta td {
  padding: 6px 8px; border-bottom: 1px solid var(--color-border-light); text-align: left; vertical-align: top;
}
.hs-tree thead th, .hs-fta thead th { position: sticky; top: 0; background: var(--color-bg-alt); }
.hs-rate { white-space: nowrap; }
.hs-row-heading td { font-weight: 600; background: var(--color-bg-alt); }
.hs-row-group td, .hs-row-subheading td { color: var(--color-text-muted); }
.hs-row-subheading:target td, .hs-row-heading:target td { background: var(--color-badge-yellow); }
.d-0 { padding-left: 8px; }
.d-1 { padding-left: 24px; }
.d-2 { padding-left: 40px; }
.d-3 { padding-left: 56px; }
.d-4 { padding-left: 72px; }
.d-5 { padding-left: 88px; }
.d-6 { padding-left: 104px; }
.hs-jump { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--font-mono); font-size: 0.875em; margin: 12px 0; }
.hs-notes { margin: 12px 0; border: 1px solid var(--color-border-light); border-radius: var(--radius); padding: 0 12px; }
.hs-notes summary { padding: 8px 0; cursor: pointer; font-weight: 600; }
.hs-notes h3 { font-size: 1rem; }
.hs-notes-lang { font-size: 0.875em; }

/* Line page */
.hs-path { font-size: 1.0625em; margin-bottom: 4px; }
/* Line page h1: code chip + product label; copy button sits below the h1. */
.hs-line-page h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hs-h1-desc { min-width: 0; overflow-wrap: anywhere; }
.hs-code-actions { margin: -4px 0 8px; }
.hs-desc-en { font-size: 0.875em; }
.hs-declare { font-size: 0.875em; color: var(--color-text-muted); margin-top: 2px; }
.hs-declare strong { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
/* Key-rate cards: first card (NK ưu đãi) gets the accent top border. */
.hs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.hs-card { border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); padding: 12px 14px;
  background: var(--color-bg); box-shadow: var(--shadow-sm); }
.hs-card:first-child { border-top: 3px solid var(--color-accent); }
.hs-card-label { display: block; font-size: 0.8125em; font-weight: 500; color: var(--color-text-muted); }
.hs-card-value { display: block; margin-top: 2px; font-family: var(--font-heading); font-size: 1.625em; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.hs-card-note { display: block; color: var(--color-text-muted); }
.hs-card-empty .hs-card-value { color: var(--color-text-muted); font-weight: 400; }
.hs-filter { font-size: 0.875em; }
.hs-fta th[scope="row"] { font-weight: 600; white-space: nowrap; }
.hs-lowest { background: var(--color-badge-green); }
.hs-dim { color: var(--color-text-muted); }
.hs-badge { display: inline-block; font-size: 0.8125em; background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light); border-radius: 10px; padding: 0 8px; }
.hs-rcep { margin: 4px 0; padding-left: 18px; }
.hs-group { border: 1px solid var(--color-border-light); border-radius: var(--radius); padding: 0 12px 8px; margin: 12px 0; }
.hs-group summary { padding: 8px 0; cursor: pointer; font-weight: 600; }
.hs-chips { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hs-chip { display: inline-block; border-radius: var(--radius); padding: 4px 10px; text-decoration: none;
  border: 1px solid var(--color-border-light); background: var(--color-bg-alt); color: var(--color-text); }
.hs-chip:hover { border-color: var(--color-link); }
.hs-chip-kind { font-weight: 600; margin-right: 4px; }
.hs-chip-quarantine .hs-chip-kind { color: var(--color-accent); }
.hs-chip-license .hs-chip-kind { color: var(--color-link); }
.hs-chip-ban .hs-chip-kind { color: var(--color-danger); }
.hs-chip-quality_check .hs-chip-kind { color: light-dark(#6D28D9, #C4B5FD); }
.hs-chip-border_trade .hs-chip-kind { color: light-dark(#92400E, #FCD34D); }
.hs-chip-anti_dumping .hs-chip-kind { color: light-dark(#C2410C, #FDBA74); }
.hs-chip-vat_no_reduction .hs-chip-kind { color: var(--color-text-muted); }
.hs-siblings { max-height: 320px; overflow-y: auto; padding-left: 18px; }
.hs-current { font-weight: 600; background: var(--color-badge-yellow); }

/* Mobile: keep the row label visible while the rate columns scroll. */
@media (max-width: 720px) {
  .hs-table-wrap { overflow-x: auto; }
  .hs-fta th[scope="row"], .hs-estimate th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--color-bg); }
  .hs-fta tr:nth-child(even) th[scope="row"], .hs-estimate tr:nth-child(even) th[scope="row"] { background: var(--color-bg-alt); }
  .hs-fta tr.hs-lowest th[scope="row"] { background: var(--color-badge-green); }
}
@media (max-width: 600px) {
  .hs-col-unit { display: none; }
  .d-4, .d-5, .d-6 { padding-left: 64px; }
  .hs-search { flex-direction: column; }
}
@media (min-width: 720px) {
  .hs-chapter-list { columns: 2; }
}

/* Phase 05: origin form, best-rate card, estimate, filters, policy pages */
.hs-origin-form { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 16px 0;
  padding: 14px 16px; background: var(--color-bg-alt); border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); }
.hs-origin-form label { display: flex; flex-direction: column; font-size: 0.875em; gap: 2px; }
.hs-origin-form select, .hs-origin-form input[type="text"] { padding: 7px 10px; font-size: 1rem; min-width: 12em;
  background: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius); }
.hs-origin-form button { min-height: 38px; padding: 7px 18px; background: var(--color-brand); color: var(--color-on-brand); border: 0;
  border-radius: var(--radius); font-family: inherit; font-weight: 600; cursor: pointer; }
.hs-origin-form button:hover { background: var(--color-brand-hover); }
.hs-quota { border: 0; padding: 0; margin: 0; display: flex; gap: 12px; font-size: 0.875em; }
.hs-quota legend { padding: 0; margin-bottom: 2px; }
.hs-quota label { flex-direction: row; align-items: center; gap: 4px; }
.hs-best { border: 1px solid var(--color-border-light); border-left: 4px solid var(--color-accent); border-radius: var(--radius-lg);
  background: var(--color-accent-soft); padding: 10px 16px; margin: 12px 0; }
.hs-best p { margin: 4px 0; }
.hs-best-pct { font-size: 1.25em; color: var(--color-accent); }
.hs-estimate { width: 100%; border-collapse: collapse; font-size: 0.9375em; }
.hs-estimate th, .hs-estimate td { padding: 6px 8px; border-bottom: 1px solid var(--color-border-light); text-align: left; }
.hs-estimate td.hs-rate { text-align: right; }
.hs-total th, .hs-total td { border-top: 2px solid var(--color-border); }
.hs-warn { background: var(--color-badge-yellow); padding: 6px 10px; border-radius: var(--radius); font-size: 0.9375em; }
.hs-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.hs-filter-chip { font-size: 0.875em; padding: 3px 10px; border: 1px solid var(--color-border-light); border-radius: 14px;
  text-decoration: none; background: var(--color-bg); }
.hs-filter-chip.is-active { background: var(--color-brand); color: var(--color-on-brand); border-color: var(--color-brand); }
.hs-policy-group h2 { font-size: 1.25rem; }
.hs-policy-list { padding-left: 18px; }
.hs-policy-list li { margin: 4px 0; }
.hs-count { color: var(--color-text-muted); font-size: 0.875em; white-space: nowrap; }

/* "Báo sai thuế suất" link at the end of an HS line page. */
.hs-report { margin-top: 1.5rem; font-size: 0.9375rem; color: var(--color-text-muted); }
