:root {
  --blue: #2455ED;
  --blue-hover: #1C45C9;
  --blue-soft: #E4EBFF;
  --cyan: #00A6BF;
  --cyan-text: #00778A;
  --text: #172033;
  --muted: #536174;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --success: #16794F;
  --warn: #9B5500;
  --error: #B42335;
  --radius: 8px;
  --radius-button: 6px;
  --space: 8px;
  font-family: Inter, "Noto Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }

html[dir="rtl"] .nav,
html[dir="rtl"] .brand,
html[dir="rtl"] .lang-switch,
html[dir="rtl"] header {
  direction: rtl;
}
html[dir="rtl"] .brand-mark,
html[dir="rtl"] .limg-mark {
  transform: none; /* never mirror brand or file icons */
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.brand-word { color: var(--text); }

.limg-mark {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
  justify-content: flex-start;
  overflow: visible;
}
.nav > a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav > a:hover { color: var(--text); background: var(--blue-soft); }
.nav > a[aria-current="page"],
.nav-more-panel a[aria-current="page"] {
  color: var(--blue);
  background: var(--blue-soft);
}

.mobile-nav-toggle,
.nav-group-toggle { display: none; }
.nav-more > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  user-select: none;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-inline-start: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
}
.nav-more > summary:hover,
.nav-more[open] > summary {
  color: var(--text);
  background: var(--blue-soft);
}
.nav-more-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 16px;
  width: min(760px, calc(100% - 32px));
  margin-inline: auto;
  max-height: min(72vh, 620px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.12);
}
.nav-more-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-more-panel a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
}
.nav-more-panel a:hover { background: var(--blue-soft); color: var(--blue); }

.tag:empty { display: none; }
.tag {
  font-size: 12px;
  color: var(--muted);
  justify-self: end;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.lang-suggestion { color: var(--blue-hover); font-size: 13px; }
.lang-switch select {
  width: auto;
  min-width: 8.5rem;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

main {
  max-width: 1050px;
  margin: auto;
  padding: 24px 20px 64px;
}

.hero {
  text-align: center;
  padding: 28px 0 34px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue);
}
.hero h1 {
  font-size: clamp(32px, 6vw, 54px);
  letter-spacing: -2px;
  margin: 10px 0;
}
.hero p,
.panel p,
.note p,
.tool-card p {
  color: var(--muted);
  line-height: 1.6;
}

.tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 1px 0 rgba(37, 99, 235, 0.08);
}
.tool-card h2 {
  margin: 8px 0;
  font-size: 20px;
  color: var(--text);
}
.tool-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 8px;
  border-radius: 4px;
}
.tool-cat.compress { background: #e3f5ec; color: var(--success); }
.tool-cat.convert { background: var(--blue-soft); color: var(--blue); }
.tool-cat.edit { background: #f7ecdf; color: var(--warn); }
.tool-cat.privacy { background: #e8edf2; color: var(--muted); }
.tool-cat.pdf { background: #f8e4e7; color: var(--error); }
.tool-cat.limg { background: #e4f7fa; color: var(--cyan-text); }
.tool-cat.social { background: #f8e6ec; color: #B63D65; }
.tool-cat.smart { background: #efeafb; color: #6941C6; }

.home-page { max-width: 1240px; }
.home-page [hidden], .image-task [hidden] { display: none; }
.home-page > .hero { max-width: 760px; margin-inline: auto; padding-block: 14px 24px; }
.home-page > .hero .eyebrow { display: none; }
.home-page > .hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.04em; }
.home-page > .hero p { margin: 8px auto 14px; }
.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding: 8px 16px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-button);
  background: var(--blue);
  color: white;
  font-weight: 650;
  text-decoration: none;
}
.action-link:hover { background: var(--blue-hover); color: white; }
.action-link.action-secondary { background: var(--surface); color: var(--blue-hover); }
.action-link.action-secondary:hover { background: var(--blue-soft); }
.home-featured > h2,
.home-catalog > h2 { font-size: 22px; margin-block: 0 12px; }
.home-featured .tool-card,
.catalog-results .tool-card { padding: 16px; }
.tool-card h3 { font-size: 18px; margin: 7px 0; }
.home-page .tool-card p { margin-block: 4px 0; }
.task-symbol {
  display: inline-grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: var(--radius-button);
  color: var(--blue-hover);
  background: var(--blue-soft);
  font-size: 23px;
  font-weight: 700;
}
.task-symbol.limg { color: var(--cyan-text); background: #e4f7fa; }
.home-limg {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-block: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: var(--surface);
}
.home-limg h2 { margin: 0; font-size: 20px; }
.home-limg p { margin: 6px 0 0; color: var(--muted); }
.home-catalog { scroll-margin-block-start: 82px; }
.catalog-controls {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px 16px;
  margin-block: 0 16px;
}
.catalog-controls label { margin: 0; }
.catalog-controls input,
.catalog-controls select { min-height: 44px; background: var(--surface); }
.hub-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.hub-actions .action-link { border-color: var(--cyan-text); }
.hub-actions .action-link:not(.action-secondary) { background: var(--cyan-text); }
.hub-actions .action-link.action-secondary { color: var(--cyan-text); }

@media (min-width: 1280px) {
  .catalog-results { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .home-page { padding-inline: 14px; }
  .home-page > .hero { padding-block-start: 0; }
  .home-limg { grid-template-columns: auto 1fr; }
  .home-limg .action-link { grid-column: 1 / -1; justify-self: stretch; }
  .catalog-controls { grid-template-columns: 1fr; }
  .hub-actions { align-items: stretch; flex-direction: column; }
  .hub-actions > a:last-child { align-self: center; }
}

.image-task .hero { padding: 8px 0 18px; }
.image-task .hero h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.04em; }
.image-task .image-source { height: auto; min-height: 54px; padding: 5px; }
.image-source::file-selector-button {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: var(--radius-button);
  padding: 12px 13px;
  margin-inline-end: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.image-source:focus-visible,
.mobile-nav-toggle:focus-visible,
.nav a:focus-visible,
.nav summary:focus-visible,
.nav-group-toggle:focus-visible,
.tool-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.image-task #result-heading { scroll-margin-block-start: 76px; }
.image-task #download { margin-block: 0 12px; }
.image-task #status:empty { display: none; }

@media (max-width: 680px) {
  .image-task { padding-block-start: 12px; }
  .image-task .hero { text-align: start; padding-block-end: 10px; }
  .image-task .hero p { margin-block: 8px; }
  .image-task .image-result:not(.has-result) { display: none; }
  .image-task #run, .image-task #download { width: 100%; min-block-size: 44px; }
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field-grid label { margin-top: 12px; }

textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  font: inherit;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  min-height: 8rem;
  line-height: 1.45;
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-top: 16px;
}
label.check input {
  width: auto;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.panel h2,
.note h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

label {
  display: block;
  font-weight: 650;
  margin: 20px 0 8px;
}

input,
select {
  display: block;
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1px solid #aeb7c6;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
}

input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

button {
  background: var(--blue);
  border: 0;
  border-radius: var(--radius-button);
  padding: 13px 16px;
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  margin-top: 16px;
  min-height: 44px;
}
button:hover { background: var(--blue-hover); }
button:disabled { opacity: 0.5; cursor: wait; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--warn);
  outline-offset: 3px;
}

.note { margin-top: 16px; }
.hint { font-size: 14px; color: var(--muted); }

#preview img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}
#destinations a {
  display: block;
  overflow-wrap: anywhere;
  color: var(--blue-hover);
  margin: 10px 0;
}

footer,
.site-footer {
  margin-top: 32px;
  padding: 28px 20px 36px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.site-footer-inner {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}
.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.footer-nav a:hover { color: var(--blue); }
.footer-legal {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  max-width: 36rem;
}
.footer-dev {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.hitechsp-logo {
  display: block;
  height: 14px;
  width: auto;
  max-width: 140px;
}
.footer-note { margin: 0; font-size: 12px; }

.hero-doc { text-align: start; padding-bottom: 12px; }
.hero-doc h1 { letter-spacing: -1px; }
.doc-meta { font-size: 13px; color: var(--muted); margin-top: 8px; }
.ad-slot {
  margin: 28px 0 8px;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}
.ad-slot[hidden] { display: none; }

@media (max-width: 1023px) {
  header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand tag lang"
      "nav nav nav";
  }
  .brand { grid-area: brand; }
  .nav { grid-area: nav; flex-wrap: wrap; }
  .tag { grid-area: tag; }
  .lang-switch { grid-area: lang; }

  header:has(> .mobile-nav-toggle) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand lang toggle";
    gap: 8px;
    padding: 8px 12px;
  }
  header:has(> .mobile-nav-toggle) .tag,
  header:has(> .mobile-nav-toggle) .lang-suggestion { display: none; }
  header:has(> .mobile-nav-toggle) .brand { font-size: 21px; gap: 6px; }
  header:has(> .mobile-nav-toggle) .brand-mark { inline-size: 24px; block-size: 24px; }
  header:has(> .mobile-nav-toggle) .lang-switch select {
    inline-size: clamp(92px, 28vw, 142px);
    min-inline-size: 0;
    min-block-size: 44px;
  }
  .mobile-nav-toggle,
  .nav-group-toggle {
    display: inline-flex;
    grid-area: toggle;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    margin: 0;
    color: var(--text);
    background: var(--blue-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    padding: 8px 10px;
  }
  .mobile-nav-toggle:hover,
  .nav-group-toggle:hover { color: var(--text); background: var(--blue-soft); }
  .nav-enhanced { display: none; }
  .nav-enhanced.is-open {
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    display: grid;
    align-items: stretch;
    max-block-size: min(72dvh, 540px);
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border-block-end: 1px solid var(--border);
    padding: 8px 12px;
  }
  .nav-enhanced a,
  .nav-enhanced summary {
    display: flex;
    align-items: center;
    min-block-size: 44px;
    white-space: normal;
  }
  .nav-more-panel {
    position: static;
    width: 100%;
    max-height: none;
    grid-template-columns: 1fr;
    padding: 6px;
    box-shadow: none;
  }
  .nav-enhanced .nav-more-label,
  .nav-group-toggle[aria-expanded="false"] + .nav-group-links { display: none; }
  .nav-group-toggle { justify-content: flex-start; width: 100%; }
}

[role="status"] { overflow-wrap: anywhere; }
.error { color: var(--error) !important; }

@media (max-width: 1100px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tools { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .panel,
  .note,
  .tool-card { padding: 18px; }
  .tag { max-width: 130px; text-align: right; }
}

.plain-list{margin:12px 0;padding-left:18px;color:var(--muted);line-height:1.6}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.export-row button { margin-top: 8px; }

.subhead {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.answer-first {
  margin: 36px 0 8px;
  padding: 22px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent);
  max-width: 720px;
}
.answer-first h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}
.answer-first h3 {
  margin: 16px 0 6px;
  font-size: 1rem;
}
.answer-first p,
.answer-first li {
  color: var(--muted);
  line-height: 1.55;
}
.answer-first ol {
  margin: 0;
  padding-left: 1.2rem;
}
.hotspot-list {
  display: grid;
  gap: 12px;
}
.hotspot-card {
  margin: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--blue) 8%);
}
.hotspot-card legend {
  padding: 0 6px;
  font-weight: 650;
  color: var(--blue-hover, var(--blue));
}
.hotspot-card label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.hotspot-card input {
  width: 100%;
  margin-top: 4px;
}
.hotspot-card button {
  margin-top: 12px;
}
.preview-stage {
  min-height: 48px;
}
.preview-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}
.preview-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
}
.hotspot-overlay {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, #9B5500 80%, #fff);
  background: color-mix(in srgb, #9B5500 18%, transparent);
  color: #172033;
  font: 650 12px/1.2 system-ui, sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2px 4px;
  pointer-events: none;
}


.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px;
}
.breadcrumb a { color: var(--blue-hover); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 650; }

.hub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 28px;
}
.hub-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
}
.hub-nav a[aria-current="page"] {
  border-color: var(--cyan);
  color: var(--cyan-text);
  background: #e4f7fa;
}
.hub-nav a.cta {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.hub-nav a.cta:hover { background: var(--blue-hover); border-color: var(--blue-hover); }

.doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px clamp(18px, 4vw, 36px);
  margin-bottom: 16px;
}
.doc h2 {
  margin: 28px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--muted); line-height: 1.65; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: start;
  vertical-align: top;
}
.doc th { background: var(--bg); color: var(--text); font-weight: 700; }
.doc code, .doc .mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92em;
}
.doc .callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--cyan);
  background: #e4f7fa;
  color: var(--text);
}
.hub-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}
@media (max-width: 680px) {
  .hub-cards { grid-template-columns: 1fr; }
}


.thumb-row{display:flex;flex-wrap:wrap;gap:10px;align-items:end}
.thumb-row img{border:1px solid var(--border);background:#fff}
.checker{background:linear-gradient(45deg,#e2e8f0 25%,transparent 25%) 0 0/16px 16px,linear-gradient(-45deg,#e2e8f0 25%,transparent 25%) 0 8px/16px 16px,#fff;padding:12px;border-radius:6px}
.pick-stage img{cursor:crosshair;max-width:100%}
.swatch{width:100%;height:72px;border-radius:8px;border:1px solid var(--border);margin-bottom:12px;background:#fff}

.palette-chip{min-width:4.5rem;min-height:2.5rem;border:1px solid var(--border);border-radius:6px;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.45);cursor:pointer;font:inherit;padding:.35rem .5rem}
pre.hint,pre#result{white-space:pre-wrap;word-break:break-word}
