:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16191f;
  --muted: #5b6472;
  --line: #e2e6eb;
  --brand: #0f7b5f;
  --brand-ink: #ffffff;
  --soft: #e7f3ef;
  --warn-bg: #fff7e0;
  --warn-ink: #6b5200;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(16, 24, 40, .12);
  color-scheme: light;
}
/* Dark tokens: follow the device unless the visitor picked light; or when the visitor picked dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --card: #161a21;
    --text: #e8eaed;
    --muted: #9aa3af;
    --line: #2a303a;
    --brand: #2bb38a;
    --brand-ink: #06120e;
    --soft: #12251f;
    --warn-bg: #2a2410;
    --warn-ink: #f1d98a;
    --shadow: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116;
  --card: #161a21;
  --text: #e8eaed;
  --muted: #9aa3af;
  --line: #2a303a;
  --brand: #2bb38a;
  --brand-ink: #06120e;
  --soft: #12251f;
  --warn-bg: #2a2410;
  --warn-ink: #f1d98a;
  --shadow: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}
a { color: var(--brand); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.logo { font-weight: 700; font-size: 1.5rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.logo span { color: var(--brand); }
.site-header nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: .95rem; }
.site-header nav a:hover, .site-header nav a[aria-current] { background: var(--soft); color: var(--brand); }
.head-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.menu-btn, .theme-btn, .lang {
  font: inherit; font-weight: 600; font-size: .9rem; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; white-space: nowrap;
  cursor: pointer; text-decoration: none; line-height: 1.5;
}
.menu-btn { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.menu-btn::after { content: " ▾"; font-size: .8em; }
.menu-btn[aria-expanded="true"]::after { content: " ▴"; }
.theme-btn { width: 36px; padding: 5px 0; }
.lang { color: var(--brand); }
.theme-btn:hover, .lang:hover { border-color: var(--brand); }
@media (max-width: 760px) {
  .site-header nav { display: none; }
  .site-header .wrap { gap: 10px; }
}

/* "All tools" mega menu */
.mega { position: absolute; inset-inline: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 61px); overflow-y: auto; }
.mega .wrap { display: block; padding-top: 16px; padding-bottom: 16px; }
.tool-search { font-size: 1rem; padding: 12px 14px; min-height: 48px; margin-bottom: 14px; }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 20px; }
.mega h4 { margin: 4px 0 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.mega-cols a, .mega-results a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .95rem; line-height: 1.4; }
.mega-cols a:hover, .mega-results a:hover, .mega-results a:first-child { background: var(--soft); color: var(--brand); }
.mega-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px; }
.mega .ico { width: 24px; text-align: center; }
.mega-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.mega-foot .btn { display: inline-block; text-decoration: none; }

/* Page */
main { padding: 28px 0 40px; }
h1 { font-size: 1.75rem; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 32px 0 8px; }
h3 { font-size: 1.05rem; margin: 20px 0 4px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .tool { grid-template-columns: 1fr; } }

/* Form */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.5; margin-top: 4px; }
input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg label { flex: 1; text-align: center; padding: 7px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .92rem; margin: 0; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--brand); color: var(--brand-ink); }
.btn { font: inherit; font-weight: 600; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; }
.btn.ghost { background: var(--soft); color: var(--brand); }

/* Results */
.result { background: var(--soft); border-color: transparent; }
.result .big { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1.3; margin: 4px 0 12px; word-break: break-word; }
.result .label { color: var(--muted); font-size: .9rem; }
.lines { list-style: none; padding: 0; margin: 0; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: .95rem; }
.lines li b { white-space: nowrap; }
.hint { color: var(--muted); }
.note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin-top: 12px; line-height: 1.6; }
.words { font-size: 1.25rem; font-weight: 600; line-height: 1.9; margin: 6px 0 14px; }

/* Ads */
.ad-slot { margin: 24px 0; min-height: 100px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }

/* Home grid */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 2rem; }
.home-search { margin: 14px 0 0; max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile .ico { font-size: 1.6rem; }
.tile h3 { margin: 6px 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* Article */
article { margin-top: 8px; }
article p, article li { color: var(--text); }
article table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .93rem; }
article th, article td { border: 1px solid var(--line); padding: 8px; text-align: start; }
article th { background: var(--soft); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
details summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related a { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-size: .9rem; }

/* Footer */
footer { border-top: 1px solid var(--line); background: var(--card); padding: 22px 0; color: var(--muted); font-size: .88rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer a { color: var(--muted); margin-inline-start: 14px; }

/* Home categories */
.cat { margin: 26px 0 10px; font-size: 1.1rem; color: var(--muted); }

/* Invoice tool */
.items { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.items th { text-align: start; font-size: .85rem; color: var(--muted); font-weight: 600; padding: 4px; }
.items td { padding: 4px; vertical-align: top; }
.items td input { min-height: 40px; padding: 8px; }
.items .del { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; padding: 6px; }
.items .c-qty { width: 70px; }
.items .c-price { width: 110px; }
@media (max-width: 560px) {
  .items thead { display: none; }
  .items tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px; border-bottom: 1px dashed var(--line); padding: 6px 0; }
  .items td:first-child { grid-column: 1 / -1; }
  .items .c-qty, .items .c-price { width: auto; }
  .gpa-rows tr { grid-template-columns: 1fr 1.6fr auto; }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.check input { width: auto; min-height: 0; }

.invoice { background: #fff; color: #111; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-top: 16px; font-size: .92rem; line-height: 1.6; }
.invoice h2 { margin: 0 0 2px; font-size: 1.3rem; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 12px; }
.invoice .qr svg { width: 130px; height: 130px; display: block; }
.invoice .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 12px; }
.invoice table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.invoice th, .invoice td { border: 1px solid #ccc; padding: 6px 8px; text-align: start; }
.invoice th { background: #f1f1f1; }
.invoice .totals { margin-inline-start: auto; width: min(100%, 320px); }
.invoice .totals td:last-child { text-align: end; font-weight: 600; white-space: nowrap; }
.invoice .grand td { background: #f1f1f1; font-size: 1rem; }
.invoice .words { font-size: .9rem; font-weight: 400; margin: 8px 0 0; }
@media (max-width: 560px) { .invoice { padding: 16px; } .invoice .inv-head { flex-direction: column-reverse; } .invoice .meta { grid-template-columns: 1fr; } }

@media print {
  body { background: #fff; }
  .site-header, footer, .no-print, .ad-slot, article, .crumbs, h1, .lead { display: none !important; }
  main { padding: 0; }
  .invoice { border: 0; margin: 0; padding: 0; }
}

/* Quotation document extras */
textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 80px; resize: vertical; }
textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.invoice .doc-notes { margin-top: 14px; font-size: .88rem; }
.invoice .doc-disclaimer { margin: 18px 0 0; padding-top: 10px; border-top: 1px solid #ddd; font-size: .8rem; color: #666; text-align: center; }

/* Let grid columns shrink on small screens (date inputs have a large minimum width) */
.tool > *, .row > *, .row3 > * { min-width: 0; }

/* Mortgage yearly schedule */
.sched-wrap { margin-top: 12px; }
.sched-wrap summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.sched { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
.sched th, .sched td { padding: 5px 4px; text-align: end; border-top: 1px dashed var(--line); }
.sched th:first-child, .sched td:first-child { text-align: start; }
.sched th { color: var(--muted); font-weight: 600; }

/* Countdown */
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cd-first { grid-column: 1 / -1; }
.cd { display: flex; gap: 8px; margin: 6px 0 10px; }
.cd span { flex: 1; display: flex; flex-direction: column; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; font-size: .78rem; color: var(--muted); }
.cd b { font-size: 1.5rem; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cd-first .cd b { font-size: 2.2rem; }
#txt { min-height: 220px; }

[hidden] { display: none !important; }
html.no-scroll { overflow: hidden; }

/* Header icon buttons (search, country) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 34px; min-width: 36px; padding: 0 8px;
  font: inherit; font-weight: 700; font-size: .78rem; letter-spacing: .02em; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 480px) {
  .head-actions { gap: 5px; }
  .site-header .wrap { gap: 6px; }
  .menu-btn { padding: 5px 8px; }
  .country-btn svg { display: none; }
  .lang { font-size: 0; padding: 5px 9px; }
  .lang::after { content: attr(data-short); font-size: .9rem; }
}

/* Quick search palette */
.palette { position: fixed; inset: 0; z-index: 50; background: rgb(10 14 20 / .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: fade .15s ease-out; }
.palette-box { width: min(640px, 100%); max-height: min(560px, 80vh); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgb(0 0 0 / .28); overflow: hidden; animation: pop .16s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: none; outline: none; font-size: 1.08rem; min-height: 52px; padding: 0; color: var(--text); }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-close { font: inherit; font-size: .72rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; cursor: pointer; }
.palette-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pal-head { font-size: .78rem; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
.pal-item[aria-selected="true"] { background: var(--soft); }
.pal-item[aria-selected="true"] b { color: var(--brand); }
.pal-item .ico { font-size: 1.3rem; width: 34px; height: 34px; display: grid; place-items: center; background: var(--bg); border-radius: 9px; flex: none; }
.pal-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pal-text b { font-weight: 600; font-size: .95rem; }
.pal-text small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-cat { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.pal-empty { padding: 18px 12px; }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
kbd { font: inherit; font-size: .7rem; background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; margin: 0 1px; }
@media (max-width: 560px) {
  .palette { padding: 0; align-items: stretch; }
  .palette-box { max-height: none; height: 100%; border-radius: 0; border: 0; }
  .palette-foot, .pal-cat { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* Country popup */
.modal { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px 22px; background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgb(0 0 0 / .3); position: relative; }
.modal[open] { animation: pop .18s ease-out; }
.modal::backdrop { background: rgb(10 14 20 / .5); backdrop-filter: blur(3px); }
.modal h2 { margin: 0 0 6px; font-size: 1.3rem; }
.modal p { color: var(--muted); margin: 0 0 18px; line-height: 1.7; font-size: .93rem; }
.modal-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.modal-ico svg { width: 26px; height: 26px; }
.modal-x { position: absolute; top: 10px; inset-inline-end: 10px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; border-radius: 8px; }
.modal-x:hover { background: var(--bg); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.country-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.country-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.country-opt small { color: var(--muted); font-size: .76rem; }
.country-opt:hover { border-color: var(--brand); }
.country-opt[aria-pressed="true"] { border-color: var(--brand); background: var(--soft); }
.country-opt[aria-pressed="true"] b { color: var(--brand); }
.country-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; font-size: .9rem; line-height: 1.6; }
.country-note .btn { padding: 4px 12px; min-height: 0; font-size: .85rem; }

/* Date picker (datepicker.js) */
.dp-field {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px; text-align: start;
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.dp-field:hover { border-color: var(--brand); }
.dp-field:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.dp-field > svg { color: var(--brand); flex: none; }
.dp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dp-main { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-ph { color: var(--muted); font-weight: 400; }

.dp-pop {
  position: absolute; z-index: 60; width: 324px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgb(0 0 0 / .22); padding: 12px; animation: pop .14s ease-out;
}
.dp-shade { position: fixed; inset: 0; z-index: 59; background: rgb(10 14 20 / .45); animation: fade .15s; }
.dp-pop.dp-sheet { position: fixed; inset: auto 0 0 0; width: auto; border-radius: 20px 20px 0 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(30%); opacity: 0; } }
.dp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dp-switch { flex: 1; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.dp-switch button { font: inherit; font-size: .88rem; font-weight: 600; border: 0; border-radius: 7px; padding: 6px; background: none; color: var(--muted); cursor: pointer; }
.dp-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.dp-x { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; display: none; }
.dp-sheet .dp-x { display: block; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.dp-arrow { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; }
.dp-arrow:hover, .dp-title:hover { background: var(--soft); color: var(--brand); }
.dp-next svg { transform: scaleX(-1); }
html[dir="rtl"] .dp-prev svg { transform: scaleX(-1); }
html[dir="rtl"] .dp-next svg { transform: none; }
.dp-title { font: inherit; font-weight: 700; font-size: 1rem; border: 0; background: none; color: var(--text); padding: 6px 12px; border-radius: 10px; cursor: pointer; }
.dp-title span { font-size: .7em; color: var(--muted); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: .7rem; color: var(--muted); padding: 4px 0; font-weight: 600; }
.dp-week .is-wkd { color: #c0392b; opacity: .8; }
.dp-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; font: inherit; padding: 0; line-height: 1.1;
}
.dp-day b { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.dp-day small { font-size: .6rem; color: var(--muted); max-width: 100%; overflow: hidden; white-space: nowrap; }
.dp-day.is-wkd b { color: var(--muted); }
.dp-day:hover { background: var(--soft); }
.dp-day:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.dp-day.is-today b { color: var(--brand); }
.dp-day.is-sel { background: var(--brand); box-shadow: none; }
.dp-day.is-sel b, .dp-day.is-sel small { color: var(--brand-ink); }
.dp-list { display: grid; gap: 6px; }
.dp-months { grid-template-columns: repeat(3, 1fr); }
.dp-years { grid-template-columns: repeat(4, 1fr); max-height: 252px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.dp-list button { font: inherit; font-size: .88rem; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; padding: 10px 4px; cursor: pointer; }
.dp-list button:hover { border-color: var(--brand); color: var(--brand); }
.dp-list button.is-sel { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.dp-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-today { font: inherit; font-size: .85rem; font-weight: 600; border: 0; border-radius: 8px; padding: 6px 12px; background: var(--soft); color: var(--brand); cursor: pointer; }
.dp-note { font-size: .78rem; color: var(--muted); flex: 1; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-sheet .dp-day b { font-size: 1.05rem; }
@media (max-width: 370px) {
  .logo { font-size: 1.25rem; }
  .menu-btn { font-size: .8rem; padding: 5px 7px; }
  .menu-btn::after { content: none; }
  .theme-btn, .icon-btn { min-width: 32px; width: auto; padding: 0 6px; }
  .theme-btn { width: 32px; padding: 5px 0; }
  .lang { padding: 5px 7px; }
}

/* "Not available for your country" marks */
.na { display: inline-flex; align-items: center; gap: 4px; color: #b45309; vertical-align: middle; flex: none; }
.na svg { flex: none; }
:root[data-theme="dark"] .na { color: #f0b35a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .na { color: #f0b35a; } }
.tile { position: relative; }
.tile .na { position: absolute; top: 12px; inset-inline-end: 12px; font-size: .72rem; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink); border-radius: 99px; padding: 3px 8px 3px 7px; }
.tile.is-na .ico, .tile.is-na h3 { opacity: .6; }
.mega-cols a.is-na > span:nth-child(2), .mega-results a.is-na > span:nth-child(2) { opacity: .65; }
.mega-cols a .na { margin-inline-start: auto; }
.na-legend { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .8rem; color: var(--muted); }
.na-legend svg { color: #b45309; }
.palette .na-legend { padding: 0 10px; margin: 2px 0 6px; }

/* "This calculator by country" row on labour tool pages (built by build/country-pages.js) */
.law-countries { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 18px; font-size: .85rem; }
.law-countries span { color: var(--muted); margin-inline-end: 2px; }
.law-countries a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--card); }
.law-countries a:hover { border-color: var(--brand); color: var(--brand); }
.law-countries a[aria-current="page"] { background: var(--soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* Percentage page: sentence-style calculators (assets/tools/percentage.js) */
.pct-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pct-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 600; }
.pct-nav a:hover { border-color: var(--brand); color: var(--brand); }
.pct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pct-card { scroll-margin-top: 80px; display: flex; flex-direction: column; min-width: 0; }
.pct-card:target { outline: 2px solid var(--brand); outline-offset: 2px; }
.pct-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin: 0 0 4px; }
.pct-ico { font-size: 1.3rem; }
.pct-use { color: var(--muted); font-size: .9rem; margin: 0 0 14px; line-height: 1.6; }
.pct-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 600; line-height: 2; }
.pct-box { display: inline-flex; align-items: center; gap: 4px; }
.pct-in { width: 6.5em; min-height: 44px; padding: 6px 10px; font-size: 1.05rem; font-weight: 700; text-align: center; }
.pct-sel { width: auto; text-align: start; }
.pct-unit { color: var(--muted); font-weight: 600; font-size: .95rem; }
.pct-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pct-presets button { font: inherit; font-size: .85rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.pct-presets button:hover { border-color: var(--brand); }
.pct-presets button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pct-out { margin-top: 14px; padding: 14px 16px; background: var(--soft); border-radius: 12px; flex: 1; }
.pct-answer { font-size: 1.9rem; font-weight: 700; color: var(--brand); line-height: 1.3; word-break: break-word; }
.pct-answer.down { color: #c2410c; }
.pct-say { margin: 4px 0 0; font-weight: 600; line-height: 1.6; }
.pct-out .lines { margin: 10px 0 0; }
.pct-how { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.pct-how span { font-weight: 600; }
:root[data-theme="dark"] .pct-answer.down { color: #fb923c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pct-answer.down { color: #fb923c; } }
@media (max-width: 760px) {
  .pct-grid { grid-template-columns: 1fr; }
  .pct-nav { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .pct-nav a { flex: none; }
}

/* Tools-by-country table (/countries/, built by build/countries-page.js) */
.cc-tools { margin: 0 0 10px; }
.cc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 14px; color: var(--muted); font-size: .88rem; }
.cc-legend span { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 700; }
.cc-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.cc-wrap:focus-visible { outline: 2px solid var(--brand); }
.cc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: 820px; }
.cc-table th, .cc-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.cc-table thead th { font-size: .82rem; color: var(--muted); font-weight: 700; background: var(--card); position: sticky; top: 0; }
.cc-table .cc-tool { text-align: start; position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; font-weight: 600; border-inline-end: 1px solid var(--line); }
.cc-table thead .cc-tool { z-index: 2; }
.cc-table .cc-tool a { color: var(--text); text-decoration: none; }
.cc-table .cc-tool a:hover { color: var(--brand); }
.cc-table .cc-cat th { text-align: start; background: var(--bg); color: var(--muted); font-size: .8rem; font-weight: 700; padding: 6px 10px; position: static; }
.cc-yes, .cc-yes a { color: var(--brand); font-weight: 700; text-decoration: none; }
.cc-yes a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); }
.cc-yes a:hover { background: var(--brand); color: var(--brand-ink); }
.cc-all { color: var(--muted); font-size: .7rem; }
.cc-no { color: var(--line); font-weight: 700; }
:root[data-theme="dark"] .cc-no { color: #4a5260; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cc-no { color: #4a5260; } }
.cc-table .cc-me { background: var(--soft); }
.cc-table thead .cc-me { color: var(--brand); }
.cc-table tfoot td, .cc-table tfoot th { font-weight: 700; border-bottom: 0; }
.cc-table tbody tr:not(.cc-cat):hover td, .cc-table tbody tr:not(.cc-cat):hover th { background: var(--bg); }

/* Contact */
.contact-form { max-width: 640px; margin-bottom: 24px; }
.contact-form .hint { margin: 10px 0 0; }

/* Share bar under a tool */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.share-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 600; margin-inline-end: 4px; }
.share-bar .btn { padding: 6px 12px; font-size: .88rem; }

/* Install as an app */
.install-btn { display: inline-flex; align-items: center; gap: 6px; }
.install-btn[hidden] { display: none; }
footer .link-btn { font: inherit; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer; margin-inline-start: 14px; }
.install-home { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 20px; color: var(--muted); font-size: .9rem; }
.install-steps { margin: 6px 0 14px; padding-inline-start: 22px; line-height: 2; }

/* Share as text or image */
.share-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.share-mode button { font: inherit; font-size: .86rem; background: var(--card); color: var(--muted); border: 0; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.share-mode button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.share-btns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.share-btns[hidden], .share-preview[hidden] { display: none; }
.share-preview { flex-basis: 100%; }
.share-preview img { display: block; width: min(260px, 100%); border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.share-preview img:not([src]) { display: none; }

/* Guides */
.guide { max-width: 760px; }
.guide-meta { color: var(--muted); font-size: .88rem; margin: -6px 0 18px; }
.guide-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.guide-tool { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--soft); text-decoration: none; color: var(--text); flex: 1 1 260px; }
.guide-tool:hover { outline: 2px solid var(--brand); }
.guide-tool-ico { font-size: 1.6rem; }
.guide-tool b { display: block; }
.guide-tool small { color: var(--brand); font-weight: 600; }
.guide-list { padding-inline-start: 20px; line-height: 2; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 26px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.guide-card:hover { border-color: var(--brand); }
.guide-card-ico { font-size: 1.6rem; }
.guide-card small { color: var(--muted); line-height: 1.6; }
.tool-guides { margin: 18px 0 6px; padding: 12px 16px; border-radius: 12px; background: var(--soft); }
.tool-guides ul { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.9; }
.home-guides { margin: 8px 0 22px; }
.home-guides h2 { font-size: 1.25rem; }

/* BMI gauge */
.gauge-wrap { position: relative; margin: 6px 0 26px; }
.gauge { position: relative; height: 12px; border-radius: 99px; }
.gauge i { position: absolute; top: -5px; width: 4px; height: 22px; margin-left: -2px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--card); }
.gauge-scale span { position: absolute; top: 16px; transform: translateX(-50%); font-size: .75rem; color: var(--muted); }

/* Unit converter */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 5px 11px; font-size: .88rem; font-weight: 600; cursor: pointer; margin: 0; }
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.convert-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.convert-row .field { margin: 0; }
.swap-btn { height: 42px; width: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.swap-btn:hover { border-color: var(--brand); }
.unit-all li { cursor: pointer; border-radius: 6px; padding-inline: 6px; }
.unit-all li:hover, .unit-all li.on { background: var(--bg); }
.unit-all li.on b { color: var(--brand); }
@media (max-width: 420px) { .convert-row { grid-template-columns: 1fr; } .swap-btn { justify-self: center; transform: rotate(90deg); } }
