/* MiniGoogle — one small stylesheet for every page. No framework; RTL first, dark mode follows the system. */
/* Vazirmatn 33.0.3 (SIL OFL, fonts/OFL.txt): one variable file serves every weight. */
@font-face {
    font-family: Vazirmatn;
    src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
    color-scheme: light dark;
    --bg: #fff; --fg: #202124; --muted: #5f6368; --faint: #70757a;
    --link: #1a0dab; --visited: #681da8; --url: #188038;
    --line: #dfe1e5; --soft: #f1f3f4; --accent: #1a73e8; --bad: #c5221f; --ok: #188038;
    --shadow: 0 1px 6px rgba(32,33,36,.28);
    --radius: 24px;
}
/* Dark: chosen in the footer (data-theme, from a cookie), or the system's when nothing is chosen. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) {
        --bg: #1f1f1f; --fg: #e8eaed; --muted: #bdc1c6; --faint: #9aa0a6;
        --link: #99c3ff; --visited: #c58af9; --url: #81c995;
        --line: #3c4043; --soft: #303134; --accent: #8ab4f8; --bad: #f28b82; --ok: #81c995;
        --shadow: 0 1px 6px rgba(0,0,0,.6);
    }
}
:root[data-theme=dark] {
    color-scheme: dark;
    --bg: #1f1f1f; --fg: #e8eaed; --muted: #bdc1c6; --faint: #9aa0a6;
    --link: #99c3ff; --visited: #c58af9; --url: #81c995;
    --line: #3c4043; --soft: #303134; --accent: #8ab4f8; --bad: #f28b82; --ok: #81c995;
    --shadow: 0 1px 6px rgba(0,0,0,.6);
}
:root[data-theme=light] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--fg);
    font: 15px/1.7 Vazirmatn, "Segoe UI", Tahoma, system-ui, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; background: var(--soft); border-radius: 6px; }
code { padding: 1px 6px; direction: ltr; unicode-bidi: isolate; }
pre { padding: 10px 14px; overflow-x: auto; text-align: left; }
.ltr { direction: ltr; text-align: left; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 10; background: var(--bg); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.skip:focus { top: 8px; }
.bad { color: var(--bad); }

/* Logo */
.logo { font-weight: 700; letter-spacing: -1px; color: var(--fg); direction: ltr; display: inline-block; line-height: 1; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo .c1 { color: #4285f4; } .logo .c2 { color: #ea4335; } .logo .c3 { color: #fbbc05; } .logo .c4 { color: #34a853; }

/* Search box */
.sbox { display: flex; align-items: center; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding-inline: 18px 6px; }
.sbox:hover, .sbox:focus-within { box-shadow: var(--shadow); border-color: transparent; }
.sbox input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--fg); background: transparent; border: 0; outline: 0; padding: 11px 0; }
.sbox input::-webkit-search-cancel-button { cursor: pointer; }
.sbox button { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); cursor: pointer; }
.sbox button:hover { background: var(--soft); }
.sbox svg { width: 22px; height: 22px; fill: currentColor; }

/* Header (results and inner pages) */
.top { display: flex; align-items: center; gap: 28px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.top .logo { font-size: 26px; }
.top form { flex: 1; max-width: 690px; }
.top nav { margin-inline-start: auto; font-size: 14px; }

main { flex: 1; width: 100%; display: flex; flex-direction: column; }
main:focus { outline: 0; }
.col { max-width: 700px; padding: 0 20px; margin-inline-start: max(0px, calc(min(170px, 12vw) - 20px)); }
.page { width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 20px 32px; }
.page h1 { font-size: 26px; font-weight: 600; margin: 24px 0 12px; }
.page h2 { font-size: 19px; font-weight: 600; margin: 28px 0 8px; }
.page li { margin-bottom: 6px; }
.page .lead { font-size: 17px; color: var(--muted); }

/* Home */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px 12vh; }
.home .logo { font-size: clamp(48px, 13vw, 72px); margin-bottom: 28px; }
.home form { max-width: 584px; width: 100%; }
.home .note { color: var(--muted); font-size: 13px; margin-top: 22px; text-align: center; max-width: 584px; }
.home .note b { color: var(--fg); font-weight: 600; }
.home .note code { display: block; margin-top: 8px; white-space: pre-wrap; text-align: left; }

/* Results */
.stats { color: var(--faint); font-size: 13px; margin: 12px 0 18px; }
.fix { margin: 16px 0 4px; font-size: 18px; }
.fix small { display: block; font-size: 14px; color: var(--muted); }
.hits { list-style: none; margin: 0; padding: 0; }
.hit { margin-bottom: 26px; overflow-wrap: anywhere; }
.hit > a { display: block; }
.hit > a:hover { text-decoration: none; }
.hit > a:hover h2 { text-decoration: underline; }
.hit > a:visited h2 { color: var(--visited); }
.hit cite { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 13px; color: var(--url); direction: ltr; justify-content: flex-start; overflow: hidden; white-space: nowrap; }
.hit[dir=rtl] cite { justify-content: flex-end; }
.hit cite .host { color: var(--fg); }
.hit cite .path { color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.hit h2 { margin: 3px 0 2px; font-size: 20px; font-weight: 400; line-height: 1.35; color: var(--link); }
.hit p { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hit b { color: var(--fg); font-weight: 600; }
.hit h2 b { color: inherit; font-weight: inherit; }
.lang { font-size: 11px; line-height: 16px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--faint); }
.none { padding: 8px 0 32px; }
.none ul { color: var(--muted); padding-inline-start: 20px; }

/* Tabs: web, pictures, videos */
.tabs { display: flex; gap: 4px; margin: 10px 0 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.tabs a, .tabs span { padding: 8px 12px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs [aria-current] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Pictures: a grid of cards. A picture that no longer loads leaves its words in a grey box. */
.col.wide-col { max-width: 1180px; }
.pics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 12px; }
.pics a { display: block; color: var(--fg); overflow-wrap: anywhere; }
.pics a:hover { text-decoration: none; }
.pics img { display: block; width: 100%; height: 160px; object-fit: cover; border-radius: 10px; background: var(--soft); color: var(--faint); font-size: 12px; }
.pics a:hover img { box-shadow: var(--shadow); }
.pics .cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 13px; line-height: 1.5; }
.pics a:hover .cap { text-decoration: underline; }
.pics cite { display: block; font-style: normal; font-size: 12px; color: var(--faint); direction: ltr; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pics [dir=rtl] cite { text-align: right; }

/* Videos: results with a thumbnail */
.hit.video { display: flex; gap: 16px; align-items: flex-start; }
.hit.video > div { flex: 1; min-width: 0; }
.hit.video .thumb { position: relative; flex: none; width: 176px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--soft); }
.hit.video .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hit.video .dur { position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
@media (max-width: 560px) {
    .hit.video { flex-direction: column; gap: 8px; }
    .hit.video .thumb { width: 100%; }
    .pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 34px 0 44px; padding: 0; list-style: none; }
.pager a, .pager span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; }
.pager a:hover { background: var(--soft); text-decoration: none; }
.pager [aria-current] { background: var(--accent); color: var(--bg); font-weight: 600; }
.pager .step { padding: 0 16px; }

/* Footer */
footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding: 16px 20px; background: var(--soft); color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); }
footer .theme { display: inline-flex; gap: 10px; }
footer .theme [aria-current] { color: var(--fg); font-weight: 600; }

/* Forms on inner pages (admin, sign-in) */
.page :is(input, textarea, button, select):not(.sbox *) { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }
.page button:not(.sbox *) { cursor: pointer; }
.page button:not(.sbox *):hover { background: var(--soft); }


/* Panels (advertiser, admin): cards, tables, stacked forms, status tags */
.page.wide { max-width: 960px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card b { display: block; font-size: 22px; font-weight: 600; }
.card span { color: var(--muted); font-size: 13px; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { font-weight: 600; color: var(--muted); font-size: 13px; }
table.data td, table.data th { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: start; vertical-align: top; }
table.data .n { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 10px; max-width: 520px; }
.stack label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.stack label > span small { color: var(--faint); }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choices legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.stack .choices label { display: flex; gap: 8px; align-items: baseline; color: var(--fg); font-size: 15px; }
.page .choices input:not(.sbox *) { padding: 0; flex: none; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row form { margin: 0; }
.msg { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ok) 15%, transparent); }
.msg.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.tag { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.tag.wait { background: color-mix(in srgb, #f9ab00 22%, transparent); color: var(--fg); }
.page textarea:not(.sbox *) { width: 100%; min-height: 140px; direction: ltr; text-align: left; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.page textarea[dir=auto] { direction: rtl; text-align: right; font-family: inherit; }
.page .primary:not(.sbox *) { background: var(--accent); color: var(--bg); border-color: transparent; font-weight: 600; }
.page .primary:not(.sbox *):hover { background: var(--accent); filter: brightness(1.1); }
.link-button { background: none !important; border: 0 !important; padding: 0 !important; color: var(--link) !important; cursor: pointer; font: inherit; }
.preview { max-width: 560px; }

/* Ads on the results page: same shape as results, clearly labelled */
.ads { margin: 6px 0 22px; }
.ads.bottom { margin: 4px 0 8px; }
.ad { margin-bottom: 20px; }
.ad cite { display: flex; align-items: center; gap: 8px; font-style: normal; font-size: 13px; color: var(--fg); }
.ad cite .label { font-weight: 700; font-size: 12px; }
.ad cite bdi { direction: ltr; unicode-bidi: isolate; color: var(--url); }
.ad > a { display: block; }
.ad > a:hover { text-decoration: none; }
.ad > a:hover h2 { text-decoration: underline; }
.ad h2 { margin: 3px 0 2px; font-size: 20px; font-weight: 400; line-height: 1.35; color: var(--link); }
.ad p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* Answer boxes above the results: prices, calculator, dates, translation. */
.ans { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 4px 0 26px; }
.ans p { margin: 0; }
.ans-k { color: var(--muted); font-size: 14px; }
.ans-v { font-size: 30px; font-weight: 600; line-height: 1.4; margin: 2px 0 4px !important; }
.ans-v small { font-size: 16px; font-weight: 400; color: var(--muted); }
.ans-sub { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ans-meta { color: var(--faint); font-size: 12px; margin-top: 12px !important; }
.ans .up { color: var(--ok); } .ans .down { color: var(--bad); }
.ans-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 20px; border-top: 1px solid var(--line); }
.ans-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ans-list li span { color: var(--muted); white-space: nowrap; }
.ans-list.occ { grid-template-columns: 1fr; }
.ans-list.occ li span { white-space: normal; text-align: left; }
.ans-list.occ li.past { opacity: .55; }
.ans-list.occ li span.name { color: inherit; text-align: right; }
.ans-list.occ b { font-weight: 600; margin-left: 6px; }
.ans :is(input, textarea, select, button) { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.ans button { cursor: pointer; }
.ans button.primary { background: var(--accent); color: var(--bg); border-color: transparent; font-weight: 600; }
.ans button.primary:hover { filter: brightness(1.1); }
.ans-form { margin-top: 14px; }
.ans-form input { width: 9em; text-align: center; }
.calc-x { color: var(--muted); font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.calc-r { font-size: 34px; font-weight: 600; text-align: left; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.calc-in { margin-top: 12px; flex-wrap: nowrap; }
.calc-in input { flex: 1; min-width: 0; font-size: 17px; text-align: left; }
.calc-in button { min-width: 52px; font-size: 18px; }
.ans-dates { border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.ans-dates th { font-weight: 400; color: var(--muted); text-align: start; padding: 5px 0 5px 18px; }
.ans-dates td { padding: 5px 0 5px 18px; }
.ans-dates .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.ans-dates tr.from td:first-of-type { font-weight: 600; }
.tr .row span { color: var(--muted); }
.tr-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tr-panes textarea { width: 100%; min-height: 120px; resize: vertical; font-size: 17px; line-height: 1.6; }
.tr-out { min-height: 120px; padding: 7px 12px; border-radius: 8px; background: var(--soft); font-size: 17px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .tr-panes { grid-template-columns: 1fr; }
    .ans-v { font-size: 26px; }
    .top { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
    .top .logo { font-size: 22px; }
    .top form { order: 3; flex-basis: 100%; max-width: none; }
    .col, .page { padding: 0 16px; margin: 0; }
    .page { padding-bottom: 24px; }
    .hit h2 { font-size: 18px; }
    .pager .num { display: none; }
    .pager [aria-current] { display: grid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top form, .pager, footer, .skip { display: none; } }
