/* Know Your Zakat, by Cowries & Coins. Paper palette: docs/brand/palette-vox-paper.md (contrast measured there). */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Tajawal (SIL OFL 1.1), Arabic and Latin subset: used only by the Arabic scholar page, so it downloads only then */
@font-face { font-family: "Tajawal"; src: url("fonts/tajawal-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("fonts/tajawal-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #F2EDE4; --ink: #141414; --saffron: #FFC93C; --card: #FBF8F1; --clip: #E9E0CC;
  --brown: #5A4D3C; --red: #B5483B; --pale: #FFF6D6; --line: #CDBFA6;
  /* One shared control style (owner, 16 Nov 2026): every select, text field and button has the same height, border,
     radius and side padding. Selects draw their own chevron, 16 px in from the right, and keep its space free of text. */
  --ctl-h: 52px; --ctl-border: 2px solid var(--ink); --ctl-radius: 12px; --ctl-pad: 16px; --chev-w: 14px; --chev-gap: 12px;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0 auto; max-width: 560px; min-height: 100vh; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--sans);
  display: flex; flex-direction: column; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 6px 8px;
  border-bottom: 1.5px solid var(--ink); background: var(--paper); }
.brand { flex: 1; font: 700 18px/1.1 var(--serif); padding-left: 6px; color: var(--ink); text-decoration: none; }
.brand small { display: block; font: italic 12.5px/1.3 var(--serif); color: var(--brown); }
.icon-btn { min-width: 48px; height: 48px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; color: var(--ink); text-decoration: none; font: 600 14px var(--sans); padding: 0 8px; cursor: pointer; }
.icon-btn svg { width: 24px; height: 24px; }
/* The other leone under a key total: 1 SLE = 1,000 old leones */
.alt { display: block; font: 600 12.5px/1.3 var(--sans); color: var(--brown); white-space: nowrap; letter-spacing: 0; text-transform: none; }
.state .big .alt { font-size: 13.5px; margin-top: 2px; }
#fx table.lines td:last-child { white-space: normal; }
#fx table.lines td:first-child { width: 36%; }
#fx .alt { white-space: normal; }
/* Text size (header "AA" button): larger steps for this visit only; nothing is kept */
body.ts-1 { zoom: 1.15; }
body.ts-2 { zoom: 1.3; }
.tip { margin: 0 0 12px; }
#fx .fx-src { font-size: 12px; color: var(--brown); }
.progress { display: flex; gap: 3px; padding: 8px 16px 6px; border-bottom: 1px dashed var(--line); }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--clip); }
.progress i.done { background: var(--ink); }
.progress i.now { background: var(--saffron); box-shadow: 0 0 0 1.5px var(--ink); }
main { flex: 1; padding: 14px 16px 24px; }
.act { position: sticky; bottom: 0; z-index: 3; border-top: 1.5px solid var(--ink); padding: 10px 16px 8px; display: grid; gap: 6px; background: var(--paper); }
.act .row { display: flex; gap: 10px; }
.act .row > * { flex: 1; }
.disc { margin: 0; font-size: 12.5px; color: var(--brown); text-align: center; }

h1 { font: 700 26px/1.15 var(--serif); margin: 2px 0 8px; }
h2 { font: 700 19px/1.2 var(--serif); margin: 18px 0 8px; }
h3 { font: 700 16px/1.3 var(--sans); margin: 0 0 6px; }
p { margin: 0 0 10px; }
.lead { font-size: 17px; }
.mark { background: linear-gradient(transparent 55%, var(--saffron) 55%); padding: 0 3px; }
.kicker { font: 700 12px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--brown); margin: 0 0 6px; }
.muted { color: var(--brown); }
.small { font-size: 14.5px; }
.hint { font-size: 14px; color: var(--brown); }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.tag { display: inline-block; font: 700 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px;
  border-radius: 4px; background: var(--ink); color: var(--paper); vertical-align: 2px; white-space: nowrap; }
.tag.agreed { background: var(--clip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tag.soon { background: transparent; color: var(--brown); box-shadow: inset 0 0 0 1px var(--brown); }

.card { background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.card.pale { background: var(--pale); }
.note { background: var(--clip); border-left: 4px solid var(--ink); padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 15px; margin: 0 0 12px; }
.note p:last-child { margin: 0; }
.other { font-size: 14.5px; color: var(--brown); border-top: 1px dashed var(--line); padding-top: 8px; margin: 10px 0 0; }
.other b { color: var(--ink); }
.scholar-line { font: italic 15.5px/1.4 var(--serif); margin: 12px 0 0; }
.taped { position: relative; margin-top: 10px; }
.taped::before, .taped::after { content: ""; position: absolute; top: -9px; width: 64px; height: 18px; background: rgba(224,206,158,.85);
  border: 1px solid rgba(150,128,80,.35); }
.taped::before { left: 18px; transform: rotate(-7deg); }
.taped::after { right: 18px; transform: rotate(6deg); }
.error { color: var(--red); font-weight: 700; font-size: 15px; margin: 0 0 10px; }
.krio { display: none; align-items: center; gap: 8px; font-size: 14px; color: var(--brown); border: 1.5px dashed var(--brown); border-radius: 10px;
  padding: 6px 10px; margin: 0 0 12px; }
.lang-kri .krio { display: flex; }
.krio svg { width: 20px; height: 20px; flex: none; }

.btn { min-height: var(--ctl-h); border-radius: var(--ctl-radius); border: var(--ctl-border); background: var(--card); color: var(--ink); font: 700 17px var(--sans);
  padding: 0 var(--ctl-pad); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; text-align: center; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.wide { width: 100%; }
.btn.ghost { border-style: dashed; }
.btn.small { font-size: 15px; } /* same height and padding as every control; only the text is smaller */
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { cursor: default; border-style: dashed; color: var(--brown); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 999px; background: var(--saffron);
  border: 1.5px solid var(--ink); font: 600 15px/1.2 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.chip.plain { background: var(--card); }
.chip[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

/* choices: real radios and checkboxes; the checked look comes from the input itself plus the card */
.choice { display: flex; gap: 12px; align-items: flex-start; min-height: 56px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 14px;
  background: var(--card); margin: 0 0 8px; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.choice b { display: block; font-size: 17px; }
.choice > span > span { display: block; font-size: 14.5px; color: var(--brown); }
.choice.on, .choice:has(input:checked) { background: var(--pale); box-shadow: inset 0 0 0 1.5px var(--ink); }
.choice.off { cursor: default; border-style: dashed; }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.langs .choice { margin: 0; padding: 10px 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
legend { font: 700 19px/1.2 var(--serif); padding: 0; margin: 0 0 8px; }

.seg { display: flex; border: var(--ctl-border); border-radius: var(--ctl-radius); overflow: hidden; margin: 0 0 10px; }
.seg label { flex: 1; min-height: calc(var(--ctl-h) - 4px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-weight: 700; font-size: 16px; cursor: pointer; background: var(--card); padding: 4px 6px; line-height: 1.15; position: relative; }
.seg label + label { border-left: 2px solid var(--ink); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label.on, .seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--saffron); outline-offset: -5px; }
.seg small { display: block; font-weight: 500; font-size: 12.5px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin: 0 0 12px; }
.field > label, .field > .label { font-weight: 600; font-size: 15.5px; }
.money { display: flex; align-items: center; min-height: var(--ctl-h); padding: 0 var(--ctl-pad); border: var(--ctl-border); border-radius: var(--ctl-radius); background: #fff; }
.money .cur { color: var(--brown); font-weight: 700; font-size: 14px; margin-right: 10px; }
.money input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: 700 21px var(--sans); color: var(--ink); text-align: right; }
.money input:focus { outline: none; }
.money input::placeholder { color: #776958; font-weight: 500; }
.money .unit { color: var(--brown); font-weight: 600; margin-left: 8px; }
.money:focus-within { box-shadow: 0 0 0 3px var(--saffron); }
select.big, input.big, textarea.big { width: 100%; min-height: var(--ctl-h); border: var(--ctl-border); border-radius: var(--ctl-radius); background-color: #fff;
  font: 600 17px var(--sans); padding: 0 var(--ctl-pad); color: var(--ink); }
textarea.big { min-height: 96px; padding: 12px var(--ctl-pad); font-weight: 500; resize: vertical; }
select.big { -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
  padding-right: calc(var(--ctl-pad) + var(--chev-w) + var(--chev-gap)); text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5l5.5 5.5 5.5-5.5' fill='none' stroke='%23141414' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--ctl-pad) center; background-size: var(--chev-w) 9px; }
select.big::-ms-expand { display: none; }
select.big:focus-visible, input.big:focus-visible, textarea.big:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--saffron); }
.sum { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 10px; margin: 4px 0 12px; font-weight: 700; }
.sum .amt { font-size: 22px; }
details { border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); margin: 0 0 12px; }
summary { min-height: 50px; display: flex; align-items: center; padding: 0 14px; font-weight: 700; cursor: pointer; }
details > div { padding: 0 14px 12px; font-size: 15px; }

.piece { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; margin: 0 0 10px; background: #fffdf8; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; min-width: 0; }
.piece .remove { margin-top: 2px; }

.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt small { font-size: .62em; font-weight: 700; color: var(--brown); margin-left: 3px; letter-spacing: .03em; }
table.lines { width: 100%; border-collapse: collapse; font-size: 15px; }
table.lines td { padding: 7px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
table.lines td:last-child { text-align: right; text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 8px; }
[dir="rtl"] table.lines td:last-child { padding-left: 0; padding-right: 8px; }
table.lines tr.total td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 800; font-size: 16.5px; }
table.lines tr.off td { color: var(--brown); }

.state { border: 2px solid var(--ink); border-radius: 16px; padding: 14px; background: var(--card); margin: 0 0 12px; }
.state.due { background: var(--saffron); }
.state .label { font: 800 13px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.state .big { font: 700 30px/1.1 var(--serif); margin: 0 0 6px; }
.bars { display: grid; gap: 8px; margin: 12px 0 2px; }
.bars div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 14px; }
.bars span { font-weight: 700; font-variant-numeric: tabular-nums; }
.bars i { grid-column: 1 / -1; height: 12px; border-radius: 6px; border: 1.5px solid var(--ink); background: var(--card); min-width: 12px; }
.bars i.fill { background: var(--ink); }
.view { border: 2px dashed var(--ink); border-radius: 16px; padding: 12px; margin: 10px 0 12px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.school { background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px; padding: 10px; font-size: 13.5px; }
.school.mine { background: var(--pale); box-shadow: inset 0 0 0 1.5px var(--ink); }
.school h3 { font: 700 17px/1.1 var(--serif); margin: 0 0 2px; }
.school .who { font-size: 12.5px; color: var(--brown); margin: 0 0 8px; min-height: 30px; }
.school dl { margin: 0; display: grid; gap: 4px; }
.school dt { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brown); }
.school dd { margin: 0 0 4px; font-weight: 700; font-size: 15px; }
.school dd.yes { background: var(--saffron); border-radius: 4px; padding: 1px 5px; justify-self: start; box-shadow: inset 0 0 0 1px var(--ink); }

ul.ticks { list-style: none; padding: 0; margin: 0 0 12px; }
ul.ticks li { padding: 4px 0 4px 28px; position: relative; border-bottom: 1px dashed var(--line); }
ul.ticks li:last-child { border: 0; }
ul.ticks li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 14px; height: 8px; border-left: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink); transform: rotate(-45deg); }
ul.dots, ol.steps { padding-left: 22px; margin: 0 0 12px; }
ul.dots li, ol.steps li { margin-bottom: 6px; }

/* the scholar sheet: preview on screen, the page itself in print */
.sheet { background: #fff; border: 1px solid var(--line); box-shadow: 0 3px 10px rgba(20,20,20,.15); padding: 14px; font-size: 13.5px; line-height: 1.4; margin: 0 0 12px; }
.sheet h2 { font-size: 18px; margin: 0 0 4px; }
.sheet h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 4px; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.sheet .cover { border: 1.5px solid var(--ink); border-radius: 8px; padding: 10px 12px; margin: 8px 0 4px; }
.sheet table.lines { font-size: 13.5px; }
.sheet table.lines td { padding: 4px 0; }
.sheet table.lines td:first-child { width: 46%; }
.sheet .write { border-bottom: 1px solid var(--ink); height: 24px; }
.sheet .foot { margin-top: 12px; font-size: 11.5px; color: var(--brown); border-top: 1px dashed var(--line); padding-top: 6px; }
.sheet .ar { font-family: Tajawal, "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif; font-size: 1.06em; line-height: 1.65; }
.sheet .ar h2, .sheet .ar h3 { font-family: inherit; letter-spacing: 0; text-transform: none; }
.sheet .ar h3 { font-size: 13.5px; }
.sheet .mark-ar { color: var(--red); font-weight: 700; font-size: 12.5px; margin: 0 0 6px; }
.sheet .bi { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; }
@media (min-width: 640px) { .sheet.both { font-size: 12.5px; } .sheet .bi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* the plain page (no JavaScript) and the guide */
.plain h2 { border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.links a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }

/* ---------- the running total (live panel): below the step on phones, beside it on tablets and desktops ---------- */
.live { margin: 4px 16px 16px; padding: 0; }
.live > summary { display: flex; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 14px; }
.live > div { padding: 0 14px 14px; font-size: 14.5px; }
.live .state { padding: 10px 12px; margin: 0 0 10px; }
.live .state .big { font-size: 22px; margin: 0; }
.live table.lines { font-size: 14px; }
.live table.lines td { padding: 5px 0; }
.cmp-wrap > div { padding: 0 10px 12px; overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cmp th, table.cmp td { border-bottom: 1px dashed var(--line); padding: 7px 6px; text-align: left; vertical-align: top; }
table.cmp thead th { border-bottom: 2px solid var(--ink); font: 700 15px/1.2 var(--serif); }
table.cmp tbody th { font-weight: 600; color: var(--brown); width: 22%; }
table.cmp .mine { background: var(--pale); }
table.cmp .yes { font-weight: 800; }
table.cmp .yes span { background: var(--saffron); border-radius: 4px; padding: 1px 5px; box-shadow: inset 0 0 0 1px var(--ink); }
.screen > .krio { grid-column: 1 / -1; }

/* Tablet: 600 px and up. Same content and order; wider, and two columns where it helps. */
@media (min-width: 600px) {
  body { max-width: none; }
  main { padding: 20px 24px 32px; }
  .screen, .plain { max-width: 680px; margin: 0 auto; }
  .act .row { width: 100%; max-width: 680px; margin: 0 auto; }
  .langs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.with-live main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  body.with-live .screen { max-width: none; margin: 0; }
  body.with-live .live { margin: 0; position: sticky; top: 80px; max-height: calc(100vh - 190px); overflow-y: auto; }
  .live > summary { font: 700 16px var(--serif); }
  .live > summary > span:first-child { white-space: nowrap; }
}
@media (min-width: 720px) {
  .screen.result { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .screen.result .col-b h2:first-child { margin-top: 2px; }
}
/* Desktop: 1024 px and up, centred, at most 1100 px */
@media (min-width: 1024px) {
  /* header and bottom bar run full width; their contents line up with the 1100 px column */
  main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 32px 40px; }
  .top, .progress, .act { padding-left: max(32px, calc(50vw - 518px)); padding-right: max(32px, calc(50vw - 518px)); }
  body.with-live main { grid-template-columns: minmax(0, 1fr) 380px; gap: 36px; }
  .screen.compare { max-width: none; }
  .screen.compare #grid { display: none; }
  .cmp-wrap { border: 0; background: none; }
  .cmp-wrap > summary { display: none; }
  .cmp-wrap > div { padding: 0; }
  table.cmp { font-size: 15px; }
  .screen.scholar { max-width: none; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
  .sch-preview { background: var(--clip); border-radius: 14px; padding: 18px; }
  .sch-preview .sheet { margin: 0 auto; max-width: 720px; padding: 44px 48px 36px; font-size: 14px; }
}

@media print {
  @page { size: A4; margin: 14mm 14mm 18mm;
    @bottom-center { content: "Educational, not a fatwa or financial advice. Know Your Zakat, by Cowries & Coins. Page " counter(page) " of " counter(pages);
      font: 8pt Inter, sans-serif; color: #5A4D3C; } }
  html, body { background: #fff; max-width: none; display: block; }
  .no-print, .top, .progress, .act, .plain, .krio { display: none !important; }
  main { padding: 0; }
  .screen.scholar { display: block !important; }
  .sch-controls, .sch-preview > :not(.sheet), .live { display: none !important; }
  .sch-preview { background: none; padding: 0; }
  .sch-preview .sheet { max-width: none; padding: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; font-size: 11pt; margin: 0; }
  .sheet h3 { break-after: avoid; }
  .sheet .keep { break-inside: avoid; }
  .sheet .foot { display: none; } /* the page footer above carries it on every page */
  .sheet.both { font-size: 9.5pt; }
  .sheet .bi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sheet .bi .cover { margin-top: 4px; }
}
