/* Customs tariff browser (/customs-tariff/) — card design follows the CustomsTariff app */
.tariff-page {
  --t-green: #2e7d32;
  --t-green-2: #43a047;
  --t-bg: #ffffff;
  --t-soft: #f1f8f1;
  --t-line: #e5e7eb;
  --t-text: #1f2937;
  --t-muted: #6b7280;
  --t-chapter: #f9fafb;
  margin-left: auto; margin-right: auto;
  padding-bottom: 24px;
  color: var(--t-text);
}
[data-bs-theme="dark"] .tariff-page {
  --t-bg: #1f2937;
  --t-soft: #1b3a24;
  --t-line: #374151;
  --t-text: #e5e7eb;
  --t-muted: #9ca3af;
  --t-chapter: #273244;
}

/* ---- Header ---- */
.tariff-page .t-header {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--t-green) 0%, var(--t-green-2) 100%);
  color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(46, 125, 50, .22);
}
.tariff-page .t-header-icon {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tariff-page .t-header-text { flex: 1; min-width: 0; }
.tariff-page .t-header h1 { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 0 0 4px; color: #fff; }
.tariff-page .t-header p { font-size: 15px; margin: 0; opacity: .92; }
.tariff-page .t-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tariff-page .t-header-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.18); color: #fff;
  font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background .15s, transform .15s;
}
.tariff-page .t-header-btn:hover, .tariff-page .t-header-btn:focus-visible { background: rgba(255,255,255,.3); color: #fff; outline: none; }
.tariff-page .t-header-btn:active { transform: scale(.94); }
.tariff-page .t-header-btn.active { background: #fff; color: var(--t-green); }
.tariff-page .t-header-btn[hidden] { display: none; }

/* ---- Search ---- */
.tariff-page .t-search { margin-bottom: 12px; }
.tariff-page .t-search[hidden] { display: none; }
.tariff-page .t-search-box {
  display: flex; align-items: center; gap: 8px; height: 48px; margin: 0;
  background: var(--t-bg); border: 1.5px solid var(--t-green-2); border-radius: 12px;
  padding: 0 6px 0 14px; box-shadow: 0 2px 6px rgba(46,125,50,.10); cursor: text;
}
.tariff-page .t-search-box:focus-within { border-color: var(--t-green); box-shadow: 0 0 0 3px rgba(67,160,71,.18); }
.tariff-page .t-search-box > i { color: var(--t-muted); }
.tariff-page .t-search-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--t-text);
}
.tariff-page .t-search-box input::-webkit-search-cancel-button { display: none; }
.tariff-page .t-search-clear {
  border: 0; background: transparent; color: var(--t-muted); font-size: 18px;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
}
.tariff-page .t-search-clear[hidden] { display: none; }
.tariff-page .t-status { font-size: 13px; color: var(--t-muted); margin: 0 4px 10px; }
.tariff-page .t-status:empty { display: none; }
.tariff-page .t-results[hidden], .tariff-page .t-tree[hidden] { display: none; }
.tariff-page .t-result-group { margin-bottom: 14px; display: grid; gap: 10px; }
.tariff-page .t-result-chapter {
  display: block; font-weight: 600; font-size: 15px; color: var(--t-green);
  padding: 8px 4px; text-decoration: none;
}
.tariff-page .t-result-chapter:hover { text-decoration: underline; }
.tariff-page mark.t-hit { background: #fde68a; color: #111827; padding: 0 2px; border-radius: 3px; }
.tariff-page .t-empty { text-align: center; padding: 48px 16px; color: var(--t-muted); background: var(--t-bg); border-radius: 16px; }
.tariff-page .t-empty i { font-size: 28px; opacity: .5; }
.tariff-page .t-empty p { margin: 10px 0 2px; font-size: 16px; color: var(--t-text); }

/* ---- Sections / chapters ---- */
.tariff-page .t-section { background: var(--t-bg); border-radius: 16px; overflow: hidden; overflow: clip; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tariff-page .t-section-head, .tariff-page .t-chapter-head {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; cursor: pointer; font: inherit;
}
.tariff-page .t-section-head {
  background: linear-gradient(135deg, var(--t-green) 0%, var(--t-green-2) 100%);
  color: #fff; padding: 13px 16px; font-size: 16px; font-weight: 600;
}
/* Stacked sticky headings: section, then chapter, then the table heading (sticky-headings.js sets the heights) */
.tariff-page .t-section-head { position: sticky; top: var(--site-top, 0px); z-index: 4; }
.tariff-page .t-chapter-head { position: sticky; top: calc(var(--site-top, 0px) + var(--sec-h, 0px)); z-index: 3; }
.tariff-page .t-section-title, .tariff-page .t-chapter-title { flex: 1; min-width: 0; }
.tariff-page .t-chev { width: 14px; font-size: 13px; transition: transform .2s; }
.tariff-page .t-count {
  flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.tariff-page .t-section:not(.is-open) .t-section-body { display: none; }
.tariff-page .t-section:not(.is-open) .t-section-head .t-chev { transform: rotate(-90deg); }

.tariff-page .t-chapter + .t-chapter { border-top: 1px solid var(--t-line); }
.tariff-page .t-chapter-head {
  background: var(--t-bg); color: var(--t-text); padding: 12px 16px; font-size: 15px; font-weight: 500;
}
.tariff-page .t-chapter-head:hover { background: var(--t-chapter); }
.tariff-page .t-chapter-head:disabled { cursor: default; opacity: .55; }
.tariff-page .t-chapter-head .t-chev { color: var(--t-muted); }
.tariff-page .t-chapter-head .t-count { background: var(--t-soft); color: var(--t-green); }
.tariff-page .t-chapter.is-open > .t-chapter-head { background: var(--t-soft); }
.tariff-page .t-chapter.is-open > .t-chapter-head .t-chev { transform: rotate(90deg); }
.tariff-page .t-chapter-body { background: var(--t-chapter); padding: 12px; display: grid; gap: 10px; }
.tariff-page .t-chapter-body[hidden] { display: none; }
.tariff-page .t-loading { text-align: center; color: var(--t-muted); padding: 16px; font-size: 14px; }

/* ---- HS code table (chapters and search results) ---- */
.tariff-page .t-chapter-body:has(> .t-table-wrap) { padding: 0; }
.tariff-page .t-table-wrap { overflow-x: auto; background: var(--t-bg); -webkit-overflow-scrolling: touch; }
.tariff-page .t-result-group .t-table-wrap { border: 1px solid var(--t-line); border-radius: 12px; }
.tariff-page .t-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--t-text); }
.tariff-page .t-table th {
  background: var(--t-green); color: #fff; font-weight: 600; font-size: 13px; text-align: center;
  padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
/* Table heading: wide screens stick it below the section and chapter headings;
   narrow screens scroll the table in its own box (it is wider than the phone) and stick it to the box top. */
@media (min-width: 768px) {
  .tariff-page .t-table-wrap { overflow: visible; }
  .tariff-page .t-result-group .t-table-wrap { overflow: clip; }
  .tariff-page .t-table th { top: calc(var(--site-top, 0px) + var(--sec-h, 0px) + var(--ch-h, 0px)); }
  .tariff-page .t-result-group .t-table th { top: var(--site-top, 0px); }
}
@media (max-width: 767px) {
  .tariff-page .t-table-wrap { max-height: 75vh; overflow: auto; }
}
.tariff-page .t-table th:first-child, .tariff-page .t-table td:first-child { padding-left: 18px; }
.tariff-page .t-table th:last-child, .tariff-page .t-table td:last-child { padding-right: 18px; }
.tariff-page .t-table th:nth-child(2) { text-align: left; }
.tariff-page .t-table td { padding: 9px 12px; border-top: 1px solid var(--t-line); vertical-align: middle; }
.tariff-page .t-table tbody tr:nth-child(even) { background: var(--t-chapter); }
.tariff-page .t-table tbody tr:hover { background: var(--t-soft); }
.tariff-page .t-table .t-code { font-size: 14px; white-space: nowrap; }
.tariff-page .t-c-desc { min-width: 220px; line-height: 1.45; }
.tariff-page .t-c-unit { white-space: nowrap; text-align: center; color: var(--t-muted); }
.tariff-page .t-c-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tariff-page .t-c-num small { font-size: 11px; color: var(--t-muted); }
.tariff-page .t-c-tti { font-weight: 700; color: #b91c1c; }
.tariff-page .t-c-calc { text-align: center; width: 1%; }
.tariff-page .t-calc-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--t-soft); color: var(--t-green); text-decoration: none; font-size: 13px;
}
.tariff-page .t-calc-icon:hover { background: var(--t-green); color: #fff; }
.tariff-page .t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- HS code card (detail page) ---- */
.tariff-page .t-card {
  background: var(--t-bg); border: 1px solid var(--t-line); border-radius: 12px; padding: 12px 14px;
}
.tariff-page .t-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tariff-page .t-code {
  display: inline-flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 700;
  color: #059669; text-decoration: none; letter-spacing: .3px; font-variant-numeric: tabular-nums;
}
.tariff-page .t-code:hover { text-decoration: underline; }
.tariff-page .t-tags { display: flex; gap: 6px; }
.tariff-page .t-unit, .tariff-page .t-tti {
  display: inline-flex; align-items: baseline; gap: 5px; border-radius: 8px; padding: 3px 9px;
  font-size: 14px; font-weight: 700;
}
.tariff-page .t-unit { background: #eef2ff; color: #4338ca; }
.tariff-page .t-tti { background: #fef2f2; color: #b91c1c; }
.tariff-page .t-tags small { font-size: 11px; font-weight: 600; opacity: .75; }
.tariff-page .t-desc { margin: 8px 0 10px; font-size: 15px; line-height: 1.55; color: var(--t-text); }
.tariff-page .t-rates {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--t-line); border-radius: 10px; overflow: hidden;
}
.tariff-page .t-rate { text-align: center; padding: 6px 2px; }
.tariff-page .t-rate + .t-rate { border-left: 1px solid var(--t-line); }
.tariff-page .t-rate span { display: block; font-size: 12px; font-weight: 700; color: var(--c); }
.tariff-page .t-rate b { display: block; font-size: 15px; font-weight: 600; color: var(--t-text); font-variant-numeric: tabular-nums; }
.tariff-page .t-rate b small { font-size: 11px; font-weight: 500; color: var(--t-muted); }
.tariff-page .t-card-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.tariff-page .t-calc, .tariff-page .t-copy {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  border-radius: 8px; padding: 6px 12px; text-decoration: none; cursor: pointer;
}
.tariff-page .t-calc { background: var(--t-green); color: #fff; border: 1px solid var(--t-green); }
.tariff-page .t-calc:hover { background: #1b5e20; color: #fff; }
.tariff-page .t-copy { background: transparent; color: var(--t-green); border: 1px solid var(--t-green-2); }
.tariff-page .t-copy:hover { background: var(--t-soft); }
.tariff-page .t-copy.copied { background: var(--t-green); color: #fff; }

/* ---- Detail page ---- */
.tariff-page .t-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-size: 13px; color: var(--t-muted); margin: 0 4px 12px;
}
.tariff-page .t-crumbs a { color: var(--t-green); text-decoration: none; }
.tariff-page .t-crumbs a:hover { text-decoration: underline; }
.tariff-page .t-crumbs i { font-size: 9px; }
.tariff-page .t-detail .t-card { padding: 18px; }
.tariff-page .t-detail .t-code { font-size: 22px; }
.tariff-page .t-detail .t-desc { font-size: 17px; }
.tariff-page .t-detail .t-rate { padding: 10px 2px; }
.tariff-page .t-detail .t-rate b { font-size: 18px; }
.tariff-page .t-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tariff-page .t-pager-btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--t-bg); color: var(--t-text);
  border: 1px solid var(--t-line); border-radius: 12px; padding: 10px 14px; text-decoration: none; font-weight: 600;
}
.tariff-page .t-pager-btn small { display: block; font-size: 11px; color: var(--t-muted); font-weight: 500; }
.tariff-page .t-pager-btn.next { text-align: right; margin-left: auto; }
.tariff-page .t-pager-btn:hover { border-color: var(--t-green-2); color: var(--t-green); }

/* ---- Phones ---- */
@media (max-width: 575px) {
  .tariff-page .t-header { padding: 14px 12px; gap: 10px; }
  .tariff-page .t-header-icon { width: 40px; height: 40px; font-size: 18px; }
  .tariff-page .t-header h1 { font-size: 19px; }
  .tariff-page .t-header p { font-size: 13px; }
  .tariff-page .t-header-btn { width: 38px; height: 38px; font-size: 15px; }
  .tariff-page .t-header-actions { gap: 6px; }
  .tariff-page .t-section-head { font-size: 15px; padding: 12px; }
  .tariff-page .t-chapter-head { font-size: 14px; padding: 11px 12px; }
  .tariff-page .t-chapter-body { padding: 8px; }
  .tariff-page .t-card { padding: 10px 11px; }
  .tariff-page .t-table { font-size: 13px; }
  .tariff-page .t-table td, .tariff-page .t-table th { padding: 7px 8px; }
  .tariff-page .t-table th:first-child, .tariff-page .t-table td:first-child { padding-left: 12px; }
  .tariff-page .t-table th:last-child, .tariff-page .t-table td:last-child { padding-right: 12px; }
  .tariff-page .t-c-desc { min-width: 180px; }
  .tariff-page .t-rate span { font-size: 11px; }
  .tariff-page .t-rate b { font-size: 13px; }
  .tariff-page .t-detail .t-rate b { font-size: 15px; }
  .tariff-page .t-detail .t-code { font-size: 19px; }
}
.tariff-page .t-chapter { scroll-margin-top: 80px; }

/* ===== Same look as the act pages (act-styles.css): header card, green section bars (like অংশ),
   bordered chapter boxes (like অধ্যায়), Hind Siliguri headings ===== */
.tariff-page {
  --t-green-3: #4caf50;          /* gradient end / chapter border, as --app-green-light on act pages */
  --t-green-dark: #1b5e20;       /* open / hover section, as --app-green-hover */
  --t-open: #e8f5e9;             /* open chapter, as --app-green-bg */
  --t-body: #fafafa;             /* behind the chapters, as .unit-content */
}
[data-bs-theme="dark"] .tariff-page { --t-open: #1b3a24; --t-body: #273244; }
.tariff-page .t-header h1, .tariff-page .t-header p,
.tariff-page .t-section-title, .tariff-page .t-chapter-title, .tariff-page .t-result-chapter {
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
}

/* Header */
.tariff-page .t-header {
  background: linear-gradient(135deg, var(--t-green) 0%, var(--t-green-3) 100%);
  padding: 12px 16px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.tariff-page .t-header-icon { border-radius: 6px; }
.tariff-page .t-header h1 { font-weight: 500; }
.tariff-page .t-header p { opacity: .9; }

/* All sections sit in one white card */
.tariff-page .t-tree {
  background: var(--t-bg); border-radius: 24px; overflow: hidden; overflow: clip;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.tariff-page .t-section {
  border-radius: 0; margin: 0 0 8px; box-shadow: none; background: transparent;
  border-bottom: 1px solid var(--t-line);
}
.tariff-page .t-section:last-child { margin-bottom: 0; border-bottom: 0; }

/* Section bar */
.tariff-page .t-section-head {
  background: linear-gradient(135deg, var(--t-green) 0%, var(--t-green-3) 100%);
  padding: 16px 20px; gap: 12px; font-size: 16px; font-weight: 500; transition: background .3s;
}
.tariff-page .t-section-head:hover,
.tariff-page .t-section.is-open > .t-section-head { background: linear-gradient(135deg, var(--t-green-dark) 0%, var(--t-green) 100%); }
.tariff-page .t-section-head .t-chev { font-size: 16px; color: rgba(255,255,255,.8); transition: transform .3s; }
.tariff-page .t-section.is-open > .t-section-head .t-chev { transform: rotate(180deg); color: #fff; }
.tariff-page .t-section:not(.is-open) .t-section-head .t-chev { transform: none; }
.tariff-page .t-section-body { background: var(--t-body); padding: 4px 0; }

/* Chapter box */
.tariff-page .t-chapter + .t-chapter { border-top: 0; }
.tariff-page .t-chapter-head {
  width: calc(100% - 24px); margin: 8px 12px; padding: 14px 16px; gap: 12px;
  background: var(--t-bg); border: 2px solid var(--t-green-3); border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05); font-size: 15px; font-weight: 500;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.tariff-page .t-chapter-head:hover { background: var(--t-body); border-color: var(--t-green); box-shadow: 0 4px 8px rgba(0,0,0,.1); }
.tariff-page .t-chapter.is-open > .t-chapter-head { background: var(--t-open); border-color: var(--t-green); box-shadow: 0 4px 8px rgba(0,0,0,.1); }
.tariff-page .t-chapter-head .t-chev { font-size: 14px; color: var(--t-muted); transition: transform .3s; }
.tariff-page .t-chapter.is-open > .t-chapter-head .t-chev { transform: rotate(180deg); color: var(--t-green); }
.tariff-page .t-chapter-body {
  margin: 0 12px 8px; background: var(--t-bg); border-radius: 0 0 8px 8px; overflow: hidden; overflow: clip;
}
.tariff-page .t-chapter-body:has(> .t-loading) { padding: 4px; }

@media (max-width: 575px) {
  .tariff-page .t-header { padding: 10px 12px; }
  .tariff-page .t-tree { border-radius: 16px; }
  .tariff-page .t-section-head { padding: 12px 14px; font-size: 15px; }
  .tariff-page .t-chapter-head { width: calc(100% - 16px); margin: 6px 8px; padding: 10px 14px; font-size: 14px; }
  .tariff-page .t-chapter-body { margin: 0 8px 6px; }
}
