/* The Arshidny records reader (R4 gate 15): in the reader overlay (living-room paper, dining-table copy) and in the
   phone's Arshidny app. Text wraps; nothing is cut outside the panel; the list scrolls by touch. */
.records, .records-reader, .rec-card { font-family: "Cairo", system-ui, sans-serif; color: var(--ink, #172A32); }
.records { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.rec-src { margin: 0; font-size: 0.8rem; color: #5B6B72; line-height: 1.5; overflow-wrap: anywhere; }
.rec-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-tabs button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(23,42,50,0.18); background: #fff; font: 700 0.92rem "Cairo", sans-serif; color: inherit; cursor: pointer; }
.rec-tabs button[aria-selected="true"] { background: #167C78; color: #fff; border-color: #167C78; }
.rec-n { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,0.08); font-size: 0.8rem; }
.rec-search { display: flex; gap: 6px; }
.rec-q { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid rgba(23,42,50,0.2); padding: 0 12px; font: 600 1rem "Cairo", sans-serif; }
.rec-clear { min-height: 44px; border-radius: 12px; border: 1px solid rgba(23,42,50,0.18); background: #fff; padding: 0 10px; font: 600 0.85rem "Cairo", sans-serif; white-space: nowrap; }
.rec-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.rec-filters select { min-height: 44px; min-width: 0; width: 100%; border-radius: 12px; border: 1px solid rgba(23,42,50,0.2); background: #fff; font: 600 0.85rem "Cairo", sans-serif; padding: 0 8px; }
.rec-count { margin: 0; font-size: 0.85rem; font-weight: 700; color: #167C78; }
.rec-scroll { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; min-height: 0; }
.rec-inner .rec-scroll { flex: 1; border-top: 1px solid rgba(23,42,50,0.1); padding-top: 4px; }
.rec-group { position: sticky; top: 0; z-index: 1; margin: 6px 0 4px; padding: 6px 10px; background: #F3ECDD; border-radius: 10px; font: 800 0.9rem "Cairo", sans-serif; }
.rec-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rec-row { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; text-align: start; padding: 8px 10px; min-height: 44px; border-radius: 12px; border: 1px solid #e0d8c7; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.rec-rowno { grid-row: span 3; align-self: start; font: 800 0.78rem "Cairo", sans-serif; color: #fff; background: #172A32; border-radius: 8px; padding: 2px 6px; white-space: nowrap; }
.rec-title { font-weight: 800; font-size: 0.98rem; line-height: 1.45; overflow-wrap: anywhere; }
.rec-meta { font-size: 0.8rem; color: #5B6B72; overflow-wrap: anywhere; }
.rec-meta2 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 0.78rem; }
.rec-badge { display: inline-block; border-radius: 999px; padding: 0 8px; font-weight: 800; font-size: 0.76rem; line-height: 1.7; }
.rec-badge.st-done { background: #DDF0EE; color: #0F5E5A; }
.rec-badge.st-ongoing { background: #FDEBD0; color: #8A4F00; }
.rec-badge.sc-riyadh { background: #E8EEF5; color: #23466B; }
.rec-badge.sc-all-branches { background: #F2E5F3; color: #6A2C70; }
.rec-nums { color: #172A32; }
.rec-end, .rec-empty { margin: 10px 0 4px; text-align: center; font-size: 0.82rem; color: #5B6B72; }
.rec-card { display: grid; gap: 8px; }
.rec-card-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-card-nav button { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(23,42,50,0.18); background: #fff; font: 700 0.9rem "Cairo", sans-serif; cursor: pointer; }
.rec-card-title { margin: 0; font: 800 1.15rem/1.5 "Cairo", sans-serif; overflow-wrap: anywhere; }
.rec-card-src { margin: 0; font-size: 0.8rem; color: #5B6B72; }
.rec-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-fields { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 12px; margin: 0; background: #fff; border: 1px solid #e0d8c7; border-radius: 12px; padding: 10px 12px; }
.rec-fields dt { font-weight: 800; font-size: 0.85rem; color: #5B6B72; }
.rec-fields dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; text-align: start; }
.rec-notes { margin: 0; padding-inline-start: 18px; font-size: 0.8rem; color: #5B6B72; display: grid; gap: 2px; }
.rec-dl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.rec-dl { min-height: 44px; border-radius: 12px; border: 1px dashed #167C78; background: #fff; color: #167C78; font: 700 0.9rem "Cairo", sans-serif; padding: 0 14px; cursor: pointer; }
.rec-dl-note { font-size: 0.78rem; color: #5B6B72; }

/* The overlay: a tall panel whose list scrolls inside it, the close button always in view. */
.reader-panel.records-mode { width: min(96vw, 760px); height: min(92vh, 920px); max-height: none; display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 16px; }
.reader-panel.records-mode h2 { margin: 0; font-size: 1.15rem; }
.reader-panel.records-mode #recordsMount { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-panel.records-mode .records-reader { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-panel.records-mode .records { flex: 1; min-height: 0; }
.reader-panel.records-mode .rec-card-scroll { flex: 1; }
.reader-panel.records-mode #readerClose { min-height: 44px; align-self: flex-start; }
@media (max-width: 480px) { .rec-filters { grid-template-columns: 1fr 1fr; } .rec-src { font-size: 0.72rem; } }
@media (orientation: landscape) and (max-height: 500px) { .reader-panel.records-mode { height: 96vh; padding: 10px; } .rec-src { display: none; } .rec-filters { grid-template-columns: repeat(4, 1fr); } }
.rec-fold { border: 1px solid rgba(23,42,50,0.12); border-radius: 12px; padding: 0 8px; background: rgba(255,255,255,0.6); }
.rec-fold > summary { min-height: 40px; display: flex; align-items: center; font: 700 0.85rem "Cairo", sans-serif; cursor: pointer; }
.rec-fold[open] > summary { margin-bottom: 4px; }
.rec-fold .rec-filters { padding-bottom: 8px; }
@media (max-width: 480px) { .rec-tabs button { min-height: 40px; padding: 0 10px; font-size: 0.85rem; } .rec-src { font-size: 0.7rem; } }
/* More of the panel for the list: the close button sits in the header corner, wide screens show two columns. */
.reader-panel.records-mode { position: relative; height: min(96vh, 940px); }
.reader-panel.records-mode h2 { padding-inline-end: 96px; }
.reader-panel.records-mode #readerClose { position: absolute; top: 10px; inset-inline-end: 12px; }
@media (min-width: 700px) { .rec-inner .rec-rows { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.rec-inner + .rec-dl-row { margin-top: 4px; }
.reader-panel.records-mode h2 { min-height: 44px; display: flex; align-items: center; }

/* Three values per record (the organiser's decision of 2026-11-24): the name, the times it ran, the beneficiaries. */
.rec-colhead { display: grid; grid-template-columns: 1fr 92px 92px; gap: 8px; padding: 0 10px; font: 700 0.78rem "Cairo", sans-serif; color: #5B6B72; }
.rec-colhead span:not(:first-child) { text-align: center; }
.rec-row { grid-template-columns: 1fr 92px 92px; align-items: center; gap: 8px; }
.rec-num { display: grid; justify-items: center; gap: 0; line-height: 1.3; }
.rec-num small { font-size: 0.68rem; color: #5B6B72; font-weight: 600; }
.rec-num b { font: 800 1.02rem "Cairo", sans-serif; color: #172A32; }
.rec-num[data-field="times"] b { color: #167C78; }
@media (min-width: 700px) { .rec-inner .rec-rows { grid-template-columns: 1fr; } .rec-num small { display: none; } }
@media (max-width: 699px) { .rec-colhead { display: none; } .rec-row { grid-template-columns: 1fr 74px 74px; } }
.rec-fields { grid-template-columns: minmax(130px, auto) 1fr; }
.rec-fields dd[data-field="times"], .rec-fields dd[data-field="attendance"] { font-size: 1.25rem; }
