/* it3-core tool UI — uses theme design tokens */
.it3-tool-ui .row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; align-items: center; }
.it3-tool-ui label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.35rem; }

.it3-input,
.it3-tool-ui textarea,
.it3-tool-ui input[type="text"],
.it3-tool-ui input[type="url"],
.it3-tool-ui input[type="email"],
.it3-tool-ui input[type="number"],
.it3-tool-ui input[type="date"],
.it3-tool-ui input[type="password"],
.it3-tool-ui input[type="file"],
.it3-tool-ui select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  background: #fff;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.it3-tool-ui textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, monospace; }
.it3-input:focus,
.it3-tool-ui textarea:focus,
.it3-tool-ui input:focus,
.it3-tool-ui select:focus {
  border-color: var(--primary, #ee6123);
  box-shadow: 0 0 0 3px rgba(238, 97, 35, 0.15);
}

.it3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
}
.it3-btn-primary {
  background: linear-gradient(to right, var(--primary, #ee6123), var(--primary-light, #ff7a3d));
  color: #fff;
  box-shadow: 0 2px 15px -3px rgba(0,0,0,0.07);
}
.it3-btn-primary:hover { filter: brightness(1.05); color: #fff; }
.it3-btn-outline {
  border: 1px solid rgba(238,97,35,0.3);
  color: var(--primary, #ee6123);
  background: rgba(255,255,255,0.8);
}
.it3-btn-outline:hover { background: rgba(238,97,35,0.06); }

.it3-tool-ui .chip {
  padding: 0.35rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  cursor: pointer;
  background: #fff;
  font-size: 0.875rem;
}
.it3-tool-ui .chip.active {
  border-color: var(--primary, #ee6123);
  color: var(--primary, #ee6123);
  background: rgba(238, 97, 35, 0.06);
}

.it3-output {
  margin-top: 0;
  padding: 1rem 1.125rem;
  background: #fff;
  border: 1px dashed rgba(238, 97, 35, 0.28);
  border-radius: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #0f172a;
  min-height: 3rem;
  transition: border-color 0.2s, background 0.2s;
}
.it3-output.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.it3-output.is-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.it3-tool-ui canvas { max-width: 100%; border-radius: 0.75rem; border: 1px solid #e2e8f0; }

/* ─── Shared fancy tool UI (all tools) ─── */
.it3-tool-ui.it3-fancy { padding: 0; }

.it3-tool-accent {
  height: 3px;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--primary, #ee6123), var(--primary-light, #ff7a3d), #f97316);
  box-shadow: 0 2px 12px rgba(238, 97, 35, 0.35);
}

.it3-section {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #fffbf7 100%);
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.it3-section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.625rem;
}
.it3-section.is-compact { padding: 0.875rem 1rem; }

.it3-field { margin-bottom: 0.875rem; }
.it3-field:last-child { margin-bottom: 0; }
.it3-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}

.it3-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
  align-items: center;
}
.it3-tool-ui.it3-fancy .row {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
  align-items: center;
}

.it3-output-wrap {
  border-radius: 1rem;
  border: 1px solid rgba(238, 97, 35, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.9) 100%);
  padding: 0.875rem 1rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 12px -4px rgba(15, 23, 42, 0.06);
}
.it3-output-wrap.is-error { border-color: #fecaca; background: #fffafb; }
.it3-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.it3-output-copy {
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(238, 97, 35, 0.3);
  background: rgba(255,255,255,0.9);
  color: var(--primary, #ee6123);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.it3-output-copy:hover { background: rgba(238, 97, 35, 0.08); }
.it3-output-copy.is-copied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.it3-tool-note {
  border-radius: 0.75rem;
  border: 1px solid rgba(238, 97, 35, 0.2);
  background: rgba(255, 247, 237, 0.65);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #7c2d12;
  margin-bottom: 1rem;
}
.it3-tool-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}

.it3-file-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem 1rem;
  border-radius: 0.875rem;
  border: 2px dashed rgba(238, 97, 35, 0.35);
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}
.it3-file-zone:hover,
.it3-file-zone.has-file {
  border-color: var(--primary, #ee6123);
  background: rgba(255, 247, 237, 0.5);
}
.it3-file-zone-hint {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}
.it3-file-zone-name {
  font-size: 0.75rem;
  color: #94a3b8;
}
.it3-file-zone.has-file .it3-file-zone-name { color: var(--primary, #ee6123); font-weight: 600; }
.it3-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.it3-preview-card {
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.75rem;
  margin: 0.75rem 0;
  text-align: center;
}
.it3-preview-card canvas { border: none; box-shadow: 0 4px 16px -6px rgba(15, 23, 42, 0.15); }

.it3-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-top: 0.75rem;
}
@media (min-width: 480px) {
  .it3-stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.it3-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 0.5rem;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-align: center;
  transition: all 0.2s;
}
.it3-stat-card.is-highlight {
  border-color: rgba(238, 97, 35, 0.4);
  background: rgba(255, 247, 237, 0.6);
  box-shadow: 0 0 0 3px rgba(238, 97, 35, 0.1);
}
.it3-stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.it3-stat-card.is-highlight .it3-stat-value { color: var(--primary, #ee6123); }
.it3-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-top: 0.25rem;
}

.it3-grid-2 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 540px) {
  .it3-grid-2 { grid-template-columns: 1fr 1fr; }
}

.it3-dice-wrap {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1rem 0;
  min-height: 4.5rem;
}
.it3-die {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(145deg, #fff 0%, #fff7ed 100%);
  border: 2px solid rgba(238, 97, 35, 0.45);
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary, #ee6123);
  box-shadow: 0 4px 14px -4px rgba(238, 97, 35, 0.35);
  transition: transform 0.3s ease;
}

.it3-range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
.it3-range-row input[type="range"] {
  flex: 1;
  height: 0.4rem;
  appearance: none;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(238,97,35,0.25), rgba(238,97,35,0.65));
  outline: none;
  cursor: pointer;
}
.it3-range-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 9999px;
  background: #fff;
  border: 3px solid var(--primary, #ee6123);
  box-shadow: 0 2px 8px rgba(238, 97, 35, 0.35);
}
.it3-range-badge {
  min-width: 2.5rem;
  text-align: center;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(238, 97, 35, 0.12);
  color: var(--primary, #ee6123);
  font-size: 0.8125rem;
  font-weight: 800;
}

.it3-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.it3-check-row:has(input:checked) {
  border-color: rgba(238, 97, 35, 0.45);
  background: rgba(255, 247, 237, 0.45);
}

.it3-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.it3-radio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}
.it3-radio-row:has(input:checked) {
  border-color: rgba(238, 97, 35, 0.45);
  background: rgba(255, 247, 237, 0.45);
}

/* Password Generator — themed fancy UI */
.it3-pw-tool-root { padding: 0; }

.it3-pw-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary, #ee6123) 0%, var(--primary-light, #ff7a3d) 55%, #f97316 100%);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  color: #fff;
  box-shadow: 0 10px 25px -10px rgba(238, 97, 35, 0.45);
}
.it3-pw-hero-glow {
  position: absolute;
  top: -2rem;
  right: -2rem;
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(24px);
  pointer-events: none;
}
.it3-pw-hero-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}
.it3-pw-hero-desc {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0.95;
  max-width: 36rem;
}

.it3-pw-display-wrap {
  border-radius: 1rem;
  border: 1px solid rgba(238, 97, 35, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,247,237,0.85) 100%);
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 15px -3px rgba(0,0,0,0.06);
}
.it3-pw-display-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.it3-pw-display-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.it3-pw-display {
  flex: 1;
  min-width: 0;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(238, 97, 35, 0.35);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.it3-pw-display.is-empty {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: normal;
}
.it3-pw-copy-btn {
  align-self: stretch;
  min-width: 5.5rem;
  padding: 0 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(238, 97, 35, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary, #ee6123);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}
.it3-pw-copy-btn:hover {
  background: rgba(238, 97, 35, 0.08);
  border-color: rgba(238, 97, 35, 0.55);
}
.it3-pw-copy-btn.is-copied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.it3-pw-strength { margin-bottom: 1.25rem; }
.it3-pw-strength-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #475569;
}
.it3-pw-strength-head span:first-child { font-weight: 600; }
.it3-pw-strength-label {
  font-weight: 800;
  color: #0f172a;
}
.it3-pw-strength-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}
.it3-pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: #94a3b8;
  transition: width 0.3s ease, background 0.3s ease;
}
.it3-pw-strength-fill.is-weak { background: linear-gradient(90deg, #ef4444, #f87171); }
.it3-pw-strength-fill.is-medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.it3-pw-strength-fill.is-strong { background: linear-gradient(90deg, #10b981, #34d399); }

.it3-pw-length { margin-bottom: 1.25rem; }
.it3-pw-length-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}
.it3-pw-length-head label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}
.it3-pw-len-badge {
  display: inline-flex;
  min-width: 2.25rem;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(238, 97, 35, 0.12);
  color: var(--primary, #ee6123);
  font-size: 0.8125rem;
  font-weight: 800;
}
.it3-pw-slider {
  width: 100%;
  height: 0.4rem;
  appearance: none;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(238,97,35,0.25), rgba(238,97,35,0.65));
  outline: none;
  cursor: pointer;
}
.it3-pw-slider::-webkit-slider-thumb {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #fff;
  border: 3px solid var(--primary, #ee6123);
  box-shadow: 0 2px 8px rgba(238, 97, 35, 0.35);
}
.it3-pw-slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #fff;
  border: 3px solid var(--primary, #ee6123);
  box-shadow: 0 2px 8px rgba(238, 97, 35, 0.35);
}
.it3-pw-length-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.it3-pw-chips {
  display: grid;
  gap: 0.625rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .it3-pw-chips { grid-template-columns: repeat(4, 1fr); }
}
.it3-pw-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.875rem 0.5rem;
  border-radius: 0.875rem;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}
.it3-pw-chip:hover {
  border-color: rgba(238, 97, 35, 0.35);
  background: rgba(255, 247, 237, 0.5);
}
.it3-pw-chip.active {
  border-color: var(--primary, #ee6123);
  background: rgba(238, 97, 35, 0.08);
  box-shadow: 0 0 0 3px rgba(238, 97, 35, 0.12);
}
.it3-pw-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(238, 97, 35, 0.1);
  color: var(--primary, #ee6123);
  font-size: 0.75rem;
  font-weight: 800;
}
.it3-pw-chip-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
}
.it3-pw-chip.active .it3-pw-chip-title { color: #9a3412; }

.it3-pw-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.it3-pw-regen { width: 100%; padding: 0.875rem 1.25rem; font-size: 0.9375rem; }
.it3-pw-footnote {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}
