/* Singlish, FM ↔ Unicode, NIC decoder and amount in words (only loaded on those pages). */
.si-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.si-modes { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-panel); background: var(--mist); }
.si-modes button { padding: 8px 14px; border: 0; border-radius: var(--r-control); background: none; color: var(--slate); font: 600 0.92rem var(--text); cursor: pointer; }
.si-modes button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.si-modes button:focus-visible, .si-palette button:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.si-size { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--slate); }
.si-size input { width: 120px; }
.si-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.si-panes .field, #sl-direct { margin: 0; }
.si-panes[hidden], #sl-direct[hidden] { display: none; }
.si-text { font-family: "Noto Sans Sinhala", var(--text); font-size: 20px; line-height: 1.8; }
.si-tool textarea { min-height: 220px; }
.si-palette { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 4px; }
.si-palette button { min-width: 38px; height: 38px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); color: var(--ink); font: 400 1.15rem "Noto Sans Sinhala", var(--text); cursor: pointer; }
.si-palette button:hover { border-color: var(--signal); background: var(--signal-soft); }
.si-guide td[lang="si"], .si-guide span[lang="si"] { font-family: "Noto Sans Sinhala", var(--text); font-size: 1.15em; }
.si-guide table td:nth-child(odd) { font-family: var(--mono); }

/* NIC decoder */
.nic-input label { display: block; font-weight: 600; margin-bottom: 6px; }
.nic-input-row { display: flex; gap: 8px; }
.nic-input-row input { flex: 1; font-family: var(--mono); font-size: 1.3rem; letter-spacing: 0.04em; text-transform: uppercase; }
.nic-result { margin-top: 16px; }
.nic-result[hidden] { display: none; }
.nic-digits { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.nic-part { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--mist); }
.nic-part b { font-family: var(--mono); font-size: 1.35rem; letter-spacing: 0.06em; color: var(--ink); }
.nic-part small { font-size: 0.75rem; color: var(--slate); font-weight: 600; }
.nic-p0 { background: #DBEAFE; } .nic-p1 { background: #FCE7F3; } .nic-p2 { background: #DCFCE7; } .nic-p3 { background: #FEF3C7; } .nic-p4 { background: #EDE9FE; }
.nic-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0; }
.nic-facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--paper); }
.nic-facts dt { font-size: 0.8rem; font-weight: 600; color: var(--slate); }
.nic-facts dd { margin: 4px 0 0; font-weight: 600; color: var(--ink); }
.nic-facts dd code { font-size: 1.05rem; }
.nic-facts dd small { font-weight: 400; color: var(--slate); }
.nic-facts .nic-main { grid-column: 1 / -1; background: var(--ink); border-color: var(--ink); }
.nic-facts .nic-main dt { color: #A9B5CB; }
.nic-facts .nic-main dd { color: #fff; font-family: var(--display); font-size: 1.6rem; }
.nic-batch { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.nic-batch summary { cursor: pointer; font-weight: 600; }
.nic-batch textarea { margin-top: 8px; font-family: var(--mono); }
.nic-batch .nic-bad td { color: var(--bad); }

/* Amount in words */
.aw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.aw-form .field { margin: 0 0 12px; }
.aw-form #aw-amount { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.aw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.aw-two .field[hidden] { display: none; }
.aw-and { align-self: end; }
.aw-words { margin: 4px 0 14px; color: #fff; font-family: var(--display); font-size: 1.25rem; line-height: 1.45; }
.aw-words:lang(si) { font-family: "Noto Sans Sinhala", var(--display); }
.aw-figures { margin: 4px 0 14px; color: #fff; font-family: var(--display); font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.aw-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-actions .btn { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.3); color: #fff; }
.aw-actions .btn svg { width: 15px; height: 15px; }
.aw-cheque-title { margin-top: 22px; }
.aw-cheque-options { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-bottom: 12px; }
.aw-cheque-options .field { margin: 0; flex: 1 1 200px; }
.aw-cheque { position: relative; max-width: 760px; aspect-ratio: 2.35 / 1; padding: 4.5% 4.5% 4%; border-radius: 10px; background: linear-gradient(135deg, #EAF4FF, #F6FBFF 55%, #E6F7EF); box-shadow: inset 0 0 0 1px #C9DAEA, var(--shadow-2); font-family: "Courier New", monospace; color: #13294B; overflow: hidden; container-type: inline-size; font-size: clamp(9px, 2.1cqw, 15px); }
.aw-cheque:empty { display: none; }
.aw-cross { position: absolute; top: -32%; left: 3%; width: 9%; height: 92%; border-left: 1.5px solid #13294B; border-right: 1.5px solid #13294B; transform: rotate(28deg); display: grid; place-items: center; }
.aw-cross span { transform: rotate(-90deg); white-space: nowrap; font-weight: 700; font-size: 0.85em; letter-spacing: 0.1em; }
.aw-ch-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6%; }
.aw-bank { font-family: var(--display); font-weight: 800; letter-spacing: 0.08em; color: #1F4E79; }
.aw-date-boxes { display: flex; gap: 2px; }
.aw-date-boxes i { display: grid; place-items: center; width: 1.7em; height: 1.9em; border: 1px solid #8DA7C2; background: #fff; font-style: normal; font-weight: 700; }
.aw-date-boxes i.gap { margin-left: 0.5em; }
.aw-ch-line { display: flex; align-items: baseline; gap: 0.8em; padding-bottom: 0.3em; margin-bottom: 4%; border-bottom: 1px solid #8DA7C2; }
.aw-ch-line > span:first-child { flex: none; font-weight: 700; }
.aw-ch-line b { flex: 1; font-weight: 700; font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive; color: #0B2A6F; }
.aw-ch-line b:lang(si) { font-family: "Noto Sans Sinhala", var(--text); }
.aw-ch-words b { line-height: 1.6; }
.aw-or { flex: none; font-size: 0.85em; color: #4A6B8A; }
.aw-ch-bottom { display: flex; justify-content: space-between; align-items: end; margin-top: 2%; }
.aw-box { padding: 0.5em 1em; border: 1.5px solid #13294B; background: #fff; font-weight: 700; font-size: 1.15em; }
.aw-sign { min-width: 30%; padding-top: 0.3em; border-top: 1px dotted #13294B; text-align: center; font-size: 0.85em; color: #4A6B8A; }

@media (max-width: 760px) {
    .si-panes, .aw-grid { grid-template-columns: 1fr; }
    .si-tool textarea { min-height: 160px; }
}
@media (max-width: 480px) {
    .aw-two { grid-template-columns: 1fr; }
    .nic-input-row { flex-direction: column; }
}
