/* africa.finance components v1.0.0 (candidate). Needs tokens.css. Wrap markup in .af-kit or use the classes directly. */
.af-kit { font-family: var(--font-body); font-size: var(--text-body); line-height: var(--text-body-lh); color: var(--text); }
.af-kit *, .af-kit *::before, .af-kit *::after { box-sizing: border-box; }

/* Focus: a real outline everywhere, so WebKit paints it on native controls too */
.af-kit :focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.af-kit input[type="checkbox"]:focus, .af-kit input[type="radio"]:focus { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

/* Buttons: 8px radius, never pills. 48px tall, 44px minimum. */
.af-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-h); min-width: var(--target-min); padding: 12px 20px; border-radius: var(--radius-btn); border: 1.5px solid transparent; font: 500 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.af-btn--primary { background: var(--primary); color: var(--on-primary); }
.af-btn--primary:hover { background: var(--primary-hover); }
.af-btn--outline { background: transparent; color: var(--link); border-color: var(--link); }
.af-btn--outline:hover { background: var(--surface-2); }
.af-btn--ghost { background: transparent; color: var(--ink); }
.af-btn--ghost:hover { background: var(--surface-2); }
.af-btn--danger { background: var(--danger); color: var(--bg); }
.af-btn--small { min-height: var(--target-min); padding: 8px 14px; font-size: .9375rem; }
.af-btn[disabled], .af-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.af-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Links */
.af-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.af-link:hover { text-decoration-thickness: 2px; }

/* Fields */
.af-field { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); }
.af-label { font-weight: 500; color: var(--ink); }
.af-hint { font-size: var(--text-small); color: var(--text-muted); margin: 0; }
.af-input, .af-select, .af-textarea { width: 100%; min-height: var(--control-h); padding: 12px 14px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--font-body); }
.af-textarea { min-height: 120px; resize: vertical; }
.af-select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.af-input[aria-invalid="true"], .af-textarea[aria-invalid="true"] { border: 2px solid var(--danger); }
.af-error { color: var(--danger); font-size: var(--text-small); margin: 0; font-weight: 500; }

/* Checkbox and radio: 22px control, whole label is a 44px target, 3:1 edge */
.af-choice { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); cursor: pointer; }
.af-choice input { appearance: none; -webkit-appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin: 0; border: 2px solid var(--border-input); background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; }
.af-choice input[type="checkbox"] { border-radius: 4px; }
.af-choice input[type="radio"] { border-radius: 50%; }
.af-choice input:checked { background-color: var(--primary); border-color: var(--primary); }
.af-choice input[type="checkbox"]:checked { background-image: var(--af-check); background-size: 16px 16px; background-position: center; background-repeat: no-repeat; }
.af-choice input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--surface); }
.af-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-5); }
.af-fieldset legend { font-weight: 500; color: var(--ink); margin-bottom: var(--space-2); padding: 0; }
:root { --af-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.8' fill='none' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-theme="night"] { --af-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.8' fill='none' stroke='%230B0D17' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) { --af-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.8' fill='none' stroke='%230B0D17' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }

/* Hairline card (RWA.io chassis) */
.af-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-5); min-width: 0; }
.af-card h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); line-height: var(--text-h3-lh); color: var(--ink); margin: 0 0 var(--space-2); }
.af-card p { margin: 0 0 var(--space-3); }
.af-card__meta { font-size: var(--text-small); color: var(--text-muted); }
.af-figure { font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Status dot, from the RWA.io dot system: core plus ring, always with a text label */
.af-status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-small); color: var(--text); }
.af-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); flex: 0 0 12px; }
.af-dot--live { background: var(--live); }
.af-dot--progress { background: var(--link); }

/* Notice */
.af-notice { border-left: 4px solid var(--link); background: var(--surface); border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: var(--space-4); margin: 0 0 var(--space-3); }
.af-notice strong { color: var(--ink); }
.af-notice--success { border-color: var(--success); background: var(--success-bg); }
.af-notice--warning { border-color: var(--warning); background: var(--warning-bg); }
.af-notice--danger { border-color: var(--danger); background: var(--danger-bg); }
.af-notice p { margin: 0; color: var(--ink); }

/* Tabs: roving tabindex, arrows, Home and End */
.af-tabs [role="tablist"] { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: 1px solid var(--line); }
.af-tabs [role="tab"] { min-height: var(--target-min); padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-muted); font: 500 1rem var(--font-body); cursor: pointer; }
.af-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--link); }
.af-tabs [role="tabpanel"] { padding: var(--space-4) 0; }

/* Accordion */
.af-accordion details { border-bottom: 1px solid var(--line); }
.af-accordion summary { min-height: var(--target-min); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; cursor: pointer; font-weight: 500; color: var(--ink); list-style: none; }
.af-accordion summary::-webkit-details-marker { display: none; }
.af-accordion summary::after { content: "+"; font-size: 1.25rem; color: var(--text-muted); }
.af-accordion details[open] summary::after { content: "\2212"; }
.af-accordion details > div { padding: 0 0 var(--space-4); }

/* Table: fixed layout, wraps at 320px */
.af-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--text-small); }
.af-table caption { text-align: left; color: var(--text-muted); padding-bottom: var(--space-2); }
.af-table th, .af-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.af-table th { color: var(--ink); font-weight: 500; }

/* Site header and footer */
.af-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--line); }
.af-header img, .af-header svg { height: 28px; width: auto; display: block; }
.af-footer { display: grid; gap: var(--space-3); padding: var(--space-5) var(--space-4); background: var(--surface); border-top: 1px solid var(--line); font-size: var(--text-small); color: var(--text-muted); }
.af-footer img { height: 22px; width: auto; }
.af-header > a:first-child, .af-footer a { display: inline-flex; align-items: center; min-height: var(--target-min); }
/* Theme-only images (e.g. day and night logo files) */
[data-theme="day"] .only-night, [data-theme="night"] .only-day { display: none !important; }
@media (prefers-color-scheme: light) { html:not([data-theme]) .only-night { display: none !important; } }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .only-day { display: none !important; } }
