/* ============================================================
   OmneTools — Modern UI Layer (2026)
   Utility + component layer that powers every tool interface.
   Auto light/dark via tokens. Loaded after style.css.
   ============================================================ */

/* ---------- 1. Surface / slate token system (auto dark) ---------- */
:root {
  --u-white:        #ffffff;
  --u-slate-50:     #f7f8fc;
  --u-slate-100:    #eef1f7;
  --u-slate-200:    #e2e6ef;
  --u-slate-300:    #cdd3e0;
  --u-slate-400:    #98a1b5;
  --u-slate-500:    #6b7590;
  --u-slate-600:    #4c556b;
  --u-slate-700:    #363e52;
  --u-slate-800:    #232a3b;
  --u-slate-900:    #131828;
  --u-blue-50:      #eef4ff;
  --u-blue-100:     #dbe7ff;
  --u-blue-200:     #bcd2ff;
  --u-blue-800:     #1e40af;
  --u-emerald-50:   #ecfdf5;
  --u-emerald-100:  #d1fae5;
  --u-emerald-200:  #a7f3d0;
  --u-emerald-600:  #059669;
  --u-purple-50:    #f6f2ff;
  --u-purple-100:   #ece3ff;
  --u-purple-200:   #dccdff;
  --u-purple-600:   #7c3aed;
  --u-indigo-50:    #eef1ff;
  --u-indigo-100:   #e0e5ff;
  --u-red-50:       #fef2f2;
  --u-red-500:      #ef4444;
  --u-red-600:      #dc2626;
  --u-amber-50:     #fffaeb;
  --u-amber-200:    #fde68a;
  --u-amber-600:    #b45309;
  --u-overlay:      rgba(255,255,255,.72);
  --ui-ring:        rgba(91,91,214,.28);
  --ui-surface:     #ffffff;
  --ui-surface-2:   #f7f8fc;
  --ui-line:        #e6e8ee;
  --ui-line-soft:   #eef0f5;
  --ui-sh-1: 0 1px 2px rgba(11,18,32,.05);
  --ui-sh-2: 0 2px 4px rgba(11,18,32,.04), 0 8px 20px -6px rgba(11,18,32,.10);
  --ui-sh-3: 0 18px 40px -14px rgba(11,18,32,.20), 0 4px 10px -4px rgba(11,18,32,.08);
  --ui-grad: linear-gradient(135deg,#5b5bd6 0%,#7c3aed 52%,#06b6d4 100%);
}
[data-theme="dark"] {
  --u-white:        #12161f;
  --u-slate-50:     #151a24;
  --u-slate-100:    #1b212d;
  --u-slate-200:    #232b39;
  --u-slate-300:    #333d4f;
  --u-slate-400:    #77809a;
  --u-slate-500:    #9aa3ba;
  --u-slate-600:    #b8bfd2;
  --u-slate-700:    #d3d8e4;
  --u-slate-800:    #e6e9f1;
  --u-slate-900:    #f6f8fc;
  --u-blue-50:      #131c33;
  --u-blue-100:     #182444;
  --u-blue-200:     #22345e;
  --u-blue-800:     #9dc0ff;
  --u-emerald-50:   #0d2119;
  --u-emerald-100:  #123326;
  --u-emerald-200:  #1c4c39;
  --u-emerald-600:  #34d399;
  --u-purple-50:    #1a1533;
  --u-purple-100:   #241a47;
  --u-purple-200:   #33265f;
  --u-purple-600:   #a78bfa;
  --u-indigo-50:    #161a33;
  --u-indigo-100:   #1c2244;
  --u-red-50:       #2a1417;
  --u-red-500:      #f87171;
  --u-red-600:      #fca5a5;
  --u-amber-50:     #2a2110;
  --u-amber-200:    #4d3d16;
  --u-amber-600:    #fbbf24;
  --u-overlay:      rgba(18,22,31,.72);
  --ui-surface:     #141923;
  --ui-surface-2:   #171d28;
  --ui-line:        #232b39;
  --ui-line-soft:   #1d2430;
  --ui-sh-1: 0 1px 2px rgba(0,0,0,.5);
  --ui-sh-2: 0 2px 4px rgba(0,0,0,.4), 0 10px 24px -8px rgba(0,0,0,.6);
  --ui-sh-3: 0 20px 44px -16px rgba(0,0,0,.75), 0 4px 12px -4px rgba(0,0,0,.5);
  --ui-ring: rgba(129,140,248,.32);
}

/* ---------- 2. Component base: cards ---------- */
.ot-tool-interface > .card,
.ot-tool-interface > .space-y-6,
.card {
  position: relative;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  box-shadow: var(--ui-sh-2);
}
.card { overflow: hidden; }
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--ui-grad);
  opacity: .9;
}
.card > .card { box-shadow: none; border-radius: 16px; }
.card + .card { margin-top: 1.5rem; }
.ot-tool-interface { --ui-pad: 1.5rem; }

/* ---------- 3. Display ---------- */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.table { display: table; width: 100%; border-collapse: collapse; }
.contents { display: contents; }

/* ---------- 4. Flex utilities ---------- */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.self-center { align-self: center; }

/* ---------- 5. Gap ---------- */
.gap-0 { gap: 0; }
.gap-1 { gap: .25rem; }
.gap-1\.5 { gap: .375rem; }
.gap-2 { gap: .5rem; }
.gap-2\.5 { gap: .625rem; }
.gap-3 { gap: .75rem; }
.gap-3\.5 { gap: .875rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* ---------- 6. Grid columns ---------- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }

/* ---------- 7. Padding / margin ---------- */
.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}
.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}
.px-1{padding-left:.25rem;padding-right:.25rem}
.px-2{padding-left:.5rem;padding-right:.5rem}
.px-2\.5{padding-left:.625rem;padding-right:.625rem}
.px-3{padding-left:.75rem;padding-right:.75rem}
.px-4{padding-left:1rem;padding-right:1rem}
.px-5{padding-left:1.25rem;padding-right:1.25rem}
.px-6{padding-left:1.5rem;padding-right:1.5rem}
.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}
.py-1{padding-top:.25rem;padding-bottom:.25rem}
.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}
.py-2{padding-top:.5rem;padding-bottom:.5rem}
.py-3{padding-top:.75rem;padding-bottom:.75rem}
.py-4{padding-top:1rem;padding-bottom:1rem}
.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}
.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}
.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}
.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}
.m-0{margin:0}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}
.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}
.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}
.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}
.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}
.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}
.my-1{margin-top:.25rem;margin-bottom:.25rem}
.my-2{margin-top:.5rem;margin-bottom:.5rem}
.my-3{margin-top:.75rem;margin-bottom:.75rem}
.mx-auto{margin-left:auto;margin-right:auto}
.mr-1{margin-right:.25rem}.ml-1{margin-left:.25rem}
.-mt-1{margin-top:-.25rem}

/* vertical rhythm */
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-1\.5 > * + * { margin-top: .375rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.divide-y > * + * { border-top: 1px solid var(--ui-line-soft); }

/* ---------- 8. Sizing ---------- */
.w-full{width:100%}.w-auto{width:auto}
.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}
.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}
.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-24{width:6rem}
.h-auto{height:auto}.h-full{height:100%}
.h-0\.5{height:2px}.h-1{height:.25rem}.h-2{height:.5rem}.h-3{height:.75rem}
.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}
.h-7{height:1.75rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-12{height:3rem}
.h-14{height:3.5rem}.h-16{height:4rem}.h-24{height:6rem}.h-28{height:7rem}
.h-32{height:8rem}.h-48{height:12rem}.h-56{height:14rem}.h-64{height:16rem}
.h-72{height:18rem}.h-80{height:20rem}.h-96{height:24rem}
.max-w-xs{max-width:20rem}.max-w-sm{max-width:24rem}.max-w-md{max-width:28rem}
.max-w-lg{max-width:32rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}
.max-w-full{max-width:100%}
.min-h-\[220px\]{min-height:220px}
.min-h-\[120px\]{min-height:120px}
.min-w-0{min-width:0}

/* ---------- 9. Typography ---------- */
.text-xs{font-size:.75rem;line-height:1.5}
.text-sm{font-size:.8125rem;line-height:1.6}
.text-base{font-size:.9375rem;line-height:1.65}
.text-lg{font-size:1.0625rem;line-height:1.5}
.text-xl{font-size:1.25rem;line-height:1.4}
.text-2xl{font-size:1.5rem;line-height:1.25}
.text-3xl{font-size:1.875rem;line-height:1.15}
.text-4xl{font-size:2.25rem;line-height:1.1}
.font-sans{font-family:var(--font-sans)}
.font-mono{font-family:var(--font-mono);font-variant-ligatures:none}
.font-normal{font-weight:400}.font-medium{font-weight:500}
.font-semibold{font-weight:600}.font-bold{font-weight:700}
.font-extrabold{font-weight:800}
.uppercase{text-transform:uppercase}
.lowercase{text-transform:lowercase}
.capitalize{text-transform:capitalize}
.tracking-tight{letter-spacing:-.01em}
.tracking-wider{letter-spacing:.06em}
.leading-none{line-height:1}.leading-snug{line-height:1.35}
.leading-relaxed{line-height:1.7}
.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}
.italic{font-style:italic}
.underline{text-decoration:underline}
.hover\:underline:hover{text-decoration:underline}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.break-all{word-break:break-all}
.whitespace-pre-wrap{white-space:pre-wrap}
.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tabular-nums{font-variant-numeric:tabular-nums}
.select-none{user-select:none}
.cursor-pointer{cursor:pointer}
.cursor-not-allowed{cursor:not-allowed}
.appearance-none{appearance:none;-webkit-appearance:none}
.list-none{list-style:none}

/* ---------- 10. Colors (auto dark via tokens) ---------- */
.text-white{color:#fff}
.text-slate-400{color:var(--u-slate-400)}
.text-slate-500{color:var(--u-slate-500)}
.text-slate-600{color:var(--u-slate-600)}
.text-slate-700{color:var(--u-slate-700)}
.text-slate-800{color:var(--u-slate-800)}
.text-slate-900{color:var(--u-slate-900)}
.text-primary{color:var(--brand)}
.text-emerald-600{color:var(--u-emerald-600)}
.text-emerald-700{color:var(--u-emerald-600)}
.text-purple-600{color:var(--u-purple-600)}
.text-blue-800{color:var(--u-blue-800)}
.text-red-500{color:var(--u-red-500)}
.text-red-600{color:var(--u-red-600)}
.text-amber-600{color:var(--u-amber-600)}
.hover\:text-primary:hover{color:var(--brand)}
.bg-white{background:var(--u-white)}
.bg-slate-50{background:var(--u-slate-50)}
.bg-slate-100{background:var(--u-slate-100)}
.bg-slate-200{background:var(--u-slate-200)}
.bg-slate-300{background:var(--u-slate-300)}
.bg-blue-50{background:var(--u-blue-50)}
.bg-blue-100{background:var(--u-blue-100)}
.bg-emerald-50{background:var(--u-emerald-50)}
.bg-emerald-100{background:var(--u-emerald-100)}
.bg-emerald-500{background:#10b981}
.bg-purple-50{background:var(--u-purple-50)}
.bg-purple-100{background:var(--u-purple-100)}
.bg-indigo-50{background:var(--u-indigo-50)}
.bg-red-50{background:var(--u-red-50)}
.bg-slate-50\/50{background:color-mix(in srgb,var(--u-slate-50) 60%,transparent)}
.bg-blue-50\/30{background:color-mix(in srgb,var(--u-blue-50) 55%,transparent)}
.bg-blue-50\/50{background:color-mix(in srgb,var(--u-blue-50) 70%,transparent)}
.bg-emerald-50\/30{background:color-mix(in srgb,var(--u-emerald-50) 55%,transparent)}
.bg-emerald-50\/50{background:color-mix(in srgb,var(--u-emerald-50) 70%,transparent)}
.bg-purple-50\/50{background:color-mix(in srgb,var(--u-purple-50) 70%,transparent)}
.hover\:bg-indigo-50:hover{background:var(--u-indigo-50)}
.hover\:bg-red-50:hover{background:var(--u-red-50)}
.border-transparent{border-color:transparent}

/* ---------- 11. Borders ---------- */
.border{border:1px solid var(--ui-line)}
.border-0{border:0}
.border-2{border-width:2px;border-style:solid}
.border-t{border-top:1px solid var(--ui-line)}
.border-b{border-bottom:1px solid var(--ui-line)}
.border-b-2{border-bottom-width:2px;border-bottom-style:solid}
.border-dashed{border-style:dashed}
.border-slate-100{border-color:var(--u-slate-100)}
.border-slate-200{border-color:var(--u-slate-200)}
.border-slate-300{border-color:var(--u-slate-300)}
.border-blue-200{border-color:var(--u-blue-200)}
.border-emerald-200{border-color:var(--u-emerald-200)}
.border-purple-200{border-color:var(--u-purple-200)}
.border-amber-200{border-color:var(--u-amber-200)}
.hover\:border-primary:hover{border-color:var(--brand)}
.rounded{border-radius:8px}
.rounded-md{border-radius:10px}
.rounded-lg{border-radius:12px}
.rounded-xl{border-radius:14px}
.rounded-2xl{border-radius:20px}
.rounded-full{border-radius:999px}
.rounded-none{border-radius:0}
.overflow-hidden{overflow:hidden}
.overflow-auto{overflow:auto}

/* ---------- 12. Elevation / effects ---------- */
.shadow-sm{box-shadow:var(--ui-sh-1)}
.shadow{box-shadow:var(--ui-sh-2)}
.shadow-md{box-shadow:var(--ui-sh-2)}
.shadow-lg{box-shadow:var(--ui-sh-3)}
.transition{transition:all .2s ease}
.transition-colors{transition:background-color .2s ease,color .2s ease,border-color .2s ease}
.transition-all{transition:all .22s ease}
.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}
.pointer-events-none{pointer-events:none}
.relative{position:relative}.absolute{position:absolute}
.inset-0{inset:0}
.z-10{z-index:10}
.animate-fade-in{animation:uiFadeIn .32s cubic-bezier(.22,1,.36,1) both}
.empty\:hidden:empty{display:none}
.object-cover{object-fit:cover}
.object-contain{object-fit:contain}
.aspect-square{aspect-ratio:1/1}
.aspect-video{aspect-ratio:16/9}

@keyframes uiFadeIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@media (prefers-reduced-motion: reduce){
  .animate-fade-in{animation:none}
}

/* ---------- 13. Form controls (modern) ---------- */
.form-label{
  display:block;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--u-slate-500);
  margin-bottom:.4rem;
}
.form-label.mb-0{margin-bottom:0}
.form-hint{display:block;font-size:.7rem;color:var(--u-slate-400);margin-top:.3rem}
.form-input,
.form-select,
.form-textarea{
  width:100%;
  background:var(--ui-surface-2);
  border:1px solid var(--ui-line);
  border-radius:13px;
  padding:.7rem .85rem;
  font-size:.8125rem;
  color:var(--u-slate-800);
  box-shadow:inset 0 1px 2px rgba(11,18,32,.03);
  transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease;
  outline:none;
}
.form-textarea{resize:vertical;line-height:1.65;overflow:auto}
.form-select{
  appearance:none;-webkit-appearance:none;
  padding-right:2.25rem;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7590' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right .7rem center;
  background-size:15px;
  cursor:pointer;
  text-overflow:ellipsis;
  min-width:0;
  max-width:100%;
}
.form-input:hover,.form-select:hover,.form-textarea:hover{border-color:var(--u-slate-300)}
.form-input:focus,.form-select:focus,.form-textarea:focus{
  background:var(--ui-surface);
  border-color:var(--brand);
  box-shadow:0 0 0 4px var(--ui-ring);
}
.form-input::placeholder,.form-textarea::placeholder{color:var(--u-slate-400)}
.form-textarea[readonly],.form-input[readonly]{cursor:default}
.form-input[type="color"]{
  padding:.2rem;width:2.35rem;height:2.35rem;cursor:pointer;border-radius:11px;
}
input[type="radio"],input[type="checkbox"]{
  appearance:none;-webkit-appearance:none;
  width:1.05rem;height:1.05rem;flex:none;
  border:1.5px solid var(--u-slate-300);
  background:var(--ui-surface);
  border-radius:6px;
  display:inline-grid;place-content:center;
  cursor:pointer;
  transition:all .16s ease;
}
input[type="radio"]{border-radius:50%}
input[type="radio"]:checked,input[type="checkbox"]:checked{
  background:var(--ui-grad);border-color:transparent;box-shadow:0 2px 6px rgba(91,91,214,.35);
}
input[type="radio"]:checked::after{
  content:"";width:.42rem;height:.42rem;border-radius:50%;background:#fff;
}
input[type="checkbox"]:checked::after{
  content:"";width:.55rem;height:.3rem;border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px);
}
input[type="radio"]:focus-visible,input[type="checkbox"]:focus-visible{box-shadow:0 0 0 4px var(--ui-ring)}
input[type="range"]{
  -webkit-appearance:none;appearance:none;width:100%;height:6px;
  background:var(--u-slate-200);border-radius:999px;outline:none;cursor:pointer;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;width:20px;height:20px;border-radius:50%;
  background:var(--ui-grad);border:2.5px solid #fff;
  box-shadow:0 2px 8px rgba(91,91,214,.45);cursor:grab;
}
input[type="range"]::-moz-range-thumb{
  width:18px;height:18px;border-radius:50%;background:#5b5bd6;border:2.5px solid #fff;
}

/* ---------- 14. Buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.45rem;
  font-size:.8125rem;font-weight:650;line-height:1;
  padding:.68rem 1.05rem;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;white-space:nowrap;
  transition:transform .14s ease,box-shadow .18s ease,background-color .18s ease,border-color .18s ease,color .18s ease;
  text-decoration:none;
  position:relative;
}
.btn:active{transform:translateY(1px) scale(.995)}
.btn:focus-visible{outline:none;box-shadow:0 0 0 4px var(--ui-ring)}
.btn-primary{
  color:#fff;
  background-image:var(--ui-grad);
  background-size:180% 180%;
  box-shadow:0 4px 14px -4px rgba(91,91,214,.55),inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-primary:hover{
  background-position:100% 50%;
  box-shadow:0 8px 22px -6px rgba(91,91,214,.62),inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-secondary{
  background:var(--ui-surface);
  border-color:var(--ui-line);
  color:var(--u-slate-700);
  box-shadow:var(--ui-sh-1);
}
.btn-secondary:hover{background:var(--ui-surface-2);border-color:var(--u-slate-300);color:var(--u-slate-900)}
.btn-danger{background:var(--u-red-500);color:#fff}
.btn-ghost{background:transparent;border-color:transparent;color:var(--u-slate-600)}
.btn-ghost:hover{background:var(--ui-surface-2);color:var(--u-slate-900)}
.btn-sm{padding:.48rem .78rem;font-size:.75rem;border-radius:10px}
.btn-lg{padding:.85rem 1.5rem;font-size:.875rem;border-radius:14px;font-weight:700}
.btn-block{width:100%}
.btn[disabled],.btn.is-loading{opacity:.6;pointer-events:none}
.btn.is-loading::after{
  content:"";width:.85rem;height:.85rem;border-radius:50%;
  border:2px solid rgba(255,255,255,.45);border-top-color:#fff;
  animation:uiSpin .7s linear infinite;
}
@keyframes uiSpin{to{transform:rotate(360deg)}}
.justify-center.btn{text-align:center}

/* ---------- 15. Badges / pills ---------- */
.badge{
  display:inline-flex;align-items:center;gap:.32rem;
  padding:.3rem .62rem;
  border-radius:999px;
  font-size:.7rem;font-weight:700;letter-spacing:.02em;
  background:var(--u-slate-100);color:var(--u-slate-600);
  border:1px solid transparent;
}
.badge-green,.badge-success{background:var(--u-emerald-50);color:var(--u-emerald-600);border-color:var(--u-emerald-200)}
.badge-blue,.badge-primary{background:var(--u-blue-50);color:var(--brand);border-color:var(--u-blue-200)}
.badge-slate{background:var(--u-slate-100);color:var(--u-slate-600)}
.badge-amber,.badge-warning{background:var(--u-amber-50);color:var(--u-amber-600);border-color:var(--u-amber-200)}
.badge-red,.badge-danger{background:var(--u-red-50);color:var(--u-red-600)}
.badge-purple{background:var(--u-purple-50);color:var(--u-purple-600)}

/* ---------- 16. Result surfaces ---------- */
.result-box{
  position:relative;
  background:linear-gradient(180deg,color-mix(in srgb,var(--u-slate-50) 88%,transparent),var(--ui-surface));
  border:1px solid var(--ui-line);
  border-radius:16px;
  padding:1.1rem 1.15rem;
  overflow:hidden;
}
.result-box::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:3px;
  background:var(--ui-grad);
}
/* result numbers get a premium treatment */
.result-box .text-3xl,.result-box .text-2xl{
  font-variant-numeric:tabular-nums;letter-spacing:-.015em;
}
/* stat tiles inside result boxes and grids */
.result-box .rounded-xl,.result-box .rounded-lg,
.grid > .rounded-xl,.grid > .rounded-lg{
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.result-box .rounded-xl:hover,.result-box .rounded-lg:hover,
.grid > .rounded-xl:hover,.grid > .rounded-lg:hover{
  transform:translateY(-2px);
  box-shadow:var(--ui-sh-2);
  border-color:var(--u-slate-300);
}
/* stat tiles get a whisper of surface tint */
.grid > .rounded-xl.bg-white,
.result-box .rounded-xl.bg-white{
  background:linear-gradient(180deg,var(--ui-surface),color-mix(in srgb,var(--ui-surface-2) 70%,var(--ui-surface)))!important;
}

/* ---------- 17. Tables ---------- */
.table-responsive{width:100%;overflow-x:auto;border-radius:14px;border:1px solid var(--ui-line)}
.table-responsive .table{border:0;min-width:520px}
.table thead th{
  background:var(--ui-surface-2);
  text-align:left;
  font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--u-slate-500);
  padding:.7rem .8rem;
  border-bottom:1px solid var(--ui-line);
  white-space:nowrap;
}
.table tbody td{
  padding:.55rem .8rem;
  border-bottom:1px solid var(--ui-line-soft);
  font-size:.8125rem;color:var(--u-slate-700);
  vertical-align:middle;
}
.table tbody tr:last-child td{border-bottom:0}
.table tbody tr:hover td{background:color-mix(in srgb,var(--u-slate-50) 80%,transparent)}
.table .form-input{padding:.4rem .55rem;border-radius:9px}

/* ---------- 18. Dropzones ---------- */
.card .border-dashed{
  background:
    radial-gradient(120% 120% at 50% 0%,color-mix(in srgb,var(--brand) 7%,transparent),transparent 70%),
    var(--ui-surface-2);
  transition:border-color .2s ease,background-color .2s ease,transform .2s ease;
}
.card .border-dashed:hover{
  border-color:var(--brand);
  transform:translateY(-1px);
}
.card .border-dashed.is-over,.card .border-dashed:hover{background-color:color-mix(in srgb,var(--brand) 6%,var(--ui-surface-2))}

/* ---------- 19. Interface shell polish ---------- */
.ot-tool-interface{
  background:
    radial-gradient(90% 60% at 50% -10%,color-mix(in srgb,var(--brand) 8%,transparent),transparent 66%);
  border-radius:24px;
}
.ot-tool-interface .card + .card{margin-top:1.5rem}
/* quick-tag buttons inside tools */
.card button.px-2\.5{
  border:1px solid var(--ui-line);
  background:var(--ui-surface-2)!important;
  font-weight:600;
  transition:all .16s ease;
}
.card button.px-2\.5:hover{
  border-color:var(--brand);
  color:var(--brand)!important;
  transform:translateY(-1px);
}

/* ---------- 20. Responsive: sm (640px) ---------- */
@media (min-width:640px){
  .sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
  .sm\:flex-row{flex-direction:row}
  .sm\:flex-initial{flex:0 1 auto}
  .sm\:items-center{align-items:center}
  .sm\:col-span-1{grid-column:span 1/span 1}
  .sm\:text-left{text-align:left}
}
/* ---------- 21. Responsive: lg (1024px) ---------- */
@media (min-width:1024px){
  .lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}
  .lg\:col-span-2{grid-column:span 2 / span 2}
}
@media (max-width:1023px){
  .lg\:grid-cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- 22. Small screens tighten the shell ---------- */
@media (max-width:640px){
  .card{padding:1.1rem}
  .card.p-6{padding:1.1rem}
  .text-3xl{font-size:1.55rem}
  .text-2xl{font-size:1.35rem}
  .h-64{height:11rem}
  .h-72{height:12rem}
  .h-48{height:9rem}
  .btn-lg{width:100%}
  .btn-lg.flex-1{width:auto}
}
@media (max-width:1024px){
  .lg\:grid-cols-4.col-config{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- 23. Print ---------- */
@media print{
  .card{box-shadow:none;border-color:#ccc}
  .btn{display:none}
}

/* ---------- 25. Tool grid overhaul: each col has min-width:0 ---------- */
.space-y-6 > * { min-width: 0; }
.space-y-4 > * { min-width: 0; }
.flex.flex-wrap { gap: 0.5rem; }
button.px-2\.5.py-1 { white-space: nowrap; }

/* ---------- 26. Prevent select option text from clipping ---------- */
.form-select option { padding: 6px 10px; }

/* ---------- 27. Directory categories bar (tools.php) ---------- */
.dir-cat-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  width: 100%;
}
.dir-cat-bar button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--u-slate-600);
  min-height: 36px;
  transition: all .16s ease;
}
.dir-cat-bar button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--u-indigo-50);
  transform: translateY(-1px);
}
.dir-cat-bar button.active {
  background: var(--ui-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(91,91,214,.6);
}
.dir-cat-bar .cat-icon { font-size: 14px; line-height: 1; }
.dir-cat-bar .cat-count {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  background: var(--u-slate-100); color: var(--u-slate-500);
  border-radius: 999px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.dir-cat-bar button.active .cat-count {
  background: rgba(255,255,255,.2); color: #fff;
}

/* ---------- 28. Tools.php hero header ---------- */
.ot-dir-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--ui-surface)) 0%, var(--ui-surface) 100%);
  border: 1px solid var(--ui-line-soft);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 12px 30px -18px rgba(91,91,214,.35);
  position: relative;
  overflow: hidden;
}
.ot-dir-hero::before {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 24%, transparent), transparent 70%);
  pointer-events: none;
}
.ot-dir-hero::after {
  content: ""; position: absolute; left: -60px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--u-emerald-600) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.ot-dir-hero > * { position: relative; z-index: 1; }
.ot-dir-title { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; color: var(--u-slate-900); }
.ot-dir-sub { font-size: 14.5px; color: var(--u-slate-600); max-width: 600px; }
.ot-dir-stats {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  font-size: 12px; font-weight: 700;
}
.ot-dir-stats strong { color: var(--brand); }

/* ---------- 29. Mobile tweaks for tools.php ---------- */
@media (max-width: 640px) {
  .ot-dir-hero { padding: 20px; border-radius: 18px; }
  .dir-cat-bar { gap: 6px; }
  .dir-cat-bar button { padding: 7px 11px; font-size: 12px; }
}

/* ---------- 24. Extra hover states used by table rows ---------- */
.hover\:text-red-700:hover{color:#b91c1c}
.hover\:bg-white:hover{background:var(--ui-surface)}
.hover\:shadow-md:hover{box-shadow:var(--ui-sh-2)}
/* stat tile number emphasis */
.result-box .font-extrabold, .grid > .rounded-xl .font-extrabold{letter-spacing:-.02em}
/* file-name readouts */
#img_comp_selected_filename,#img_res_selected_filename,#img_crop_filename,#j2p_filename,
#p2j_filename,#jpg_selected_filename,#pdf_selected_filename,#split_filename_info,
#pdf_comp_filename,#merge_file_count_info{color:var(--u-slate-500);font-family:var(--font-mono);font-size:.7rem}
/* ============================================================
   OmneTools — UI layer addendum (v2.1)
   Appended to ot-ui.css. Adds: ad-container auto-collapse,
   drag & drop zones, spinners, mobile category accordion,
   command-palette selection state, active-category highlight,
   recently-used rail, tool long-form content, typing-test stats.
   ============================================================ */

/* ---------- 30. Ad container auto-collapse (CLS protection) ----------
   Any ad wrapper that ends up with no content collapses to zero height
   instead of reserving space and shifting the layout. */
.ot-ad-row:empty,
.ad-slot:empty,
[data-ad-slot]:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* A wrapper holding only whitespace is also empty for layout purposes. */
.ot-ad-row:not(:has(*)):not(:has(img)):not(:has(iframe)):not(:has(ins)):not(:has(canvas)):not(:has(video)) {
  display: none !important;
}

/* ---------- 31. Drag & drop file zones ---------- */
.ot-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 32px 22px;
  border: 2px dashed var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface-2);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.ot-drop:hover { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand) 5%, var(--ui-surface-2)); }
.ot-drop:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ui-ring); }
.ot-drop.is-over {
  border-color: var(--brand);
  border-style: solid;
  background: color-mix(in srgb, var(--brand) 12%, var(--ui-surface-2));
  transform: scale(1.012);
  box-shadow: 0 0 0 5px var(--ui-ring);
}
.ot-drop.is-over::after {
  content: "Release to load the file";
  position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand);
}
.ot-drop input[type="file"] { display: none; }
.ot-drop-badge,
.ot-drop-readout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--u-slate-600);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 32. Processing spinner + button loading state ---------- */
.ot-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: otSpin .7s linear infinite;
}
@keyframes otSpin { to { transform: rotate(360deg); } }

.is-loading { position: relative; pointer-events: none; opacity: .82; }
.ot-btn.is-loading, .btn.is-loading { cursor: progress; }

/* Copy confirmation state */
.is-copied {
  background: rgba(5, 150, 105, .12) !important;
  border-color: rgba(5, 150, 105, .45) !important;
  color: #059669 !important;
}

/* ---------- 33. Toast icon chip ---------- */
.ot-toast-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: 11px;
  flex: none;
}

/* ---------- 34. Mobile category accordion (separate from desktop mega) ---------- */
.ot-drawer-dropdown { border-radius: 12px; overflow: hidden; }
.ot-drawer-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.ot-drawer-dropdown-trigger svg { transition: transform .22s ease; flex: none; }
.ot-drawer-dropdown[data-open="true"] .ot-drawer-dropdown-trigger svg { transform: rotate(180deg); }
.ot-drawer-dropdown[data-open="true"] .ot-drawer-dropdown-trigger { color: var(--brand); }
.ot-drawer-dropdown-panel {
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  border-left: 2px solid var(--ui-line);
  margin-left: 6px;
  animation: otDropIn .22s ease;
}
@keyframes otDropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 35. Command palette keyboard selection ---------- */
.ot-cmd-item.is-selected {
  background: color-mix(in srgb, var(--brand) 10%, var(--ui-surface));
  outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent);
  outline-offset: -2px;
  border-radius: 10px;
}

/* ---------- 36. Active-page highlight for category links ---------- */
.ot-mega-cell.is-active,
.ot-drawer-sub.is-active {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent);
}
.ot-mega-cell.is-active .ot-mega-name-pill,
.ot-drawer-sub.is-active span:first-child { color: var(--brand); font-weight: 800; }
.ot-related-item.is-active {
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
}
.ot-related-item.is-active .ot-related-name { color: var(--brand); font-weight: 800; }
.ot-nav-link.is-active { color: var(--brand); }
.ot-nav-link.is-active::after { opacity: 1; transform: scaleX(1); }

/* ---------- 37. Recently-used rail widget ---------- */
.ot-rail-clear {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--u-slate-500);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 7px;
  transition: .16s;
}
.ot-rail-clear:hover { color: #dc2626; background: rgba(220, 38, 38, .08); }
.ot-recent-empty {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--u-slate-500);
}
.ot-section-tight { padding-top: 8px; padding-bottom: 8px; }
.ot-recent-grid { margin-top: 4px; }

/* ---------- 38. Tool long-form content (steps / features / FAQ) ---------- */
.ot-tool-steps-title {
  grid-column: 1 / -1;
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--u-slate-900);
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--u-slate-900);
}
.ot-tool-features {
  margin-top: 26px;
  padding: 22px 24px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface);
}
.ot-tool-features h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--u-slate-900);
}
.ot-tool-features ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 22px;
}
.ot-tool-features li {
  position: relative;
  padding-left: 26px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--u-slate-600);
}
.ot-tool-features li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 55%, transparent);
}
.ot-tool-features li::after {
  content: "";
  position: absolute;
  left: 4.5px; top: 11px;
  width: 6px; height: 3px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.ot-tool-faq h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--u-slate-900);
}
.ot-tool-faq details {
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: var(--ui-surface);
  margin-bottom: 10px;
  overflow: hidden;
}
.ot-tool-faq details[open] { border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.ot-tool-faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--u-slate-800);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ot-tool-faq summary::-webkit-details-marker { display: none; }
.ot-tool-faq summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  flex: none;
  transition: transform .2s ease;
}
.ot-tool-faq details[open] summary::after { transform: rotate(45deg); }
.ot-tool-faq p {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--u-slate-600);
}

/* ---------- 39. Typing-test stat tiles (scoped) ---------- */
#typing-tool .ot-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}
#typing-tool .ot-stat {
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface);
  padding: 14px 16px;
}
#typing-tool .ot-stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--u-slate-400);
}
#typing-tool .ot-stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--u-slate-900);
  font-variant-numeric: tabular-nums;
}
#typing-tool .ot-stat-value.is-accent { color: var(--brand); }
#typing-tool .ot-stat-value.is-good { color: #059669; }
#typing-tool .ot-stat-sub { font-size: 11.5px; color: var(--u-slate-500); }

/* ---------- 40. Reduced-motion & print safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .ot-spinner { animation-duration: 1.6s; }
  .ot-drop.is-over { transform: none; }
  .ot-drawer-dropdown-panel { animation: none; }
  .ot-typing-stream .ch.cur::after { animation: none; }
}
@media print {
  .ot-ad-row, .ot-rail, .ot-cmd-overlay, .ot-toast-stack { display: none !important; }
}

/* ---------- 36. Language selector dropdown (added) ---------- */
.ot-lang {
  position: relative;
  z-index: 100;
}
.ot-lang-menu {
  z-index: 9999;
}
.ot-lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text, #0f172a);
  text-decoration: none;
  font-size: 13px;
}
.ot-lang-item:hover {
  background: var(--bg-soft, #f1f5f9);
}
.ot-lang-item.is-current {
  font-weight: 800;
  background: color-mix(in srgb, var(--brand, #5B5BD6) 12%, transparent);
}



/* OmneTools usability patch — public view/use counters are removed from public templates.
   This rule only hides explicit internal identifiers if a template still marks one. */
.tool-id,
.admin-id,
[data-admin-id],
.ot-internal-id,
.admin-only {
  display: none !important;
}

/* Better touch targets and uncluttered category controls on narrow screens. */
@media (max-width: 640px) {
  .ot-category-filters,
  .ot-category-filter-row,
  .category-filter-row,
  .tool-category-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    gap: 6px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .ot-category-filters > *,
  .ot-category-filter-row > *,
  .category-filter-row > *,
  .tool-category-filters > * {
    flex: 0 0 auto;
    min-height: 34px;
    font-size: 12px;
  }
}

/* Keyboard users should always be able to see the focused control. */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}
