/* ============================================================
   MarketplaceProfile Tools - Shared Stylesheet
   Tool-specific UI only. The shared topnav and infocard are rendered
   and styled exclusively by /shared/style.css.
   ============================================================ */

:root {
  --tc-blue: var(--mp-color-brand);

  --tc-blue-alpha: rgba(40, 90, 211, 0.12);

  --tc-border: var(--mp-color-border);
  --tc-border-2: var(--mp-color-divider);
  --tc-text: var(--mp-color-text-strong);
  --tc-muted: var(--mp-color-text-muted);
  --tc-subtle: var(--mp-color-text-subtle);
  --tc-green: var(--mp-color-success);
  --tc-green-bg: var(--mp-color-success-soft);
  --tc-green-bd: var(--mp-color-success-border);
  --tc-amber: var(--mp-color-warning);
  --tc-amber-bg: var(--mp-color-warning-soft);
  --tc-amber-bd: var(--mp-color-warning-border);
  --tc-red: var(--mp-color-danger);
  --tc-red-bg: var(--mp-color-danger-soft);
  --tc-red-bd: var(--mp-color-danger-border);

  --tc-heading-font: var(--mp-font-sans);
}

body.tools-page {
  background: transparent;
  overflow-x: clip;
}

@media (min-width: 769px) {
  body.tools-page .main-content {
    padding-bottom: 0;
  }

  body.tools-page.mp-has-infocard:not(.homepage)
    .info-card.mp-page-hero.mp-infocard-inner {
    width: 100%;
  }
}

/* ============================================================
   TOOLS NAV
   Matches the company-profile category selector rail: icon chips,
   edge fades, chevrons, drag scrolling, and native swipe fallback.
   ============================================================ */

.tools-nav-row {
  width: 100%;
  margin: 0;
  padding: 4px 0 12px;
  background: transparent;
}

.tools-nav-scroll-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
  isolation: isolate;
}

.tools-nav-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

.tools-nav-viewport::before,
.tools-nav-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0.42rem;
  width: 6.5rem;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--mp-motion-standard) ease;
}

.tools-nav-viewport::before {
  left: 0;
  background: linear-gradient(
    90deg,
    var(--mp-color-surface-muted) 0%,
    rgba(240, 244, 250, 0.99) 24%,
    rgba(240, 244, 250, 0.9) 48%,
    rgba(240, 244, 250, 0.48) 74%,
    rgba(240, 244, 250, 0) 100%
  );
}

.tools-nav-viewport::after {
  right: 0;
  background: linear-gradient(
    270deg,
    var(--mp-color-surface-muted) 0%,
    rgba(240, 244, 250, 0.99) 24%,
    rgba(240, 244, 250, 0.9) 48%,
    rgba(240, 244, 250, 0.48) 74%,
    rgba(240, 244, 250, 0) 100%
  );
}

.tools-nav-scroll-wrap.tools-nav-has-left .tools-nav-viewport::before,
.tools-nav-scroll-wrap.tools-nav-has-right .tools-nav-viewport::after {
  opacity: 1;
}

.tools-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 4px 0.48rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.tools-nav-links::-webkit-scrollbar {
  display: none;
}

.tools-nav-scroll-wrap.tools-nav-is-centered .tools-nav-links {
  justify-content: center;
}

.tools-nav-links:focus-visible {
  outline: 2px solid rgba(40, 90, 211, 0.28);
  outline-offset: -2px;
  border-radius: var(--mp-radius-lg);
}

.tools-nav-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: flex;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--mp-radius-lg);
  background: var(--mp-color-surface);
  color: var(--mp-color-text);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-58%) scale(0.94);
  transition:
    opacity var(--mp-motion-fast) ease,
    visibility var(--mp-motion-fast) ease,
    transform var(--mp-motion-fast) ease,
    border-color var(--mp-motion-fast) ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tools-nav-control[hidden] {
  display: none;
}

.tools-nav-control--left {
  left: 0.45rem;
}

.tools-nav-control--right {
  right: 0.45rem;
}

.tools-nav-scroll-wrap.tools-nav-has-left .tools-nav-control--left,
.tools-nav-scroll-wrap.tools-nav-has-right .tools-nav-control--right {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-58%) scale(1);
}

.tools-nav-control:hover {
  background: var(--mp-color-surface);
  color: var(--mp-color-text-strong);
  box-shadow: none;
  outline: none;
}

.tools-nav-control:focus-visible {
  background: var(--mp-color-surface);
  border-color: var(--mp-color-brand);
  color: var(--mp-color-text-strong);
  box-shadow: var(--mp-shadow-focus);
  outline: 3px solid var(--mp-color-brand);
  outline-offset: 3px;
}

.tools-nav-control:active {
  background: var(--mp-color-surface);
  box-shadow: none;
  transform: translateY(-58%) scale(0.96);
}

.tools-nav-control:disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tools-nav-control svg,
.tools-nav-control svg * {
  cursor: pointer;
}

.tools-nav-link[hidden] {
  display: none;
}

.tools-nav-link {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  min-height: 48px;
  padding: 0 1.12rem 0 0.78rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--mp-radius-lg);
  background: var(--mp-color-surface);
  color: var(--mp-color-text);
  box-shadow: none;
  font-family: var(--mp-font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--mp-motion-fast) ease,
    color var(--mp-motion-fast) ease,
    transform var(--mp-motion-fast) ease;
  scroll-snap-align: start;
}

.tools-nav-link::before {
  display: none;
}

.tools-nav-link > * {
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.tools-nav-link:not(.is-active):hover {
  background: var(--mp-color-surface);
  color: var(--mp-color-text);
  box-shadow: none;
}

.tools-nav-link:focus-visible {
  outline: 2px solid rgba(36, 85, 191, 0.28);
  outline-offset: 2px;
}

.tools-nav-link:active {
  transform: scale(0.985);
  box-shadow: none;
}

.tools-nav-link.is-active {
  background: var(--mp-color-text);
  color: var(--mp-color-surface);
  font-weight: 600;
  box-shadow: none;
}

.tools-nav-icon {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  flex: 0 0 27px;
  border: 1px solid var(--mp-color-divider);
  border-radius: var(--mp-radius-sm);
  background: var(--mp-color-surface);
  color: var(--mp-color-text);
  box-shadow: none;
  transition:
    background-color var(--mp-motion-fast) ease,
    border-color var(--mp-motion-fast) ease,
    color var(--mp-motion-fast) ease;
}

.tools-nav-link:not(.is-active):hover .tools-nav-icon {
  background: var(--mp-color-surface);
  border-color: var(--mp-color-divider);
  color: var(--mp-color-text);
}

.tools-nav-link.is-active .tools-nav-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--mp-color-surface);
}

.tools-nav-icon-svg,
.tools-nav-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  flex: none;
}

.tools-nav-label {
  display: inline-block;
  line-height: 1;
}

@media (min-width: 769px) {
  .tools-nav-links {
    cursor: grab;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
  }

  .tools-nav-links.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  .tools-nav-links.is-dragging,
  .tools-nav-links.is-dragging * {
    cursor: grabbing;
  }

  .tools-nav-links.is-dragging .tools-nav-link {
    pointer-events: none;
  }

  .tools-nav-icon-svg {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
  }
}

@media (max-width: 768px) {
  .tools-nav-row {
    margin: 0;
    padding: 0 0.75rem 16px;
    overflow: hidden;
  }

  .tools-nav-scroll-wrap {
    overflow: visible;
  }

  .tools-nav-viewport {
    overflow: hidden;
  }

  .tools-nav-viewport::before,
  .tools-nav-viewport::after {
    top: 0;
    bottom: 0;
    width: 3.5rem;
    z-index: 2;
  }

  .tools-nav-viewport::before {
    background: linear-gradient(
      90deg,
      var(--mp-color-surface-muted) 0%,
      rgba(240, 244, 250, 0.98) 26%,
      rgba(240, 244, 250, 0.72) 58%,
      rgba(240, 244, 250, 0) 100%
    );
  }

  .tools-nav-viewport::after {
    background: linear-gradient(
      270deg,
      var(--mp-color-surface-muted) 0%,
      rgba(240, 244, 250, 0.98) 26%,
      rgba(240, 244, 250, 0.72) 58%,
      rgba(240, 244, 250, 0) 100%
    );
  }

  .tools-nav-control {
    display: flex;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--mp-color-text);
    box-shadow: none;
    transform: translateY(-55%);
    transition:
      opacity var(--mp-motion-fast) ease,
      visibility var(--mp-motion-fast) ease,
      transform var(--mp-motion-fast) ease,
      color var(--mp-motion-fast) ease;
  }

  .tools-nav-control--left {
    left: -0.32rem;
  }

  .tools-nav-control--right {
    right: -0.32rem;
  }

  .tools-nav-scroll-wrap.tools-nav-has-left .tools-nav-control--left,
  .tools-nav-scroll-wrap.tools-nav-has-right .tools-nav-control--right {
    transform: translateY(-55%) scale(1);
  }

  .tools-nav-control:hover {
    background: transparent;
    border-color: transparent;
    color: var(--mp-color-text-strong);
    box-shadow: none;
    outline: none;
  }

  .tools-nav-control:focus-visible {
    background: var(--mp-color-surface);
    border-color: var(--mp-color-brand);
    color: var(--mp-color-text-strong);
    box-shadow: var(--mp-shadow-focus);
    outline: 3px solid var(--mp-color-brand);
    outline-offset: 2px;
  }

  .tools-nav-control:active {
    transform: translateY(-55%) scale(0.92);
  }

  .tools-nav-control svg {
    width: 16px;
    height: 16px;
  }

  .tools-nav-links {
    gap: 0.58rem;
    padding: 4px 0;
    scroll-snap-type: x proximity;
  }

  .tools-nav-links:focus-visible {
    outline: 3px solid var(--mp-color-brand);
    outline-offset: 2px;
  }

  .tools-nav-link {
    min-height: 43px;
    padding: 0 0.92rem 0 0.62rem;
    border-radius: var(--mp-radius-md);
    gap: 0.46rem;
    font-size: 0.86rem;
    box-shadow: none;
  }

  .tools-nav-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: var(--mp-radius-sm);
  }

  .tools-nav-icon-svg,
  .tools-nav-icon svg {
    width: 15px;
    height: 15px;
  }
}

/* No-JavaScript fallback: every tool remains a real link. Desktop expands
   the rail into wrapped rows; mobile retains native horizontal scrolling. */
html:not(.tools-nav-js) .tools-nav-control {
  display: none;
}

@media (min-width: 769px) {
  html:not(.tools-nav-js) .tools-nav-viewport {
    overflow: visible;
  }

  html:not(.tools-nav-js) .tools-nav-viewport::before,
  html:not(.tools-nav-js) .tools-nav-viewport::after {
    display: none;
  }

  html:not(.tools-nav-js) .tools-nav-links {
    max-width: none;
    padding-bottom: 0.38rem;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    scroll-snap-type: none;

    user-select: auto;
    -webkit-user-select: auto;
  }
}

/* ============================================================
   TOOLS DIRECTORY
   ============================================================ */

.tools-index-main {
  width: 100%;
  margin: 0 auto;
  padding: 0 0 20px;
}

.tools-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.tools-card {
  position: relative;
  display: flex;
  min-width: 0;
  width: 100%;
  padding: 22px;
  flex-direction: column;
  gap: 11px;
  overflow: hidden;
  border: 0;
  border-radius: var(--mp-infocard-card-radius-desktop, 14px);
  background: var(--mp-color-surface);
  color: inherit;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--mp-motion-standard) ease,
    transform var(--mp-motion-standard) ease;
}

.tc-tools-index .tools-card {
  opacity: 0;
  translate: 0 14px;
  animation: mpToolsCardReveal 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.tc-tools-index .tools-card:nth-child(1) {
  animation-delay: 0.04s;
}
.tc-tools-index .tools-card:nth-child(2) {
  animation-delay: 0.08s;
}
.tc-tools-index .tools-card:nth-child(3) {
  animation-delay: var(--mp-motion-fast);
}
.tc-tools-index .tools-card:nth-child(4) {
  animation-delay: var(--mp-motion-fast);
}
.tc-tools-index .tools-card:nth-child(5) {
  animation-delay: var(--mp-motion-standard);
}
.tc-tools-index .tools-card:nth-child(6) {
  animation-delay: 0.24s;
}
.tc-tools-index .tools-card:nth-child(7) {
  animation-delay: var(--mp-motion-slow);
}
.tc-tools-index .tools-card:nth-child(8) {
  animation-delay: 0.32s;
}
.tc-tools-index .tools-card:nth-child(9) {
  animation-delay: 0.36s;
}

@keyframes mpToolsCardReveal {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tc-tools-index .tools-card {
    opacity: 1;
    translate: 0 0;
    animation: none;
  }
}

.tools-card::before {
  content: none;
}

.tools-card:hover {
  background: var(--mp-color-surface);
  transform: none;
}

.tools-card:focus-visible {
  background: var(--mp-color-surface);
  outline: 3px solid var(--mp-color-brand);
  outline-offset: 3px;
  box-shadow: var(--mp-shadow-focus);
  transform: none;
}

.tools-card,
.tools-card * {
  cursor: pointer;
}

.tools-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.tools-card-icon {
  display: flex;
  width: 42px;
  height: 42px;
  margin: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--mp-radius-md);
  background: var(--mp-color-brand-soft);
  color: var(--tc-blue);
  box-shadow: none;
}

.tools-card-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

.tools-card-name {
  min-width: 0;
  margin: 0;
  flex: 1 1 auto;
  color: var(--tc-text);
  font-family: var(--tc-heading-font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-align: left;
  text-wrap: balance;
}

.tools-card-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--tc-muted);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tools-card-tags {
  display: flex;
  margin-top: auto;
  padding-top: 2px;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.tools-tag {
  padding: 4px 8px;
  border: 0;
  border-radius: var(--mp-radius-sm);
  background: var(--mp-color-surface-soft);
  color: var(--mp-color-text-secondary);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
  text-transform: uppercase;
}

.tc-wrap {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--tc-text);
  font-size: 14px;
}

/* ----------------------------------------------------------
   TOOL PANELS
   ---------------------------------------------------------- */
.tc-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 0;
}
.tc-section {
  margin-bottom: 20px;
}

.tc-panel {
  background: var(--mp-color-surface);
  border: 0;
  border-radius: var(--mp-infocard-card-radius-desktop, 14px);
  overflow: hidden;
  box-shadow: none;
  position: relative;
}
.tc-panel::before {
  content: none;
}
.tc-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  background: var(--mp-color-surface-soft);
  border-bottom: 1px solid var(--tc-border-2);
}
.tc-panel-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--mp-radius-sm);
  background: var(--mp-color-brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-blue);
  flex-shrink: 0;
  box-shadow: none;
}
.tc-panel-icon svg {
  width: 14px;
  height: 14px;
}
.tc-panel-title {
  font-family: var(--tc-heading-font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--mp-color-text-secondary);
  text-align: left;
}
.tc-panel-body {
  padding: 22px;
}

/* ----------------------------------------------------------
   FORM FIELDS
   ---------------------------------------------------------- */
.tc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tc-label {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--tc-muted);
  text-align: left;
}
.tc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tc-pre {
  left: 10px;
}
.tc-suf {
  right: 10px;
}

.tc-input,
.tc-select,
.tc-textarea {
  width: 100%;
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-md);
  background: var(--mp-color-surface);
  font-size: 14px;
  color: var(--tc-text);
  font-family: inherit;
  transition:
    border-color var(--mp-motion-fast),
    box-shadow var(--mp-motion-fast);

  text-align: left;
  box-shadow: none;
  min-width: 0;
}
.tc-input {
  height: 40px;
  padding: 0 12px;
  display: block;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}
.tc-input::-webkit-outer-spin-button,
.tc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.tc-input[type="text"],
.tc-input[type="email"],
.tc-input[type="date"] {
  font-variant-numeric: normal;
}
.tc-textarea {
  padding: 10px 12px;
  resize: vertical;
  min-height: 78px;
  line-height: 1.6;
  display: block;
}
.tc-input:focus,
.tc-select:focus,
.tc-textarea:focus {
  outline: none;
  border-color: var(--tc-blue);
  box-shadow: 0 0 0 4px rgba(36, 84, 198, 0.1);
}

.tc-input:focus-visible,
.tc-select:focus-visible,
.tc-textarea:focus-visible {
  outline: 3px solid var(--mp-color-brand);
  outline-offset: 2px;
  box-shadow: var(--mp-shadow-focus);
}
.tc-has-pre .tc-input {
  padding-left: 22px;
}
.tc-has-suf .tc-input {
  padding-right: 40px;
}
.tc-select {
  height: 40px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding: 0 32px 0 12px;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b93a8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.tc-hint {
  font-size: 12px;
  color: var(--tc-subtle);
  line-height: 1.45;
  text-align: left;
}
.tc-divider {
  height: 1px;
  background: var(--tc-border-2);
  margin: 16px 0;
}

/* ----------------------------------------------------------
   GRID HELPERS
   ---------------------------------------------------------- */
.tc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tc-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tc-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */
.tc-run-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: var(--mp-color-brand);
  color: var(--mp-color-surface);
  border: none;
  border-radius: var(--mp-radius-lg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--mp-motion-fast),
    transform 0.1s;
  margin-top: 4px;
  box-shadow: none;
}
.tc-run-btn:hover {
  background: var(--mp-color-brand-hover);
}
.tc-run-btn:active {
  transform: scale(0.99);
}

.tc-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px dashed var(--tc-blue);
  color: var(--tc-blue);
  border-radius: var(--mp-radius-sm);
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background var(--mp-motion-fast);
}
.tc-add-btn:hover {
  background: var(--tc-blue-alpha);
}

.tc-del-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--tc-border);
  border-radius: var(--mp-radius-sm);
  background: var(--mp-color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-subtle);
  transition:
    border-color var(--mp-motion-fast),
    color var(--mp-motion-fast);
  align-self: end;
  flex-shrink: 0;
}
.tc-del-btn:hover {
  border-color: var(--tc-red);
  color: var(--tc-red);
}

/* ----------------------------------------------------------
   RESULTS
   ---------------------------------------------------------- */
.tc-results {
  display: none;
  margin: 0;
  opacity: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.tc-results.is-visible {
  display: block;
  opacity: 1;
  height: auto;
  overflow: visible;
  pointer-events: auto;
}

.tc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.tc-stats-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.tc-stat {
  background: var(--mp-color-surface);
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-lg);
  padding: 15px 16px;
  text-align: left;
  box-shadow: none;
}
.tc-stat.is-primary {
  background: var(--mp-color-brand-soft);
  border-color: var(--mp-color-brand-border-strong);
  box-shadow: none;
}
.tc-stat.is-good {
  background: var(--tc-green-bg);
  border-color: var(--tc-green-bd);
}
.tc-stat.is-warn {
  background: var(--tc-amber-bg);
  border-color: var(--tc-amber-bd);
}

.tc-stat-label {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--tc-subtle);
  margin-bottom: 5px;
  text-align: left;
}
.tc-stat.is-primary .tc-stat-label {
  color: var(--mp-color-brand);
}
.tc-stat.is-good .tc-stat-label {
  color: var(--tc-green);
  opacity: 0.8;
}
.tc-stat.is-warn .tc-stat-label {
  color: var(--tc-amber);
  opacity: 0.8;
}

.tc-stat-val {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tc-text);
  line-height: 1;
  text-align: left;
}
.tc-stat.is-primary .tc-stat-val {
  color: var(--mp-color-brand);
}
.tc-stat.is-good .tc-stat-val {
  color: var(--tc-green);
}
.tc-stat.is-warn .tc-stat-val {
  color: var(--tc-amber);
}

/* ----------------------------------------------------------
   TABLE
   ---------------------------------------------------------- */
.tc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tc-table th {
  background: var(--mp-color-surface-soft);
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tc-subtle);
  padding: 9px 13px;
  border-bottom: 1px solid var(--tc-border);
  white-space: nowrap;
  text-align: left;
}
.tc-table th:not(:first-child) {
  text-align: left;
}
.tc-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--tc-border-2);
  color: var(--tc-text);
  text-align: left;
}
.tc-table td:not(:first-child) {
  text-align: right;
}
.tc-table .tc-total-row td {
  background: var(--mp-color-surface-soft);
  font-weight: 700;
  border-bottom: none;
}

/* ----------------------------------------------------------
   ALERTS
   ---------------------------------------------------------- */
.tc-alert {
  display: none;
  margin-top: 12px;
  border-radius: var(--mp-radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
  border-left: 3px solid;
  text-align: left;
}
.tc-alert.is-visible {
  display: block;
}
.tc-alert-warn {
  background: var(--tc-amber-bg);
  border-color: var(--tc-amber);
  color: var(--tc-amber);
}
.tc-alert-good {
  background: var(--tc-green-bg);
  border-color: var(--tc-green);
  color: var(--tc-green);
}
.tc-alert-danger {
  background: var(--tc-red-bg);
  border-color: var(--tc-red);
  color: var(--tc-red);
}
.tc-alert strong {
  font-weight: 700;
}
.tc-alert span {
  color: var(--tc-text);
}

/* ----------------------------------------------------------
   FILL BAR
   ---------------------------------------------------------- */
.tc-fill-wrap {
  margin: 14px 0;
}
.tc-fill-label {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--tc-subtle);
  margin-bottom: 7px;
  text-align: left;
}
.tc-fill-track {
  background: var(--tc-border-2);
  border-radius: var(--mp-radius-sm);
  height: 22px;
  overflow: hidden;
}
.tc-fill-bar {
  height: 100%;
  border-radius: var(--mp-radius-sm);
  display: flex;
  align-items: center;
  padding: 0 10px;
  transition: width 0.5s ease;
  justify-content: space-between;
  min-width: 40px;
}
.tc-fill-bar span {
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-color-surface);
  white-space: nowrap;
}

/* ----------------------------------------------------------
   CONTAINER SELECTOR
   ---------------------------------------------------------- */
.tc-ctn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tc-ctn-opt {
  position: relative;
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-lg);
  padding: 15px 14px;
  cursor: pointer;
  transition:
    border-color var(--mp-motion-standard),
    background var(--mp-motion-standard),
    box-shadow var(--mp-motion-standard),
    transform var(--mp-motion-standard);
  text-align: center;
  user-select: none;
  background: var(--mp-color-surface);
  box-shadow: none;
}
.tc-ctn-opt input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tc-ctn-opt:focus-within {
  border-color: var(--mp-color-brand);
  outline: 3px solid var(--mp-color-brand);
  outline-offset: 3px;
  box-shadow: var(--mp-shadow-focus);
}
.tc-ctn-opt:hover {
  border-color: rgba(36, 84, 198, 0.45);
  transform: translateY(-1px);
}
.tc-ctn-opt.is-sel {
  border-color: var(--tc-blue);
  background: rgba(36, 84, 198, 0.08);
  box-shadow: none;
}
.tc-ctn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-text);
  margin-bottom: 3px;
  text-align: center;
}
.tc-ctn-dims {
  font-size: 12px;
  color: var(--tc-subtle);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  text-align: center;
}
.tc-ctn-vol {
  font-size: 13px;
  color: var(--tc-blue);
  font-weight: 700;
  text-align: center;
}

/* ----------------------------------------------------------
   SKU ROWS
   ---------------------------------------------------------- */
.tc-sku-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tc-sku-row {
  display: grid;
  grid-template-columns: minmax(100px, 2fr) repeat(5, minmax(65px, 1fr)) 30px;
  gap: 10px;
  align-items: end;
  background: var(--mp-color-surface);
  border: 1px solid var(--tc-border-2);
  border-radius: var(--mp-radius-lg);
  padding: 14px;
}

/* ----------------------------------------------------------
   RFQ LAYOUT
   ---------------------------------------------------------- */
.tc-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.tc-form-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-preview-col {
  position: sticky;
  top: 20px;
}
.tc-form-col,
.tc-preview-col {
  min-width: 0;
}

.rfq-sku-row {
  display: grid;
  grid-template-columns:
    minmax(180px, 2fr) minmax(120px, 1fr) minmax(90px, 0.75fr)
    28px;
  gap: 8px;
  align-items: end;
  background: var(--mp-color-surface-soft);
  border: 1px solid var(--tc-border-2);
  border-radius: var(--mp-radius-sm);
  padding: 10px;
}
.rfq-sku-row .tc-field,
.rfq-sku-row .tc-input {
  min-width: 0;
}

.tc-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tc-check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--tc-text);
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--tc-border);
  border-radius: var(--mp-radius-pill);
  background: var(--mp-color-surface);
  transition:
    border-color var(--mp-motion-fast),
    background var(--mp-motion-fast),
    box-shadow var(--mp-motion-fast);
  user-select: none;
  line-height: 1;
  text-align: left;
}
.tc-check-item input[type="checkbox"] {
  accent-color: var(--tc-blue);
  cursor: pointer;
  margin: 0;
}
.tc-check-item:hover {
  border-color: var(--tc-blue);
  background: var(--tc-blue-alpha);
  box-shadow: none;
}

.tc-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: var(--mp-color-surface);
  border-bottom: 1px solid var(--tc-border-2);
}
.tc-preview-title {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tc-muted);
}
.tc-action-btns {
  display: flex;
  gap: 6px;
}
.tc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: var(--mp-radius-pill);
  cursor: pointer;
  transition: all var(--mp-motion-fast);
  border: 1px solid var(--tc-border);
  background: var(--mp-color-surface);
  color: var(--tc-muted);
}
.tc-action-btn:hover {
  border-color: var(--tc-blue);
  color: var(--tc-blue);
}

.tc-rfq-body {
  padding: 16px;
  max-height: 560px;
  overflow-y: auto;
  font-family: var(--mp-font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--tc-text);
  white-space: pre-wrap;
  background: var(--mp-color-surface);
  text-align: left;
}
.tc-rfq-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-family: inherit;
  font-size: 13px;
}

.tc-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--tc-text);
  color: var(--mp-color-surface);
  padding: 10px 16px;
  border-radius: var(--mp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(50px);
  opacity: 0;
  transition: all var(--mp-motion-slow);
  pointer-events: none;
  z-index: var(--mp-z-dropdown);
}
.tc-toast.is-show {
  transform: translateY(0);
  opacity: 1;
}

/* ----------------------------------------------------------
   INCOTERMS
   ---------------------------------------------------------- */
.tc-rec-result {
  display: none;
  margin-top: 12px;
  background: var(--tc-blue-alpha);
  border: 1px solid rgba(40, 90, 211, 0.2);
  border-radius: var(--mp-radius-sm);
  padding: 13px 15px;
  font-size: 13px;
  text-align: left;
}
.tc-rec-result.is-visible {
  display: block;
}
.tc-rec-code {
  font-size: 17px;
  font-weight: 700;
  color: var(--tc-blue);
}
.tc-rec-link {
  color: var(--tc-blue);
  font-weight: 600;
  cursor: pointer;
}
.tc-rec-link:hover {
  text-decoration: underline;
}

.tc-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
}
.tc-term-card {
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-lg);
  padding: 13px 14px;
  cursor: pointer;
  transition:
    border-color var(--mp-motion-standard),
    background var(--mp-motion-standard),
    box-shadow var(--mp-motion-standard),
    transform var(--mp-motion-standard);
  position: relative;
  text-align: left;
  background: var(--mp-color-surface);
}
.tc-term-card:hover {
  border-color: var(--tc-blue);
  background: var(--mp-color-surface-soft);
  box-shadow: none;
  transform: translateY(-2px);
}
.tc-term-card.is-active {
  border-color: var(--mp-color-brand-border-strong);
  background: var(--mp-color-brand-soft);
  box-shadow: none;
}
.tc-term-code {
  font-size: 16px;
  font-weight: 700;
  color: var(--tc-text);
  font-family: var(--mp-font-mono);
  letter-spacing: 1px;
}
.tc-term-card.is-active .tc-term-code {
  color: var(--mp-color-brand);
}
.tc-term-full {
  font-size: 12px;
  color: var(--tc-subtle);
  margin-top: 2px;
  line-height: 1.35;
}
.tc-term-card.is-active .tc-term-full {
  color: var(--mp-color-text-secondary);
}
.tc-term-mode {
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 5px;
  border-radius: 3px;
}
.tc-mode-any {
  background: var(--tc-border-2);
  color: var(--tc-subtle);
}
.tc-mode-sea {
  background: var(--mp-color-brand-border);
  color: var(--mp-color-brand);
}
.tc-term-card.is-active .tc-mode-any,
.tc-term-card.is-active .tc-mode-sea {
  background: var(--mp-color-surface);
  color: var(--mp-color-brand);
}
.tc-term-burden {
  font-size: 12px;
  font-weight: 600;
  margin-top: 7px;
}
.tc-burden-b {
  color: var(--tc-green);
}
.tc-burden-s {
  color: var(--tc-red);
}
.tc-term-card.is-active .tc-burden-b,
.tc-term-card.is-active .tc-burden-s {
  color: var(--mp-color-text-secondary);
}

.tc-detail {
  display: none;
}
.tc-detail.is-visible {
  display: block;
}
.tc-detail-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tc-detail-code {
  font-size: 30px;
  font-weight: 700;
  color: var(--tc-blue);
  font-family: var(--mp-font-mono);
}
.tc-detail-full {
  font-size: 15px;
  font-weight: 600;
  color: var(--tc-muted);
}
.tc-risk-bar {
  background: var(--tc-amber-bg);
  border: 1px solid var(--tc-amber-bd);
  border-left: 3px solid var(--tc-amber);
  border-radius: var(--mp-radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--tc-text);
  line-height: 1.55;
  text-align: left;
}
.tc-risk-bar strong {
  color: var(--tc-amber);
  font-weight: 700;
}
.tc-journey {
  margin-bottom: 14px;
}
.tc-journey-label {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--tc-subtle);
  margin-bottom: 6px;
  text-align: left;
}
.tc-journey-track {
  display: flex;
  border-radius: var(--mp-radius-sm);
  overflow: hidden;
  height: 20px;
}
.tc-j-seller {
  background: var(--tc-red);
  display: flex;
  align-items: center;
  padding: 0 7px;
}
.tc-j-buyer {
  background: var(--tc-green);
  display: flex;
  align-items: center;
  padding: 0 7px;
}
.tc-j-seller span,
.tc-j-buyer span {
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-color-surface);
  white-space: nowrap;
}
.tc-resp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.tc-resp-col {
  border-radius: var(--mp-radius-lg);
  padding: 15px 16px;
  text-align: left;
}
.tc-resp-s {
  background: var(--tc-red-bg);
  border: 1px solid var(--tc-red-bd);
}
.tc-resp-b {
  background: var(--tc-green-bg);
  border: 1px solid var(--tc-green-bd);
}
.tc-resp-h {
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 9px;
  text-align: left;
}
.tc-resp-s .tc-resp-h {
  color: var(--tc-red);
}
.tc-resp-b .tc-resp-h {
  color: var(--tc-green);
}
.tc-resp-item {
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--tc-text);
}
.tc-resp-item:last-child {
  border-bottom: none;
}
.tc-resp-item::before {
  content: "-";
  flex-shrink: 0;
  font-weight: 700;
  margin-top: 1px;
}
.tc-resp-s .tc-resp-item::before {
  color: var(--tc-red);
}
.tc-resp-b .tc-resp-item::before {
  color: var(--tc-green);
}
.tc-detail-notes {
  font-size: 13px;
  color: var(--tc-muted);
  line-height: 1.65;
  text-align: left;
}
.tc-detail-notes strong {
  color: var(--tc-text);
  font-weight: 600;
}

/* ----------------------------------------------------------
   MATRIX TABLE
   ---------------------------------------------------------- */
.tc-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tc-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 640px;
}
.tc-matrix th {
  background: var(--mp-color-surface-soft);
  font-family: var(--tc-heading-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--tc-subtle);
  padding: 8px 9px;
  border-bottom: 1px solid var(--tc-border);
  text-align: left;
  white-space: nowrap;
}
.tc-matrix th:first-child {
  min-width: 155px;
}
.tc-th-code {
  font-family: var(--mp-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tc-blue);
}
.tc-matrix td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--tc-border-2);
  text-align: center;
  vertical-align: middle;
}
.tc-matrix td:first-child {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--tc-muted);
}
.tc-matrix tr:hover td {
  background: var(--mp-color-surface-soft);
}
.tc-matrix tr:last-child td {
  border-bottom: none;
}
.tc-dot-s {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tc-red);
  display: inline-block;
}
.tc-dot-b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tc-green);
  display: inline-block;
}
.tc-legend {
  display: flex;
  gap: 18px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--tc-muted);
  text-align: left;
}
.tc-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ----------------------------------------------------------
   CBM TOOL ENTERPRISE LAYOUT
   ---------------------------------------------------------- */
.tc-main.tc-tool-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.tc-main.tc-tool-main > .tc-tool-command {
  margin-bottom: 18px;
}

.tc-main.tc-tool-main > .tc-section {
  margin-bottom: 0;
}

/* Keep the CBM input panels visually separated at every viewport. */
.tc-cbm-tool .tc-main.tc-tool-main > .tc-section + .tc-section {
  margin-top: 18px;
}

/* Keep every Incoterms panel and its generated data areas evenly separated. */
.tc-incoterms-tool .tc-main.tc-tool-main > .tc-section + .tc-section {
  margin-top: 18px;
}

.tc-incoterms-tool .tc-terms-grid,
.tc-incoterms-tool #cmpResult:not(:empty) {
  margin-top: 18px;
}

/* Keep the MOQ input panels and result tables evenly separated at every viewport. */
.tc-moq-tool .tc-main.tc-tool-main > .tc-section + .tc-section,
.tc-moq-tool .tc-panel-body > .tc-table-wrap + .tc-table-wrap {
  margin-top: 18px;
}

/* Keep the Supplier Quote Comparison panels on the same shared vertical rhythm. */
.tc-supplier-comparison-tool .tc-main.tc-tool-main > .tc-section + .tc-section {
  margin-top: 18px;
}

/* Match the RFQ builder's outer panel rhythm to every other tool. The direct
   column scope preserves the tighter field spacing inside individual panels. */
.tc-rfq-tool > .tc-layout > .tc-form-col,
.tc-rfq-tool > .tc-layout > .tc-preview-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tc-rfq-tool > .tc-layout > .tc-form-col > .tc-section,
.tc-rfq-tool > .tc-layout > .tc-preview-col > .tc-section {
  margin-bottom: 0;
}

.tc-main.tc-tool-main > .tc-results:not(.is-visible) {
  display: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.tc-main.tc-tool-main > .tc-results.is-visible {
  margin-top: 18px;
}

.tc-main.tc-tool-main > .tc-guidance-card {
  margin-top: 18px;
}

.tc-tool-command {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 2px;
}

.tc-command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: var(--mp-color-surface);
  border: 0;
  border-radius: var(--mp-infocard-card-radius-desktop, 14px);
  padding: 12px 14px;
  box-shadow: none;
}

.tc-command-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--mp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tc-blue);
  background: rgba(36, 84, 198, 0.09);
  border: 1px solid rgba(36, 84, 198, 0.12);
}

.tc-command-icon svg {
  width: 16px;
  height: 16px;
}

.tc-command-green {
  color: var(--tc-green);
  background: rgba(21, 128, 61, 0.09);
  border-color: rgba(21, 128, 61, 0.14);
}

.tc-command-item strong,
.tc-command-item em {
  display: block;
  line-height: 1.25;
  text-align: left;
}

.tc-command-item strong {
  font-size: 12.5px;
  color: var(--tc-text);
  font-weight: 600;
}

.tc-command-item em {
  margin-top: 2px;
  font-size: 12px;
  font-style: normal;
  color: var(--tc-subtle);
}

.tc-tool-panel {
  border-radius: var(--mp-radius-xl);
}

.tc-tool-panel-head {
  justify-content: space-between;
}

.tc-panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tc-panel-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--tc-subtle);
  text-align: left;
}

.tc-split-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.tc-split-primary {
  min-width: 0;
}

.tc-side-note {
  background: var(--mp-color-surface);
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-lg);
  padding: 15px 16px;
  color: var(--tc-muted);
  text-align: left;
}

.tc-side-note-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--tc-blue);
  margin-bottom: 8px;
}

.tc-side-note ul {
  margin: 0;
  padding-left: 16px;
}

.tc-side-note li {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 7px;
}

.tc-side-note li:last-child {
  margin-bottom: 0;
}

.tc-container-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: center;
}

.tc-container-controls {
  min-width: 0;
}

.tc-ctn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--mp-radius-md);
  margin: 0 auto 8px;
  color: var(--tc-blue);
  background: rgba(36, 84, 198, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-ctn-icon svg {
  width: 18px;
  height: 18px;
}

.tc-container-visual {
  min-height: 300px;
  border-radius: var(--mp-radius-xl);
  background: var(--mp-color-surface);
  border: 1px solid rgba(212, 221, 232, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  overflow: hidden;
}

.tc-container-dimension-img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  object-fit: contain;
  border-radius: var(--mp-radius-lg);
}

.tc-container-caption {
  margin-top: 12px;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: var(--tc-muted);
}

.tc-cbm-tool .tc-sku-row {
  grid-template-columns: minmax(190px, 2fr) repeat(5, minmax(112px, 1fr)) 32px;
  gap: 12px;
}

.tc-cbm-tool .tc-sku-row .tc-del-btn {
  align-self: end;
}

.tc-info-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: var(--mp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-blue);
  background: var(--mp-color-brand-soft);
  border: 0;
  box-shadow: none;
  margin: 0;
}

.tc-info-icon svg {
  width: 24px;
  height: 24px;
}

.tc-run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  margin-top: 22px;
}

.tc-secondary-btn,
.tc-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  border-radius: var(--mp-radius-lg);
  border: 1px solid rgba(212, 221, 232, 0.95);
  background: rgba(255, 255, 255, 0.96);
  color: var(--tc-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color var(--mp-motion-fast),
    color var(--mp-motion-fast),
    box-shadow var(--mp-motion-fast),
    transform var(--mp-motion-fast);
}

.tc-secondary-btn:hover,
.tc-action-secondary:hover {
  border-color: rgba(36, 84, 198, 0.45);
  color: var(--tc-blue);
  box-shadow: none;
  transform: translateY(-1px);
}

.tc-results-panel {
  margin-top: 4px;
}

.tc-panel-icon-success {
  background: rgba(21, 128, 61, 0.12);
  color: var(--tc-green);
}

.tc-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tc-action-secondary {
  height: 34px;
  padding: 0 13px;
  border-radius: var(--mp-radius-pill);
  font-size: 12px;
}

.tc-fill-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 7px;
}

.tc-fill-label-row .tc-fill-label {
  margin-bottom: 0;
}

.tc-fill-note {
  font-size: 12px;
  color: var(--tc-subtle);
  text-align: right;
}

.tc-fill-wrap-premium .tc-fill-track {
  height: 24px;
}

.tc-guidance-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 22px 24px;
  border: 0;
  border-radius: var(--mp-infocard-card-radius-desktop, 14px);
  background: var(--mp-color-surface);
  box-shadow: none;
  overflow: hidden;
}

.tc-result-info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tc-result-info-strip .tc-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  text-align: left;
}

.tc-info-copy {
  display: block;
  min-width: 0;
  padding-top: 2px;
}

.tc-result-info-strip .tc-info-copy strong,
.tc-result-info-strip .tc-info-copy > span {
  display: block;
}

.tc-result-info-strip strong {
  color: var(--tc-text);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.tc-result-info-strip span:not(.tc-info-icon) {
  color: var(--tc-muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

@media print {
  .top-nav,
  .tools-nav-row,
  .tc-tool-command,
  .tc-panel-actions,
  .tc-run-row,
  footer {
    display: none;
  }
  body.tools-page {
    background: var(--mp-color-surface);
  }
  .tc-wrap .tc-main,
  .tc-wrap .tc-layout,
  .tc-main {
    padding: 0;
  }
  .tc-panel {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ----------------------------------------------------------
   RESPONSIVE TOOL CONTENT
   ---------------------------------------------------------- */
@media (max-width: 700px) {
  .tc-layout {
    grid-template-columns: 1fr;
  }
  .tc-preview-col {
    position: static;
  }
  .tc-grid-3,
  .tc-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .tc-stats,
  .tc-stats-4 {
    grid-template-columns: 1fr 1fr;
  }
  .tc-sku-row {
    grid-template-columns: 1fr 1fr;
  }
  .tc-sku-row .tc-del-btn {
    grid-column: 2;
    justify-self: end;
  }
  .tc-ctn-grid,
  .tc-resp-grid {
    grid-template-columns: 1fr;
  }
  .rfq-sku-row {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.72fr) 34px;
    gap: 10px;
  }
  .rfq-sku-row .tc-field:first-child {
    grid-column: 1 / -1;
  }
  .rfq-sku-row .tc-field:nth-child(2) {
    grid-column: 1 / 2;
  }
  .rfq-sku-row .tc-field:nth-child(3) {
    grid-column: 2 / 3;
  }
  .rfq-sku-row .tc-del-btn {
    grid-column: 3 / 4;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }
  .tc-panel-body {
    padding: 18px;
  }
  .tc-panel-head {
    padding: 12px 14px;
  }
  .tc-table th,
  .tc-table td {
    padding-left: 9px;
    padding-right: 9px;
  }
  .tc-matrix {
    min-width: 560px;
  }
  .tc-matrix th:first-child {
    min-width: 135px;
  }
}

@media (max-width: 500px) {
  .tc-grid-2,
  .tc-grid-3 {
    grid-template-columns: 1fr;
  }
  .tc-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .tc-stats,
  .tc-stats-4 {
    grid-template-columns: 1fr;
  }
  .tc-sku-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    gap: 10px;
  }
  .tc-sku-row .tc-field,
  .tc-sku-row .tc-input {
    min-width: 0;
  }
  .tc-sku-row .tc-del-btn {
    grid-column: 2;
    justify-self: end;
  }
  .rfq-sku-row {
    grid-template-columns: minmax(0, 1fr) minmax(88px, 0.62fr) 32px;
    padding: 12px;
    gap: 9px;
  }
  .rfq-sku-row .tc-field:first-child {
    grid-column: 1 / -1;
  }
  .rfq-sku-row .tc-field:nth-child(2) {
    grid-column: 1 / 2;
  }
  .rfq-sku-row .tc-field:nth-child(3) {
    grid-column: 2 / 3;
  }
  .rfq-sku-row .tc-del-btn {
    grid-column: 3 / 4;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }
  .tc-panel {
    border-radius: var(--mp-infocard-card-radius-mobile, 12px);
  }
  .tc-panel-body {
    padding: 16px;
  }
  .tc-terms-grid {
    grid-template-columns: 1fr;
  }
  .tc-matrix {
    min-width: 500px;
    font-size: 12px;
  }
  .tc-matrix th,
  .tc-matrix td {
    padding: 6px 7px;
  }
  .tc-input,
  .tc-select,
  .tc-textarea {
    font-size: 16px;
  }
  .tc-rfq-body {
    font-size: 12px;
  }
}

@media (max-width: 980px) {
  .tc-tool-command {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tc-split-body,
  .tc-container-layout {
    grid-template-columns: 1fr;
  }
  .tc-side-note {
    order: 2;
  }
  .tc-container-visual {
    min-height: 240px;
  }
  .tc-cbm-tool .tc-sku-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 32px;
  }
  .tc-result-info-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 34px;
  }
}

@media (max-width: 699px) {
  .tc-tool-command {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tc-command-item {
    padding: 10px 12px;
  }
  .tc-tool-panel {
    border-radius: var(--mp-infocard-card-radius-mobile, 12px);
  }
  .tc-tool-panel-head {
    gap: 10px;
  }
  .tc-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .tc-split-body,
  .tc-container-layout {
    gap: 14px;
  }
  .tc-container-visual {
    display: flex;
    min-height: 210px;
    padding: 18px;
  }

  .tc-container-dimension-img {
    max-width: 360px;
  }
  .tc-cbm-tool .tc-sku-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 8px;
    padding: 12px;
  }

  .tc-cbm-tool .tc-sku-row .tc-field,
  .tc-cbm-tool .tc-sku-row .tc-input {
    min-width: 0;
  }

  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(1) {
    grid-column: 1 / span 5;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(2) {
    grid-column: 1 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(3) {
    grid-column: 3 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(4) {
    grid-column: 5 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(5) {
    grid-column: 1 / span 3;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(6) {
    grid-column: 4 / span 3;
  }

  .tc-cbm-tool .tc-sku-row .tc-del-btn {
    grid-column: 6;
    grid-row: 1;
    justify-self: end;
    align-self: end;
  }
  .tc-run-row {
    grid-template-columns: 1fr;
  }
  .tc-secondary-btn {
    height: 42px;
  }
  .tc-fill-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .tc-fill-note {
    text-align: left;
  }
  .tc-guidance-card {
    gap: 14px;
    padding: 18px 16px;
    border-radius: var(--mp-infocard-card-radius-mobile, 12px);
  }

  .tc-result-info-strip {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0;
    border-radius: 0;
  }
}

/* ============================================================
   FINAL LAYOUT / SPACING
   One shared gutter system keeps the infocard, navigation,
   directory cards, and individual tool panels aligned.
   ============================================================ */

.tools-nav-link,
.tools-nav-link *,
.tc-ctn-opt,
.tc-ctn-opt *,
.tc-term-card,
.tc-term-card * {
  cursor: pointer;
}

.tc-wrap .tc-main,
.tc-main.tc-tool-main,
.tc-wrap .tc-layout {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 20px;
}

.tc-main.tc-tool-main > *,
.tc-wrap .tc-section,
.tc-wrap .tc-panel,
.tc-wrap .tc-tool-panel,
.tc-wrap .tc-panel-body,
.tc-wrap .tc-tool-command,
.tc-wrap .tc-table-wrap,
.tc-wrap .tc-matrix-wrap,
.tc-wrap .tc-guidance-card,
.tc-wrap .tc-result-info-strip {
  max-width: 100%;
  min-width: 0;
}

.tc-wrap .tc-table-wrap,
.tc-wrap .tc-matrix-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Tablet layouts inherit the universal page rail; only component columns change here. */
@media (min-width: 769px) and (max-width: 1100px) {
  .tc-grid-4,
  .tc-stats-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tc-preview-col {
    position: static;
  }
}

@media (max-width: 1279px) {
  .tools-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tools-index-main,
  .tc-wrap .tc-main,
  .tc-main.tc-tool-main,
  .tc-wrap .tc-layout {
    width: calc(100% - (var(--mp-page-gutter-inline) * 2));
  }

  .tools-index-main {
    padding-bottom: 24px;
  }
  .tools-index-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tools-card {
    padding: 18px 16px;
    border-radius: var(--mp-infocard-card-radius-mobile, 12px);
  }

  .tools-card-head {
    gap: 12px;
  }
  .tools-card-icon {
    width: 40px;
    height: 40px;
  }
  .tools-card-icon svg {
    width: 20px;
    height: 20px;
  }
  .tools-card-desc {
    font-size: 13px;
  }
  .tools-card-tags {
    gap: 5px;
  }
  .tools-tag {
    padding: 4px 8px;
    font-size: 12px;
  }

  .tc-wrap .tc-main,
  .tc-main.tc-tool-main,
  .tc-wrap .tc-layout {
    padding-bottom: 20px;
  }

  .tc-wrap .tc-tool-panel-head {
    flex-direction: column;
    gap: 12px;
  }

  .tc-wrap .tc-panel-title-group {
    width: 100%;
  }

  .tc-wrap .tc-panel-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .tc-wrap .tc-action-secondary {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .tc-wrap .tc-table-wrap,
  .tc-wrap .tc-matrix-wrap {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .tc-wrap .tc-table,
  .tc-wrap .tc-matrix {
    max-width: none;
  }
}

/* Supplier comparison rows: keep the last field visible */
.sc-compare-rows .tc-sku-row {
  grid-template-columns: minmax(180px, 2.2fr) repeat(6, minmax(95px, 1fr)) 30px;
}

@media (max-width: 1200px) {
  .sc-compare-rows .tc-sku-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 30px;
  }
}

@media (max-width: 700px) {
  .sc-compare-rows .tc-sku-row {
    grid-template-columns: 1fr;
  }

  .sc-compare-rows .tc-del-btn {
    justify-self: start;
  }
}
/* ----------------------------------------------------------
   IMPORT DUTY TOOL ENTERPRISE LAYOUT
   ---------------------------------------------------------- */
.tc-id-tool .tc-id-input-panel .tc-panel-body {
  padding: 20px 22px 22px;
}

.tc-id-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

.tc-id-form {
  min-width: 0;
}

.tc-id-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--tc-text);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tc-id-step:not(:first-child) {
  margin-top: 22px;
}

.tc-id-step span {
  width: 24px;
  height: 24px;
  border-radius: var(--mp-radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--mp-color-surface);
  background: var(--tc-blue);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.tc-id-step em {
  font-style: normal;
  color: var(--tc-muted);
  font-weight: 600;
}

.tc-flag-select-wrap {
  position: relative;
}

.tc-flag-select-wrap img {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: none;
  z-index: 2;
}

.tc-flag-select-wrap .tc-flag-select {
  padding-left: 46px;
}

.tc-id-scenario-grid,
.tc-id-cost-grid {
  gap: 14px;
}

.tc-id-run-row {
  margin-top: 20px;
}

.tc-id-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--tc-muted);
  font-size: 12px;
  line-height: 1.45;
}

.tc-id-privacy svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--tc-subtle);
}

.tc-id-method-card {
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-xl);
  background: var(--mp-color-surface);
  padding: 22px 20px;
  box-shadow: none;
  min-width: 0;
}

.tc-id-method-title {
  color: var(--tc-blue);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.tc-id-method-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tc-id-method-step > span {
  width: 38px;
  height: 38px;
  border-radius: var(--mp-radius-md);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-blue);
  background: rgba(36, 84, 198, 0.09);
  border: 1px solid rgba(36, 84, 198, 0.11);
}

.tc-id-method-step svg {
  width: 18px;
  height: 18px;
}

.tc-id-method-step strong,
.tc-id-method-step em {
  display: block;
  text-align: left;
}

.tc-id-method-step strong {
  color: var(--tc-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.tc-id-method-step em {
  margin-top: 3px;
  color: var(--tc-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.tc-id-method-arrow {
  color: var(--mp-color-text-subtle);
  font-size: 22px;
  line-height: 1;
  padding: 5px 0 5px 18px;
}

.tc-id-note {
  margin-top: 18px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--mp-radius-lg);
  background: rgba(255, 251, 235, 0.74);
  padding: 13px 14px;
  color: var(--tc-muted);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: left;
}

.tc-id-note strong {
  color: var(--tc-amber);
}

.tc-id-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tc-id-stat-grid .tc-stat {
  padding: 15px 14px;
}

.tc-id-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.tc-id-breakdown-card,
.tc-id-composition-card {
  border: 1px solid rgba(212, 221, 232, 0.95);
  border-radius: var(--mp-radius-lg);
  background: var(--mp-color-surface);
  padding: 16px;
  min-width: 0;
}

.tc-id-subtitle {
  margin: 0 0 12px;
  color: var(--tc-text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
}

.tc-id-bar {
  display: flex;
  width: 100%;
  height: 42px;
  overflow: hidden;
  border-radius: var(--mp-radius-md);
  background: var(--mp-color-divider);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tc-id-bar span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mp-color-surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tc-id-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin-top: 14px;
}

.tc-id-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--tc-muted);
  font-size: 12px;
  line-height: 1.35;
}

.tc-id-legend i {
  width: 9px;
  height: 9px;
  border-radius: var(--mp-radius-pill);
  flex-shrink: 0;
}

.tc-id-legend b {
  margin-left: auto;
  color: var(--tc-text);
  font-weight: 700;
}

.tc-id-warning {
  margin-top: 18px;
}

.tc-id-info-strip {
  margin: 0;
}

.tc-guidance-card .tc-id-disclaimer {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(228, 235, 243, 0.95);
  background: transparent;
  text-align: center;
  color: var(--tc-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .tc-id-layout,
  .tc-id-result-layout {
    grid-template-columns: 1fr;
  }
  .tc-id-method-card {
    order: 2;
  }
  .tc-id-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .tc-id-tool .tc-id-input-panel .tc-panel-body {
    padding: 16px;
  }
  .tc-id-step {
    align-items: flex-start;
  }
  .tc-id-run-row {
    grid-template-columns: 1fr;
  }
  .tc-id-stat-grid {
    grid-template-columns: 1fr;
  }
  .tc-id-legend {
    grid-template-columns: 1fr;
  }
  .tc-id-method-card {
    padding: 18px 16px;
  }

  /* Import-duty mobile repair. */
  .tc-id-tool .tc-main.tc-tool-main {
    gap: 0;
  }

  .tc-id-tool .tc-tool-command {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tc-id-tool .tc-command-item {
    align-items: flex-start;
    min-height: 72px;
    padding: 10px 11px;
    border-radius: var(--mp-radius-lg);
  }

  .tc-id-tool .tc-command-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--mp-radius-md);
  }

  .tc-id-tool .tc-command-item strong {
    font-size: 12px;
  }

  .tc-id-tool .tc-command-item em {
    font-size: 12px;
    line-height: 1.3;
  }

  .tc-id-tool .tc-tool-panel-head {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .tc-id-tool .tc-panel-title-group {
    align-items: flex-start;
  }

  .tc-id-tool .tc-panel-subtitle {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .tc-id-tool .tc-id-layout,
  .tc-id-tool .tc-id-result-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tc-id-tool .tc-id-scenario-grid,
  .tc-id-tool .tc-id-cost-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tc-id-tool .tc-id-step {
    margin-bottom: 12px;
    line-height: 1.3;
  }

  .tc-id-tool .tc-id-step:not(:first-child) {
    margin-top: 18px;
  }

  .tc-id-tool .tc-id-step em {
    display: block;
    margin-left: 0;
    font-size: 12px;
  }

  .tc-id-tool .tc-id-run-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .tc-id-tool .tc-run-btn,
  .tc-id-tool .tc-secondary-btn {
    height: 46px;
    border-radius: var(--mp-radius-lg);
  }

  .tc-id-tool .tc-id-privacy {
    align-items: flex-start;
    font-size: 11.5px;
  }

  .tc-id-tool .tc-id-method-card {
    order: 2;
    padding: 16px;
    border-radius: var(--mp-radius-xl);
  }

  .tc-id-tool .tc-id-method-title {
    margin-bottom: 14px;
  }

  .tc-id-tool .tc-id-method-step {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
  }

  .tc-id-tool .tc-id-method-step > span {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: var(--mp-radius-lg);
  }

  .tc-id-tool .tc-id-method-step strong {
    font-size: 12.5px;
  }

  .tc-id-tool .tc-id-method-step em {
    font-size: 11.5px;
  }

  .tc-id-tool .tc-id-method-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 1.6rem;
    margin: 0.2rem 0 0.35rem;
    color: var(--mp-color-text-subtle);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1;
  }

  .tc-id-tool .tc-id-method-step + .tc-id-method-step {
    margin-top: 0;
  }

  .tc-id-tool .tc-id-note {
    margin-top: 14px;
    font-size: 12px;
  }

  .tc-id-tool .tc-panel-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tc-id-tool .tc-action-secondary {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .tc-id-tool .tc-id-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tc-id-tool .tc-id-stat-grid .tc-stat {
    min-width: 0;
    padding: 13px 12px;
    border-radius: var(--mp-radius-lg);
  }

  .tc-id-tool .tc-id-stat-grid .tc-stat-label {
    font-size: 12px;
    letter-spacing: 0.35px;
  }

  .tc-id-tool .tc-id-stat-grid .tc-stat-val {
    font-size: 16px;
    line-height: 1.12;
    word-break: break-word;
  }

  .tc-id-tool .tc-id-breakdown-card,
  .tc-id-tool .tc-id-composition-card {
    padding: 14px;
    border-radius: var(--mp-radius-lg);
  }

  .tc-id-tool .tc-table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px;
  }

  .tc-id-tool .tc-id-bar {
    height: 34px;
    border-radius: var(--mp-radius-md);
  }

  .tc-id-tool .tc-id-bar span {
    font-size: 12px;
  }

  .tc-id-tool .tc-id-legend {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tc-id-tool .tc-id-warning {
    font-size: 12px;
    line-height: 1.5;
  }

  .tc-id-tool .tc-id-info-strip {
    margin: 0;
  }

  .tc-id-tool .tc-id-disclaimer {
    margin: 0;
    padding: 14px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
  }
}

@media (max-width: 430px) {
  .tc-id-tool .tc-tool-command {
    grid-template-columns: 1fr;
  }

  .tc-id-tool .tc-command-item {
    min-height: 0;
  }

  .tc-id-tool .tc-id-stat-grid {
    grid-template-columns: 1fr;
  }

  .tc-id-tool .tc-panel-actions {
    grid-template-columns: 1fr;
  }

  .tc-id-tool .tc-id-bar {
    height: auto;
    min-height: 34px;
    flex-wrap: wrap;
  }

  .tc-id-tool .tc-id-bar span {
    min-height: 34px;
  }
}

/* ----------------------------------------------------------
   CBM TABLET PORTRAIT SKU FIT
   Keep every field inside the shared page rail without horizontal overflow.
   ---------------------------------------------------------- */
@media (min-width: 700px) and (max-width: 980px) and (orientation: portrait) {
  .tc-cbm-tool .tc-sku-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tc-cbm-tool .tc-sku-row .tc-field,
  .tc-cbm-tool .tc-sku-row .tc-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(1) {
    grid-column: 1 / span 5;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(2) {
    grid-column: 1 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(3) {
    grid-column: 3 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(4) {
    grid-column: 5 / span 2;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(5) {
    grid-column: 1 / span 3;
  }
  .tc-cbm-tool .tc-sku-row .tc-field:nth-child(6) {
    grid-column: 4 / span 3;
  }

  .tc-cbm-tool .tc-sku-row .tc-del-btn {
    grid-column: 6;
    grid-row: 1;
    justify-self: end;
    align-self: end;
  }
}


/* Flat tools system: consistent surfaces, keyboard visibility, and touch input sizing */
@media (max-width: 768px), (any-pointer: coarse) {
  .tc-input,
  .tc-select,
  .tc-textarea {
    font-size: 16px;
  }
}

@media (forced-colors: active) {
  .tools-card:focus-visible,
  .tools-nav-link:focus-visible,
  .tools-nav-control:focus-visible,
  .tc-ctn-opt:focus-within,
  .tc-input:focus-visible,
  .tc-select:focus-visible,
  .tc-textarea:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
    box-shadow: none;
  }

  .tools-nav-link.is-active,
  .tc-ctn-opt.is-sel,
  .tc-term-card.is-active {
    border: 2px solid Highlight;
  }
}
