:root {
  --accent: #2f6f5e; --accent-dark: #1f4f43; --accent-light: #e6f0ed;
  --text: #1f2933; --muted: #5b6573; --line: #dfe3e8; --bg: #fbfbf9; --card: #fff;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .4em 0 .3em; }
h2 { font-size: 1.4rem; margin: 1.8em 0 .7em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 70ch; }

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--accent); }
.nav nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.nav nav a:hover { color: var(--accent); }

.hero { background: linear-gradient(180deg, var(--accent-light), var(--bg)); padding: 56px 0 24px; }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 2px solid var(--accent); margin: 4px 6px 4px 0; text-align: center; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--accent-light); }
.btn small { display: block; font-size: .78rem; font-weight: 400; opacity: .9; }
.btn.alt { background: #fff; color: var(--accent-dark); }
.btn.alt:hover { background: var(--accent-light); }
.btn.disabled { background: #98a2b3; border-color: #98a2b3; cursor: not-allowed; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card-body { padding: 16px 18px 20px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }
.price { font-weight: 800; color: var(--accent-dark); }
.price.big { font-size: 1.6rem; margin: .4em 0; }
.price .muted { font-size: .9rem; font-weight: 400; }
.soon { font-size: .8rem; background: #fef0c7; color: #93370d; padding: 2px 8px; border-radius: 99px; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.tool:hover { border-color: var(--accent); }
.tool span { color: var(--muted); font-size: .9rem; }

.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 28px; position: relative; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

.crumbs { font-size: .9rem; margin-top: 18px; color: var(--muted); }
.product-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 36px; align-items: start; }
.gallery > img { border-radius: var(--radius); box-shadow: var(--shadow); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs img { width: 120px; border-radius: 8px; border: 1px solid var(--line); }
.buybox h1 { margin-top: 0; }
.buybox .btn { display: block; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.prose { max-width: 760px; }

.calc { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 18px 0 28px; }
.calc .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.calc label { display: flex; flex-direction: column; font-size: .875rem; font-weight: 600; gap: 4px; }
.calc input, .calc select { font: inherit; padding: 9px 10px; border: 1px solid #c4cad3; border-radius: 8px; background: #fffdf5; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.calc .results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; }
.calc .stat { background: var(--accent-light); border-radius: 10px; padding: 12px 14px; }
.calc .stat b { display: block; font-size: 1.35rem; color: var(--accent-dark); }
.calc .stat span { font-size: .85rem; color: var(--muted); }
.calc table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .92rem; }
.calc th, .calc td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.calc th:first-child, .calc td:first-child { text-align: left; }
.calc .rows .row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: end; }
.calc .link { background: none; border: 0; color: var(--accent-dark); font: inherit; cursor: pointer; text-decoration: underline; padding: 4px 0; }
.calc .bar { height: 12px; background: var(--accent); border-radius: 6px; }
.calc .note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.calc .warn { color: #b42318; font-weight: 600; }
.upsell { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; align-items: center; background: #fff; border: 2px solid var(--accent-light); border-radius: var(--radius); padding: 18px; }
.upsell h2 { margin-top: 0; }
.upsell img { border-radius: 8px; }

.foot { margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--line); background: #fff; font-size: .92rem; }
@media (max-width: 820px) {
  .product-grid, .upsell { grid-template-columns: 1fr; }
  .calc .rows .row { grid-template-columns: 1fr 1fr; }
}

.search { display: flex; flex-direction: column; gap: 6px; font-weight: 600; max-width: 460px; margin: 10px 0 6px; }
.search input { font: inherit; padding: 11px 12px; border: 1px solid #c4cad3; border-radius: 10px; }
.tool-cat h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 10px; }
.explain .example { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.explain table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); font-size: .93rem; }
.explain th, .explain td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.explain td:last-child, .explain th:last-child { text-align: right; }
.explain th { background: var(--accent-light); }
[hidden] { display: none !important; }
@media (max-width: 820px) { .explain .example { grid-template-columns: 1fr; } }

/* ---- File, writing and image tools ---- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.filetool .fields { margin-top: 14px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 34px 16px;
  border: 2px dashed #9fb8b0; border-radius: var(--radius); background: var(--accent-light); cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone strong { font-size: 1.15rem; color: var(--accent-dark); }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent); background: #d7e8e2; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 16px 0 6px; }
.actions .btn { margin: 0; }
button.btn { font: inherit; cursor: pointer; }
button.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small-btn { padding: 5px 10px; font-size: .85rem; font-weight: 600; }
.progress { margin: 12px 0; }
.progress .pbar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress .pbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress .pbar.indet i { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.progress .plabel { display: block; font-size: .875rem; color: var(--muted); margin-top: 6px; }
.progress.err .pbar i { background: #b42318; }
.progress.err .plabel { color: #b42318; font-weight: 600; }
.result-box { margin-top: 16px; padding: 16px; border-radius: 10px; background: #f6faf8; border: 1px solid var(--line); }
.note-box { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: #fffbea; border: 1px solid #f3e3a1; font-size: .92rem; }
.filelist { list-style: none; padding: 0; margin: 16px 0 0; }
.thumbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumbs-grid li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: .8rem; }
.thumbs-grid .thumb { height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f3f4f6; border-radius: 6px; }
.thumbs-grid .thumb img { max-height: 120px; object-fit: contain; transition: transform .2s; }
.thumbs-grid .fname { margin: 6px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; }
button.icon { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 6px; min-width: 32px; min-height: 32px; cursor: pointer; }
button.icon:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
button.icon:disabled { opacity: .35; }
.calc label.block, .calc label.inline { font-weight: 600; font-size: .9rem; }
.calc label.block { display: flex; flex-direction: column; gap: 6px; }
.calc label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; }
.bigtext, .calc textarea { width: 100%; font: inherit; font-weight: 400; line-height: 1.55; padding: 12px; border: 1px solid #c4cad3; border-radius: 10px; background: #fff; resize: vertical; }
.calc textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.calc input[type=text] { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #c4cad3; border-radius: 8px; }
span.warn { color: #b42318; }

/* Word to PDF preview */
.doc-preview { margin-top: 16px; background: #e9ecef; padding: 16px; border-radius: 10px; overflow-x: auto; max-height: 80vh; overflow-y: auto; }
.doc-preview section.docx { margin: 0 auto 16px; box-shadow: 0 2px 8px rgba(0,0,0,.15); background: #fff; }
.plain-page { background: #fff; max-width: 210mm; margin: 0 auto; padding: 22mm 20mm; box-shadow: 0 2px 8px rgba(0,0,0,.15); font: 11pt/1.5 Georgia, "Times New Roman", serif; color: #111; }
.plain-page p { margin: 0 0 .35em; white-space: pre-wrap; word-wrap: break-word; }
.plain-page p.tabbed { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; }
.plain-page .page-break { border-top: 1px dashed #bbb; margin-top: 18px; padding-top: 18px; }
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .doc-preview { background: none; padding: 0; margin: 0; max-height: none; overflow: visible; border-radius: 0; }
  #print-root section.docx { box-shadow: none !important; margin: 0 !important; break-after: page; }
  #print-root section.docx:last-child { break-after: auto; }
  #print-root .plain-page { box-shadow: none; padding: 0; max-width: none; }
  #print-root .page-break { border: 0; margin: 0; padding: 0; break-before: page; }
}

/* Plagiarism checker */
.sources { display: grid; gap: 12px; }
.source { border-left: 5px solid var(--c); padding-left: 12px; }
.source-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.source-head input { flex: 1 1 200px; }
.c0 { --c: #f59e0b; --cb: #fde68a; } .c1 { --c: #3b82f6; --cb: #bfdbfe; } .c2 { --c: #ec4899; --cb: #fbcfe8; }
.c3 { --c: #10b981; --cb: #a7f3d0; } .c4 { --c: #8b5cf6; --cb: #ddd6fe; } .c5 { --c: #ef4444; --cb: #fecaca; }
.marked { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; line-height: 1.7; }
.marked mark { background: var(--cb); border-bottom: 2px solid var(--c); padding: 1px 0; color: inherit; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.verdict { font-weight: 600; }
.phrases li { margin-bottom: 8px; }
.phrases span { font-style: italic; }

/* Paraphraser */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seg button { font: inherit; border: 1px solid #c4cad3; background: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; text-align: left; color: var(--text); }
.seg button small { display: block; color: var(--muted); font-size: .78rem; }
.seg button[aria-selected=true], .seg button.on { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.seg button:disabled { opacity: .5; cursor: not-allowed; }
.seg.modes button { padding: 6px 12px; border-radius: 99px; }
.para-opts { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; margin-bottom: 12px; }
.para-opts .ai-only { flex: 1 1 420px; }
.row-label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.para-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pane-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.para-out { min-height: 330px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; line-height: 1.7; }
.para-out .sent { cursor: pointer; border-radius: 4px; }
.para-out .sent:hover, .para-out .sent:focus { background: #f1f5f4; outline: none; }
.para-out .sent.pending { color: var(--muted); }
.para-out mark { background: #fde68a; color: inherit; border-radius: 2px; }
.para-out.plain mark { background: none; }
.alts { display: block; margin: 6px 0 10px; padding: 10px; border: 1px solid var(--accent); border-radius: 10px; background: #f6faf8; }
.alts button { display: block; width: 100%; text-align: left; font: inherit; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; }
.alts button:hover { border-color: var(--accent); }
.alts button.link { width: auto; border: 0; background: none; text-decoration: underline; color: var(--accent-dark); }

/* Background remover */
.bg-stage { margin-top: 16px; }
.bg-view { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.bg-view canvas { display: block; max-width: 100%; max-height: 70vh; height: auto; }
.bg-view .bg-before { position: absolute; inset: 0; width: 100%; height: 100%; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
input.compare { width: 220px; }

.howto ol { padding-left: 1.3em; } .howto li { margin-bottom: 6px; }
.about-tool p { max-width: 75ch; }
@media (max-width: 760px) { .para-grid { grid-template-columns: 1fr; } .para-out { min-height: 160px; } }

/* ---- Batch 2: image, PDF, text and utility tools ---- */
.calc .fields label.wide { grid-column: 1 / -1; }
.batch-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.batch-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.batch-list .fname { font-weight: 600; flex: 1 1 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-list .row-actions { margin-left: auto; }
.page-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.page-thumbs figure { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.page-thumbs canvas { display: block; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.1); max-width: 140px; height: auto; }
.page-grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.page-grid li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.page-grid .thumb { height: 170px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.page-grid .thumb img { max-height: 160px; max-width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s; }
.page-grid .row-actions { justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.ocr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-top: 12px; }
.ocr-preview img { width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.lang-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lang-row label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; gap: 4px; flex: 1 1 160px; }
.reading { margin-top: 14px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; line-height: 1.8; }
.reading .now { background: #fde68a; border-radius: 3px; }
.limits { display: grid; gap: 6px; max-width: 560px; }
.limit { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 10px; font-size: .9rem; }
.limit .meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.limit .meter i { display: block; height: 100%; background: var(--accent); }
.limit.over .meter i { background: #b42318; }
.limit.over span:last-child { color: #b42318; font-weight: 600; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.qr-preview { text-align: center; position: sticky; top: 80px; }
.qr-canvas { width: 100%; max-width: 320px; height: auto; border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.qr-payload { word-break: break-all; }
.qr-preview .actions { justify-content: center; }
.pw-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.pw-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.pw-list code { flex: 1; font-size: 1.05rem; word-break: break-all; }
.pw-meter .bar-wrap { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-top: 12px; }
.pw-meter .bar-wrap i { display: block; height: 100%; }
.pw-meter i.weak { background: #b42318; } .pw-meter i.fair { background: #f59e0b; } .pw-meter i.strong { background: #10b981; } .pw-meter i.vstrong { background: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0; }
@media (max-width: 760px) { .ocr-grid, .qr-layout { grid-template-columns: 1fr; } .qr-preview { position: static; } .limit { grid-template-columns: 1fr 1fr; } .limit .meter { grid-column: 1 / -1; grid-row: 2; } }

/* Passport photo maker */
.pp-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 16px; }
.pp-canvas { display: block; height: 420px; max-width: 100%; width: auto; border: 1px solid var(--line); border-radius: 6px; cursor: grab; touch-action: none; box-shadow: var(--shadow); }
.pp-canvas:active { cursor: grabbing; }
.pp-nudge { margin-top: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) { .pp-layout { grid-template-columns: 1fr; } .pp-canvas { height: auto; width: 100%; } }
.pp-checks { list-style: none; padding: 0; margin: 0 0 12px; font-size: .9rem; }
.pp-checks li { padding: 4px 0; }
.pp-checks li.ok { color: #067647; }
.pp-checks li.warn-item { color: #b54708; font-weight: 600; }
.crop-editor { margin: 14px 0; padding: 14px; border: 1px solid var(--accent); border-radius: 10px; background: #f6faf8; }
.crop-canvas { display: block; max-width: 100%; height: auto; cursor: move; touch-action: none; border-radius: 6px; }
