.browser-tool-page {
  --bt-bg: #0b1020;
  --bt-bg-2: #101624;
  --bt-panel: rgba(17, 24, 39, 0.94);
  --bt-panel-2: rgba(15, 23, 42, 0.82);
  --bt-line: rgba(255, 255, 255, 0.14);
  --bt-line-strong: rgba(147, 197, 253, 0.34);
  --bt-text: #f8fafc;
  --bt-muted: #c7d2e5;
  --bt-soft: #93a4bd;
  --bt-blue: #4f8cff;
  --bt-green: #22c55e;
  --bt-orange: #f59e0b;
  --bt-purple: #a78bfa;
  --bt-cyan: #14b8a6;
  background: linear-gradient(180deg, var(--bt-bg) 0%, var(--bt-bg-2) 48%, #0f172a 100%);
  color: var(--bt-text);
  min-height: 100vh;
}

.bt-hero {
  position: relative;
  overflow: hidden;
  padding: 128px 0 56px;
  border-bottom: 1px solid var(--bt-line);
  background:
    radial-gradient(circle at 16% 20%, rgba(79, 140, 255, 0.34), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(20, 184, 166, 0.22), transparent 32%),
    linear-gradient(135deg, #090d1b 0%, #11172a 54%, #0b1020 100%);
}

.bt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/static/hub/img/bg/grid.jpg') center center / cover no-repeat;
  opacity: 0.14;
  mix-blend-mode: screen;
  pointer-events: none;
}

.bt-hero-inner {
  position: relative;
  z-index: 1;
}

.bt-accent-orange {
  background:
    radial-gradient(circle at 16% 20%, rgba(245, 158, 11, 0.34), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(79, 140, 255, 0.22), transparent 32%),
    linear-gradient(135deg, #090d1b 0%, #11172a 54%, #0b1020 100%);
}

.bt-accent-green {
  background:
    radial-gradient(circle at 16% 20%, rgba(34, 197, 94, 0.28), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(79, 140, 255, 0.22), transparent 32%),
    linear-gradient(135deg, #090d1b 0%, #11172a 54%, #0b1020 100%);
}

.bt-accent-purple {
  background:
    radial-gradient(circle at 16% 20%, rgba(167, 139, 250, 0.36), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(20, 184, 166, 0.2), transparent 32%),
    linear-gradient(135deg, #090d1b 0%, #11172a 54%, #0b1020 100%);
}

.bt-accent-cyan {
  background:
    radial-gradient(circle at 16% 20%, rgba(20, 184, 166, 0.34), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(14, 165, 233, 0.24), transparent 32%),
    linear-gradient(135deg, #090d1b 0%, #11172a 54%, #0b1020 100%);
}

.bt-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.88rem;
  margin-bottom: 1.35rem;
}

.bt-breadcrumb a {
  color: #bfdbfe;
  font-weight: 700;
  text-decoration: none;
}

.bt-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: stretch;
}

.bt-eyebrow,
.bt-section-kicker {
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

.bt-hero h1 {
  color: #ffffff;
  font-size: 3.35rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  margin: 1rem 0;
  max-width: 900px;
}

.bt-hero p {
  color: var(--bt-muted);
  font-size: 1.13rem;
  line-height: 1.72;
  max-width: 760px;
}

.bt-privacy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.45rem;
}

.bt-privacy-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #e5edf8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bt-line);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.bt-hero-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--bt-line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  padding: 1.35rem;
}

.bt-hero-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--bt-blue);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.bt-accent-orange .bt-hero-icon { background: var(--bt-orange); }
.bt-accent-green .bt-hero-icon { background: var(--bt-green); }
.bt-accent-purple .bt-hero-icon { background: var(--bt-purple); }
.bt-accent-cyan .bt-hero-icon { background: var(--bt-cyan); }

.bt-hero-card-kicker {
  color: #7dd3fc !important;
  font-size: 0.78rem !important;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.bt-hero-card h2 {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.bt-hero-card p {
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.95rem;
  margin: 0;
}

.bt-tool-section {
  background: #0b1020;
  padding: 46px 0 64px;
}

.bt-tool-shell,
.bt-content-grid article,
.bt-related-panel {
  background: var(--bt-panel);
  border: 1px solid var(--bt-line);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28);
}

.bt-tool-shell {
  overflow: hidden;
}

.bt-tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--bt-line);
  background: rgba(15, 23, 42, 0.86);
}

.bt-tool-heading h2 {
  color: #fff;
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0.2rem 0 0;
}

.bt-status {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.bt-status.is-error {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.28);
}

.bt-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--bt-line);
  background: rgba(15, 23, 42, 0.54);
}

.bt-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bt-control-checkbox {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
}

.bt-control-checkbox span {
  order: 2;
  text-transform: none;
  font-size: 0.93rem;
}

.bt-control input,
.bt-control select,
.bt-control textarea {
  width: 100%;
  min-height: 44px;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
  outline: none;
}

.bt-control input[type="checkbox"] {
  width: 1.1rem;
  min-height: 1.1rem;
  accent-color: #4f8cff;
}

.bt-control input[type="range"] {
  padding: 0;
  accent-color: #38bdf8;
}

.bt-control output {
  color: #7dd3fc;
  font-size: 0.95rem;
  font-weight: 900;
}

.bt-control option {
  background: #111827;
  color: #f8fafc;
}

.bt-control input:focus,
.bt-control select:focus,
.bt-panel textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.bt-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--bt-line);
}

.bt-workspace-compare {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bt-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 420px;
  background: var(--bt-panel-2);
  padding: 1.25rem;
}

.bt-panel label {
  color: #f8fafc;
  font-weight: 800;
  margin: 0;
}

.bt-panel textarea {
  flex: 1;
  width: 100%;
  min-height: 320px;
  resize: vertical;
  color: #e5edf8;
  background: rgba(2, 6, 23, 0.76);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  padding: 0.9rem;
  font: 13px/1.55 Monaco, Menlo, Consolas, "Liberation Mono", monospace;
  outline: none;
}

.bt-panel textarea::placeholder,
.bt-control input::placeholder {
  color: rgba(203, 213, 225, 0.48);
}

.bt-action-row,
.bt-samples,
.bt-file-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--bt-line);
  background: rgba(15, 23, 42, 0.68);
}

.bt-file-line {
  border-top: 0;
  border-bottom: 1px solid var(--bt-line);
}

.bt-file-line input {
  display: none;
}

.bt-file-line span,
.bt-samples span {
  color: var(--bt-muted);
  font-weight: 700;
}

.bt-button,
.bt-samples button,
.bt-result-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0.62rem 0.95rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.bt-button:hover,
.bt-samples button:hover,
.bt-result-download:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.bt-button-primary {
  color: #fff;
  background: #4f8cff;
  box-shadow: 0 10px 22px rgba(79, 140, 255, 0.2);
}

.bt-button-secondary,
.bt-samples button,
.bt-result-download {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bt-line);
}

.bt-button-danger {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.28);
}

.bt-button:disabled,
.bt-result-download:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.bt-samples {
  border-top: 0;
  padding-top: 0;
}

.bt-image-layout {
  background: rgba(15, 23, 42, 0.54);
}

.bt-drop-zone {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  min-height: 210px;
  margin: 1.25rem;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.42);
  border: 2px dashed rgba(56, 189, 248, 0.72);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
}

.bt-drop-zone input {
  display: none;
}

.bt-drop-zone.is-dragover {
  background: rgba(14, 165, 233, 0.14);
  border-color: #14b8a6;
}

.bt-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  border-radius: 8px;
  font-size: 1.35rem;
}

.bt-drop-zone span,
.bt-empty-state {
  color: rgba(226, 232, 240, 0.68);
}

.bt-image-results {
  display: grid;
  gap: 1px;
  background: var(--bt-line);
  border-top: 1px solid var(--bt-line);
}

.bt-image-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 1rem;
  background: var(--bt-panel-2);
  padding: 1rem 1.25rem;
}

.bt-image-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 8px;
  background: conic-gradient(rgba(245, 243, 250, 0.1) 25%, rgba(15, 23, 42, 0.72) 0 50%, rgba(245, 243, 250, 0.1) 0 75%, rgba(15, 23, 42, 0.72) 0) 0 0 / 18px 18px;
}

.bt-image-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.bt-image-meta strong {
  display: block;
  color: #f8fafc;
  overflow-wrap: anywhere;
}

.bt-image-meta span,
.bt-image-saving {
  display: block;
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.bt-empty-state {
  background: var(--bt-panel-2);
  padding: 1.5rem;
  text-align: center;
}

.bt-calculator {
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.54);
}

.bt-calculator .bt-option-grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.bt-calculator-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.bt-token-counter {
  background: rgba(15, 23, 42, 0.54);
}

.bt-token-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 1px;
  background: var(--bt-line);
}

.bt-token-input-panel {
  min-height: 520px;
}

.bt-token-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bt-panel-2);
  padding: 1.25rem;
}

.bt-token-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.bt-token-context,
.bt-token-note {
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  padding: 1rem;
}

.bt-token-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--bt-muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bt-token-context-head strong {
  color: #ffffff;
  font-size: 1rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.bt-token-meter {
  height: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 999px;
  margin: 0.85rem 0 0.65rem;
}

.bt-token-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4f8cff 0%, #14b8a6 100%);
  border-radius: inherit;
  transition: width 0.18s ease;
}

.bt-token-meter span.is-over {
  background: linear-gradient(90deg, #f59e0b 0%, #f43f5e 100%);
}

.bt-token-context p,
.bt-token-note {
  color: rgba(226, 232, 240, 0.74);
  line-height: 1.55;
  margin: 0;
}

.bt-token-note strong {
  color: #f8fafc;
}

.bt-result-card {
  min-height: 112px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  padding: 1rem;
}

.bt-result-card span {
  display: block;
  color: var(--bt-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bt-result-card strong {
  display: block;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.bt-result-card p {
  color: rgba(226, 232, 240, 0.72);
  margin: 0.4rem 0 0;
}

.bt-svg-preview {
  display: none;
  min-height: 160px;
  background: rgba(2, 6, 23, 0.56);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  padding: 1rem;
}

.bt-svg-preview.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-svg-preview svg,
.bt-svg-preview img {
  max-width: 100%;
  max-height: 220px;
}

.bt-content-section {
  background: #101624;
  padding: 64px 0 80px;
}

.bt-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
}

.bt-content-grid article,
.bt-related-panel {
  padding: 1.35rem;
}

.bt-content-grid h2,
.bt-related-panel h2 {
  color: #f8fafc;
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.25rem 0 0.8rem;
}

.bt-content-grid h3 {
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 1.1rem 0 0.35rem;
}

.bt-content-grid p {
  color: var(--bt-muted);
  line-height: 1.72;
  margin: 0;
}

.bt-explainer-block {
  display: grid;
  gap: 1.05rem;
  margin-top: 1.2rem;
}

.bt-explainer-block section {
  background: rgba(2, 6, 23, 0.38);
  border: 1px solid rgba(147, 197, 253, 0.16);
  border-radius: 8px;
  padding: 1rem;
}

.bt-explainer-block h3 {
  margin-top: 0;
}

.bt-related-list {
  display: grid;
  gap: 0.55rem;
}

.bt-related-list a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 0.65rem;
  color: #e5edf8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bt-line);
  border-radius: 8px;
  padding: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.bt-related-list a:hover {
  color: #fff;
  border-color: var(--bt-line-strong);
  text-decoration: none;
}

.bt-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1050;
  display: none;
  color: #fff;
  background: #16a34a;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  padding: 0.8rem 1rem;
  font-weight: 800;
}

.bt-toast.is-visible {
  display: block;
}

@media (max-width: 991.98px) {
  .bt-hero-grid,
  .bt-content-grid {
    grid-template-columns: 1fr;
  }

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

  .bt-workspace,
  .bt-workspace-compare {
    grid-template-columns: 1fr;
  }

  .bt-panel {
    min-height: auto;
  }

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

  .bt-token-workspace {
    grid-template-columns: 1fr;
  }

  .bt-token-input-panel {
    min-height: auto;
  }
}

@media (max-width: 767.98px) {
  .bt-hero {
    padding: 150px 0 42px;
  }

  .bt-hero h1 {
    font-size: 2.35rem;
  }

  .bt-hero p {
    font-size: 1rem;
  }

  .bt-tool-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .bt-option-grid,
  .bt-calculator-results,
  .bt-token-result-grid,
  .bt-image-row {
    grid-template-columns: 1fr;
  }

  .bt-token-context-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bt-button,
  .bt-samples button,
  .bt-result-download {
    width: 100%;
  }
}
