:root {
  --ink: #17201b;
  --muted: #5e6a63;
  --line: #d9e0dc;
  --paper: #fbfcfa;
  --surface: #f2f6f3;
  --teal: #11756f;
  --teal-dark: #0d5854;
  --blue: #244f7a;
  --amber: #b45f12;
  --red: #a33a2c;
  --shadow: 0 18px 60px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(217, 224, 220, 0.88);
  background: rgba(251, 252, 250, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
  background: var(--teal-dark);
  font-size: 13px;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.lookup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
  align-items: stretch;
  padding: 34px 0 28px;
}

.lookup-panel,
.signal-panel,
.results-section,
.workflow-section,
.keyword-section,
.content-page,
.source-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.lookup-panel {
  padding: clamp(22px, 4vw, 40px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.intro,
.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.search-form {
  margin-top: 28px;
}

.search-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-row input {
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #bfc9c4;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(17, 117, 111, 0.14);
}

.search-row button,
.popular button,
.copy-button {
  border: 0;
  cursor: pointer;
  font-weight: 760;
}

.search-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 126px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 8px;
  color: white;
  background: var(--teal);
}

.search-row button:hover {
  background: var(--teal-dark);
}

.popular {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.popular button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.popular button:hover {
  border-color: #9fb1aa;
  background: #e7eeea;
}

.notice {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid #ead7b7;
  border-radius: 8px;
  color: #4f3517;
  background: #fff8ec;
  font-size: 14px;
}

.signal-panel {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #10201e;
}

#tradeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.signal-content {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.signal-content > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  background: rgba(11, 24, 22, 0.72);
}

.metric-label {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  margin-bottom: 0;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 800;
  line-height: 1.1;
}

.results-section,
.workflow-section,
.keyword-section {
  margin: 0 0 22px;
  padding: clamp(18px, 3vw, 28px);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.status {
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
  font-weight: 650;
}

.status.loading {
  color: var(--blue);
  border-color: #bdd0e2;
  background: #f0f6fb;
}

.status.warning {
  color: #5a3311;
  border-color: #e7c894;
  background: #fff7e8;
}

.status.error {
  color: var(--red);
  border-color: #e8b8b1;
  background: #fff1ef;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.code {
  margin-bottom: 2px;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.05;
}

.hs6 {
  margin-bottom: 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-button {
  min-width: 64px;
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.copy-button:hover {
  background: #e2ebe6;
}

.description {
  color: var(--ink);
  font-size: 15px;
}

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: auto 0 14px;
}

.tariff-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-size: 13px;
  font-weight: 760;
  text-align: center;
  text-decoration: none;
}

.result-actions a:last-child {
  color: var(--ink);
  background: #eaf0f4;
}

.workflow-section {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 22px;
  align-items: start;
}

.workflow-grid,
.keyword-grid,
.content-grid,
.source-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-grid article,
.keyword-grid a,
.content-grid article,
.source-list article,
.article-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.keyword-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.keyword-grid a {
  color: var(--ink);
  text-decoration: none;
}

.keyword-grid a:hover {
  border-color: #9fb1aa;
  background: var(--surface);
}

.keyword-grid span {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 850;
}

.keyword-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.step {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--amber);
  font-weight: 850;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
  padding: 16px;
  box-shadow: none;
}

.source-strip a,
.source-list a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--teal-dark);
  background: #e8f3f1;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.content-page {
  margin-top: 34px;
  margin-bottom: 26px;
  padding: clamp(20px, 4vw, 42px);
}

.content-page h1 {
  font-size: clamp(38px, 6vw, 76px);
}

.content-grid,
.source-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.article-block {
  margin-top: 14px;
}

.check-list,
.number-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.check-list li,
.number-list li {
  margin: 8px 0;
}

.warning-block {
  border-color: #e8b8b1;
  background: #fff7f5;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 4vw, 56px) 34px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 920px) {
  .lookup-hero,
  .workflow-section {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keyword-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-panel {
    min-height: 330px;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    overflow-x: auto;
  }

  main {
    width: min(100% - 20px, 1180px);
  }

  .lookup-hero {
    padding-top: 16px;
  }

  .search-row,
  .results-grid,
  .workflow-grid,
  .keyword-grid,
  .content-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  .search-row button {
    width: 100%;
  }

  .section-heading,
  .result-actions,
  .signal-content {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .signal-panel {
    min-height: 420px;
  }

  .tariff-grid {
    grid-template-columns: 1fr;
  }
}

/* Visual refresh */
:root {
  --ink: #101815;
  --muted: #596761;
  --line: #d7ded9;
  --paper: #f6f8f5;
  --surface: #edf3ef;
  --teal: #117c73;
  --teal-dark: #0f3f3b;
  --blue: #2b5573;
  --amber: #c6842b;
  --shadow: 0 24px 80px rgba(19, 32, 27, 0.13);
}

body {
  background:
    linear-gradient(180deg, #fbfcfa 0%, #f2f6f3 46%, #f6f8f5 100%);
}

.site-header {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom-color: rgba(188, 202, 195, 0.72);
  background: rgba(250, 252, 249, 0.9);
}

.brand {
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15, 63, 59, 0.2);
}

.brand-text {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  display: none;
}

nav {
  gap: 4px;
}

nav a {
  border: 1px solid transparent;
  color: #4d5d56;
  font-size: 13px;
  letter-spacing: 0;
}

nav a:hover,
nav a[aria-current="page"] {
  border-color: var(--line);
  background: rgba(237, 243, 239, 0.78);
}

main {
  width: min(1180px, calc(100% - 40px));
}

.lookup-hero {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.86fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  min-height: calc(100vh - 118px);
  padding: clamp(34px, 6vw, 72px) 0 30px;
}

.lookup-panel {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  letter-spacing: 0.14em;
}

h1 {
  max-width: 690px;
  font-size: clamp(46px, 6.2vw, 86px);
  line-height: 0.93;
  letter-spacing: 0;
}

.intro,
.lede {
  color: #52615b;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
}

.search-form {
  max-width: 680px;
  margin-top: 34px;
  padding: 16px;
  border: 1px solid rgba(183, 198, 190, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(21, 34, 29, 0.1);
}

.search-form label {
  margin-bottom: 10px;
  color: #25312d;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
}

.search-row input {
  height: 58px;
  border-color: #c5d0ca;
  background: #fbfcfa;
  font-size: 16px;
}

.search-row button {
  min-width: 0;
  min-height: 58px;
  background: #0f6861;
  box-shadow: 0 10px 22px rgba(15, 104, 97, 0.22);
}

.search-row button:hover {
  background: #0d514c;
}

.popular {
  max-width: 680px;
  margin-top: 12px;
}

.popular button {
  min-height: 36px;
  border-color: #c9d5ce;
  background: rgba(255, 255, 255, 0.78);
}

.notice {
  max-width: 680px;
  margin-top: 18px;
  border-color: #e4c492;
  background: #fff6e8;
}

.signal-panel {
  min-height: 650px;
  border: 1px solid rgba(214, 222, 216, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(10, 27, 25, 0.08), rgba(10, 27, 25, 0.64)),
    url("./assets/trade-lookup-hero.webp") center / cover no-repeat;
  box-shadow: 0 26px 80px rgba(16, 29, 25, 0.2);
}

.signal-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(12, 31, 28, 0.18), rgba(12, 31, 28, 0.02) 46%, rgba(12, 31, 28, 0.28));
  pointer-events: none;
}

#tradeCanvas {
  display: none;
}

.signal-content {
  z-index: 1;
  right: 20px;
  bottom: 20px;
  left: 20px;
}

.signal-content > div {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(8, 22, 20, 0.76);
  box-shadow: 0 12px 34px rgba(5, 14, 12, 0.24);
}

.metric-value {
  color: #fffef8;
}

.results-section,
.workflow-section,
.keyword-section {
  border: 1px solid rgba(210, 220, 214, 0.9);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 60px rgba(28, 43, 36, 0.08);
}

.results-section {
  margin-top: 0;
}

.status {
  border-color: #cad6cf;
  color: #53635d;
  background: #f4f7f4;
}

.results-grid {
  gap: 12px;
}

.result-card {
  min-height: 292px;
  border-color: #d6dfd9;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(23, 32, 27, 0.06);
}

.code {
  font-size: 22px;
}

.description {
  color: #25312d;
  font-size: 14px;
  line-height: 1.45;
}

.tariff-grid div {
  border-color: #dce4df;
  background: #f5f8f5;
}

.result-actions a {
  background: #244f7a;
}

.result-actions a:last-child {
  color: #12302d;
  background: #e5f1ee;
}

.workflow-grid article,
.keyword-grid a,
.content-grid article,
.source-list article,
.article-block {
  border-color: #d6dfd9;
  background: rgba(255, 255, 255, 0.7);
}

.step {
  background: #b36f24;
}

.source-strip {
  border-color: #d6dfd9;
  background: rgba(255, 255, 255, 0.68);
}

@media (max-width: 980px) {
  .lookup-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .signal-panel {
    min-height: 460px;
    order: -1;
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    gap: 12px;
  }

  .lookup-hero {
    padding-top: 18px;
  }

  .lookup-panel {
    order: -1;
  }

  .signal-panel {
    order: 0;
    min-height: 300px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 50px);
    line-height: 0.98;
  }

  .search-form {
    padding: 12px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .signal-content {
    grid-template-columns: 1fr;
  }
}
