/* ============================================================
   QR code scanner (qrcode-scan) - two-column layout
   ============================================================ */

.qs-tool {
  max-width: 1280px;
}

.qs-panels {
  align-items: flex-start;
}

.qs-input-panel,
.qs-result-panel {
  height: auto;
  min-width: 0;
}

.qs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.qs-result-status {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary, #6c757d);
  max-width: 55%;
  text-align: right;
}

.qs-settings-body,
.qs-result-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---- tabs ---- */

.qs-tabs {
  display: flex;
  gap: 6px;
}

.qs-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #c9ced6);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text-secondary, #6c757d);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qs-tab.active {
  border-color: var(--brand, #0a58ca);
  color: var(--brand, #0a58ca);
  background: rgba(10, 88, 202, 0.06);
  font-weight: 600;
}

/* ---- paste & upload ---- */

.qs-paste-area,
.qs-drop {
  position: relative;
  border: 2px dashed var(--border-color, #c9ced6);
  border-radius: 8px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}

.qs-paste-area:focus,
.qs-paste-area.hover,
.qs-drop.hover {
  border-color: var(--brand, #0a58ca);
  background: rgba(10, 88, 202, 0.05);
}

.qs-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.qs-paste-area i,
.qs-drop-inner i {
  font-size: 26px;
  color: var(--text-secondary, #6c757d);
}

.qs-paste-area p,
.qs-drop-inner p {
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--text-primary, #212529);
}

.qs-paste-area small,
.qs-drop-inner small {
  font-size: 12px;
  color: var(--text-secondary, #6c757d);
}

/* ---- preview ---- */

.qs-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border: 1px solid var(--border-color, #e3e6ea);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: auto;
  padding: 12px;
}

.qs-placeholder {
  text-align: center;
  color: var(--text-secondary, #6c757d);
}

.qs-placeholder i {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
}

.qs-placeholder p {
  margin: 0;
  font-size: 13px;
}

.qs-preview {
  max-width: 100%;
  max-height: 340px;
  height: auto;
  display: block;
}

.qs-preview.hidden {
  display: none;
}

.qs-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qs-action-row .btn {
  min-width: 120px;
}

.qs-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fdecea;
  color: #b3261e;
  font-size: 13px;
  line-height: 1.5;
}

.qs-message.hidden {
  display: none;
}

/* ---- result ---- */

.qs-result-body .result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color, #e3e6ea);
  padding-top: 12px;
  margin-top: 4px;
}

.result-toolbar-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-chip-alt {
  background: rgba(10, 88, 202, 0.06);
  color: var(--brand, #0a58ca);
}

.qs-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qs-result-actions .btn[disabled],
.qs-result-actions .btn[disabled]:hover {
  opacity: 0.5;
  cursor: not-allowed;
}

.chip-url {
  background: rgba(10, 88, 202, 0.1) !important;
  color: #0a58ca !important;
}

.chip-email {
  background: rgba(25, 135, 84, 0.1) !important;
  color: #157347 !important;
}

.chip-phone {
  background: rgba(111, 66, 193, 0.1) !important;
  color: #6f42c1 !important;
}

.chip-wifi {
  background: rgba(13, 110, 253, 0.1) !important;
  color: #0d6efd !important;
}

.chip-text {
  background: rgba(108, 117, 125, 0.1) !important;
  color: #495057 !important;
}

.qs-result-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  resize: vertical;
  min-height: 280px;
  max-height: 520px;
  background: var(--surface, #fff);
}

.qs-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary, #6c757d);
}

.qs-note i {
  margin-top: 2px;
}

/* ---- swap note (shared across tool pages) ---- */

.swap-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-color, #e3e6ea);
  border-left: 4px solid var(--brand, #0a58ca);
  border-radius: 8px;
  background: rgba(10, 88, 202, 0.04);
}

.swap-note > i {
  font-size: 22px;
  color: var(--brand, #0a58ca);
}

.swap-note-text {
  flex: 1;
  min-width: 0;
}

.swap-note-text strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary, #212529);
}

.swap-note-text span {
  font-size: 12.5px;
  color: var(--text-secondary, #6c757d);
  line-height: 1.5;
}

.swap-note .btn {
  white-space: nowrap;
}

/* ---- mobile ---- */

@media (max-width: 767px) {
  .qs-result-status {
    max-width: 100%;
    text-align: left;
  }

  .qs-result-body .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .qs-preview-wrap {
    min-height: 180px;
  }

  .swap-note {
    flex-wrap: wrap;
  }

  .swap-note .btn {
    width: 100%;
  }
}
