/* Drop preeti.ttf into /fonts to bundle it; otherwise an installed Preeti is used. */
@font-face {
    font-family: "PreetiWeb";
    src: local("Preeti"), url("../../fonts/preeti.ttf") format("truetype");
    font-display: swap;
}

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f1f3f8;
    --text: #1b1f2a;
    --muted: #616a7d;
    --border: #e1e5ee;
    --accent: #c8102e;          /* Nepal crimson */
    --accent-2: #003893;        /* Nepal blue */
    --accent-soft: #fdecef;
    --warn-bg: #fff7e6;
    --warn-border: #f5c26b;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --radius: 14px;
}

:root[data-theme="dark"] {
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1f2430;
    --text: #e8eaf0;
    --muted: #9aa3b5;
    --border: #2a303d;
    --accent: #ff4d63;
    --accent-2: #7aa2ff;
    --accent-soft: #2a1a1f;
    --warn-bg: #2a2214;
    --warn-border: #7a5a1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 "Inter", "Mukta", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; }
.brand strong { color: var(--accent); }
.brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font: 600 20px/1 "Mukta", sans-serif;
}
.header-inner { gap: 16px; }
.nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav .short { display: none; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }
.theme-toggle {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}

/* Hero */
.hero { text-align: center; padding-top: 48px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.lead { color: var(--muted); max-width: 680px; margin: 0 auto; font-size: 17px; }

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.converter { padding: 20px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.tabs { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 11px; }
.tab {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    font: 600 14px "Inter", sans-serif; padding: 9px 16px; border-radius: 8px;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.switch { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }

.font-warning {
    background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px;
    padding: 10px 14px; font-size: 14px; margin-bottom: 16px;
}

.panes { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.pane-label { font-weight: 600; font-size: 14px; }
.pane-actions { display: flex; gap: 6px; align-items: center; }
.pane-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }

textarea {
    width: 100%; height: 320px; resize: vertical;
    padding: 14px 16px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: 18px; line-height: 1.7; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent); }
textarea.unicode { font-family: "Mukta", sans-serif; }
textarea.preeti { font-family: "PreetiWeb", "Preeti", monospace; font-size: 22px; }
textarea.raw { font-family: ui-monospace, Menlo, monospace; font-size: 15px; }

.swap {
    width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: grid; place-items: center; transform: rotate(90deg); transition: transform .2s;
}
.swap:hover { transform: rotate(270deg); }

.btn-ghost, .btn-primary {
    font: 500 13px "Inter", sans-serif; padding: 6px 12px; border-radius: 8px; cursor: pointer;
}
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }

.raw-toggle { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: center; cursor: pointer; }

.convert-row { display: flex; justify-content: center; margin-top: 18px; }
.btn-convert {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0;
    font: 600 16px "Inter", sans-serif; padding: 13px 34px; border-radius: 12px; cursor: pointer;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-convert:hover { filter: brightness(1.06); }

/* Info */
.info { padding-top: 56px; }
.info h2 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step h3 { margin: 10px 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.step-num {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.explain { padding: 22px 24px; }
.explain h3 { margin-top: 0; }
.explain p { color: var(--muted); }
.preeti-inline {
    font-family: "PreetiWeb", "Preeti", monospace; background: var(--surface-2);
    padding: 1px 6px; border-radius: 5px; color: var(--text);
}

details {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 18px; margin-bottom: 10px;
}
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { margin: 0; max-width: 300px; }
.footer-col h3 { margin: 4px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a, .footer-bottom a { color: var(--muted); }
.footer-col a:hover, .footer-bottom a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; }
@media (max-width: 820px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
}

.toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
    background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
    font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
    .panes { grid-template-columns: 1fr; }
    .swap { justify-self: center; transform: none; }
    .swap:hover { transform: rotate(180deg); }
    textarea { height: 220px; }
    .steps { grid-template-columns: 1fr; }
}

/* ---- Image & PDF converter ------------------------------------------- */

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 220px; padding: 32px 20px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2);
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 6%, var(--surface-2)); }
.dropzone svg { color: var(--accent-2); }
.dropzone strong { font-size: 18px; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone.compact { min-height: 0; padding: 14px; flex-direction: row; gap: 10px; }
.dropzone.compact svg { width: 22px; height: 22px; }
.dropzone.compact strong { font-size: 15px; }
.dropzone.compact span { display: none; }

.bulk-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
    padding: 14px 16px; margin: 16px 0; border-radius: 12px; background: var(--surface-2);
}
.bulk-bar .group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; }
.bulk-bar label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
select, .bulk-bar input[type=range] { accent-color: var(--accent); }
select {
    font: 500 14px "Inter", sans-serif; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}

.settings { display: flex; flex-wrap: wrap; gap: 12px 18px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
#addMore { margin-top: 12px; }
.settings label { display: flex; gap: 8px; align-items: center; }

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
    display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
    padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.thumb {
    width: 64px; height: 64px; border-radius: 8px; background: var(--surface-2) center/cover no-repeat;
    display: grid; place-items: center; font: 700 12px "Inter", sans-serif; color: var(--muted); overflow: hidden;
}
.thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.file-meta { min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge {
    font: 700 11px "Inter", sans-serif; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent);
}
.badge.pdf { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.file-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.targets { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.targets button {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    font: 600 12px "Inter", sans-serif; padding: 6px 10px; border-radius: 7px;
}
.targets button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.status { font-size: 13px; color: var(--muted); }
.status.error { color: var(--accent); }
.btn-success { background: #13804b; border: 1px solid #13804b; color: #fff; font: 500 13px "Inter", sans-serif; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; }
.icon-btn:hover { color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }

.formats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.format-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.format-card h3 { margin: 0 0 4px; font-size: 16px; }
.format-card p { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
    .file-item { grid-template-columns: 48px 1fr; }
    .thumb { width: 48px; height: 48px; }
    .file-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .formats { grid-template-columns: 1fr 1fr; }
}

/* ---- Image compressor ------------------------------------------------- */

.target-picker {
    display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
    padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-2);
}
.target-label { font-weight: 600; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font: 600 13px "Inter", sans-serif; padding: 7px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.custom-size { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.custom-size input {
    width: 96px; font: 500 14px "Inter", sans-serif; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
.custom-size input:focus { outline: none; border-color: var(--accent-2); }

.size-to { font-weight: 600; color: var(--text); }
.badge.saved { background: color-mix(in srgb, #13804b 14%, transparent); color: #13804b; }
.file-info.detail { font-size: 12px; }
.meter-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; max-width: 260px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: #13804b; border-radius: 4px; }


/* ---- Image to text (OCR) ---------------------------------------------- */

.ocr-list { display: flex; flex-direction: column; gap: 14px; }
.ocr-item {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px;
    padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.ocr-preview {
    display: grid; place-items: center; min-height: 160px; max-height: 360px; overflow: hidden;
    border-radius: 10px; background: var(--surface-2); color: var(--muted); font-weight: 700;
}
.ocr-preview img, .ocr-preview canvas { max-width: 100%; max-height: 360px; object-fit: contain; display: block; }
.ocr-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ocr-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ocr-text { height: 240px; font-family: "Mukta", "Inter", sans-serif; font-size: 16px; }
.ocr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent-2); transition: width .2s; }

@media (max-width: 820px) {
    .ocr-item { grid-template-columns: 1fr; }
    .ocr-preview { max-height: 220px; }
    .ocr-text { height: 200px; }
}

@media (max-width: 820px) {
    #langTabs { width: 100%; }
    #langTabs .tab { flex: 1; padding: 9px 6px; font-size: 13px; white-space: nowrap; }
}

/* ---- Image cropper ---------------------------------------------------- */

.crop-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.crop-stage { height: 560px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.crop-stage img { display: block; max-width: 100%; }
.crop-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.crop-panel .chips { gap: 6px; }
.crop-panel .chip { padding: 6px 11px; font-size: 12px; }
.size-inputs { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.size-inputs input {
    width: 92px; font: 500 14px "Inter", sans-serif; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
}
.size-inputs input:focus { outline: none; border-color: var(--accent-2); }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tool {
    width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text);
}
.tool:hover { border-color: var(--accent-2); color: var(--accent-2); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; font-size: 13px; color: var(--muted); }
.output-grid label { display: flex; flex-direction: column; gap: 4px; }
.output-grid .span-2 { grid-column: 1 / -1; }
.output-grid .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.output-grid .check input { accent-color: var(--accent); width: 16px; height: 16px; }
.range-row { display: flex; gap: 6px; align-items: center; }
.range-row input { flex: 1; min-width: 0; accent-color: var(--accent); }
.preview-section { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crop-preview {
    display: grid; place-items: center; width: 100%; min-height: 120px; padding: 10px; border-radius: 10px;
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--border);
}
.crop-preview canvas { max-width: 100%; max-height: 200px; display: block; }
.preview-meta { font-size: 12px; color: var(--muted); }
.panel-actions { display: flex; gap: 8px; }
.panel-actions .btn-primary { flex: 1; padding: 9px 12px; font-size: 14px; }

@media (max-width: 960px) {
    .crop-editor { grid-template-columns: 1fr; }
    .crop-stage { height: 380px; }
}

/* ---- Header on smaller screens ------------------------------------------ */

@media (max-width: 1100px) {
    .nav { gap: 16px; }
    .nav .full { display: none; }
    .nav .short { display: inline; }
}
/* Phones: links move to their own scrollable row under the logo */
@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 0; }
    .brand { flex: 1; }
    .nav {
        order: 3; width: calc(100% + 40px); margin: 8px -20px 0; padding: 0 20px 10px; gap: 18px;
        overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { font-size: 14px; padding: 4px 0; }
    .nav a.active { padding-bottom: 4px; }
}

/* ---- QR code generator ------------------------------------------------ */

.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.qr-controls { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.qr-section { padding: 18px 20px; }
.qr-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; }
.sec-num {
    display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 13px;
    background: var(--accent-soft); color: var(--accent);
}
.opt-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 8px; }
.qr-section .opt-label:first-of-type { margin-top: 0; }

.type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.type-tab {
    font: 600 13px "Inter", sans-serif; padding: 8px 14px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.type-tab.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; flex: 1; min-width: 0; }
.field input, .field textarea, .field select, .gradient-opts select {
    font: 400 15px "Inter", "Mukta", sans-serif; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; width: 100%;
}
.field textarea { height: auto; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-2); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > * { flex: 1 1 200px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; margin-top: 8px; }
.check-field input { accent-color: var(--accent); width: 16px; height: 16px; }
.field.check-field { flex-direction: row; margin-top: 26px; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.template {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; cursor: pointer;
    border: 2px solid var(--border); border-radius: 12px; background: var(--surface);
    font: 600 12px "Inter", sans-serif; color: var(--text);
}
.template:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.template.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.template-art { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #fff; }
.template-art canvas { width: 100%; height: 100%; display: block; }

.shape-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.shape-grid button {
    font: 600 13px "Inter", sans-serif; padding: 8px 12px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.shape-grid.small button { padding: 6px 10px; font-size: 12px; }
.shape-grid button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.small-tabs .tab { padding: 6px 12px; font-size: 13px; }

.color-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.swatch {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text); background: var(--surface);
}
.swatch input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 7px; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 7px; }
.swatch input:disabled { opacity: .35; cursor: not-allowed; }
.gradient-only { display: none !important; }
.is-gradient .swatch.gradient-only { display: flex !important; }
.is-gradient .gradient-opts.gradient-only { display: flex !important; }
.gradient-opts { gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gradient-opts select { width: auto; padding: 6px 10px; font-size: 13px; }
.gradient-opts .range-row input { width: 120px; flex: none; }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.logo-opt {
    aspect-ratio: 1; display: grid; place-items: center; padding: 8px; cursor: pointer;
    border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted);
}
.logo-opt img { width: 100%; height: 100%; object-fit: contain; }
.logo-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.logo-opt .none { font: 600 11px "Inter", sans-serif; }
.logo-opt .upload { display: flex; flex-direction: column; align-items: center; font-size: 20px; line-height: 1; }
.logo-opt .upload small { font-size: 10px; font-weight: 600; margin-top: 2px; }
.logo-opts { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.logo-opts .range-row input { width: 120px; flex: none; }
.logo-opts .check-field { margin-top: 0; }
.frame-opts { margin-top: 14px; align-items: flex-end; }
.frame-opts .swatch { flex: 0 0 auto; margin-bottom: 10px; }

.qr-preview-col { position: sticky; top: 84px; }
.qr-preview-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.qr-preview {
    display: grid; place-items: center; min-height: 356px; padding: 18px; border-radius: 12px;
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 18px 18px;
}
.qr-preview canvas { width: 100%; max-width: 320px; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.12)); }
.qr-hint { font-size: 12px; color: var(--muted); text-align: center; }
.qr-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.qr-warn p { margin: 0; }
.qr-warn p + p { margin-top: 6px; }
.download-row { display: flex; justify-content: center; font-size: 14px; color: var(--muted); }
.download-row label { display: flex; gap: 8px; align-items: center; }
.download-buttons { display: flex; flex-direction: column; gap: 8px; }
.download-buttons .btn-convert { width: 100%; }
.download-secondary { display: flex; gap: 8px; }
.download-secondary button { flex: 1; padding: 9px; }

@media (max-width: 960px) {
    .qr-layout { grid-template-columns: 1fr; }
    .qr-preview-col { position: static; order: -1; }
    .qr-preview { min-height: 296px; }
    .qr-preview canvas { max-width: 260px; }
}


/* ---- Related tools ------------------------------------------------------ */

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card {
    align-content: start; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
    padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-mark {
    grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: 700 16px "Mukta", "Inter", sans-serif;
}
.tool-name { font-weight: 600; }
.tool-text { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---- Articles & content pages -------------------------------------------- */

.page-wrap { max-width: 780px; padding-top: 28px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.page-wrap h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.article-meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.prose { font-size: 17px; line-height: 1.75; }
.prose h2 { font-size: 24px; line-height: 1.3; letter-spacing: -.01em; margin: 40px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin-bottom: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code, .prose .preeti-sample {
    font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--surface-2);
    padding: 1px 6px; border-radius: 5px;
}
.prose .lead-p { font-size: 19px; color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.callout {
    border-left: 4px solid var(--accent-2); background: var(--surface); border-radius: 0 12px 12px 0;
    padding: 14px 18px; margin: 0 0 22px; box-shadow: var(--shadow);
}
.callout p:last-child { margin-bottom: 0; }
.cta-box {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
    padding: 20px 22px; margin: 32px 0; border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface)));
    border: 1px solid var(--border);
}
.cta-box p { margin: 0; font-weight: 600; }
.cta-box .btn-convert { text-decoration: none; padding: 11px 22px; font-size: 15px; }

.guide-list { display: grid; gap: 14px; }
.guide-card {
    display: block; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.guide-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.guide-card h2 { font-size: 20px; margin: 0 0 6px; }
.guide-card p { margin: 0; color: var(--muted); }
.guide-card .more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--accent); }

.tool-guide { max-width: 860px; }
.tool-guide .prose { font-size: 16px; }
