/* X2X Converter — New template chrome (Bootstrap-based tool pages, admin panel)
   Loaded alongside the existing /assets/css/theme.css so legacy widget markup
   (.converter, .info-section, .download-btn, etc.) keeps working unchanged. */

/* ── Dynamic, unlimited-depth nav menu (/admin/menu.php) ─────────────────── */
.dropdown-content ul.dropdown-submenu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-content li {
  position: relative;
}

.dropdown-content > ul > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 18px;
  color: var(--text, #14213d);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-content > ul > li > a:hover {
  background: var(--bg, #f5f7fb);
  color: var(--primary, #1f5eff);
  text-decoration: none;
}

.dropdown-content > ul > li > a i {
  font-size: 0.65rem;
}

.menu-icon {
  margin-right: 2px;
}

/* Flyout for a 3rd+ level: open to the right of its parent item on desktop */
.dropdown-content-nested {
  display: none;
  position: absolute;
  top: -6px;
  left: 100%;
  min-width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(20, 33, 61, 0.12);
  border: 1px solid #e3e7ef;
  z-index: 210;
  padding: 6px 0;
}

.dropdown-content li:hover > .dropdown-content-nested {
  display: block;
}

@media (max-width: 900px) {
  .dropdown-content-nested {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    display: block;
  }
}

.tool-page .tool-h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tool-page .tool-intro {
  color: #3b4a6b;
  max-width: 760px;
}

.tool-page .breadcrumb {
  font-size: 0.9rem;
}

.tool-page .tool-trust .badge {
  font-weight: 600;
}

.tool-page .tool-section {
  margin: 2rem 0;
}

.tool-page .tool-section h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.tool-page .author-box .author-avatar {
  flex: 0 0 48px;
  height: 48px;
  width: 48px;
  border-radius: 12px;
  background: #14213d;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

/* Ad slots stay invisible until a real <ins> ad unit is placed inside them */
.ad-slot:empty {
  display: none;
}
/* ...and so does the wrapper around an empty slot (no stray gap between sections) */
.container:has(> .ad-slot:empty):not(:has(> :not(.ad-slot))) {
  display: none;
}

/* Admin panel */
.admin-shell {
  min-height: 100vh;
  background: #f5f7fb;
}

.admin-sidebar {
  background: #14213d;
  min-height: 100vh;
}

.admin-sidebar a {
  color: #c3cbe0;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  color: #fff;
}

.faq-repeater .faq-row,
.related-repeater .related-row {
  border: 1px solid #e3e7ef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

/* ── Homepage ───────────────────────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, #eaf0ff 0%, #ffffff 100%);
}

.home-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1f5eff;
  background: #eaf0ff;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}

.home-hero-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
}

.home-hero-lead {
  max-width: 700px;
  color: #3b4a6b;
  font-size: 1.1rem;
}

.home-trust li {
  font-size: 0.95rem;
  color: #3b4a6b;
  font-weight: 500;
}

.home-pop-card {
  border: 1px solid #e3e7ef;
  transition: box-shadow 0.15s, transform 0.15s;
}

.home-pop-card:hover {
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.1);
  transform: translateY(-2px);
}

.home-pop-card {
  padding: 1.25rem 1.4rem;
  color: inherit;
}

/* Icon sits in front of the tool name; description goes underneath */
.home-pop-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.6rem;
}

.home-pop-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf0ff;
  color: #1f5eff;
  font-size: 1.35rem;
}

.home-pop-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #14213d;
}

.home-pop-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5a6683;
}

.home-cat-card {
  border-top: 4px solid var(--cat-accent, #1f5eff);
  border-left: 1px solid #e3e7ef;
  border-right: 1px solid #e3e7ef;
  border-bottom: 1px solid #e3e7ef;
}

.home-cat-icon {
  color: var(--cat-accent, #1f5eff);
}

.home-cat-list a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.home-cat-list a:hover {
  color: var(--cat-accent, #1f5eff);
}

.home-standard-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #c7cedd;
  margin-bottom: 0.25rem;
}

.home-flow li {
  position: relative;
  padding: 0.5rem 0 0.5rem 2rem;
  border-left: 2px solid #e3e7ef;
  margin-left: 0.6rem;
}

.home-flow li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.9rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1f5eff;
}

.home-about-badge {
  flex: 0 0 48px;
  height: 48px;
  width: 48px;
  border-radius: 12px;
  background: #14213d;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

/* ══ Homepage polish (responsive / spacing fixes) ═════════════════════════ */

/* theme.css gives legacy .container extra padding on phones; Bootstrap's gutters are what we want */
@media (max-width: 768px) {
  body > section .container { padding: 0 16px; }
}

/* Category cards: collapsible list on phones, always open on md+ */
.home-cat-toggle { cursor: default; }
.home-cat-card { padding: 1.25rem 1.4rem !important; }
.home-cat-list li { padding-top: .55rem !important; padding-bottom: .55rem !important; }
@media (max-width: 767.98px) {
  .home-cat-toggle { cursor: pointer; min-height: 44px; margin-bottom: 0 !important; }
  .home-cat-toggle[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
  .home-cat-card { padding: 1rem 1.1rem !important; }
}

/* Standards: tighter on phones */
@media (max-width: 767.98px) {
  .home-standard-num { font-size: 1.4rem; margin-bottom: 0; }
}

/* Blog (homepage): theme.css made this a centred, max-width box and a CSS grid, which
   fought Bootstrap's grid. Let the section span full width and the row behave like a row. */
.blog-section-home {
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
}
.blog-section-home .blog-section-header { margin-bottom: 1.25rem; flex-direction: row; align-items: baseline; }
.blog-section-home h2 { color: var(--primary); font-size: 1.8rem; margin: 0; text-align: left; }
.blog-grid.row { display: flex; gap: 0; margin-top: 0; }  /* gutters come from Bootstrap g-4, not the old grid gap */
.blog-card-img { height: 190px; }
@media (max-width: 575.98px) {
  .blog-card-img { height: 150px; }
  .blog-section-home .blog-section-header { flex-wrap: wrap; }
}

/* Footer: compact, no indented lists, smaller gaps */
.x2x-footer { margin-top: 0; }
.footer-grid { padding: 40px 24px 20px; gap: 28px 24px; }
.footer-col ul { padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col h4 { margin-bottom: 10px; }
@media (max-width: 767.98px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); padding: 28px 16px 12px; gap: 22px 16px; }
  .footer-col ul li a { display: inline-block; padding: 3px 0; font-size: .85rem; }
}
@media (max-width: 420px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Rich-text (admin editor) output: keep it tight inside cards/lists ───── */
.rich-content > :last-child { margin-bottom: 0; }
.rich-content p { margin-bottom: .5rem; }
.home-pop-desc.rich-content p,
.home-list-desc.rich-content p { margin: 0; }
.home-hero-lead.rich-content p { margin-bottom: 0; }

/* ── "All tools by category": icon in front of name, description underneath ── */
.home-cat-list a.home-list-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .1rem 0;
  color: #14213d;
}
.home-list-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cat-accent, #1f5eff) 12%, #fff);
  color: var(--cat-accent, #1f5eff);
  font-size: .95rem;
}
.home-list-text { display: flex; flex-direction: column; min-width: 0; }
.home-list-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.home-list-desc { font-size: .8rem; color: #5a6683; line-height: 1.4; margin-top: 2px; }
.home-cat-list a.home-list-item:hover .home-list-name { color: var(--cat-accent, #1f5eff); }
.home-cat-list a.home-list-item { min-height: 44px; align-items: center; }

/* ── Homepage blog: always 3 cards in one row ─────────────────────────────
   >= 576px: three equal columns. Phones: one swipeable row (scroll-snap) so
   there are still three in a row without squeezing the text. */
@media (max-width: 575.98px) {
  #homeBlogGrid.row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .75rem;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 8px;
    padding-right: 8px;
  }
  #homeBlogGrid .blog-col {
    flex: 0 0 82%;
    max-width: 82%;
    scroll-snap-align: center;
  }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  #homeBlogGrid .blog-card-img { height: 120px; }
  #homeBlogGrid .blog-card-title { font-size: .95rem; }
  #homeBlogGrid .blog-card-excerpt { display: none; }
}

/* ── Homepage FAQ: full container width, same card look as the rest of the page ── */
.home-faq .accordion-item {
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  margin-bottom: .75rem;
  overflow: hidden;
  background: #fff;
}
.home-faq .accordion-button {
  font-size: 1.05rem;
  font-weight: 600;
  color: #14213d;
  padding: 1rem 1.25rem;
  min-height: 56px;
  background: #fff;
  box-shadow: none;
}
.home-faq .accordion-button:not(.collapsed) { color: #1f5eff; background: #eaf0ff; }
.home-faq .accordion-body { padding: 1rem 1.25rem 1.25rem; color: #3b4a6b; line-height: 1.6; }
.home-faq .accordion-body > :last-child { margin-bottom: 0; }
@media (max-width: 575.98px) {
  .home-faq .accordion-button { font-size: 1rem; padding: .85rem 1rem; }
  .home-faq .accordion-body { padding: .85rem 1rem 1rem; }
}

/* ── Footer sections (admin-managed): stacked sections inside one column ── */
.footer-section + .footer-section { margin-top: 1.2rem; }
.footer-copy { text-align: center; }

/* ══ Sidebar: other tools in the same category ═══════════════════════════════ */
.rel-tools { list-style: none; margin: 0; padding: 0; }
.rel-tool { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem .4rem; border-top: 1px solid #eef1f7; border-radius: 10px; color: #14213d; text-decoration: none; min-height: 44px; transition: background .15s; }
.rel-tools li:first-child .rel-tool { border-top: 0; }
.rel-tool:hover { background: #f4f7ff; text-decoration: none; color: #14213d; }
.rel-tool-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--cat-accent, #1f5eff) 12%, #fff); color: var(--cat-accent, #1f5eff); font-size: 1rem; }
.rel-tool-text { display: flex; flex-direction: column; min-width: 0; }
.rel-tool-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.rel-tool:hover .rel-tool-name { color: var(--cat-accent, #1f5eff); }
.rel-tool-desc { font-size: .8rem; color: #5a6683; line-height: 1.4; margin-top: 2px; }
.rel-tool-desc p { margin: 0; }

/* ══ Tool page: sidebar lines up with the heading (breadcrumb sits above both columns) ══ */
.tool-page .tool-h1 { margin-top: 0; }
.tool-page aside > .card:first-child { margin-top: 0; }

/* ══ Buttons: never let hover make text unreadable ═════════════════════════════ */

/* ══ Quick reference / admin-authored tables ═══════════════════════════════════ */
.tool-page .ref-table-wrap {
  border: 1px solid #e3e7ef;
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 33, 61, .05);
}
.tool-page table.ref-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .95rem;
  min-width: 420px;
}
.tool-page table.ref-table th {
  background: #1b2c52;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  padding: .85rem 1rem;
  white-space: nowrap;
  border: 0;
}
.tool-page table.ref-table td {
  padding: .8rem 1rem;
  color: #26324d;
  border: 0;
  border-top: 1px solid #eef1f7;
  vertical-align: top;
}
.tool-page table.ref-table tbody tr:nth-child(even) td { background: #f7f9fe; }
.tool-page table.ref-table tbody tr:hover td { background: #eaf0ff; }
.tool-page table.ref-table td:first-child { font-weight: 700; color: #14213d; white-space: nowrap; }
.tool-page table.ref-table tr:first-child th:first-child { border-top-left-radius: 13px; }
.tool-page table.ref-table tr:first-child th:last-child { border-top-right-radius: 13px; }
@media (max-width: 575.98px) {
  .tool-page table.ref-table { font-size: .88rem; }
  .tool-page table.ref-table th, .tool-page table.ref-table td { padding: .65rem .75rem; }
}
/* Any other table an admin puts in a content section gets a cleaner default too */
.tool-page .tool-section table:not(.ref-table) { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.tool-page .tool-section table:not(.ref-table) th,
.tool-page .tool-section table:not(.ref-table) td { border: 1px solid #e3e7ef; padding: .6rem .8rem; }
.tool-page .tool-section table:not(.ref-table) th { background: #f1f4fb; text-align: left; }

/* ══ Searchable dropdowns (Tom Select) — match the site's inputs ═══════════════ */
.ts-wrapper { width: 100%; }
.ts-wrapper.single .ts-control, .ts-wrapper.single.input-active .ts-control {
  min-height: 44px;
  border: 1.5px solid #d6dcea;
  border-radius: 12px;
  background: #f8faff;
  color: #14213d;
  padding: .5rem 2.2rem .5rem 1rem;
  box-shadow: none;
  display: flex; align-items: center;
}
.ts-wrapper.focus .ts-control { border-color: #1f5eff; background: #fff; box-shadow: 0 0 0 4px rgba(31, 94, 255, .14); }
.ts-dropdown { border: 1px solid #d6dcea; border-radius: 12px; box-shadow: 0 14px 34px rgba(20, 33, 61, .16); margin-top: 6px; overflow: hidden; z-index: 2000; }
.ts-dropdown .option { padding: .6rem 1rem; color: #14213d; }
.ts-dropdown .active { background: #eaf0ff; color: #0a3fc2; }
.ts-dropdown .option.selected { font-weight: 700; }
.ts-dropdown .no-results { padding: .75rem 1rem; color: #5a6683; }
.ts-wrapper.single .ts-control input { color: #14213d; }
/* inside the admin, keep Bootstrap's smaller form-select sizing */
.admin-shell .ts-wrapper.single .ts-control { min-height: 31px; border-radius: 6px; padding: .25rem 2rem .25rem .6rem; font-size: .875rem; background: #fff; border: 1px solid #ced4da; }
.admin-shell .form-select:not(.form-select-sm) + .ts-wrapper .ts-control, .admin-shell .ts-wrapper:not(.form-select-sm) .ts-control { font-size: 1rem; min-height: 38px; }

/* ══ New Wiz Tech logo (use nwt_logo() in PHP — see includes/config.php) ═══════ */
.nwt-logo {
  flex: 0 0 auto;
  display: block;
  border-radius: 12px;
  object-fit: contain;
  background: #f7f7f7;
  border: 1px solid #e3e7ef;
}

/* ══ Toast message (assets/js/copy.js → x2xToast) ══════════════════════════════ */
.x2x-toast-host {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  justify-content: center;
  width: calc(100% - 2rem);
  max-width: 420px;
  pointer-events: none;
}
.x2x-toast {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.1rem;
  border-radius: 999px;
  background: #14213d;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(20, 33, 61, .35);
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: opacity .2s ease, transform .2s ease;
}
.x2x-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.x2x-toast.is-success i { color: #3ddc97; }
.x2x-toast.is-error { background: #7a1f2b; }
.x2x-toast.is-error i { color: #ffb3bd; }
.x2x-toast.is-info i { color: #8fb4ff; }
@media (prefers-reduced-motion: reduce) { .x2x-toast { transition: none; } }

/* ══════════════════════════════════════════════════════════════════════════════
   Shared tool-widget components (use these for every migrated tool)
   .x2x-tool  card · .x2x-drop  file drop zone · .x2x-btn  buttons · .x2x-field  labelled input
   ══════════════════════════════════════════════════════════════════════════════ */
.x2x-tool {
  background: #fff;
  border: 1px solid #e3e7ef;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(20, 33, 61, .07);
}
@media (max-width: 575.98px) { .x2x-tool { padding: 1rem; border-radius: 14px; } }

.x2x-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 190px; padding: 1.5rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed #b9c6e6; border-radius: 16px; background: #f6f9ff; color: #3b4a6b;
  transition: border-color .15s, background .15s, transform .15s;
}
.x2x-drop:hover, .x2x-drop:focus-visible, .x2x-drop.is-over { border-color: #1f5eff; background: #eaf0ff; outline: none; }
.x2x-drop.is-over { transform: scale(1.01); }
.x2x-drop > i { font-size: 2.2rem; color: #1f5eff; margin-bottom: .25rem; }
.x2x-drop strong { color: #14213d; font-size: 1.1rem; }
.x2x-drop span { font-size: .9rem; }
.x2x-drop input[type=file] { display: none; }

.x2x-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.2rem; border: 0; border-radius: 12px;
  background: #1f5eff; color: #fff; font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none; transition: background .15s, box-shadow .15s, transform .1s;
}
.x2x-btn:hover { background: #0a3fc2; color: #fff; text-decoration: none; filter: none; box-shadow: 0 6px 16px rgba(31, 94, 255, .3); }
.x2x-btn.is-ghost { background: #eaf0ff; color: #0a3fc2; }
.x2x-btn.is-ghost:hover { background: #d9e4ff; color: #072f94; box-shadow: none; }
.x2x-btn.is-done, .x2x-btn.is-done:hover { background: #2ecc71; color: #fff; }
.x2x-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.x2x-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.x2x-field label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6683; margin-bottom: .4rem; }
.x2x-field input[type=text], .x2x-field input[type=number], .x2x-field select, .x2x-field textarea {
  width: 100%; min-height: 48px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #f8faff; color: #14213d; padding: .6rem 1rem; font-size: 1rem;
}
.x2x-field input:focus, .x2x-field select:focus, .x2x-field textarea:focus { outline: none; border-color: #1f5eff; background: #fff; box-shadow: 0 0 0 4px rgba(31, 94, 255, .14); }

/* ══ Color Extractor ═══════════════════════════════════════════════════════════ */
.cx-layout { display: none; }  /* legacy, no longer used */
.cx-preview { margin-top: 1.25rem; height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid #e3e7ef; background: #f1f4fb; display: flex; align-items: center; justify-content: center; }
/* Fixed-size preview box: the image always fits inside it (never stretches the page) */
.cx-preview img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
@media (max-width: 575.98px) { .cx-preview { height: 220px; } }
.cx-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin: 1.1rem 0 .9rem; }
.cx-head .x2x-field { min-width: 150px; }
.cx-palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.cx-swatch { border-radius: 14px; overflow: hidden; border: 1px solid #e3e7ef; background: #fff; display: flex; flex-direction: column; }
.cx-chip { position: relative; height: 84px; border: 0; padding: 0; border-radius: 0; cursor: pointer; display: flex; align-items: flex-end; justify-content: flex-start; width: 100%; }
.cx-chip:hover { filter: brightness(.96); }
.cx-chip .cx-tag { margin: .5rem; padding: .15rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.85); color: #14213d; }
.cx-info { padding: .55rem .6rem .65rem; font-size: .85rem; color: #26324d; display: grid; gap: .3rem; }
.cx-code { display: flex; align-items: center; justify-content: space-between; gap: .4rem; background: #f4f7ff; border: 0; border-radius: 8px; padding: .3rem .5rem; min-height: 36px; width: 100%; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; white-space: nowrap; color: #14213d; text-align: left; }
.cx-code:hover { background: #e3ebff; color: #0a3fc2; filter: none; }
.cx-code span { overflow: hidden; text-overflow: ellipsis; }
.cx-code i { color: #7a89ad; font-size: .8rem; flex: 0 0 auto; }
@media (max-width: 479.98px) { .cx-code { font-size: .72rem; padding: .3rem .4rem; } .cx-code i { display: none; } }
.cx-error { margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; background: #fdecee; color: #8a1f2d; font-weight: 600; }
/* 3 colors per row; phones drop to 2 so the codes stay readable */
@media (max-width: 575.98px) { .cx-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ══ Shared: fixed-size preview stage + error box (x2x-*) ═════════════════════ */
.x2x-stage {
  position: relative; margin-top: 1.25rem; height: 340px; border-radius: 14px; overflow: hidden;
  border: 1px solid #e3e7ef; background: #f1f4fb; display: flex; align-items: center; justify-content: center;
}
.x2x-stage img, .x2x-stage canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
@media (max-width: 575.98px) { .x2x-stage { height: 240px; } }
.x2x-error { margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; background: #fdecee; color: #8a1f2d; font-weight: 600; }

/* ══ Face Counter ═══════════════════════════════════════════════════════════════ */
.fc-status { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .35rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #eef1f8; color: #3b4a6b; }
.fc-status .fc-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa6c4; }
.fc-status.is-loading .fc-dot { background: #f5a623; animation: fcPulse 1s infinite; }
.fc-status.is-ready { background: #e6f8ef; color: #17734a; }
.fc-status.is-ready .fc-dot { background: #2ecc71; }
.fc-status.is-error { background: #fdecee; color: #8a1f2d; }
.fc-status.is-error .fc-dot { background: #e5484d; }
@keyframes fcPulse { 50% { opacity: .3; } }
.fc-busy { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .6rem; background: rgba(20, 33, 61, .78); color: #fff; font-weight: 600; font-size: .9rem; }
.fc-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: fcSpin .8s linear infinite; }
@keyframes fcSpin { to { transform: rotate(360deg); } }
.fc-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding: 1rem 1.25rem; border-radius: 16px; background: linear-gradient(135deg, #1f5eff 0%, #4b83ff 100%); color: #fff; }
.fc-count { display: flex; align-items: baseline; gap: .6rem; }
.fc-number { font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 800; line-height: 1; }
.fc-label { font-size: 1.05rem; font-weight: 600; opacity: .95; }
.fc-summary .x2x-btn { background: #fff; color: #1f5eff; }
.fc-summary .x2x-btn:hover { background: #eaf0ff; color: #0a3fc2; box-shadow: none; }
.fc-summary .x2x-btn.is-ghost { background: rgba(255,255,255,.18); color: #fff; }
.fc-summary .x2x-btn.is-ghost:hover { background: rgba(255,255,255,.3); color: #fff; }
.fc-option { display: flex; gap: .65rem; align-items: flex-start; margin-top: 1rem; font-size: .92rem; color: #3b4a6b; cursor: pointer; }
.fc-option input { margin-top: .25rem; width: 18px; height: 18px; flex: 0 0 auto; accent-color: #1f5eff; }
.fc-hint { margin: .5rem 0 0; font-size: .88rem; color: #5a6683; }

/* ══ Image Blur ══════════════════════════════════════════════════════════════════ */
.x2x-stage.is-tall { height: 460px; }
@media (max-width: 575.98px) { .x2x-stage.is-tall { height: 340px; } }
.ib-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.ib-modes { display: inline-flex; background: #eef1f8; border-radius: 12px; padding: 4px; gap: 4px; }
.ib-mode { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem 1rem; border: 0; border-radius: 9px; background: transparent; color: #3b4a6b; font-weight: 700; font-size: .92rem; cursor: pointer; }
.ib-mode:hover { background: #dfe6f6; color: #14213d; filter: none; }
.ib-mode.is-active, .ib-mode.is-active:hover { background: #1f5eff; color: #fff; box-shadow: 0 4px 10px rgba(31, 94, 255, .3); }
.ib-stage { cursor: none; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.ib-stage canvas { touch-action: none; cursor: none; }
.ib-cursor { position: absolute; pointer-events: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #1f5eff, inset 0 0 0 1.5px #1f5eff; transform: translate(-50%, -50%); z-index: 3; }
.ib-tip { margin: .75rem 0 0; font-size: .88rem; color: #5a6683; }
.ib-tip i { color: #1f5eff; margin-right: .3rem; }
.ib-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
@media (max-width: 575.98px) { .ib-sliders { grid-template-columns: 1fr; gap: .75rem; } }
.ib-sliders .x2x-field label { display: flex; justify-content: space-between; align-items: baseline; }
.ib-sliders output { font-weight: 800; color: #1f5eff; text-transform: none; letter-spacing: 0; font-size: .95rem; }
.ib-sliders input[type=range] { width: 100%; height: 32px; accent-color: #1f5eff; cursor: pointer; }
.ib-final { margin-top: 1.1rem; }

/* ══ Shared: [hidden] must always win inside tool widgets (display:flex/grid rules would override it) ══ */
.x2x-tool [hidden] { display: none !important; }

/* ══ Shared: segmented control (x2x-seg) ═════════════════════════════════════════ */
.x2x-seg { display: inline-flex; flex-wrap: nowrap; max-width: 100%; background: #eef1f8; border-radius: 12px; padding: 4px; gap: 4px; }
.x2x-seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .4rem .8rem; white-space: nowrap; border: 0; border-radius: 9px; background: transparent; color: #3b4a6b; font-weight: 700; font-size: .9rem; cursor: pointer; }
.x2x-seg-btn:hover { background: #dfe6f6; color: #14213d; filter: none; }
.x2x-seg-btn.is-active, .x2x-seg-btn.is-active:hover { background: #1f5eff; color: #fff; box-shadow: 0 4px 10px rgba(31, 94, 255, .3); }
.x2x-field output { font-weight: 800; color: #1f5eff; text-transform: none; letter-spacing: 0; font-size: .95rem; float: right; }

/* ══ Image Merger ═════════════════════════════════════════════════════════════════ */
.im-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }   /* minmax(0,…): a long file name must never widen a column */
.im-slot { min-width: 0; }
@media (max-width: 575.98px) { .im-slots { grid-template-columns: minmax(0, 1fr); } }
.im-drop { min-height: 170px; }
.im-thumb { min-width: 0; border: 1px solid #e3e7ef; border-radius: 16px; overflow: hidden; background: #fff; }
.im-thumb > img { display: block; width: 100%; height: 170px; object-fit: contain; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 16px 16px; }
.im-meta { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-top: 1px solid #eef1f7; }
.im-badge { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #1f5eff; color: #fff; font-weight: 800; font-size: .85rem; }
.im-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 0; line-height: 1.25; }
.im-name { display: block; max-width: 100%; font-size: .9rem; color: #14213d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-info small { display: block; white-space: nowrap; }
.im-info small { color: #5a6683; font-size: .78rem; }
.im-icon-btn { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: #eaf0ff; color: #0a3fc2; cursor: pointer; }
.im-icon-btn:hover { background: #d9e4ff; color: #072f94; filter: none; }
.im-remove:hover { background: #fdecee; color: #8a1f2d; }
.im-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem 1.25rem; margin-top: 1.25rem; padding: 1.1rem; border-radius: 14px; background: #f6f9ff; border: 1px solid #e3e7ef; align-items: start; }
.im-custom { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.im-range { width: 100%; height: 32px; accent-color: #1f5eff; cursor: pointer; }
.im-color { width: 100%; height: 48px; padding: 4px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #fff; cursor: pointer; }
.im-stage { background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.im-empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1rem; text-align: center; color: #5a6683; font-weight: 600; }
.im-empty i { font-size: 2rem; color: #9fb3dd; }
.im-size { margin: .6rem 0 1rem; font-size: .88rem; color: #5a6683; min-height: 1.3em; }

/* ══ Image to Anime Style ═════════════════════════════════════════════════════════ */
.an-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.an-label { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6683; }
.an-stage { background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.an-compare { position: relative; flex: 0 0 auto; }
.an-compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: fill; }
.an-divider { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(20,33,61,.35), 0 0 12px rgba(0,0,0,.35); z-index: 2; pointer-events: none; }
.an-tag { position: absolute; bottom: .5rem; z-index: 3; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: rgba(20,33,61,.78); color: #fff; opacity: 0; transition: opacity .15s; pointer-events: none; }
.an-tag-l { left: .5rem; } .an-tag-r { right: .5rem; }
.an-compare.is-comparing .an-tag { opacity: 1; }
.an-compare-ctl { margin-top: 1rem; }
.an-compare-ctl label { display: block; }
.an-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem 1.5rem; margin-top: .5rem; }
.an-final { margin-top: 1.1rem; }

/* ══ Image to Base64 ══════════════════════════════════════════════════════════════ */
.b64-stage { height: 260px; }
@media (max-width: 575.98px) { .b64-stage { height: 200px; } }
.b64-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
@media (max-width: 767.98px) { .b64-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.b64-stat { padding: .7rem .9rem; border-radius: 12px; background: #f4f7ff; border: 1px solid #e3e7ef; min-width: 0; }
.b64-stat span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5a6683; }
.b64-stat strong { display: block; margin-top: .15rem; font-size: .98rem; color: #14213d; overflow-wrap: anywhere; }
.b64-warn { margin-top: .75rem; padding: .7rem 1rem; border-radius: 12px; background: #fff6e0; color: #7a5200; font-size: .9rem; font-weight: 600; }
.b64-format { margin-top: 1.1rem; }
.b64-output { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.45; word-break: break-all; resize: vertical; min-height: 140px; }
.x2x-field label output { font-weight: 800; color: #1f5eff; text-transform: none; letter-spacing: 0; font-size: .85rem; }
/* Base64 output-format buttons: share the row evenly, wrap to two lines on narrow screens */
.b64-format .x2x-seg { display: flex; flex-wrap: wrap; width: 100%; }
.b64-format .x2x-seg-btn { flex: 1 1 auto; }

/* ══ Image to Cartoon: extra toggles under the sliders (layout otherwise shared with .an-*) ══ */
.ct-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .25rem 1.5rem; margin-top: .75rem; }

/* ══ Image to Sketch: paper selector under the sliders ═══════════════════════════ */
.sk-paper { margin-top: .9rem; }

/* ══ Photo Location Reader ═══════════════════════════════════════════════════════ */
.loc-stage { height: 260px; }
@media (max-width: 575.98px) { .loc-stage { height: 210px; } }
.loc-card { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid #e3e7ef; border-radius: 14px; background: #f8faff; }
.loc-status { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.02rem; margin-bottom: .75rem; }
.loc-status.is-found { color: #17734a; }
.loc-status.is-missing { color: #8a5a00; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem 1.25rem; margin: 0; }
.loc-row { min-width: 0; margin: 0; }
.loc-row.is-wide { grid-column: 1 / -1; }
.loc-row dt { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5a6683; margin: 0; }
.loc-row dd { margin: .1rem 0 0; font-size: .98rem; font-weight: 600; color: #14213d; overflow-wrap: anywhere; }
.loc-note { margin: .9rem 0 0; font-size: .9rem; color: #5a6683; }
.loc-actions { margin-top: 1rem; }
.loc-map-wrap { margin-top: 1.1rem; }
.loc-map { height: 340px; border-radius: 14px; border: 1px solid #e3e7ef; overflow: hidden; z-index: 1; }
@media (max-width: 575.98px) { .loc-map { height: 280px; } }
.loc-attrib { margin: .5rem 0 0; font-size: .8rem; color: #5a6683; }

/* Trust badge: long server notes must wrap on narrow screens instead of widening the page */
.tool-page .tool-trust .badge { white-space: normal; text-align: left; max-width: 100%; line-height: 1.4; padding: .4em .8em; }

/* ══ Vector to Image ═══════════════════════════════════════════════════════════════ */
.vi-stage { height: 280px; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
@media (max-width: 575.98px) { .vi-stage { height: 220px; } }
.vi-stage img { max-width: none; max-height: none; object-fit: contain; }
.vi-paste { margin-top: 1rem; border: 1px solid #e3e7ef; border-radius: 14px; background: #f8faff; padding: .15rem 1rem; }
.vi-paste summary { cursor: pointer; padding: .7rem 0; font-weight: 700; font-size: .92rem; color: #0a3fc2; list-style-position: inside; min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.vi-paste[open] summary { border-bottom: 1px solid #e3e7ef; margin-bottom: .8rem; }
.vi-paste textarea { width: 100%; min-height: 130px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #fff; padding: .7rem .9rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; margin-bottom: .75rem; resize: vertical; }
.vi-paste textarea:focus { outline: none; border-color: #1f5eff; box-shadow: 0 0 0 4px rgba(31, 94, 255, .14); }
.vi-paste .x2x-btn { margin-bottom: .9rem; }
.vi-meta { margin: .6rem 0 0; font-size: .9rem; font-weight: 600; color: #3b4a6b; overflow-wrap: anywhere; }
.vi-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem 1.25rem; margin-top: 1rem; padding: 1.1rem; border-radius: 14px; background: #f6f9ff; border: 1px solid #e3e7ef; align-items: start; }
.vi-bg { display: flex; align-items: center; gap: .75rem; }
.vi-bg .im-color { width: 64px; flex: 0 0 auto; }
.vi-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; font-weight: 600; color: #26324d; cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; }
.vi-check input { width: 18px; height: 18px; accent-color: #1f5eff; }
.vi-check.is-disabled { opacity: .5; cursor: not-allowed; }
.vi-bg .im-color:disabled { opacity: .45; cursor: not-allowed; }

/* ══ Image to PDF ═════════════════════════════════════════════════════════════════ */
.pdf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.pdf-head strong { display: block; font-size: 1.05rem; color: #14213d; }
.pdf-hint { display: block; font-size: .85rem; color: #5a6683; }
.pdf-pages { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; counter-reset: none; }
.pdf-page { position: relative; display: flex; flex-direction: column; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #fff; overflow: hidden; cursor: grab; transition: border-color .15s, box-shadow .15s, opacity .15s; min-width: 0; }
.pdf-page:hover { border-color: #b9c6e6; box-shadow: 0 6px 16px rgba(20, 33, 61, .08); }
.pdf-page.is-dragging { opacity: .45; }
.pdf-page.is-target { border-color: #1f5eff; box-shadow: 0 0 0 3px rgba(31, 94, 255, .2); }
.pdf-thumb { height: 130px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 16px 16px; overflow: hidden; }
.pdf-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s; }
.pdf-badge { position: absolute; top: .45rem; left: .45rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #1f5eff; color: #fff; font-size: .8rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pdf-name { padding: .45rem .65rem 0; font-size: .8rem; font-weight: 600; color: #26324d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-tools { display: flex; justify-content: space-between; gap: .25rem; padding: .35rem .5rem .55rem; }
.pdf-ibtn { flex: 1 1 0; min-width: 0; min-height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: #eaf0ff; color: #0a3fc2; font-size: .85rem; cursor: pointer; }
.pdf-ibtn:hover:not(:disabled) { background: #d9e4ff; color: #072f94; filter: none; }
.pdf-ibtn.is-danger:hover:not(:disabled) { background: #fdecee; color: #8a1f2d; }
.pdf-ibtn:disabled { opacity: .35; cursor: not-allowed; }
.pdf-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem 1.25rem; margin-top: 1.1rem; padding: 1.1rem; border-radius: 14px; background: #f6f9ff; border: 1px solid #e3e7ef; align-items: start; }
.pdf-check { grid-column: 1 / -1; display: flex; align-items: center; gap: .55rem; font-size: .92rem; font-weight: 600; color: #26324d; cursor: pointer; margin: 0; }
.pdf-check input { width: 18px; height: 18px; accent-color: #1f5eff; }
@media (max-width: 575.98px) { .pdf-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pdf-thumb { height: 110px; } }

/* ══ Image to Text (OCR) ═══════════════════════════════════════════════════════════ */
.ocr-options { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 1rem 1.5rem; align-items: end; margin-bottom: 1.1rem; padding: 1.1rem; border-radius: 14px; background: #f6f9ff; border: 1px solid #e3e7ef; }
@media (max-width: 767.98px) { .ocr-options { grid-template-columns: minmax(0, 1fr); } }
.ocr-check { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; color: #3b4a6b; cursor: pointer; margin: 0; }
.ocr-check input { margin-top: .25rem; width: 18px; height: 18px; flex: 0 0 auto; accent-color: #1f5eff; }
.ocr-stage { height: 240px; }
@media (max-width: 575.98px) { .ocr-stage { height: 190px; } }
.ocr-progress { margin-top: 1rem; padding: .9rem 1rem; border-radius: 14px; background: #eef3ff; border: 1px solid #d7e2ff; }
.ocr-bar { height: 10px; border-radius: 999px; background: #d7e2ff; overflow: hidden; }
.ocr-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #1f5eff, #4b83ff); transition: width .25s ease; }
.ocr-status { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .6rem; font-size: .9rem; font-weight: 600; color: #26324d; }
.ocr-cancel { min-height: 36px; padding: .25rem .9rem; border: 0; border-radius: 9px; background: #fff; color: #8a1f2d; font-weight: 700; font-size: .85rem; cursor: pointer; }
.ocr-cancel:hover { background: #fdecee; color: #6d1722; filter: none; }
.ocr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 .75rem; }
.ocr-pill { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: #eef1f8; color: #26324d; font-size: .82rem; font-weight: 700; }
.ocr-pill.is-good { background: #e6f8ef; color: #17734a; }
.ocr-pill.is-ok { background: #fff6e0; color: #7a5200; }
.ocr-pill.is-low { background: #fdecee; color: #8a1f2d; }
.ocr-tip { font-size: .88rem; color: #5a6683; flex-basis: 100%; }
.ocr-text { font-size: .98rem; line-height: 1.55; min-height: 200px; resize: vertical; }
.ocr-edit-note { font-weight: 500; text-transform: none; letter-spacing: 0; color: #5a6683; }

/* ══ Markdown to HTML ═════════════════════════════════════════════════════════════ */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.md-stats { font-size: .85rem; font-weight: 600; color: #5a6683; }
.md-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 1rem; }
.md-pane { min-width: 0; border-radius: 14px; }
.md-pane.is-over { outline: 3px dashed #1f5eff; outline-offset: 3px; background: #eaf0ff; }
.md-label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6683; margin-bottom: .4rem; }
.md-label small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.md-editor, .md-code { width: 100%; height: 420px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #f8faff; padding: .8rem 1rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.55; resize: vertical; color: #14213d; }
.md-editor:focus, .md-code:focus { outline: none; border-color: #1f5eff; background: #fff; box-shadow: 0 0 0 4px rgba(31, 94, 255, .14); }
.md-tabs { display: inline-flex; background: #eef1f8; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: .55rem; }
.md-tab { min-height: 36px; padding: .3rem 1rem; border: 0; border-radius: 9px; background: transparent; color: #3b4a6b; font-weight: 700; font-size: .88rem; cursor: pointer; }
.md-tab:hover { background: #dfe6f6; color: #14213d; filter: none; }
.md-tab.is-active, .md-tab.is-active:hover { background: #1f5eff; color: #fff; }
.md-preview { display: block; width: 100%; height: 420px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #fff; }
@media (max-width: 767.98px) { .md-editor, .md-code, .md-preview { height: 300px; } }
.md-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .25rem 1.5rem; margin-top: .9rem; }
.md-warn { margin-top: .75rem; padding: .7rem 1rem; border-radius: 12px; background: #fff6e0; color: #7a5200; font-size: .88rem; font-weight: 600; }
.md-actions { margin-top: 1rem; }

/* ══ PDF to JPG ═══════════════════════════════════════════════════════════════════ */
.pj-file { display: flex; align-items: center; gap: .85rem; margin-top: 1rem; padding: .85rem 1rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #f8faff; }
.pj-file > i { font-size: 1.8rem; color: #d63a4a; flex: 0 0 auto; }
.pj-file-info { flex: 1 1 auto; min-width: 0; }
.pj-file-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #14213d; }
.pj-file-info span { font-size: .85rem; color: #5a6683; }
@media (max-width: 575.98px) { .pj-file { flex-wrap: wrap; } .pj-file .x2x-btn { width: 100%; } }
.pj-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.5rem; margin-top: 1.1rem; }
.pj-help { display: block; margin-top: .3rem; font-size: .8rem; color: #5a6683; }
.pj-go { margin-top: 1.1rem; }
.pj-progress { margin-top: .9rem; }
.pj-bar { height: 10px; border-radius: 999px; background: #e3e7ef; overflow: hidden; }
.pj-bar span { display: block; height: 100%; width: 0; background: #1f5eff; transition: width .2s; }
.pj-progress small { display: block; margin-top: .35rem; color: #5a6683; }
.pj-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
.pj-res-head strong { display: block; font-size: 1.05rem; color: #14213d; }
.pj-grid { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 575.98px) { .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; } }
.pj-card { display: flex; flex-direction: column; gap: .5rem; padding: .6rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #fff; min-width: 0; }
.pj-thumb { height: 220px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #eef1f8; overflow: hidden; }
@media (max-width: 575.98px) { .pj-thumb { height: 160px; } }
.pj-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 2px 8px rgba(20, 33, 61, .18); }
.pj-cap { min-width: 0; }
.pj-cap strong { display: block; font-size: .9rem; color: #14213d; }
.pj-cap span { display: block; font-size: .78rem; color: #5a6683; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-dl { width: 100%; justify-content: center; margin-top: auto; }

/* ══ Word to Audio ════════════════════════════════════════════════════════════════ */
.wa-text-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: 1.1rem; }
.wa-text-head .md-label { margin-bottom: 0; }
.wa-text { height: 280px; margin-top: .4rem; font-family: inherit; font-size: .95rem; }
@media (max-width: 767.98px) { .wa-text { height: 220px; } }
.wa-options { margin-top: 1.1rem; }
.wa-options output { font-weight: 700; color: #1f5eff; margin-left: .25rem; }
.wa-actions { margin-top: 1.1rem; }

/* ══ Base64 Encoder/Decoder ═══════════════════════════════════════════════════════ */
.b64-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.b64-top .x2x-seg { max-width: 100%; }
@media (max-width: 575.98px) { .b64-top .x2x-seg { width: 100%; } .b64-top .x2x-seg-btn { flex: 1 1 0; padding-left: .5rem; padding-right: .5rem; } }
#b64 .md-pane { margin-top: 1rem; }
.b64-area { height: 200px; word-break: break-all; }
.b64-options { margin-top: 1rem; }
@media (max-width: 575.98px) { .b64-long { display: none; } }

/* ══ Excel to JSON ════════════════════════════════════════════════════════════════ */
.xj-out { height: 340px; white-space: pre; overflow: auto; word-break: normal; margin-top: .4rem; }
@media (max-width: 767.98px) { .xj-out { height: 260px; } }
#xj .md-options { margin-bottom: 1rem; }

/* ══ JSON Prettifier ══════════════════════════════════════════════════════════════ */
.jp-area { height: 260px; white-space: pre; overflow: auto; word-break: normal; }
@media (max-width: 767.98px) { .jp-area { height: 220px; } }
.jp-options { margin-top: 1rem; }
.jp-sort { margin-top: 0; }
.jp-out-pane { margin-top: 1rem; }
.jp-status { margin-top: 1rem; padding: .7rem 1rem; border-radius: 12px; font-size: .9rem; line-height: 1.5; background: #eef1f8; color: #26324d; }
.jp-status.is-ok { background: #e6f6ec; color: #11602f; }
.jp-status.is-bad { background: #fdecee; color: #8a1f2d; }
.jp-snip { display: block; margin-top: .4rem; padding: .4rem .6rem; border-radius: 8px; background: rgba(255,255,255,.7); color: #14213d; font-size: .82rem; white-space: pre-wrap; word-break: break-all; }
.jp-goto { margin-top: .5rem; min-height: 38px; }

/* ══ JSON to HTML Table ═══════════════════════════════════════════════════════════ */
.jh-preview { margin-top: .6rem; max-height: 440px; overflow: auto; border: 1.5px solid #d6dcea; border-radius: 12px; background: #fff; }
.jh-preview:focus-visible { outline: 3px solid rgba(31, 94, 255, .35); outline-offset: 2px; }
.jh-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .88rem; }
.jh-table th, .jh-table td { border: 1px solid #e3e7ef; padding: .45rem .7rem; text-align: left; vertical-align: top; max-width: 360px; overflow-wrap: anywhere; }
.jh-table th { position: sticky; top: 0; background: #eef2fb; color: #14213d; font-weight: 700; z-index: 1; }
.jh-table tbody tr:nth-child(even) { background: #f8faff; }
.jh-table td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
#jh .wa-text-head .md-tabs { margin-bottom: 0; }

/* ══ SSL Certificate Converter ════════════════════════════════════════════════════ */
.ssl-top { margin-top: 0; }
.ssl-safety { display: flex; gap: .7rem; align-items: flex-start; margin: 1rem 0; padding: .8rem 1rem; border-radius: 12px; background: #eaf0ff; color: #1b3a8a; font-size: .88rem; line-height: 1.5; }
.ssl-safety i { margin-top: .2rem; }
.ssl-area { height: 170px; white-space: pre; overflow: auto; word-break: normal; font-size: .8rem; }
.ssl-gap { margin-top: 1rem; }
.ssl-open { min-height: 38px; padding: .3rem .9rem; font-size: .85rem; }
.ssl-drop { margin-top: 0; }
.ssl-panel[hidden] { display: none; }
.ssl-info { margin-top: 1.25rem; padding: 1rem 1.1rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #f8faff; }
.ssl-info h3 { margin: 0 0 .5rem; font-size: 1rem; color: #14213d; }
.ssl-info dl { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .35rem 1rem; margin: 0; }
.ssl-info dt { font-weight: 700; color: #5a6683; font-size: .85rem; }
.ssl-info dd { margin: 0; font-size: .88rem; color: #14213d; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .ssl-info dl { grid-template-columns: minmax(0, 1fr); gap: 0; } .ssl-info dd { margin-bottom: .55rem; } }
#ssl #sslOutBox { margin-top: 1rem; }
#ssl .x2x-actions .x2x-btn { max-width: 100%; }

/* ══ URL Parser ═══════════════════════════════════════════════════════════════════ */
.up-modes { max-width: 100%; flex-wrap: wrap; }
.up-panel { margin-top: 1.1rem; }
.up-panel[hidden] { display: none; }
.up-row { display: flex; gap: .6rem; align-items: stretch; }
.up-row input { flex: 1 1 auto; min-width: 0; }
@media (max-width: 575.98px) { .up-row { flex-direction: column; } .up-modes .x2x-seg-btn { flex: 1 1 100%; } }
.up-gap { margin-top: 1rem; }
.up-privacy { margin: .8rem 0 0; font-size: .85rem; line-height: 1.5; color: #3b4a6b; }
.up-privacy i { color: #1f5eff; margin-right: .3rem; }
.up-filters { margin-top: 1.25rem; }
.up-table-wrap { margin-top: .6rem; max-height: 480px; overflow: auto; border: 1.5px solid #d6dcea; border-radius: 12px; background: #fff; }
.up-table-wrap:focus-visible { outline: 3px solid rgba(31, 94, 255, .35); outline-offset: 2px; }
.up-table { width: 100%; min-width: 100%; }
.up-table .up-url { max-width: 520px; overflow-wrap: anywhere; word-break: break-all; }
.up-table .up-url a { color: #0a3fc2; }
.up-table tbody th { position: static; width: 11rem; background: #f3f6fd; font-size: .85rem; }
.up-table .up-none { color: #8a93a8; font-style: italic; }
.up-copy { min-height: 34px; padding: .15rem .7rem; font-size: .8rem; }
.up-h { margin: 1.25rem 0 .2rem; font-size: 1rem; color: #14213d; }
#upOneOut .md-warn { margin-bottom: .5rem; }
@media (max-width: 575.98px) { .up-table tbody th { width: 6.5rem; } }

/* Content tables that are not the reference table (e.g. in worked examples) scroll inside themselves on narrow screens */
.tool-section table:not(.ref-table):not(.jh-table) { display: block; max-width: 100%; overflow-x: auto; }

.up-consent { margin-top: .9rem; }
.up-legal { margin-top: .9rem; padding: .85rem 1rem; border-radius: 12px; background: #f3f6fd; border: 1px solid #dbe3f5; font-size: .86rem; line-height: 1.55; color: #26324d; }
.up-legal > strong { display: block; margin-bottom: .3rem; color: #14213d; }
.up-legal i { color: #1f5eff; margin-right: .3rem; }
.up-legal ul { margin: 0; padding-left: 1.2rem; }
#upTable { min-width: 560px; }
.up-row .x2x-btn { flex: 0 0 auto; white-space: nowrap; justify-content: center; }
#up .x2x-actions .x2x-btn, #up .x2x-seg-btn { white-space: nowrap; }
@media (max-width: 575.98px) { .up-modes .x2x-seg-btn { white-space: normal; } }

/* ══ Barcode Generator ════════════════════════════════════════════════════════════ */
.bc-input { font-size: 1.1rem; }
.bc-options { margin-top: 1rem; }
.bc-hint { margin: 0; padding: .65rem .85rem; border-radius: 10px; background: #f3f6fd; color: #26324d; font-size: .86rem; line-height: 1.5; min-height: 48px; }
.bc-sliders { margin-top: 1.1rem; }
.bc-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-top: 1.1rem; max-width: 420px; }
.bc-stage { margin-top: 1.25rem; }
.bc-preview { display: flex; justify-content: center; align-items: center; padding: 1rem; border: 1.5px solid #d6dcea; border-radius: 14px; background: #fff; overflow: auto; }
.bc-preview.is-clear { background: repeating-conic-gradient(#e6eaf3 0% 25%, #f8faff 0% 50%) 50% / 18px 18px; }
.bc-preview svg { max-width: 100%; height: auto; display: block; }
.bc-stage .md-stats { margin-top: .5rem; overflow-wrap: anywhere; }
.bc-scale { margin-left: auto; min-width: 170px; }
@media (max-width: 575.98px) { .bc-scale { margin-left: 0; width: 100%; } }

/* ══ Barcode Reader ═══════════════════════════════════════════════════════════════ */
.br-camera { margin-top: .75rem; }
.br-stage { margin-top: 1.1rem; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.br-result { margin-top: 1.25rem; padding: 1.1rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #f8faff; }
.br-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.br-badge { display: inline-block; padding: .25rem .8rem; border-radius: 999px; background: #1f5eff; color: #fff; font-weight: 700; font-size: .85rem; }
.br-check { display: inline-block; padding: .25rem .8rem; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.br-check.is-ok { background: #e6f6ec; color: #11602f; }
.br-check.is-bad { background: #fdecee; color: #8a1f2d; }
.br-text { height: 110px; font-size: .95rem; }
.br-result .br-text { height: 110px; min-height: 0; }   /* keeps the result box short on phones too (the shared .md-code rule makes it 300px) */

/* ══ QR Code Reader ═══════════════════════════════════════════════════════════════ */
.qr-kind { display: inline-block; padding: .25rem .8rem; border-radius: 999px; background: #e8eefc; color: #1b3a8a; font-weight: 700; font-size: .85rem; }
.qr-meta { font-size: .82rem; color: #5a6683; font-weight: 600; }
.qr-fields { margin: 0 0 1rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #fff; overflow: hidden; }
.qr-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; border-top: 1px solid #edf0f6; }
.qr-row:first-child { border-top: 0; }
.qr-row dt { margin: 0; padding: .6rem .9rem; background: #f6f8fd; color: #5a6683; font-size: .82rem; font-weight: 700; }
.qr-row dd { margin: 0; padding: .45rem .6rem .45rem .9rem; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.qr-row dd span { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #14213d; font-weight: 600; }
.qr-copy { flex: none; width: 38px; height: 38px; border: 1.5px solid #d6dcea; border-radius: 10px; background: #fff; color: #1f5eff; cursor: pointer; }
.qr-copy:hover, .qr-copy:focus-visible { background: #1f5eff; border-color: #1f5eff; color: #fff; outline: none; }
.br-result .qr-text { height: 120px; min-height: 0; }
@media (max-width: 575.98px) {
  .qr-row { grid-template-columns: 1fr; }
  .qr-row dt { padding: .45rem .9rem .2rem; background: transparent; }
  .qr-row dd { padding-top: 0; }
}

/* ══ Text Analyzer ════════════════════════════════════════════════════════════════ */
.ta-area { height: 260px; min-height: 0; resize: vertical; }
.ta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-top: 1.1rem; }
.ta-grid-small { grid-template-columns: repeat(6, 1fr); margin-top: .6rem; }
.ta-card { padding: .8rem .9rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #f8faff; min-width: 0; }
.ta-card b { display: block; font-size: 1.35rem; line-height: 1.2; color: #14213d; overflow-wrap: anywhere; }
.ta-card span { display: block; margin-top: .2rem; font-size: .78rem; font-weight: 700; color: #5a6683; line-height: 1.3; }
.ta-card em { font-style: normal; font-weight: 500; }
.ta-card.is-main { background: #eef3ff; border-color: #cddafc; }
.ta-card.is-main b { font-size: 1.7rem; color: #1f5eff; }
.ta-h { margin: 1.4rem 0 0; font-size: 1.05rem; font-weight: 800; color: #14213d; }
.ta-limit { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; margin-top: .6rem; }
.ta-limit .x2x-field { flex: 1 1 220px; max-width: 320px; }
.ta-meter { height: 12px; margin-top: .8rem; border-radius: 999px; background: #e6eaf3; overflow: hidden; }
.ta-meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: #1f5eff; transition: width .15s; }
.ta-meter.is-warn i { background: #e69500; }
.ta-meter.is-over i { background: #d63a4a; }
.ta-meter-text { margin-top: .4rem; font-size: .9rem; font-weight: 700; color: #26324d; }
.ta-top-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .4rem 1.2rem; }
.ta-top-head .fc-option { margin-top: 1rem; }
.ta-top { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.ta-top li { display: grid; grid-template-columns: minmax(80px, 28%) 1fr auto; gap: .7rem; align-items: center; padding: .4rem .7rem; border: 1px solid #e3e7ef; border-radius: 10px; background: #fff; }
.ta-top .ta-w { font-weight: 700; color: #14213d; overflow-wrap: anywhere; }
.ta-top .ta-bar { height: 8px; border-radius: 999px; background: #e6eaf3; overflow: hidden; }
.ta-top .ta-bar i { display: block; height: 100%; background: #1f5eff; border-radius: 999px; }
.ta-top .ta-n { font-size: .82rem; font-weight: 700; color: #5a6683; white-space: nowrap; }
.ta-top li.ta-empty { display: block; border-style: dashed; color: #5a6683; font-size: .9rem; }
@media (max-width: 991.98px) { .ta-grid-small { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767.98px) { .ta-grid { grid-template-columns: repeat(2, 1fr); } .ta-card b { font-size: 1.2rem; } .ta-card.is-main b { font-size: 1.45rem; } }
@media (max-width: 575.98px) { .ta-area { height: 220px; } .ta-grid-small { grid-template-columns: repeat(2, 1fr); } .ta-top li { grid-template-columns: 1fr auto; } .ta-top .ta-bar { grid-column: 1 / -1; grid-row: 2; } .ta-limit .x2x-field { max-width: none; } }

/* ══ Text to Image ════════════════════════════════════════════════════════════════ */
.ti-area { height: 150px; min-height: 0; resize: vertical; }
.ti-text-actions { margin-top: .6rem; }
.ti-stage canvas { background: #fff; box-shadow: 0 2px 14px rgba(20, 33, 61, .14); }
.ti-stage.ti-checker { background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.ti-stage.ti-checker canvas { background: transparent; }
.ti-styles { display: flex; gap: 1.5rem; flex-wrap: wrap; min-height: 48px; align-items: center; }
.ti-opt { margin-top: 0; }
.vi-bg .ti-opt { margin-left: .4rem; }
@media (max-width: 575.98px) { .ti-area { height: 130px; } }
.x2x-field label.ti-opt { display: flex; align-items: center; gap: .5rem; margin: 0; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 600; color: #3b4a6b; }
.x2x-field label.ti-opt input { margin-top: 0; }

/* ══ Text to QR Code ══════════════════════════════════════════════════════════════ */
.tq-type { max-width: 420px; }
.tq-forms { margin-top: 1rem; }
.tq-area { height: 130px; min-height: 0; resize: vertical; }
.tq-form.pj-options { margin-top: 0; }
.tq-wide { grid-column: 1 / -1; }
.tq-form .x2x-field textarea { min-height: 0; }
.x2x-field label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tq-stage canvas { image-rendering: pixelated; background: #fff; box-shadow: 0 2px 14px rgba(20, 33, 61, .14); }
.tq-stage.ti-checker canvas { background: transparent; }
.tq-content { margin-top: 1.25rem; }
.tq-content .tq-payload { height: 110px; min-height: 0; }
@media (max-width: 575.98px) { .tq-area { height: 110px; } .tq-type { max-width: none; } }
.tq-logo { margin-top: 1.25rem; padding: 1.1rem; border: 1.5px dashed #c5d2f0; border-radius: 14px; background: #fbfcff; }
.tq-logo .md-label { margin-bottom: .6rem; }
.tq-logo-actions { align-items: center; }
.tq-logo-name { font-size: .85rem; color: #5a6683; overflow-wrap: anywhere; min-width: 0; }
.tq-logo-opts { margin-top: 1rem; }
.tq-logo-check { margin-top: .9rem; padding: .7rem 1rem; border-radius: 12px; font-size: .9rem; font-weight: 600; line-height: 1.45; background: #eef1f8; color: #26324d; }
.tq-logo-check.is-ok { background: #e6f6ec; color: #11602f; }
.tq-logo-check.is-warn { background: #fff6e0; color: #7a5200; }
.tq-logo-check.is-bad { background: #fdecee; color: #8a1f2d; }

/* ══ Text to Speech ═══════════════════════════════════════════════════════════════ */
.ts-now { margin: .5rem 0 0; padding: .55rem .8rem; border-left: 4px solid #1f5eff; background: #f3f6ff; border-radius: 0 10px 10px 0; font-size: .92rem; color: #26324d; overflow-wrap: anywhere; }
.ts-match-btn { margin-left: .5rem; min-height: 40px; }
#ts .md-warn { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* ══ Bank Deduction Calculator ════════════════════════════════════════════════════ */
.fp-help { margin: .6rem 0 0; font-size: .9rem; color: #5a6683; }
.fp-modes { width: 100%; max-width: 640px; }
.fp-modes .x2x-seg-btn { flex: 1 1 0; white-space: normal; text-align: center; }
.fp-inputs { margin-top: 1.1rem; }
.fp-inputs [hidden] { display: none; }
.fp-empty { margin-top: 1.1rem; padding: 1rem; border: 1.5px dashed #d6dcea; border-radius: 12px; color: #5a6683; text-align: center; font-weight: 600; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-top: 1.1rem; }
.fp-card { padding: .9rem 1rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #f8faff; min-width: 0; }
.fp-card span { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #5a6683; }
.fp-card b { display: block; margin-top: .25rem; font-size: 1.45rem; line-height: 1.2; color: #14213d; overflow-wrap: anywhere; }
.fp-card.is-main b { color: #1f5eff; }
.fp-card.is-fee { background: #fdf3f4; border-color: #f2cdd2; }
.fp-card.is-fee b { color: #b3263a; }
.fp-card.is-ok { background: #eaf7ef; border-color: #bfe3cc; }
.fp-card.is-ok b { color: #11602f; }
.fp-keep { margin: .9rem 0 0; font-weight: 600; color: #26324d; }
.fp-small { margin: .7rem 0 0; font-size: .82rem; color: #5a6683; }
#fp .md-warn, #bt .md-warn, #pc .md-warn, #pi .md-warn { margin-top: .9rem; }
@media (max-width: 575.98px) { .fp-inputs { grid-template-columns: 1fr 1fr; } .fp-inputs .x2x-field:not(.fp-half) { grid-column: 1 / -1; } .fp-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } .fp-card { padding: .75rem .8rem; } .fp-card b { font-size: 1.15rem; } .fp-modes .x2x-seg-btn { padding-left: .35rem; padding-right: .35rem; font-size: .82rem; } .fp-modes .x2x-seg-btn i { display: none; } }
/* Percentage Calculator (CalculatePercentage): six calculation buttons wrap into rows */
.pc-modes { width: 100%; max-width: 760px; flex-wrap: wrap; }
.pc-modes .x2x-seg-btn { flex: 1 1 30%; white-space: normal; text-align: center; }
@media (max-width: 575.98px) { .pc-modes .x2x-seg-btn { flex-basis: 45%; padding-left: .4rem; padding-right: .4rem; font-size: .82rem; } }
/* Zakat Calculator: three numbered cards with aligned grids */
#zk [hidden] { display: none !important; }
#zk .md-warn { margin-top: 0; }
.zk-card { margin-top: 1rem; padding: 1.1rem 1.2rem 1.2rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #fff; }
.zk-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.zk-head h3 { margin: 0; font-size: 1.1rem; line-height: 1.25; color: #14213d; }
.zk-head p { margin: .15rem 0 0; font-size: .85rem; color: #5a6683; }
.zk-num { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #1f5eff; color: #fff; font-weight: 700; font-size: .95rem; }
.zk-num.is-ok { background: #11602f; }
.zk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; align-items: end; }
.zk-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zk-grid .x2x-field { margin: 0; min-width: 0; }
.zk-grid .x2x-field > label { display: block; margin-bottom: .35rem; min-height: 1.25em; }
.zk-grid input, .zk-grid select { width: 100%; box-sizing: border-box; }
.zk-in { position: relative; display: block; }
.zk-pre, .zk-suf { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-weight: 700; color: #5a6683; pointer-events: none; font-size: .95rem; }
.zk-pre { left: .8rem; }
.zk-suf { right: .9rem; }
.zk-money.has-pre input { padding-left: 2.6rem; }
.zk-money.has-pre.is-long input { padding-left: 3.6rem; }
.zk-in:has(.zk-suf) input { padding-right: 2.2rem; }
.zk-note { margin: .9rem 0 0; font-size: .85rem; line-height: 1.5; color: #5a6683; }
.zk-hawl { margin-top: 1rem; padding: .8rem .9rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #f8faff; }
.zk-out { border-color: #bfe3cc; background: #fbfefc; }
.zk-out .fp-grid { margin-top: 0; }
.fp-card.zk-main { border-width: 2px; }
@media (max-width: 767.98px) { .zk-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .zk-grid.is-3 .x2x-field:first-child { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .zk-card { padding: .9rem .85rem 1rem; } .zk-grid, .zk-grid.is-3 { grid-template-columns: 1fr; gap: .85rem; } .zk-grid.is-3 .x2x-field:first-child { grid-column: auto; } }
#zk .ts-wrapper { width: 100%; }
#zk .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; }
.zk-head > div { text-align: left; min-width: 0; }
.zk-head h3, .zk-head p { text-align: left; }
.fp-card.zk-main { grid-column: 1 / -1; text-align: center; padding: 1.1rem 1rem; }
.fp-card.zk-main b { font-size: 2rem; }
/* Chest & Clothing Size Calculator */
.cs-seg .x2x-seg-btn { min-height: 48px; }
.cs-seg { width: 100%; }
.cs-seg .x2x-seg-btn { flex: 1 1 0; white-space: normal; text-align: center; }
#cs .md-warn { margin-top: 0; }
#cs [hidden] { display: none !important; }
/* Chest calculator: photo slots */
.zk-head h3 small { font-weight: 600; color: #5a6683; font-size: .8em; }
/* Chest calculator: tidy top selectors (one line each, equal height) */
#cs .md-warn { margin-bottom: 1.1rem; }
.cs-seg { display: flex; box-sizing: border-box; }
.cs-seg .x2x-seg-btn { flex: 1 1 0; min-width: 0; min-height: 48px; white-space: nowrap; padding-left: .5rem; padding-right: .5rem; }
/* Color Converter */
#cc [hidden] { display: none !important; }
.cc-pick { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.2rem; align-items: end; }
.cc-picker { position: relative; display: block; width: 110px; height: 88px; margin: 0; cursor: pointer; }
.cc-picker input { width: 100%; height: 100%; padding: 0; border: 2px solid #e3e7ef; border-radius: 14px; background: none; cursor: pointer; }
.cc-picker-ico { position: absolute; left: 0; right: 0; bottom: -.1rem; transform: translateY(100%); text-align: center; font-size: .8rem; font-weight: 700; color: #5a6683; }
.cc-pick { padding-bottom: 1.2rem; }
.cc-any { margin: 0; min-width: 0; }
.cc-any input { width: 100%; box-sizing: border-box; }
.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; align-items: start; }
.cc-grid .x2x-field { margin: 0; min-width: 0; }
.cc-grid .x2x-field > label { display: block; margin-bottom: .35rem; }
.cc-grid label small { font-weight: 600; text-transform: none; letter-spacing: 0; color: #5a6683; }
.cc-row { display: flex; gap: .5rem; align-items: stretch; }
.cc-row input { flex: 1 1 auto; min-width: 0; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cc-copy { flex: 0 0 auto; min-width: 48px; padding-left: .8rem; padding-right: .8rem; }
.cc-err { margin-top: .4rem; font-size: .85rem; line-height: 1.4; color: #b3263a; }
.cc-prev { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.1rem; align-items: stretch; }
.cc-swatch { min-height: 150px; border-radius: 14px; border: 1.5px solid #e3e7ef; overflow: hidden; background-color: #fff; background-image: linear-gradient(45deg, #d7dbe6 25%, transparent 25%), linear-gradient(-45deg, #d7dbe6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d7dbe6 75%), linear-gradient(-45deg, transparent 75%, #d7dbe6 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.cc-swatch-col { display: block; width: 100%; height: 100%; min-height: 150px; }
.cc-contrast { display: grid; gap: .7rem; min-width: 0; }
.cc-crow { display: flex; gap: .8rem; align-items: center; padding: .7rem .8rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #f8faff; min-width: 0; }
.cc-sample { flex: 0 0 auto; width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 700; font-size: 1.3rem; border: 1px solid #d6dcea; }
.cc-cinfo { min-width: 0; }
.cc-cinfo b { display: block; color: #14213d; }
.cc-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.cc-chip { padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.cc-chip.is-pass { background: #eaf7ef; color: #11602f; }
.cc-chip.is-fail { background: #fdf3f4; color: #b3263a; }
.cc-best { margin: 0; font-size: .88rem; color: #5a6683; }
.cc-sets { display: grid; gap: 1rem; }
.cc-set-title { margin-bottom: .4rem; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #5a6683; }
.cc-set-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.cc-chipcolor { flex: 1 1 88px; min-width: 88px; min-height: 52px; padding: .3rem .4rem; border: 1.5px solid rgba(0,0,0,.12); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 700; cursor: pointer; }
.cc-chipcolor:focus-visible { outline: 3px solid #1f5eff; outline-offset: 2px; }
#cc .md-warn { margin-top: 1rem; }
@media (max-width: 767.98px) { .cc-prev { grid-template-columns: 1fr; } .cc-swatch, .cc-swatch-col { min-height: 110px; } }
@media (max-width: 575.98px) { .cc-pick { grid-template-columns: 1fr; } .cc-picker { width: 100%; height: 64px; } .cc-picker-ico { display: none; } .cc-pick { padding-bottom: 0; } .cc-grid { grid-template-columns: 1fr; } .cc-chipcolor { flex-basis: 30%; min-width: 0; } }
@media (max-width: 575.98px) { .cc-row input { font-size: .82rem; padding-left: .6rem; padding-right: .4rem; } .cc-copy { min-width: 44px; padding-left: .6rem; padding-right: .6rem; } }
@media (max-width: 575.98px) {
  .cc-grid .x2x-field { position: relative; }
  .cc-row input { width: 100%; font-size: .76rem; padding-left: .55rem; padding-right: .35rem; }
  .cc-copy { position: absolute; top: -.35rem; right: 0; min-width: 40px; height: 34px; min-height: 34px; padding: 0 .5rem; }
}
@media (max-width: 575.98px) { .cc-row input { font-size: .72rem; } }
@media (max-width: 575.98px) { #cc .cc-row input { font-family: inherit; letter-spacing: -.01em; } }
/* Data Size Converter (memory-converter) */
#dm [hidden] { display: none !important; }
#dm .md-warn { margin-top: 1rem; }
.dm-value { margin: 0 0 1rem; }
.dm-value input { width: 100%; max-width: 420px; box-sizing: border-box; }
.dm-units { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; align-items: end; }
.dm-units .x2x-field { margin: 0; min-width: 0; }
.dm-units .x2x-field > label { display: block; margin-bottom: .35rem; }
.dm-swap { min-width: 48px; height: 48px; padding: 0; justify-content: center; }
.dm-opts { display: flex; gap: 1rem 1.4rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.dm-dec { margin: 0; }
.dm-dec input { width: 120px; }
.dm-opt-note { margin: 0; flex: 1 1 240px; }
.dm-main { padding: 1rem; border: 2px solid #bfe3cc; border-radius: 12px; background: #eaf7ef; text-align: center; }
.dm-eq { font-size: 1.6rem; font-weight: 800; line-height: 1.3; color: #11602f; overflow-wrap: anywhere; }
.dm-exact { margin-top: .35rem; font-size: .82rem; font-weight: 700; }
.dm-exact.is-exact { color: #11602f; }
.dm-exact.is-round { color: #8a5a00; }
.dm-words { margin-top: .9rem; padding: .8rem 1rem; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #f8faff; }
.dm-words span { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6683; }
.dm-words p { margin: .25rem 0 0; font-style: italic; color: #26324d; overflow-wrap: anywhere; }
.dm-all { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1.4rem; }
.dm-group-title { margin-bottom: .45rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5a6683; }
.dm-row { display: flex; width: 100%; justify-content: space-between; gap: .8rem; align-items: baseline; margin: 0 0 .3rem; padding: .5rem .7rem; border: 1.5px solid #e3e7ef; border-radius: 10px; background: #fff; text-align: left; cursor: pointer; color: #14213d; font-size: .9rem; }
.dm-row:hover { background: #f3f6ff; border-color: #c6d3f5; }
.dm-row.is-to { border-color: #1f5eff; background: #eef4ff; }
.dm-row.is-from { border-color: #bfe3cc; background: #f3fbf6; }
.dm-row-name { flex: 0 1 auto; min-width: 0; font-weight: 600; }
.dm-row-val { flex: 1 1 auto; min-width: 0; text-align: right; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
@media (max-width: 767.98px) { .dm-all { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) { .dm-units { grid-template-columns: 1fr; } .dm-swap { justify-self: center; transform: rotate(90deg); } .dm-eq { font-size: 1.25rem; } .dm-row { flex-direction: column; gap: .15rem; } .dm-row-val { text-align: left; } }
#dm .ts-wrapper { width: 100%; }
#dm .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#dm .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#dm .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#dc [hidden] { display: none !important; }
#dc .md-warn { margin-top: 1rem; }
#dc .ts-wrapper { width: 100%; }
#dc .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#dc .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#dc .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Shoe Size Converter */
#ss [hidden] { display: none !important; }
#ss .md-warn { margin-top: 0; margin-bottom: 1rem; }
.ss-scale { margin: 0 0 1rem; }
.ss-seg { display: flex; width: 100%; max-width: 520px; }
.ss-seg .x2x-seg-btn { flex: 1 1 0; min-width: 0; min-height: 48px; }
.ss-scale .zk-note { margin-top: .6rem; }
.ss-adv { margin-top: 1rem; border: 1.5px solid #e3e7ef; border-radius: 12px; padding: .1rem .9rem; background: #f8faff; }
.ss-adv summary { cursor: pointer; padding: .7rem 0; font-weight: 700; color: #26324d; }
.ss-allow { margin: 0 0 .9rem; max-width: 420px; }
.ss-allow input { width: 100%; box-sizing: border-box; }
.fp-card .ss-sub { display: block; margin-top: .2rem; font-size: .78rem; font-weight: 600; color: #5a6683; text-transform: none; letter-spacing: 0; }
#tc [hidden] { display: none !important; }
#tc .md-warn { margin-top: 1rem; }
#tc .ts-wrapper { width: 100%; }
#tc .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#tc .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#tc .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tc-quick { margin-top: 1rem; }
.tc-quick-title { display: block; margin-bottom: .45rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5a6683; }
.tc-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.tc-chip { padding: .4rem .8rem; border: 1.5px solid #d6dcea; border-radius: 999px; background: #fff; color: #26324d; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tc-chip:hover { background: #f3f6ff; border-color: #1f5eff; }
.tc-chip:focus-visible { outline: 3px solid #1f5eff; outline-offset: 2px; }
#wc [hidden] { display: none !important; }
#wc .md-warn { margin-top: 1rem; }
#wc .ts-wrapper { width: 100%; }
#wc .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#wc .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#wc .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Currency Unit Converter (number magnitudes) */
#cu [hidden] { display: none !important; }
#cu .md-warn { margin-top: 1rem; }
#cu .ts-wrapper { width: 100%; }
#cu .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#cu .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#cu .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cu-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.1rem; align-items: start; margin-top: 1rem; }
.cu-opts .x2x-field { margin: 0; min-width: 0; }
.cu-opts .x2x-field > label { display: block; margin-bottom: .35rem; }
.cu-opts label small { font-weight: 600; text-transform: none; letter-spacing: 0; color: #5a6683; }
.cu-opts input[type=number] { width: 100%; box-sizing: border-box; }
.cu-seg { display: flex; width: 100%; }
.cu-seg .x2x-seg-btn { flex: 1 1 0; min-width: 0; min-height: 40px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 767.98px) { .cu-opts { grid-template-columns: 1fr 1fr; } .cu-opts .x2x-field:first-child { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .cu-opts { grid-template-columns: 1fr; } .cu-opts .x2x-field:first-child { grid-column: auto; } }
/* JSON Stringify */
#jx [hidden] { display: none !important; }
#jx .md-pane { margin-top: 1rem; }
.jx-lead { margin: .9rem 0 0; }
.jx-options { margin-top: 1rem; align-items: start; }
.jx-checks { grid-column: 1 / -1; display: grid; gap: .1rem; }
.jx-checks .fc-option { margin-top: .6rem; }
.jx-options .x2x-field { margin: 0; }
/* Image Resizer */
#rs [hidden] { display: none !important; }
#rs .md-warn { margin-top: 1rem; }
#rs .ts-wrapper { width: 100%; }
#rs .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#rs .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#rs .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rs-orig { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; padding: .7rem .9rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #fff; }
.rs-orig img { flex: 0 0 auto; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid #e3e7ef; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 12px 12px; }
.rs-orig-info { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rs-orig-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #14213d; }
.rs-orig-info span { font-size: .85rem; color: #5a6683; }
#rs .zk-card { margin-top: 1rem; }
.rs-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-lock { margin: 1rem 0 0; }
.rs-more { margin-top: 1rem; }
.rs-tran { margin: 0; }
.rs-stage { position: relative; height: 340px; background: repeating-conic-gradient(#eceff6 0% 25%, #f7f9fd 0% 50%) 50% / 20px 20px; }
.rs-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #5a6683; background: rgba(248, 250, 255, .6); }
@media (max-width: 575.98px) { .rs-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rs-grid3 .x2x-field:last-child { grid-column: 1 / -1; } .rs-orig { flex-wrap: wrap; } .rs-stage { height: 260px; } }
@media (max-width: 575.98px) { .rs-orig .x2x-btn { flex: 1 1 100%; justify-content: center; } .rs-orig-info { flex-basis: calc(100% - 90px); } }
/* Invoice & Quotation Generator */
#iv [hidden] { display: none !important; }
#iv .zk-card { margin-top: 1rem; }
#iv .ts-wrapper { width: 100%; }
#iv .ts-wrapper .ts-control { min-height: 48px; box-sizing: border-box; align-items: center; flex-wrap: nowrap; }
#iv .ts-wrapper .ts-control > input { min-width: 0; flex: 1 1 30px; }
#iv .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#iv .x2x-field input, #iv .x2x-field select, #iv .x2x-field textarea { width: 100%; box-sizing: border-box; }
.iv-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.iv-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.iv-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border: 1.5px solid #e3e7ef; border-radius: 999px; background: #fff; color: #14213d; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
.iv-tab:hover { border-color: #1f5eff; color: #0a3fc2; }
.iv-tab.is-active { background: #1f5eff; border-color: #1f5eff; color: #fff; }
.iv-count:not(:empty) { background: rgba(20, 33, 61, .1); border-radius: 999px; padding: 0 .5rem; font-size: .8rem; }
.iv-tab.is-active .iv-count:not(:empty) { background: rgba(255, 255, 255, .25); }
.iv-store { font-size: .85rem; color: #5a6683; }
.iv-store.is-warn { color: #b3261e; font-weight: 700; }
#ivMsg { margin-top: .8rem; }
.iv-typefield { margin-bottom: .9rem; }
.iv-seg { display: inline-flex; flex-wrap: wrap; }
.iv-seg .x2x-seg-btn:disabled:not(.is-active) { opacity: .45; cursor: not-allowed; }
.iv-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iv-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iv-wide { grid-column: 1 / -1; }
#iv .iv-wide { margin-top: .9rem; }
#iv .zk-grid .iv-wide { margin-top: 0; }
#iv .x2x-field small { font-weight: 400; color: #5a6683; }
.iv-line { border: 1.5px solid #e3e7ef; border-radius: 12px; padding: .8rem; margin-bottom: .8rem; background: #fafbff; }
.iv-line-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.iv-line-no { font-weight: 800; color: #14213d; }
.iv-line-tools { display: flex; gap: .3rem; }
.iv-ibtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1.5px solid #e3e7ef; border-radius: 10px; background: #fff; color: #14213d; cursor: pointer; flex: 0 0 auto; }
.iv-ibtn:hover { border-color: #1f5eff; color: #0a3fc2; }
.iv-ibtn-danger:hover { border-color: #b3261e; color: #b3261e; }
.iv-line-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; gap: .7rem; align-items: end; }
.iv-line-grid .iv-lf { margin: 0; min-width: 0; }
.iv-ltax { grid-column: 1 / -1; margin: 0; }
.iv-line-dlabel { margin: .8rem 0 .3rem; font-weight: 700; font-size: .9rem; }
.iv-line-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .7rem; padding-top: .6rem; border-top: 1px dashed #d4daea; }
.iv-line-total { font-size: 1.05rem; color: #14213d; }
.iv-line-actions { margin-top: .6rem; }
.iv-itempick { margin-top: .8rem; padding: .8rem; border: 1.5px solid #e3e7ef; border-radius: 12px; }
.iv-itempick > input { width: 100%; box-sizing: border-box; }
.iv-results { margin-top: .6rem; display: grid; gap: .4rem; max-height: 320px; overflow: auto; }
.iv-result { display: flex; flex-direction: column; text-align: left; gap: .1rem; padding: .55rem .75rem; border: 1.5px solid #e3e7ef; border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: #14213d; }
.iv-result:hover { border-color: #1f5eff; background: #f3f6ff; }
.iv-result-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.iv-result-m { font-size: .82rem; color: #5a6683; }
.iv-empty { color: #5a6683; margin: .8rem 0; }
.iv-sub { margin: 1.2rem 0 .5rem; font-size: 1rem; color: #14213d; }
.iv-sub small { font-weight: 400; color: #5a6683; }
.iv-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1fr) auto auto; gap: .6rem; align-items: center; margin-bottom: .55rem; }
.iv-row-tax { grid-template-columns: minmax(0, 1fr) 130px auto; }
.iv-row input, .iv-row select { width: 100%; box-sizing: border-box; min-width: 0; }
.iv-rowtax { margin: 0; white-space: nowrap; }
.iv-pct { display: flex; align-items: center; gap: .3rem; }
.iv-add { margin-top: .2rem; }
.iv-summary { margin-top: 1.2rem; display: flex; justify-content: flex-end; }
.iv-sum { width: 100%; max-width: 380px; border-collapse: collapse; }
.iv-sum th { text-align: left; font-weight: 600; padding: .35rem 0; color: #5a6683; }
.iv-sum td { text-align: right; padding: .35rem 0; font-variant-numeric: tabular-nums; font-weight: 700; color: #14213d; }
.iv-sum-total th, .iv-sum-total td { border-top: 2px solid #14213d; color: #14213d; font-size: 1.1rem; }
.iv-terms-actions { margin-top: .6rem; }
.iv-previewbar { display: flex; gap: 1rem; margin-bottom: .8rem; }
.iv-paperfield { max-width: 200px; }
.iv-previewwrap { position: relative; overflow: hidden; border: 1.5px solid #e3e7ef; border-radius: 12px; background: #eef1f8; }
.iv-preview { position: absolute; top: 0; left: 0; }
.iv-main-actions { margin-top: 1rem; }
.iv-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .7rem 0; padding: .7rem .9rem; border: 1.5px solid #f0b4b0; border-radius: 12px; background: #fff4f3; color: #7a1c16; }
.iv-confirm span { flex: 1 1 260px; }
.x2x-btn.iv-danger { background: #b3261e; border-color: #b3261e; }
.x2x-btn.iv-danger:hover { background: #8e1d17; box-shadow: 0 6px 16px rgba(179, 38, 30, .3); }
.iv-hrow { padding: .75rem .9rem; border: 1.5px solid #e3e7ef; border-radius: 12px; margin-top: .6rem; background: #fff; }
.iv-hrow-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.iv-hnum { color: #14213d; min-width: 0; overflow-wrap: anywhere; }
.iv-hwrap { font-weight: 600; }
.iv-hmeta { font-size: .88rem; color: #5a6683; margin-top: .25rem; overflow-wrap: anywhere; }
.iv-hacts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.iv-hacts .x2x-btn { padding: .45rem .8rem; font-size: .88rem; }
.iv-badge { font-size: .75rem; font-weight: 800; letter-spacing: .02em; padding: .15rem .55rem; border-radius: 999px; background: #e6edff; color: #0a3fc2; }
.iv-badge-quotation { background: #fff1d6; color: #8a5a00; }
.iv-badge-s { background: #eef1f8; color: #44506e; }
.iv-listbar { display: flex; flex-wrap: wrap; gap: .6rem; }
.iv-listbar input { flex: 1 1 220px; min-width: 0; box-sizing: border-box; }
.iv-form { margin: 1rem 0; padding: 1rem; border: 1.5px solid #cdd8f5; border-radius: 12px; background: #f7f9ff; }
.iv-form .x2x-field { margin: 0; }
.iv-form > .x2x-field, .iv-form > .fc-option, .iv-form > .zk-grid { margin-bottom: .8rem; }
.iv-logo-box { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }
.iv-logo-prev { width: 200px; height: 100px; border: 1.5px dashed #c5cde3; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #fff; color: #7a86a3; overflow: hidden; }
.iv-logo-prev img { max-width: 100%; max-height: 100%; }
.iv-logo-btns { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 240px; }
.iv-hint { color: #5a6683; font-size: .88rem; margin: .3rem 0; flex-basis: 100%; }
/* rich text editor */
.rt-box { border: 1.5px solid #cfd6e6; border-radius: 12px; background: #fff; overflow: hidden; }
.rt-box:focus-within { border-color: #1f5eff; box-shadow: 0 0 0 3px rgba(31, 94, 255, .15); }
.rt-bar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .35rem; border-bottom: 1px solid #e3e7ef; background: #f4f6fb; }
.rt-btn { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #14213d; cursor: pointer; }
.rt-btn:hover { background: #e3e9fb; }
.rt-btn.is-on { background: #1f5eff; color: #fff; }
.rt-area { padding: .7rem .8rem; min-height: 5em; outline: none; line-height: 1.5; overflow-wrap: anywhere; color: #14213d; }
.rt-area:empty::before { content: attr(data-placeholder); color: #8a94ad; }
.rt-area p { margin: 0 0 .5em; } .rt-area ul, .rt-area ol { margin: 0 0 .5em 1.3em; padding: 0; }
.rt-url { display: flex; gap: .4rem; padding: .4rem; border-bottom: 1px solid #e3e7ef; }
.rt-url-in { flex: 1 1 auto; min-width: 0; }
/* the document (preview, print and PDF) */
.iv-paper { box-sizing: border-box; background: #fff; color: #1b1f2a; padding: 48px 52px; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.45; text-align: left; }
.iv-paper * { box-sizing: border-box; }
.iv-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.iv-from { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.iv-logo { display: block; max-width: 200px; max-height: 90px; margin-bottom: 10px; }
.iv-company { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.iv-meta { flex: 0 0 auto; max-width: 48%; text-align: right; }
.iv-title { font-size: 28px; font-weight: 800; letter-spacing: .04em; color: #1f3a8a; margin-bottom: 8px; overflow-wrap: anywhere; }
.iv-meta-table { margin-left: auto; border-collapse: collapse; }
.iv-meta-table th { text-align: right; padding: 1px 10px 1px 0; color: #5a6683; font-weight: 600; }
.iv-meta-table td { text-align: right; padding: 1px 0; font-weight: 700; overflow-wrap: anywhere; }
.iv-to { margin-bottom: 24px; overflow-wrap: anywhere; }
.iv-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5a6683; margin-bottom: 4px; }
.iv-cname { font-weight: 700; font-size: 15px; }
.iv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.iv-table th { background: #1f3a8a; color: #fff; padding: 8px 8px; font-size: 12px; }
.iv-table td { padding: 8px; border-bottom: 1px solid #dfe3ee; vertical-align: top; }
.iv-table th.iv-num, .iv-table td.iv-num { width: 34px; text-align: center; }
.iv-table th.iv-right, .iv-table td.iv-right { text-align: right; width: 16%; white-space: normal; overflow-wrap: anywhere; }
.iv-table th.iv-left, .iv-table td.iv-left { text-align: left; }
.iv-amt { font-weight: 700; }
.iv-desc { overflow-wrap: anywhere; }
.iv-rich p { margin: 0 0 .4em; } .iv-rich ul, .iv-rich ol { margin: 0 0 .4em 1.3em; padding: 0; } .iv-rich a { color: #1f3a8a; }
.iv-foot-note { margin-top: 6px; font-size: 11px; color: #5a6683; }
.iv-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.iv-totals-table { min-width: 280px; border-collapse: collapse; }
.iv-totals-table th { text-align: left; padding: 4px 16px 4px 0; font-weight: 600; color: #44506e; }
.iv-totals-table td { text-align: right; padding: 4px 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.iv-totals-table .iv-grand th, .iv-totals-table .iv-grand td { border-top: 2px solid #1b1f2a; padding-top: 8px; font-size: 16px; color: #1b1f2a; }
.iv-block { margin-top: 22px; overflow-wrap: anywhere; }
.iv-footer { margin-top: 28px; padding-top: 10px; border-top: 1px solid #dfe3ee; text-align: center; color: #5a6683; font-size: 12px; }
.iv-pdf-stage { position: absolute; left: -10000px; top: 0; }
@media (max-width: 767.98px) { .iv-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .iv-lmode { grid-column: 1 / -1; } .iv-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .iv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .iv-row > :first-child { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .iv-g2, .iv-g3 { grid-template-columns: 1fr; } .iv-tab { padding: .5rem .7rem; font-size: .86rem; } .iv-sum { max-width: none; } .iv-logo-prev { width: 100%; } }
@media print {
  body.iv-printing > *:not(#ivPrintRoot) { display: none !important; }
  body.iv-printing { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  #ivPrintRoot { display: block !important; }
  #ivPrintRoot .iv-paper { width: 100% !important; min-height: 0 !important; padding: 0 !important; transform: none !important; }
  #ivPrintRoot .iv-table thead { display: table-header-group; }
  #ivPrintRoot [data-pb] { break-inside: avoid; page-break-inside: avoid; }
  #ivPrintRoot .iv-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 767.98px) { .iv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .iv-row-tax { grid-template-columns: minmax(0, 1fr) auto; } .iv-row-tax > :first-child { grid-column: 1 / -1; } .iv-rowtax { white-space: normal; } .iv-row > .iv-ibtn { justify-self: end; } }
.iv-rowtax { display: flex; align-items: center; justify-content: flex-start; gap: .5rem; padding: .4rem .2rem; }
.iv-rowtax input { width: auto; flex: 0 0 auto; }
.iv-row .iv-rowtax input, .iv-line-grid .iv-ltax input { width: 18px; flex: 0 0 18px; }
#iv .x2x-field input[type=date] { width: 100%; min-height: 48px; border: 1.5px solid #d6dcea; border-radius: 12px; background: #f8faff; color: #14213d; padding: .6rem 1rem; font: inherit; font-size: 1rem; box-sizing: border-box; -webkit-appearance: none; appearance: none; display: block; }
#iv .x2x-field input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
#iv .x2x-field input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
#iv .x2x-field input[type=date]:focus { outline: none; border-color: #1f5eff; background: #fff; box-shadow: 0 0 0 4px rgba(31, 94, 255, .14); }
#iv .iv-lmode select { width: 100%; }
.iv-newtop { padding: .5rem .95rem; font-size: .92rem; }
.iv-topbar { margin-bottom: .2rem; }
/* Category pages */
.cat-head h1 { font-size: 2rem; font-weight: 800; color: #14213d; margin-bottom: .6rem; overflow-wrap: anywhere; }
.cat-icon { margin-right: .25rem; }
.cat-intro { color: #3b4a6b; font-size: 1.05rem; max-width: 820px; }
.cat-tool, .cat-blog { display: flex; flex-direction: column; gap: .35rem; border: 1.5px solid #e3e7ef; border-radius: 14px; background: #fff; color: #14213d; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-tool:hover, .cat-blog:hover { border-color: var(--cat-accent, #1f5eff); box-shadow: 0 8px 22px rgba(20, 33, 61, .1); transform: translateY(-2px); color: #14213d; }
.cat-tool-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: #eef3ff; color: var(--cat-accent, #1f5eff); font-size: 1.1rem; }
.cat-tool-name { font-weight: 800; font-size: 1.05rem; }
.cat-tool-desc, .cat-blog-desc { color: #5a6683; font-size: .92rem; }
.cat-tool-desc p { margin: 0; }
.cat-blog-title { font-weight: 700; }
.cat-blog-title i { color: var(--cat-accent, #1f5eff); margin-right: .3rem; }
.cat-content { max-width: 860px; }
.cat-content h2 { font-size: 1.4rem; margin-top: 1.4rem; }
.cat-others { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-other { padding: .5rem .95rem; border: 1.5px solid #e3e7ef; border-radius: 999px; background: #fff; color: #14213d; font-weight: 700; text-decoration: none; }
.cat-other:hover { border-color: #1f5eff; color: #0a3fc2; }
@media (max-width: 575.98px) { .cat-head h1 { font-size: 1.6rem; } }
.home-cat-link { color: inherit; text-decoration: none; } .home-cat-link:hover { color: var(--cat-accent, #1f5eff); text-decoration: underline; }
.rel-tools-head a, .card h3.h6 a { color: inherit; }
.cat-faq { max-width: 860px; }
.cat-faq-item { padding: .9rem 0; border-top: 1px solid #e3e7ef; }
.cat-faq-item h3 { font-weight: 800; color: #14213d; margin-bottom: .35rem; }
.cat-faq-item p { margin-bottom: .4rem; }
.cat-tool { flex-direction: row; align-items: center; gap: .85rem; }
.cat-tool-icon { flex: 0 0 auto; }
.cat-tool-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cat-tool-name { overflow-wrap: anywhere; }

/* Content pages (Admin -> Pages) */
.page-content { max-width: 900px; margin: 40px auto; padding: clamp(20px, 5vw, 40px); text-align: left; overflow-wrap: break-word; }
.page-content h1 { color: #0d6efd; margin-bottom: 20px; }
.page-content h2, .page-content h3 { color: #333; margin-top: 30px; margin-bottom: 15px; }
.page-content ul, .page-content ol { margin: 0 0 20px 20px; }
.page-content img, .page-content table { max-width: 100%; height: auto; }
.page-content .page-updated { color: #666; font-size: .9em; margin-bottom: 30px; }
