/* Scoped to #itb-tool-mount so tool styles never override Bootstrap navbar/sidebar. */
#itb-tool-mount {
  color-scheme: light;
}

#itb-tool-mount.container-narrow,
#itb-tool-mount .container-narrow {
  max-width: 1100px;
}

#itb-tool-mount.card {
  background: var(--tblr-card-bg, #fff);
  border: 1px solid var(--tblr-border-color, rgb(226 232 240));
  border-radius: 16px;
  color: var(--tblr-body-color, #0f172a);
}

#itb-tool-mount .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
}

#itb-tool-mount .btn-primary {
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  border-color: var(--tblr-primary, #206bc4);
}

#itb-tool-mount .btn-primary:hover:not(:disabled) {
  background: var(--tblr-link-hover-color, #1a569d);
  border-color: var(--tblr-link-hover-color, #1a569d);
}

#itb-tool-mount .btn-primary:disabled,
#itb-tool-mount .btn-primary.disabled {
  opacity: 1 !important;
  background: #94a3b8 !important;
  border-color: #94a3b8 !important;
  color: #fff !important;
  cursor: not-allowed;
}

#itb-tool-mount .btn-secondary {
  background: rgb(241 245 249);
  color: rgb(15 23 42);
  border: 1px solid rgb(226 232 240);
}

#itb-tool-mount .btn-secondary:hover:not(:disabled) {
  background: rgb(226 232 240);
}

#itb-tool-mount .btn-secondary:disabled,
#itb-tool-mount .btn-secondary.disabled {
  opacity: 1 !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
  cursor: not-allowed;
}

#itb-tool-mount .pill {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 9999px;
  border: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  color: rgb(51 65 85);
}

/* Form controls: tools mount via JS so Tailwind CDN may not style them; keep light mode readable */
#itb-tool-mount input[type="text"],
#itb-tool-mount input[type="number"],
#itb-tool-mount input[type="search"],
#itb-tool-mount input:not([type]),
#itb-tool-mount select,
#itb-tool-mount textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background-color: #fff;
  color: #0f172a;
  padding: 0.5rem 0.75rem;
  font: inherit;
  line-height: 1.4;
}

#itb-tool-mount input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 4rem;
  height: 2.5rem;
  min-width: 4rem;
  max-width: 4rem;
  min-height: 2.5rem;
  padding: 0.2rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  background-color: #fff;
  cursor: pointer;
  vertical-align: middle;
  flex: 0 0 auto;
}

#itb-tool-mount input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

#itb-tool-mount input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.35rem;
}

#itb-tool-mount input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.35rem;
}

#itb-tool-mount input[type="color"]:focus {
  outline: none;
  border-color: var(--tblr-primary, #206bc4);
  box-shadow: 0 0 0 0.2rem rgba(32, 107, 196, 0.15);
}

#itb-tool-mount input[type="range"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  accent-color: var(--tblr-primary, #206bc4);
}

#itb-tool-mount input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--tblr-primary, #206bc4);
}

#itb-tool-mount select {
  appearance: auto;
}

#itb-tool-mount input::placeholder {
  color: #94a3b8;
}

#itb-tool-mount input:focus,
#itb-tool-mount select:focus,
#itb-tool-mount textarea:focus {
  outline: none;
  border-color: var(--tblr-primary, #206bc4);
  box-shadow: 0 0 0 0.2rem rgba(32, 107, 196, 0.15);
}

#itb-tool-mount img.rounded-xl {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background-color: #fff;
}

#itb-tool-mount canvas.rounded-xl {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background-color: #fff;
}

/* Layout for tool forms: not dependent on Tailwind JIT seeing strings inside bundled .js */
#itb-tool-mount .itb-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  #itb-tool-mount .itb-two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

#itb-tool-mount .itb-two-col > * {
  min-width: 0;
}

#itb-tool-mount .itb-ui-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 0;
  align-items: start;
}
@media (min-width: 768px) {
  #itb-tool-mount .itb-ui-row {
    grid-template-columns: minmax(9rem, 11.5rem) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.15rem;
  }
}

#itb-tool-mount .itb-ui-row__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: rgb(51 65 85);
}

@media (min-width: 768px) {
  #itb-tool-mount .itb-ui-row__label {
    padding-top: 0.5rem;
  }
}

#itb-tool-mount .itb-ui-row__control {
  min-width: 0;
  width: 100%;
}

#itb-tool-mount .itb-ui-row__control select,
#itb-tool-mount .itb-ui-row__control input[type="number"],
#itb-tool-mount .itb-ui-row__control input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#itb-tool-mount .itb-ui-row__control input[type="range"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Light-mode fallbacks when Tailwind utilities are not generated for dynamic nodes */
#itb-tool-mount .flex { display: flex; }
#itb-tool-mount .flex-col { flex-direction: column; }
#itb-tool-mount .flex-wrap { flex-wrap: wrap; }
#itb-tool-mount .items-center { align-items: center; }
#itb-tool-mount .justify-between { justify-content: space-between; }
#itb-tool-mount .gap-2 { gap: 0.5rem; }
#itb-tool-mount .gap-3 { gap: 0.75rem; }
#itb-tool-mount .gap-4 { gap: 1rem; }
#itb-tool-mount .text-xs { font-size: 0.75rem; line-height: 1rem; }
#itb-tool-mount .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
#itb-tool-mount .font-semibold { font-weight: 600; }
#itb-tool-mount .font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
#itb-tool-mount .text-slate-500 { color: #64748b; }
#itb-tool-mount .text-slate-600 { color: #475569; }
#itb-tool-mount .text-slate-700 { color: #334155; }
#itb-tool-mount .text-red-700 { color: #b91c1c; }
#itb-tool-mount .text-amber-800 { color: #92400e; }
#itb-tool-mount .bg-slate-50 {
  background-color: #f8fafc;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
}
#itb-tool-mount .bg-amber-50 {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
}
#itb-tool-mount .border-amber-200 { border-color: #fde68a; }
#itb-tool-mount .mt-1 { margin-top: 0.25rem; }
#itb-tool-mount .mt-3 { margin-top: 0.75rem; }
#itb-tool-mount .mt-4 { margin-top: 1rem; }
#itb-tool-mount .p-3 { padding: 0.75rem; }
#itb-tool-mount .w-full { width: 100%; }
#itb-tool-mount .w-16 { width: 4rem; max-width: 4rem; }
#itb-tool-mount .h-10 { height: 2.5rem; min-height: 2.5rem; }
#itb-tool-mount .rounded-xl { border-radius: 0.75rem; }
#itb-tool-mount .rounded-lg { border-radius: 0.5rem; }
#itb-tool-mount .border { border-width: 1px; border-style: solid; }
#itb-tool-mount .border-slate-200 { border-color: rgb(226 232 240); }
#itb-tool-mount .bg-white { background-color: #fff; }
#itb-tool-mount .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
#itb-tool-mount .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Dark mode */
.theme-dark #itb-tool-mount,
.theme-dark-auto #itb-tool-mount {
  color-scheme: dark;
}

.theme-dark #itb-tool-mount .bg-white,
.theme-dark-auto #itb-tool-mount .bg-white {
  background-color: var(--tblr-bg-surface, #1d273b) !important;
}

.theme-dark #itb-tool-mount .bg-slate-50,
.theme-dark-auto #itb-tool-mount .bg-slate-50 {
  background-color: var(--tblr-bg-surface-secondary, #1a2234) !important;
}

.theme-dark #itb-tool-mount .border-slate-200,
.theme-dark-auto #itb-tool-mount .border-slate-200 {
  border-color: var(--tblr-border-color, rgba(101, 109, 119, 0.16)) !important;
}

.theme-dark #itb-tool-mount .text-slate-700,
.theme-dark-auto #itb-tool-mount .text-slate-700 {
  color: var(--tblr-body-color, #f8fafc) !important;
}

.theme-dark #itb-tool-mount .text-slate-600,
.theme-dark-auto #itb-tool-mount .text-slate-600 {
  color: var(--tblr-body-color, #f8fafc) !important;
}

.theme-dark #itb-tool-mount .text-slate-500,
.theme-dark-auto #itb-tool-mount .text-slate-500 {
  color: var(--tblr-muted, #99a0a4) !important;
}

.theme-dark #itb-tool-mount .text-red-700,
.theme-dark-auto #itb-tool-mount .text-red-700 {
  color: #f87171 !important;
}

.theme-dark #itb-tool-mount .text-amber-800,
.theme-dark-auto #itb-tool-mount .text-amber-800 {
  color: #fcd34d !important;
}

.theme-dark #itb-tool-mount .bg-amber-50,
.theme-dark-auto #itb-tool-mount .bg-amber-50 {
  background-color: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
}

.theme-dark #itb-tool-mount .itb-ui-row__label,
.theme-dark-auto #itb-tool-mount .itb-ui-row__label {
  color: var(--tblr-body-color, #f8fafc);
}

.theme-dark #itb-tool-mount select,
.theme-dark #itb-tool-mount input[type="number"],
.theme-dark #itb-tool-mount input[type="text"],
.theme-dark #itb-tool-mount input[type="search"],
.theme-dark #itb-tool-mount input:not([type]),
.theme-dark #itb-tool-mount textarea,
.theme-dark-auto #itb-tool-mount select,
.theme-dark-auto #itb-tool-mount input[type="number"],
.theme-dark-auto #itb-tool-mount input[type="text"],
.theme-dark-auto #itb-tool-mount input[type="search"],
.theme-dark-auto #itb-tool-mount input:not([type]),
.theme-dark-auto #itb-tool-mount textarea {
  background-color: var(--tblr-bg-forms, #1a2234);
  color: var(--tblr-body-color, #f8fafc);
  border-color: var(--tblr-border-color, rgba(101, 109, 119, 0.16));
}

.theme-dark #itb-tool-mount input[type="color"],
.theme-dark-auto #itb-tool-mount input[type="color"] {
  background-color: var(--tblr-bg-forms, #1a2234);
  border-color: var(--tblr-border-color, rgba(101, 109, 119, 0.16));
}

.theme-dark #itb-tool-mount input[type="color"]::-webkit-color-swatch,
.theme-dark-auto #itb-tool-mount input[type="color"]::-webkit-color-swatch {
  border-color: rgba(255, 255, 255, 0.16);
}

.theme-dark #itb-tool-mount input[type="color"]::-moz-color-swatch,
.theme-dark-auto #itb-tool-mount input[type="color"]::-moz-color-swatch {
  border-color: rgba(255, 255, 255, 0.16);
}

.theme-dark #itb-tool-mount .btn-primary,
.theme-dark-auto #itb-tool-mount .btn-primary {
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  border-color: var(--tblr-primary, #206bc4);
}

.theme-dark #itb-tool-mount .btn-primary:hover:not(:disabled),
.theme-dark-auto #itb-tool-mount .btn-primary:hover:not(:disabled) {
  background: var(--tblr-link-hover-color, #206bc4);
  filter: brightness(1.08);
}

.theme-dark #itb-tool-mount .btn-primary:disabled,
.theme-dark-auto #itb-tool-mount .btn-primary:disabled {
  background: #475569 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

.theme-dark #itb-tool-mount .btn-secondary,
.theme-dark-auto #itb-tool-mount .btn-secondary {
  background: var(--tblr-bg-surface, #1d273b);
  color: var(--tblr-body-color, #f8fafc);
  border-color: var(--tblr-border-color, rgba(101, 109, 119, 0.16));
}

.theme-dark #itb-tool-mount .btn-secondary:hover:not(:disabled),
.theme-dark-auto #itb-tool-mount .btn-secondary:hover:not(:disabled) {
  background: var(--tblr-active-bg, #202c42);
}

.theme-dark #itb-tool-mount .pill,
.theme-dark-auto #itb-tool-mount .pill {
  background: var(--tblr-bg-surface, #1d273b);
  color: var(--tblr-body-color, #f8fafc);
  border-color: var(--tblr-border-color, rgba(101, 109, 119, 0.16));
}

.theme-dark #itb-tool-mount img.rounded-xl,
.theme-dark #itb-tool-mount canvas.rounded-xl,
.theme-dark-auto #itb-tool-mount img.rounded-xl,
.theme-dark-auto #itb-tool-mount canvas.rounded-xl {
  background-color: #243049 !important;
}
