/* HSN & SAC Code Finder — hero & tool widget (shared toolkit hero pattern) */
.hsn-page {
  --hsn-navy: #061a31;
  --hsn-navy-2: #0b2947;
  --hsn-coral: #f45f58;
  --hsn-coral-dark: #d94a44;
  --hsn-coral-soft: #fff2f1;
  --hsn-ink: #10243a;
  --hsn-muted: #5c6f82;
  --hsn-line: #d9e2ea;
  --hsn-green: #16825c;
  --hsn-green-soft: #eaf7f1;
  --hsn-amber: #a96b10;
  --hsn-amber-soft: #fff7e8;
  --hsn-shadow: 0 24px 70px rgba(4, 24, 46, 0.18);
}

.hsn-page .hero-tool {
  position: relative;
  min-height: calc(100svh - 58px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(54, 107, 155, 0.36), transparent 32%),
    linear-gradient(135deg, var(--hsn-navy) 0%, #081f39 58%, #0b2d50 100%);
  color: #fff;
}

.hsn-page .grid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  pointer-events: none;
  color: #fff;
}

.hsn-page .page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1850px;
  margin-inline: auto;
  padding-block: 24px 26px;
  padding-inline: clamp(24px, 5vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(32px, 4vw, 62px);
  align-items: center;
}

.hsn-page .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffaaa6;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hsn-page .kicker:before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--hsn-coral);
}

.hsn-page .intro h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(2.4rem, 4.2vw, 4.45rem);
  line-height: 0.98;
  letter-spacing: -0.058em;
  font-weight: 800;
  text-align: left;
  word-spacing: normal;
}

.hsn-page .intro h1 span {
  color: #ff817a;
}

.hsn-page .intro-copy {
  max-width: 555px;
  margin: 18px 0 0;
  color: #c8d6e4;
  font-size: 0.94rem;
  line-height: 1.68;
}

.hsn-page .proof {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 18px;
  margin-top: 20px;
  color: #c6d5e3;
  font-size: 0.73rem;
  font-weight: 650;
}

.hsn-page .proof span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hsn-page .proof svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #57dda1;
  stroke-width: 2.4;
}

.hsn-page .keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.hsn-page .keyword-cloud button {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e2ec;
  font-size: 0.67rem;
  cursor: pointer;
}

.hsn-page .keyword-cloud button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.hsn-page .tool {
  min-width: 0;
  max-width: 100%;
  min-height: 625px;
  background: #fff;
  color: var(--hsn-ink);
  box-shadow: var(--hsn-shadow);
  border-top: 4px solid var(--hsn-coral);
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.hsn-page .tool-head {
  padding: 16px 19px 14px;
  border-bottom: 1px solid var(--hsn-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hsn-page .tool-head small {
  display: block;
  color: var(--hsn-coral-dark);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hsn-page .tool-head h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
  color: var(--hsn-ink);
  text-align: left;
}

.hsn-page .source-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--hsn-green);
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}

.hsn-page .source-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
}

.hsn-page .search-area {
  padding: 15px 19px;
  border-bottom: 1px solid var(--hsn-line);
  background: #fbfcfd;
}

.hsn-page .search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.hsn-page .search-wrap {
  position: relative;
}

.hsn-page .search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7b8997;
  stroke-width: 2;
  pointer-events: none;
}

.hsn-page .search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 43px;
  border: 1px solid #cfd8e1;
  outline: none;
  color: var(--hsn-ink);
  font-size: 0.8rem;
  background: #fff;
  border-radius: 0;
}

.hsn-page .search-input:focus {
  border-color: var(--hsn-coral);
  box-shadow: 0 0 0 3px rgba(244, 95, 88, 0.12);
}

.hsn-page .clear-search {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  border: 0;
  background: transparent;
  color: #8b98a5;
  display: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.hsn-page .search-btn {
  min-width: 94px;
  border: 0;
  background: var(--hsn-coral);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
}

.hsn-page .search-btn:hover {
  background: var(--hsn-coral-dark);
}

.hsn-page .filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.hsn-page .filter-tabs {
  display: flex;
  gap: 5px;
}

.hsn-page .filter {
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid var(--hsn-line);
  background: #fff;
  color: var(--hsn-muted);
  font-size: 0.63rem;
  font-weight: 800;
  cursor: pointer;
}

.hsn-page .filter.active {
  border-color: var(--hsn-navy-2);
  background: var(--hsn-navy-2);
  color: #fff;
}

.hsn-page .search-hint {
  color: var(--hsn-muted);
  font-size: 0.59rem;
}

.hsn-page .workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.72fr);
}

.hsn-page .results-pane {
  min-width: 0;
  padding: 16px 19px 18px;
  border-right: 1px solid var(--hsn-line);
  display: flex;
  flex-direction: column;
}

.hsn-page .results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.hsn-page .results-toolbar strong {
  font-size: 0.73rem;
  color: var(--hsn-ink);
}

.hsn-page .results-toolbar span {
  color: var(--hsn-muted);
  font-size: 0.61rem;
}

.hsn-page .results {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 3px;
  max-height: 438px;
}

.hsn-page .result-card {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--hsn-line);
  background: #fff;
  text-align: left;
  color: var(--hsn-ink);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: start;
  cursor: pointer;
}

.hsn-page .result-card:hover {
  border-color: #b8c5d0;
  background: #fbfcfd;
}

.hsn-page .result-card.selected {
  border-color: var(--hsn-coral);
  background: var(--hsn-coral-soft);
  box-shadow: inset 0 0 0 1px var(--hsn-coral);
}

.hsn-page .type-chip {
  min-width: 38px;
  padding: 5px 6px;
  text-align: center;
  font-size: 0.56rem;
  line-height: 1;
  font-weight: 850;
  color: #fff;
  background: var(--hsn-navy-2);
}

.hsn-page .type-chip.sac {
  background: var(--hsn-green);
}

.hsn-page .result-main {
  min-width: 0;
}

.hsn-page .result-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.hsn-page .result-code strong {
  font-size: 0.8rem;
  letter-spacing: 0.015em;
}

.hsn-page .confidence {
  padding: 3px 6px;
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hsn-green);
  background: var(--hsn-green-soft);
}

.hsn-page .result-title {
  font-size: 0.7rem;
  line-height: 1.4;
  font-weight: 700;
}

.hsn-page .result-terms {
  margin-top: 4px;
  color: var(--hsn-muted);
  font-size: 0.58rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hsn-page .rate {
  min-width: 48px;
  text-align: right;
}

.hsn-page .rate strong {
  display: block;
  color: var(--hsn-coral-dark);
  font-size: 0.92rem;
  line-height: 1;
}

.hsn-page .rate span {
  color: var(--hsn-muted);
  font-size: 0.53rem;
}

.hsn-page .empty-state {
  margin-inline: auto;
  
  text-align: center;
  color: var(--hsn-muted);
  max-width: 330px;
  padding: 30px 10px;
}

.hsn-page .empty-state svg {
  width: 88px;
  height: 88px;
  margin-bottom: 8px;
}

.hsn-page .empty-state strong {
  display: block;
  color: var(--hsn-ink);
  font-size: 0.85rem;
}

.hsn-page .empty-state p {
  margin: 5px 0 0;
  font-size: 0.66rem;
  line-height: 1.5;
}

.hsn-page .detail-pane {
  padding: 16px;
  background: #f7f9fb;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hsn-page .detail-empty {
  margin-inline: auto;
  
  max-width: 240px;
  text-align: center;
  color: var(--hsn-muted);
}

.hsn-page .detail-empty svg {
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
}

.hsn-page .detail-empty strong {
  display: block;
  color: var(--hsn-ink);
  font-size: 0.79rem;
}

.hsn-page .detail-empty p {
  margin: 4px 0 0;
  font-size: 0.62rem;
  line-height: 1.45;
}

.hsn-page .detail {
  display: none;
}

.hsn-page .detail.visible {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hsn-page .detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hsn-page .detail-kicker {
  color: var(--hsn-coral-dark);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hsn-page .detail-code {
  margin: 4px 0 3px;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  color: var(--hsn-ink);
  text-align: left;
}

.hsn-page .detail-desc {
  margin: 0;
  color: var(--hsn-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.hsn-page .rate-box {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px;
  text-align: center;
  border: 1px solid #f2c8c5;
  background: #fff;
}

.hsn-page .rate-box strong {
  display: block;
  color: var(--hsn-coral-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.hsn-page .rate-box span {
  color: var(--hsn-muted);
  font-size: 0.55rem;
}

.hsn-page .detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

.hsn-page .meta-box {
  padding: 9px;
  border: 1px solid var(--hsn-line);
  background: #fff;
}

.hsn-page .meta-box small {
  display: block;
  color: var(--hsn-muted);
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.hsn-page .meta-box strong {
  display: block;
  margin-top: 2px;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--hsn-ink);
}

.hsn-page .calculator {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--hsn-line);
  background: #fff;
}

.hsn-page .calculator-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.hsn-page .calculator-head strong {
  font-size: 0.68rem;
  color: var(--hsn-ink);
}

.hsn-page .calculator-head span {
  font-size: 0.54rem;
  color: var(--hsn-muted);
}

.hsn-page .calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.hsn-page .field label {
  display: block;
  margin-bottom: 4px;
  color: var(--hsn-muted);
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hsn-page .field input,
.hsn-page .field select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--hsn-line);
  background: #fff;
  color: var(--hsn-ink);
  padding: 0 9px;
  outline: none;
  font-size: 0.64rem;
  border-radius: 0;
}

.hsn-page .field input:focus,
.hsn-page .field select:focus {
  border-color: var(--hsn-coral);
}

.hsn-page .calc-result {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--hsn-line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.hsn-page .calc-result div {
  padding: 7px;
  background: #f7f9fb;
}

.hsn-page .calc-result small {
  display: block;
  color: var(--hsn-muted);
  font-size: 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.hsn-page .calc-result strong {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--hsn-ink);
}

.hsn-page .warning {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #eed5a8;
  background: var(--hsn-amber-soft);
  color: #77500f;
  font-size: 0.57rem;
  line-height: 1.45;
}

.hsn-page .detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: auto;
  padding-top: 11px;
}

.hsn-page .detail-actions button,
.hsn-page .detail-actions a {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hsn-line);
  background: #fff;
  color: var(--hsn-ink);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}

.hsn-page .detail-actions a {
  color: #fff;
  background: var(--hsn-coral);
  border-color: var(--hsn-coral);
}

.hsn-page .detail-actions a:hover {
  background: var(--hsn-coral-dark);
  color: #fff;
}

@media (max-width: 1120px) {
  .hsn-page .hero-tool {
    min-height: auto;
  }

  .hsn-page .page-shell {
    grid-template-columns: 1fr;
    padding-block: 42px;
    padding-inline: clamp(24px, 5vw, 96px);
  }

  .hsn-page .intro h1,
  .hsn-page .intro-copy {
    max-width: 760px;
  }
}

@media (max-width: 760px) {
  .hsn-page .page-shell {
    padding-inline: clamp(16px, 4vw, 24px);
    padding-block: 25px;
    gap: 26px;
  }

  .hsn-page .intro h1 {
    font-size: 2.35rem;
  }

  .hsn-page .intro-copy {
    font-size: 0.86rem;
  }

  .hsn-page .keyword-cloud {
    display: none;
  }

  .hsn-page .tool {
    min-height: 760px;
  }

  .hsn-page .workspace {
    grid-template-columns: 1fr;
  }

  .hsn-page .results-pane {
    border-right: 0;
    border-bottom: 1px solid var(--hsn-line);
  }

  .hsn-page .results {
    max-height: 290px;
  }

  .hsn-page .detail-pane {
    min-height: 310px;
  }

  .hsn-page .filters {
    align-items: flex-start;
    flex-direction: column;
  }

  .hsn-page .search-hint {
    display: none;
  }
}

@media (max-width: 460px) {
  .hsn-page .intro h1 {
    font-size: 2.05rem;
  }

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

  .hsn-page .search-btn {
    height: 40px;
  }

  .hsn-page .tool-head,
  .hsn-page .search-area,
  .hsn-page .results-pane {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hsn-page .source-badge {
    display: none;
  }

  .hsn-page .result-card {
    grid-template-columns: auto 1fr;
  }

  .hsn-page .rate {
    grid-column: 2;
    text-align: left;
    display: flex;
    gap: 5px;
    align-items: baseline;
  }

  .hsn-page .detail-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hsn-page .result-card {
    transition: none !important;
  }
}
