/* ═══════════════════════════════════════════════════════
   KBTool — style.css  v1.1
   Dark, premium, production-ready
═══════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure `hidden` attribute works even if display is set elsewhere */
[hidden] {
  display: none !important;
}

/* ── Design Tokens ──────────────────────────────────── */
:root {
  /* Surfaces */
  --surface-0: #08080a;
  --surface-1: #0f0f13;
  --surface-2: #161619;
  --surface-3: #1d1d22;
  --surface-4: #242429;

  /* Borders */
  --border-1: #1f1f27;
  --border-2: #2c2c38;
  --border-3: #3a3a4a;

  /* Brand — orange */
  --orange: #f97316;
  --orange-lt: #fb923c;
  --orange-glow: rgba(249, 115, 22, .20);
  --orange-tint: rgba(249, 115, 22, .08);

  /* Accent — blue */
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, .20);
  --blue-tint: rgba(59, 130, 246, .08);

  /* Green */
  --green: #22c55e;
  --green-tint: rgba(34, 197, 94, .10);
  --green-border: rgba(34, 197, 94, .35);

  /* Red */
  --red: #ef4444;
  --red-tint: rgba(239, 68, 68, .08);
  --red-border: rgba(239, 68, 68, .3);

  /* Text */
  --text-1: #f1f1f5;
  --text-2: #9999b0;
  --text-3: #58586c;
  --text-orange: #fa9a50;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Sidebar */
  --sidebar-w: 228px;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t: 150ms;
}

/* ── Base ───────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--surface-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell ──────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ══ SIDEBAR ════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-1);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  padding: 0 10px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 16px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 14px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--orange-tint);
  border: 1px solid rgba(249, 115, 22, .3);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--orange);
  flex-shrink: 0;
}

.logo-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--text-orange);
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--text-3);
  padding: 0 10px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--t) var(--ease),
    color var(--t) var(--ease),
    border-color var(--t) var(--ease);
  margin-bottom: 2px;
  line-height: 1.4;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.nav-item.active {
  background: var(--orange-tint);
  color: var(--orange-lt);
  border-color: rgba(249, 115, 22, .22);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--border-1);
}

.sidebar-version {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-align: center;
}

/* ══ MAIN CONTENT ═══════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
  min-width: 0;
  background: var(--surface-0);
}

/* ── Panel ──────────────────────────────────────────── */
.tool-panel {
  max-width: 1060px;
  margin: 0 auto;
  animation: fadeSlide .22s var(--ease) both;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Panel Header ───────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.panel-icon.orange {
  background: var(--orange-tint);
  border: 1px solid rgba(249, 115, 22, .28);
  color: var(--orange);
}

.panel-icon.blue {
  background: var(--blue-tint);
  border: 1px solid rgba(59, 130, 246, .28);
  color: var(--blue);
}

.panel-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.02em;
  line-height: 1.25;
}

.panel-subtitle {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.4;
}

/* ── Dupe Badge ─────────────────────────────────────── */
.btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1.5px solid rgba(249, 115, 22, .38);
  background: var(--orange-tint);
  color: var(--orange);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-badge:hover {
  background: var(--orange-glow);
  border-color: var(--orange);
  box-shadow: 0 0 16px var(--orange-glow);
}

.btn-badge.active-dupe {
  background: var(--orange);
  color: #000;
  border-color: var(--orange);
}

/* ── Dupe Panel ─────────────────────────────────────── */
.dupe-panel {
  background: rgba(249, 115, 22, .055);
  border: 1px solid rgba(249, 115, 22, .22);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 22px;
  animation: fadeSlide .15s var(--ease) both;
}

.dupe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dupe-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-lt);
}

.dupe-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--orange);
  color: #000;
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
}

.dupe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dupe-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(249, 115, 22, .14);
  border: 1px solid rgba(249, 115, 22, .28);
  color: var(--orange-lt);
  padding: 2px 9px;
  border-radius: 5px;
}

/* ── Section Label ──────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--text-3);
  margin-bottom: 16px;
  text-transform: uppercase;
}

/* ── Fields ─────────────────────────────────────────── */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.field-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.4;
}

/* Text inputs */
.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease);
  caret-color: var(--orange);
}

.field-input::placeholder {
  color: var(--text-3);
  font-family: var(--font-sans);
  font-style: italic;
}

.field-input:focus {
  border-color: var(--orange);
  background: var(--surface-3);
}

/* Textarea */
.textarea-wrapper {
  position: relative;
}

.field-textarea {
  width: 100%;
  min-height: 158px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  padding: 12px 14px 34px;
  outline: none;
  resize: vertical;
  transition: border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease);
  caret-color: var(--orange);
}

.field-textarea::placeholder {
  color: var(--text-3);
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 12.5px;
}

.field-textarea:focus {
  border-color: var(--orange);
  background: var(--surface-3);
}

.textarea-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  pointer-events: none;
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-1);
  transition: color var(--t);
}

/* ── Mode Row ───────────────────────────────────────── */
.mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  width: 38px;
  height: 21px;
  background: var(--surface-3);
  border: 1.5px solid var(--border-2);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
  outline: none;
  flex-shrink: 0;
  /* reset button defaults */
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.toggle-switch.active {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 14px var(--orange-glow);
}

.toggle-switch:focus-visible {
  box-shadow: 0 0 0 3px var(--orange-glow);
}

.toggle-knob {
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform var(--t) var(--ease),
    background var(--t) var(--ease);
  pointer-events: none;
}

.toggle-switch.active .toggle-knob {
  transform: translateX(17px);
  background: #fff;
}

.toggle-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.mode-hint {
  font-size: 11.5px;
  color: var(--text-3);
  font-style: italic;
}

/* ── Formatter Grid ─────────────────────────────────── */
.formatter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 820px) {
  .formatter-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Result ─────────────────────────────────────────── */
.formatter-result {
  display: flex;
  flex-direction: column;
}

.result-box {
  flex: 1;
  min-height: 210px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  transition: border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

.result-box.has-result {
  border-color: rgba(249, 115, 22, .38);
  box-shadow: 0 0 28px rgba(249, 115, 22, .06), inset 0 0 0 1px rgba(249, 115, 22, .05);
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 178px;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

.result-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-orange);
  word-break: break-all;
  width: 100%;
}

@keyframes flashResult {
  0% {
    color: var(--text-orange);
  }

  35% {
    color: #fff;
  }

  100% {
    color: var(--text-orange);
  }
}

.result-text.flash {
  animation: flashResult .32s var(--ease);
}

/* ── Action Row ─────────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 8px;
}

/* ── Primary Button ─────────────────────────────────── */
.btn-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  background: var(--orange);
  color: #000;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
  letter-spacing: .01em;
}

.btn-primary:hover {
  background: var(--orange-lt);
  box-shadow: 0 4px 20px rgba(249, 115, 22, .4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary.success {
  background: var(--green);
  color: #fff;
}

.btn-primary.manual-mode {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

.btn-primary.manual-mode:hover {
  background: var(--orange-tint);
  box-shadow: 0 4px 20px var(--orange-glow);
}

.arrow-icon {
  flex-shrink: 0;
}

/* ── Secondary Button ───────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 15px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t) var(--ease);
}

.btn-secondary:hover {
  border-color: var(--red);
  color: #f87171;
  background: var(--red-tint);
}

/* ══ COMPANY SEARCH ═════════════════════════════════ */
.search-card {
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-big-input {
  font-size: 14.5px;
  padding: 13px 15px;
  font-family: var(--font-sans);
  font-weight: 400;
}

/* Open All Tabs */
.btn-open-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--green-border);
  background: var(--green-tint);
  color: #4ade80;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  letter-spacing: .01em;
}

.btn-open-all:hover {
  background: rgba(34, 197, 94, .18);
  border-color: var(--green);
  box-shadow: 0 4px 22px rgba(34, 197, 94, .18);
  transform: translateY(-1px);
}

.btn-open-all:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Platform grid */
.platforms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  user-select: none;
  white-space: nowrap;
  width: 100%;
}

.platform-btn:hover {
  border-color: var(--blue);
  background: var(--blue-tint);
  color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--blue-glow);
}

.platform-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.plat-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

/* Search Reset */
.btn-search-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--red-border);
  background: var(--red-tint);
  color: #f87171;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.btn-search-reset:hover {
  background: rgba(239, 68, 68, .16);
  border-color: var(--red);
  color: var(--red);
}

/* ── Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: toastIn .18s var(--ease) both;
  pointer-events: all;
  max-width: 300px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.success {
  border-color: rgba(34, 197, 94, .5);
}

.toast.error {
  border-color: rgba(239, 68, 68, .5);
}

.toast.info {
  border-color: rgba(249, 115, 22, .5);
}

.toast-icon {
  flex-shrink: 0;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(16px) scale(.96);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(16px) scale(.96);
  }
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-3);
}

/* ── Focus-visible ring ─────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

button:focus-visible { outline-offset: 3px; }

/* Inputs/textareas use border-color on focus — no outline needed */
.field-input:focus-visible,
.field-textarea:focus-visible {
  outline: none;
}

/* ════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE  (≤ 768px)
   Strategy: sidebar → fixed bottom tab bar, single-column layout
════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Shell: stack vertically, add bottom padding for tab bar ── */
  .app-shell {
    flex-direction: column;
    padding-bottom: 64px; /* space for fixed bottom nav */
  }

  /* ── Sidebar → Bottom Tab Bar ──────────────────────────────── */
  .sidebar {
    width: 100%;
    height: 64px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-right: none;
    border-top: 1px solid var(--border-1);
    background: var(--surface-1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    gap: 0;
    overflow: visible;
  }

  /* Hide logo, section label, version in bottom bar */
  .sidebar-logo,
  .nav-section-label,
  .sidebar-bottom {
    display: none;
  }

  /* Nav items become equal-width tab buttons */
  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 0;
    border: none;
    height: 64px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 0;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 1;
  }

  .nav-item.active {
    background: transparent;
    border: none;
    color: var(--orange);
  }

  .nav-item.active svg { color: var(--orange); }

  /* Active indicator — top border on the tab */
  .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--orange);
    border-radius: 0 0 2px 2px;
  }

  .nav-item { position: relative; }

  /* ── Main content: full width, tighter padding ─────────────── */
  .main-content {
    padding: 20px 16px;
    width: 100%;
  }

  /* ── Panel header: stack on very small screens ─────────────── */
  .panel-header {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }

  .panel-title { font-size: 18px; }
  .panel-subtitle { font-size: 11.5px; }
  .panel-icon { width: 36px; height: 36px; }

  /* ── Formatter grid: single column ────────────────────────── */
  .formatter-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 0;
  }

  /* Restore column wrappers from display:contents to normal block */
  .formatter-inputs,
  .formatter-result {
    display: block;
  }

  /* Reset all explicit grid placements */
  .formatter-inputs > .section-label,
  .formatter-inputs > .field-group:nth-child(2),
  .formatter-inputs > .field-group:nth-child(3),
  .formatter-inputs > .mode-row,
  .formatter-result > .section-label,
  .result-box,
  .result-actions {
    grid-column: unset;
    grid-row: unset;
  }

  /* Restore margins removed by grid layout */
  .formatter-inputs > .section-label { margin-bottom: 14px; }
  .formatter-inputs > .mode-row { padding-top: 4px; }
  .formatter-result > .section-label { margin-top: 24px; margin-bottom: 14px; }
  .result-actions { padding-top: 0; margin-top: 12px; }

  /* Result box: sensible fixed height on mobile */
  .result-box {
    min-height: 120px;
  }

  /* ── Touch-friendly tap targets (min 44px) ─────────────────── */
  .btn-primary,
  .btn-secondary,
  .btn-open-all,
  .btn-search-reset,
  .platform-btn {
    min-height: 46px;
  }

  /* ── Field textarea: shorter on mobile ─────────────────────── */
  .field-textarea {
    min-height: 120px;
  }

  /* ── Search card: full width ───────────────────────────────── */
  .search-card {
    max-width: 100%;
  }

  /* ── Platform grid: 2 cols still fine, just shorter padding ── */
  .platform-btn {
    padding: 12px 10px;
    font-size: 13px;
  }

  /* ── Dupe badge: shrink on small screens ───────────────────── */
  .btn-badge {
    font-size: 9.5px;
    padding: 6px 10px;
  }

  /* ── Toast: full width at bottom ──────────────────────────── */
  .toast-container {
    bottom: 74px; /* above the tab bar */
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: 100%;
  }
}

/* ── Extra small phones (≤ 380px) ──────────────────────────── */
@media (max-width: 380px) {
  .main-content { padding: 16px 12px; }
  .panel-title  { font-size: 16px; }
  .panel-subtitle { display: none; }
  .platforms-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
  .btn-secondary  { width: 100%; justify-content: center; }
}
