@font-face {
    font-family: Vazirmatn;
    src: url('/assets/fonts/Vazirmatn.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --paper: #f8f8f2;
    --surface: #ffffff;
    --ink: #243d32;
    --muted: #727b72;
    --green: #244f40;
    --green-hover: #163c2e;
    --lime: #d5e4a1;
    --line: #dedfd5;
    --soft: #edf0e5;
    --error: #a84234;
    --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
button:disabled { cursor: wait; opacity: 0.55; }
button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid #899e56;
    outline-offset: 5px;
}
[hidden] { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }
.container { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 99; top: 10px; right: 10px; background: white; padding: 12px 24px; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 29px; border-bottom: 1px solid var(--line); gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 720; letter-spacing: -1px; }
.brand img { display: block; }
.brand-dot { color: #87906c; font-weight: 400; }
nav { display: flex; gap: 32px; font-size: 13px; }
nav a { color: var(--muted); }
nav [aria-current] { color: var(--green); font-weight: 650; }
.header-link { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 15px; }
.header-link span { margin-right: 12px; }
.hero {
    max-width: 820px;
    padding-block: 46px 35px;
}
.hero-copy { text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.2px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8b9f58; flex-shrink: 0; }
h1, h2, h3, h4, p { margin: 0; }
.hero h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 750; letter-spacing: -1.4px; line-height: 1.55; margin-block: 12px 14px; }
.hero h1 > span { color: #788b4d; }
.hero-description { font-size: 15px; line-height: 2; color: #70796c; max-width: 560px; margin-inline: auto; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 18px; padding: 13px 24px; min-height: 49px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 550; transition: background 160ms, transform 160ms; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-hover); }
.button.text { background: transparent; color: var(--ink); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--green); }
.button.secondary:hover { background: var(--soft); }
.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; font-size: 11px; color: var(--muted); margin-top: 18px; }
.hero-meta span + span::before { content: '·'; margin-left: 16px; }
pre, code, .output-header, #json-editor, #entry-data { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.section-heading h2 { font-size: 29px; font-weight: 650; letter-spacing: -0.8px; margin-top: 8px; }
.section-index { font-family: monospace; font-size: 11px; color: #909780; }
.builder-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 27px 30px;
    border-radius: var(--radius);
    margin-top: 28px;
    box-shadow: 0 12px 35px #244f4006;
}
.builder-card label { margin-top: 0; font-size: 14px; }
.form-help { font-size: 12px; color: var(--muted); margin-top: 13px; }
.step-number { display: flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; background: #eef2e3; border: 1px solid #dbe2c8; color: #768650; border-radius: 10px; font-size: 17px; }
label { display: block; font-size: 12px; color: #56634f; font-weight: 550; margin-block: 14px 7px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; color: var(--ink); background: #fff; font-size: 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #7f9664; box-shadow: 0 0 0 3px #8c9c6c1c; }
input::placeholder, textarea::placeholder { color: #a4a99a; }
input[dir="ltr"] { font-family: Vazirmatn, Arial, sans-serif; }
.url-row { display: flex; gap: 12px; }
.url-input-wrap { position: relative; flex: 1; min-width: 0; }
.url-input-wrap input { padding: 15px 19px 15px 45px; height: 55px; background: #fafbf7; font-size: 15px; }
.url-input-wrap > span { position: absolute; left: 18px; top: 10px; font-size: 22px; color: #8b947a; }
.url-row .button { padding-inline: 33px; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.link-button { border: 0; background: transparent; padding: 4px 0; font-size: 12px; color: var(--green); text-decoration: underline; text-decoration-color: #bcc6a2; text-underline-offset: 5px; }
.form-error { margin-top: 15px; color: var(--error); font-size: 12px; background: #fbf0ec; padding: 10px 15px; border-radius: 8px; }
.progress-panel { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.progress-top { display: flex; align-items: center; gap: 12px; font-size: 13px; }
#progress-number { margin-right: auto; color: var(--muted); }
progress { width: 100%; height: 8px; display: block; appearance: none; border: 0; border-radius: 5px; margin-block: 20px 12px; overflow: hidden; background: var(--soft); }
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value { background: #8ba35e; transition: width 200ms; }
progress::-moz-progress-bar { background: #8ba35e; }
.progress-panel p { font-size: 11px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid #d0dac2; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.workspace { padding-block: 40px 20px; }
.badge { font-size: 11px; background: #e8eedb; color: #58723a; border: 1px solid #d5dfc0; padding: 6px 12px; border-radius: 30px; }
.badge.invalid { background: #fbefeb; color: var(--error); border-color: #ebcfc2; }
.notice { padding: 16px 20px; margin-bottom: 22px; border-radius: 10px; background: #f0f0e0; border: 1px solid #dfdfc4; font-size: 12px; color: #6a704c; }
.workspace-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 24px; align-items: start; }
.editor-panel { padding: 27px; border: 1px solid var(--line); background: white; border-radius: var(--radius); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-heading h3 { font-size: 15px; font-weight: 600; }
.resources-heading { border-top: 1px solid var(--line); padding-top: 25px; margin-top: 28px; }
.count { font-size: 10px; color: #718555; background: var(--soft); border-radius: 5px; padding: 2px 6px; margin-right: 5px; }
.entry-card { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 15px; }
.entry-card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.entry-card h4 { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.entry-card .entry-type { font-size: 9px; display: block; text-align: right; margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; font-family: monospace; }
.entry-card-actions { display: flex; gap: 10px; flex-shrink: 0; }
.entry-card-actions button { border: 0; background: transparent; font-size: 11px; padding: 2px 0; color: var(--green); }
.entry-card-actions .delete-entry { color: var(--error); }
.empty-state { padding: 35px 15px 15px; text-align: center; }
.empty-state > span { font-size: 29px; font-family: monospace; color: #a0b080; }
.empty-state h4 { font-size: 14px; margin-block: 9px; font-weight: 550; }
.empty-state p { font-size: 11px; color: var(--muted); line-height: 2; }
.output-panel { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.output-header { display: flex; justify-content: space-between; align-items: center; background: #2b4938; color: #dce7d2; padding: 14px 20px; font-size: 11px; }
.output-header button { border: 1px solid #617659; border-radius: 6px; color: #e0e8d4; background: transparent; padding: 4px 9px; font-family: Vazirmatn, sans-serif; font-size: 10px; }
#json-editor { border: 0; border-radius: 0; display: block; resize: vertical; width: 100%; min-height: 375px; font-size: 11px; line-height: 2; padding: 24px; background: #223e31; color: #dae5bc; tab-size: 2; }
#json-editor:focus { box-shadow: inset 0 0 0 2px #8aa45f; }
.output-status { display: flex; justify-content: space-between; gap: 10px; padding: 8px 20px; font-size: 10px; background: #f0f3e9; color: #6b7d57; }
.output-help { padding: 15px 20px 0; line-height: 1.9; font-size: 10px; }
.output-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 20px; }
.output-actions .button { padding: 9px 13px; min-height: 39px; font-size: 11px; }
.output-actions .primary { flex: 1; }
.validation-messages { padding: 0 20px 15px; font-size: 11px; line-height: 2; }
.validation-messages ul { padding-right: 17px; margin: 0; }
.validation-errors { color: var(--error); }
.validation-warnings { color: #8b7941; }
.report-details { border: 1px solid var(--line); border-radius: 10px; margin-top: 20px; background: #fff; padding: 14px 21px; font-size: 12px; }
.report-details summary { color: var(--green); cursor: pointer; }
#report-content { padding-top: 17px; overflow-wrap: anywhere; }
#report-content ul { padding-right: 18px; }
.install-card { display: flex; gap: 18px; background: #eaf0dd; padding: 26px; border-radius: 12px; margin-top: 23px; }
.install-card h3 { font-size: 16px; }
.install-card p { font-size: 12px; margin-top: 7px; color: #697755; }
.install-card a { display: inline-block; font-size: 12px; margin-top: 13px; border-bottom: 1px solid #afc391; }
code { font-size: 0.87em; overflow-wrap: anywhere; }
.how-section { padding-block: 40px 60px; }
.quiet-link { font-size: 12px; color: #718057; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how-grid article { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 12px; }
.feature-icon { display: inline-flex; justify-content: center; align-items: center; width: 37px; height: 37px; background: #e9efda; color: #758a4d; border-radius: 9px; font-size: 22px; }
.feature-number { position: absolute; left: 28px; top: 26px; font-size: 12px; color: #a0a58e; }
.how-grid h3 { margin-block: 22px 9px; font-size: 16px; font-weight: 600; }
.how-grid p { font-size: 12px; line-height: 2.1; color: #78806f; }
.faq-section { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 100px; border-top: 1px solid var(--line); padding-block: 62px 82px; }
.faq-section h2 { font-size: 28px; margin-block: 10px 12px; letter-spacing: -0.6px; }
.faq-section > div > p { font-size: 12px; color: var(--muted); }
.faq-list details { border-bottom: 1px solid var(--line); padding-block: 18px; }
.faq-list details:first-child { padding-top: 5px; }
summary { cursor: pointer; }
.faq-list summary { font-size: 13px; font-weight: 550; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.faq-list summary::after { content: '+'; font-size: 21px; font-weight: 400; color: #8c997a; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list p { font-size: 12px; color: var(--muted); padding-top: 13px; line-height: 2.1; }
.site-footer { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding-block: 28px; }
.site-footer .brand { font-size: 19px; }
.site-footer p, .site-footer a:not(.brand) { font-size: 11px; color: var(--muted); }
.site-footer > div { display: flex; gap: 24px; }
.site-footer small { grid-column: 1 / -1; text-align: center; border-top: 1px solid #e8e9df; padding-top: 18px; font-size: 9px; color: #929783; }
dialog { width: min(570px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 16px; padding: 27px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #142d226b; backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-header h2 { font-size: 23px; }
.icon-button { border: 0; width: 30px; height: 30px; background: var(--soft); color: var(--green); border-radius: 50%; font-size: 22px; line-height: 1; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 22px; z-index: 100; background: #244f40; color: #fff; border-radius: 10px; font-size: 12px; box-shadow: 0 8px 24px #152d2225; max-width: calc(100% - 32px); }
.article { width: min(820px, calc(100% - 64px)); margin: 70px auto 100px; }
.article h1 { font-size: clamp(31px, 4vw, 45px); letter-spacing: -1px; line-height: 1.6; margin-block: 15px 26px; font-weight: 700; }
.article .lead { font-size: 18px; color: #6d7a5b; line-height: 2.1; }
.article h2 { margin-block: 46px 15px; font-size: 25px; font-weight: 650; }
.article h3 { margin-block: 27px 12px; font-size: 18px; }
.article p, .article li { font-size: 14px; line-height: 2.2; }
.article p + p { margin-top: 16px; }
.article a:not(.button) { color: #607746; text-decoration: underline; text-underline-offset: 4px; }
.article pre { padding: 23px; background: #223e31; color: #d7e3b7; border-radius: 12px; overflow: auto; font-size: 12px; line-height: 2; text-align: left; margin-block: 20px; }
.article table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 12px; }
.article th, .article td { text-align: right; padding: 13px; border-bottom: 1px solid var(--line); }
.article th { background: var(--soft); font-weight: 600; }
.article .notice { margin-top: 25px; }
.article .button { margin-top: 25px; }

@media (max-width: 1100px) {
    .container { width: calc(100% - 64px); }
    nav { gap: 20px; }
    .header-link { display: none; }
    .faq-section { gap: 55px; }
}
@media (max-width: 760px) {
    .container { width: calc(100% - 40px); }
    .site-header { padding-block: 19px; gap: 15px; flex-wrap: wrap; }
    .brand { font-size: 20px; }
    .brand img { width: 34px; height: 34px; }
    nav { gap: 16px; font-size: 11px; }
    .hero { padding-block: 28px 24px; }
    .hero h1 { font-size: 36px; letter-spacing: -1px; }
    .hero-description { font-size: 13px; max-width: 340px; }
    .section-heading h2 { font-size: 25px; }
    .section-index { display: none; }
    .builder-card { padding: 24px; }
    .url-row { flex-direction: column; }
    .url-row .button { width: 100%; }
    .form-bottom { gap: 12px; }
    .form-bottom .link-button { font-size: 11px; }
    .form-help { font-size: 11px; }
    .workspace-grid { grid-template-columns: 1fr; }
    .workspace .section-heading { align-items: center; }
    .badge { font-size: 9px; padding-inline: 9px; }
    .editor-panel { padding: 23px; }
    #json-editor { min-height: 330px; font-size: 10px; padding: 18px; }
    .install-card { padding: 22px; gap: 12px; }
    .how-section { padding-block: 30px 45px; }
    .how-section .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .how-grid { grid-template-columns: 1fr; gap: 15px; }
    .how-grid article { padding: 23px; }
    .how-grid h3 { margin-top: 15px; }
    .faq-section { grid-template-columns: 1fr; gap: 30px; padding-block: 45px 55px; }
    .site-footer { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 15px; }
    .site-footer small { width: 100%; }
    .article { width: calc(100% - 40px); margin-block: 45px 65px; }
    .article .lead { font-size: 16px; }
    .article pre { padding: 16px; font-size: 10px; }
    .article table { font-size: 10px; }
    .article td, .article th { padding: 10px 6px; }
}
@media (max-width: 420px) {
    .site-header { justify-content: center; }
    .hero h1 { font-size: 32px; }
    .hero-meta { gap: 8px; font-size: 10px; }
    .hero-meta span + span::before { margin-left: 8px; }
    .builder-card { padding: 20px; }
    .field-pair { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
