/* ============================================================
   Shared shell — match main SPA header / card chrome on static
   /hs-codes/ pages
   ============================================================ */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #0d1323;
  --bg-card: #111827;
  --bg-hover: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #4f7cff;
  --accent-blue-dim: #3d5fcc;
  --border-color: #1e293b;
}

.hs-static-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
}

.hs-static-body * { box-sizing: border-box; }

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header .logo-img {
  height: 64px;
  width: auto;
  display: block;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-text-short { display: none; }
.nav-text-full { display: inline; }

.nav-link.active-nav {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.header-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-auth .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.header-auth .btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.header-auth .btn-secondary:hover {
  background: var(--bg-hover);
}

.header-auth .btn-primary {
  background: var(--accent-blue);
  color: #fff;
}

.header-auth .btn-primary:hover {
  background: var(--accent-blue-dim);
}

.hidden {
  display: none !important;
}

.notifications-header-container {
  position: relative;
  z-index: 100;
}

.notifications-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.notifications-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--accent-blue);
}

.notifications-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent-blue);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notifications-unread-badge.hidden {
  display: none !important;
}

.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 260px;
  max-width: 320px;
  max-height: 320px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notifications-dropdown.hidden {
  display: none;
}

.notifications-dropdown-list {
  overflow-y: auto;
  max-height: 280px;
}

.notifications-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.notifications-dropdown-item:hover {
  background: var(--bg-hover);
}

.notifications-dropdown-item:last-of-type {
  border-bottom: none;
}

.notifications-dropdown-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.notifications-dropdown-item-summary {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.notifications-dropdown-viewall {
  display: block;
  padding: 0.65rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent-blue);
  text-decoration: none;
  border-top: 1px solid var(--border-color);
}

.notifications-dropdown-viewall:hover {
  background: var(--bg-hover);
}

.notifications-dropdown-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

#anonAuthButtons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-menu-container {
  position: relative;
  z-index: 100;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-hover);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-user:hover {
  background: var(--border-color);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dim));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-menu-container:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item.logout {
  border-top: 1px solid var(--border-color);
  color: var(--accent-red, #ef4444);
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.container {
  width: 100%;
  max-width: min(1400px, 100%);
  margin: 0 auto;
  padding: 2rem;
  overflow-x: clip;
}

.search-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.tab-navigation {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  top: 1px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: var(--bg-card);
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-label-short { display: none; }
.tab-label-full { display: inline; }

.tab-panel {
  padding: 1.25rem 1.5rem 1.5rem;
}

.search-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-row .input-group {
  flex: 1;
  min-width: 200px;
}

.search-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.search-row input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.search-row input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-blue);
  color: #fff;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--accent-blue-dim); }

.hs-static-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  margin-top: 2rem;
  overflow-x: clip;
}

.hs-static-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
}

.hs-static-footer-inner > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hs-static-footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

.commodity-tag {
  display: inline-block;
  background: rgba(79, 124, 255, 0.12);
  color: var(--text-secondary);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin: 0.2rem;
  font-size: 0.8rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

@media (max-width: 640px) {
  .header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .header .logo-img { height: 48px; }
  .nav-main { margin-left: 0.5rem; }
  .nav-link-home,
  .nav-main > a.nav-link[href="/"] { display: none; }
  .nav-text-full { display: none; }
  .nav-text-short { display: inline; }
  .tab-label-full { display: none; }
  .tab-label-short { display: inline; }
  .tab-btn { padding: 0.75rem 0.85rem; }
  .container { padding: 1rem; }
  .tab-panel { padding: 1rem; }
  .header-auth .btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
  .hs-static-footer { padding: 1.25rem 1rem; }
  .hs-static-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Catalogue content (embedded + static)
   ============================================================ */
.hs-catalogue-browse {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color, #1e293b);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hs-catalogue-browse-header { margin-bottom: 1rem; }

.hs-catalogue-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.35rem;
}

.hs-catalogue-sub {
  font-size: 0.875rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.5;
}

.hs-catalogue-loading,
.hs-catalogue-error {
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.hs-catalogue-error { color: #f87171; }

.hs-section-block { margin-bottom: 1.75rem; }

.hs-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color, #1e293b);
}

.hs-section-roman {
  color: var(--accent-blue, #4f7cff);
  margin-right: 0.35rem;
}

.hs-chapter-table,
.hs-children-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.hs-chapter-table {
  table-layout: fixed;
}

.hs-chapter-table col.hs-col-chapter { width: 8%; }
.hs-chapter-table col.hs-col-description { width: 70%; }
.hs-chapter-table col.hs-col-headings,
.hs-chapter-table col.hs-col-hs { width: 11%; }

.hs-chapter-table th,
.hs-chapter-table td,
.hs-children-table th,
.hs-children-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-color, #1e293b);
  vertical-align: top;
}

.hs-chapter-table th,
.hs-children-table th {
  color: var(--text-muted, #64748b);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hs-th-short { display: none; }

.hs-chapter-table th.hs-col-chapter,
.hs-chapter-table td.hs-col-chapter,
.hs-chapter-table th.hs-col-headings,
.hs-chapter-table td.hs-col-headings,
.hs-chapter-table th.hs-col-hs,
.hs-chapter-table td.hs-col-hs {
  text-align: center;
  vertical-align: middle;
}

.hs-chapter-table tr.hs-section-row td {
  background: var(--bg-secondary, #0d1323);
  border-bottom: 1px solid var(--border-color, #1e293b);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  font-size: 0.9rem;
}

.hs-chapter-table td.hs-section-roman-cell {
  color: var(--accent-blue, #4f7cff);
  font-weight: 600;
  white-space: nowrap;
}

.hs-chapter-table td.hs-section-desc-cell {
  color: var(--text-primary, #f1f5f9);
  font-weight: 600;
  text-align: left;
}

.hs-chapter-table .hs-section-range {
  color: var(--text-muted, #64748b);
  font-weight: 400;
  font-size: 0.8rem;
}

.hs-chapter-table td.hs-col-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary, #94a3b8);
}

.hs-chapter-table a,
.hs-children-table a,
.hs-breadcrumbs a,
.hs-back-link,
.hs-tax-type-link {
  color: var(--accent-blue, #4f7cff);
  text-decoration: none;
  font-weight: 500;
}

.hs-chapter-table a:hover,
.hs-children-table a:hover,
.hs-breadcrumbs a:hover,
.hs-back-link:hover,
.hs-tax-type-link:hover {
  text-decoration: underline;
}

.hs-chapter-code {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hs-catalogue-node-view { margin-top: 1.25rem; }

.hs-node-card {
  background: var(--bg-card, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  max-width: 100%;
  /* Fallback scroll if a wide table is not wrapped yet */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Horizontal scroll only when table content cannot fit */
.hs-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.hs-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.85rem;
  color: var(--text-muted, #64748b);
}

.hs-breadcrumb-sep { opacity: 0.5; }

.hs-node-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.hs-node-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-primary, #f1f5f9);
}

.hs-node-desc {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}

.hs-tax-types {
  margin: 1rem 0;
  font-size: 0.9rem;
}

.hs-tax-types-label {
  color: var(--text-muted, #64748b);
  margin-right: 0.35rem;
}

/* "Last Verified Date" line under Applicable taxes (verified 8-digit codes only) */
.hs-tax-verified {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
}

.hs-tax-verified svg {
  flex: 0 0 auto;
  color: var(--accent-green, #10b981);
}

/* Verified tax rates badge (shown when HS code exists in tax_verifications) */
.tax-verified-badge {
  display: inline-flex;
  align-items: center;
  color: #10b981;
  cursor: pointer;
  line-height: 1;
}

.tax-verified-badge:hover {
  color: #059669;
}

/* Optically centre the tick against the .hs-tool-breakdown-label text */
.hs-tool-breakdown-label .tax-verified-badge {
  position: relative;
  top: 1px;
}

.tax-verified-tooltip {
  position: fixed;
  z-index: 9999;
  background: #111827;
  color: #f9fafb;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: none;
}

.hs-tax-label .hs-tax-short { display: none; }

@media (max-width: 640px) {
  .hs-tax-label .hs-tax-full { display: none; }
  .hs-tax-label .hs-tax-short { display: inline; }
}

.hs-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}

.hs-back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.hs-children-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: auto;
}

.hs-children-table th:first-child,
.hs-children-table td:first-child {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
}

.hs-children-table th:nth-child(2),
.hs-children-table td:nth-child(2) {
  width: auto;
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hs-children-table .tax-cell,
.hs-children-table th.hs-tax-col {
  width: 1%;
  white-space: nowrap;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.8rem;
  vertical-align: top;
}

.hs-children-table .hs-expand-col {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.hs-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 6px;
  background: var(--bg-secondary, #0d1323);
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
}

.hs-expand-btn:hover {
  color: var(--text-primary, #f1f5f9);
  border-color: var(--accent-blue, #4f7cff);
}

.hs-expand-btn[aria-expanded="true"] {
  color: var(--accent-blue, #4f7cff);
  border-color: var(--accent-blue, #4f7cff);
}

.hs-expand-btn:disabled,
.hs-expand-btn--empty {
  opacity: 0.45;
  cursor: default;
}

.hs-expand-btn svg {
  display: block;
}

.hs-children-table tr.hs-expand-child td {
  background: rgba(15, 23, 42, 0.35);
}

.hs-children-table td.hs-expand-indent {
  padding-left: calc(0.65rem + (var(--hs-indent, 1) * 0.85rem));
}

.hs-catalogue-tax-panel,
.hs-catalogue-tool-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color, #1e293b);
}

.hs-tool-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hs-tool-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  flex: 0 0 3px;
  border-radius: 2px;
  background: var(--accent-blue, #4f7cff);
}

.hs-tool-trigger {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent-amber, #f59e0b);
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hs-tool-trigger:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.hs-tool-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.hs-tool-trigger svg {
  flex: 0 0 auto;
}

.hs-tool-content {
  margin-top: 1rem;
}

.hs-tool-content[hidden] {
  display: none;
}

.hs-tool-input-card {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #0d1323);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 8px;
}

.hs-tool-input-card > p {
  margin: 0 0 0.75rem;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.8rem;
}

.hs-catalogue-tax-panel label,
.hs-catalogue-tool-panel label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.hs-catalogue-tax-panel input,
.hs-catalogue-tool-panel input,
.hs-catalogue-tool-panel select {
  background: var(--bg-secondary, #0d1323);
  border: 1px solid var(--border-color, #1e293b);
  color: var(--text-primary, #f1f5f9);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  width: 100%;
  max-width: 280px;
  margin-bottom: 0.65rem;
}

.hs-tool-field {
  margin-bottom: 0.35rem;
}

.hs-tool-input-card .hs-tool-field:has(.hs-tool-currency) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 0.5rem;
}

.hs-tool-input-card .hs-tool-field:has(.hs-tool-currency) label {
  grid-column: 1 / -1;
}

.hs-tool-input-card .hs-tool-field input,
.hs-tool-input-card .hs-tool-field select {
  max-width: none;
  margin: 0;
  background: var(--bg-primary, #080d18);
}

.hs-tool-currency {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary, #080d18);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 6px;
  color: var(--text-primary, #f1f5f9);
  font-size: 0.85rem;
}

.hs-tool-calculate {
  width: 100%;
  padding: 0.6rem 1rem;
  margin-top: 0.75rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent-green, #10b981);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.hs-tool-calculate:hover {
  background: #059669;
}

.hs-tool-calculate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hs-tool-results {
  margin-top: 1rem;
}

.hs-tool-result-card {
  position: relative;
  padding: 2.75rem 1rem 1rem;
  background: var(--code-bg, #080d18);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 8px;
}

.hs-tool-plus {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-color, #334155);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hs-tool-plus:hover {
  color: #fff;
  border-color: var(--accent-blue, #4f7cff);
}

.hs-tool-breakdown-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
}

.hs-tool-tax-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-color, #1e293b);
  font-size: 0.85rem;
}

.hs-tool-tax-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs-tool-tax-code {
  color: var(--text-secondary, #94a3b8);
}

.hs-tool-tax-rate {
  margin-top: 0.2rem;
  color: var(--text-muted, #64748b);
  font-size: 0.75rem;
}

.hs-tool-tax-amount {
  flex: 0 0 auto;
  color: var(--text-primary, #f1f5f9);
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

.hs-tool-tax-row.total {
  margin-top: 0.45rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border-color, #1e293b);
  border-bottom: 0;
  color: var(--accent-green, #10b981);
}

.hs-tool-tax-row.total .hs-tool-tax-amount {
  color: var(--accent-green, #10b981);
  font-weight: 600;
}

.hs-tool-tax-row.is-lower {
  padding-left: 0.5rem;
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.hs-tool-tax-row.is-lower .hs-tool-tax-amount {
  color: #10b981;
  font-weight: 600;
}

.hs-tool-tax-amount small {
  color: #10b981;
  font-size: 0.7rem;
}

.hs-tool-preferential {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color, #1e293b);
}

.hs-tool-preferential > p,
.hs-tool-preferential > label {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
  line-height: 1.5;
}

.hs-tool-preferential > p {
  margin: 0 0 0.75rem;
}

.hs-tool-preferential .hs-tool-field label {
  display: none;
}

.hs-tool-preferential .hs-tool-field select {
  max-width: none;
  margin: 0;
  background: var(--bg-primary, #080d18);
}

.hs-tool-pref-calculate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #10b981, #059669);
}

.hs-tool-pref-card {
  position: relative;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #0d1323);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 8px;
}

.hs-tool-pref-title {
  padding-right: 2.5rem;
  color: var(--text-primary, #f1f5f9);
  font-size: 0.9rem;
  font-weight: 600;
}

.hs-tool-pref-countries {
  margin-top: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color, #1e293b);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.8rem;
}

.hs-tool-pref-card .hs-tool-result-card {
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.hs-tool-pref-saving {
  margin-top: 0.75rem;
  padding: 0.55rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 0.8rem;
  font-weight: 500;
}

.hs-tool-disclaimer {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
  line-height: 1.5;
  padding: 0.75rem;
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid rgba(255, 193, 7, 0.5);
  border-radius: 4px;
}

.hs-pref-option {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #0d1323);
  border-radius: 8px;
  border: 1px solid var(--border-color, #1e293b);
}

.hs-pref-option-title {
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 0.25rem;
}

.hs-pref-savings {
  color: #34d399;
  font-weight: 500;
}

.hs-reg-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #0d1323);
  border-radius: 8px;
  border-left: 4px solid #4f7cff;
}

.hs-reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hs-reg-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 0.25rem;
}

.hs-reg-value {
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .hs-reg-grid {
    grid-template-columns: 1fr;
  }

  .hs-tool-tax-row {
    flex-direction: column;
  }

  .hs-tool-tax-row.total {
    flex-direction: row;
  }
}

@media (max-width: 640px) {
  .hs-chapter-table {
    font-size: 0.8rem;
  }

  .hs-th-full { display: none; }
  .hs-th-short { display: inline; }
  .hs-section-label { display: none; }

  .hs-chapter-table col.hs-col-chapter { width: 14%; }
  .hs-chapter-table col.hs-col-description { width: 72%; }
  .hs-chapter-table col.hs-col-hs { width: 14%; }

  .hs-chapter-table th.hs-col-headings,
  .hs-chapter-table td.hs-col-headings,
  .hs-chapter-table col.hs-col-headings {
    display: none;
  }

  .hs-chapter-table th,
  .hs-chapter-table td {
    padding: 0.45rem 0.35rem;
  }

  .hs-chapter-table .hs-section-range {
    font-size: 0.7rem;
  }

  .hs-node-card {
    padding: 1rem 0.85rem;
  }

  .hs-children-table th,
  .hs-children-table td {
    padding: 0.45rem 0.4rem;
  }

  .hs-children-table .hs-expand-col {
    width: 2.25rem;
    min-width: 2.25rem;
    max-width: 2.25rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .hs-expand-btn {
    width: 1.6rem;
    height: 1.6rem;
  }

  /* Nested expand indent can force scroll; keep it modest on phones */
  .hs-children-table td.hs-expand-indent {
    padding-left: calc(0.4rem + (var(--hs-indent, 1) * 0.55rem));
  }
}
