@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/bricolage-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-700-latin.woff2') format('woff2');
}

/* The upload site's palette as RGB channels - the same values as
 * web/src/index.css, light and dark - so colours take an alpha like
 * Tailwind's `text-ink/70` there. */
:root {
  color-scheme: light;
  --c-primary: 31 107 69;
  --c-primary-dark: 23 71 47;
  --c-deep: 23 71 47;
  --c-leaf: 110 155 78;
  --c-sage: 220 232 214;
  --c-paper: 247 249 245;
  --c-ink: 28 36 32;
  --c-line: 202 213 200;
  --c-surface: 255 255 255;
  --c-friday: 239 245 236;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', ui-sans-serif, system-ui, sans-serif;
  --card-shadow: 0 18px 40px -32px rgba(23, 71, 47, 0.5);
  --sheet-shadow: 0 1px 0 rgb(var(--c-line)), 0 24px 48px -28px rgba(23, 71, 47, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --c-primary: 46 138 91;
    --c-primary-dark: 172 218 190;
    --c-deep: 26 92 61;
    --c-leaf: 141 186 108;
    --c-sage: 31 54 42;
    --c-paper: 14 24 20;
    --c-ink: 226 235 229;
    --c-line: 48 67 57;
    --c-surface: 22 35 29;
    --c-friday: 27 45 36;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgb(var(--c-paper));
  color: rgb(var(--c-ink));
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
main { flex: 1; padding-bottom: 4rem; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:where(a, button, input):focus-visible {
  outline: 2px solid rgb(var(--c-primary));
  outline-offset: 2px;
  border-radius: 8px;
}

/* max-w-6xl px-4 sm:px-6, like every upload-site page */
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

/* Buttons and links: .btn-primary / .btn-secondary / .btn-link in web/src/index.css */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.5rem; padding: 0.75rem 1rem;
  font: inherit; font-size: 0.875rem; font-weight: 700; line-height: 1.25rem;
  text-decoration: none; cursor: pointer; transition: background-color 150ms, border-color 150ms;
}
.btn-primary { border: 0; background: rgb(var(--c-primary)); color: #fff; }
.btn-primary:hover { background: rgb(var(--c-deep)); }
.btn-secondary { border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); }
.btn-secondary:hover { border-color: rgb(var(--c-primary) / 0.5); background: rgb(var(--c-sage) / 0.4); }
.btn-link {
  border-radius: 0.25rem; font-size: 0.875rem; font-weight: 700; color: rgb(var(--c-primary));
  text-decoration: underline; text-decoration-color: rgb(var(--c-primary) / 0.3); text-underline-offset: 4px;
  transition: text-decoration-color 150ms;
}
.btn-link:hover { text-decoration-color: rgb(var(--c-primary)); }

/* Header: SiteHeader.tsx */
.site-header { border-bottom: 1px solid rgb(var(--c-line) / 0.7); }
.site-header-row { display: flex; align-items: center; gap: 0.75rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.wordmark {
  display: flex; align-items: center; gap: 0.5rem; min-width: 0;
  font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; color: rgb(var(--c-primary-dark)); text-decoration: none;
}
.wordmark img { height: 2rem; width: auto; }
@media (min-width: 420px) {
  .wordmark { gap: 0.75rem; font-size: 1.125rem; }
  .wordmark img { height: 2.25rem; }
}
.header-upload { margin-left: auto; padding: 0.5rem 0.875rem; white-space: nowrap; }
@media (min-width: 768px) { .header-upload { padding: 0.5rem 1rem; } }

/* Two columns: UploadForm.tsx */
.split { padding-top: 2rem; }
.split-content { margin-top: 2.5rem; }
@media (min-width: 1024px) {
  .split {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 3.5rem; padding-top: 3.5rem; align-items: start;
  }
  .split-content { margin-top: 0; }
  .split-aside-inner { position: sticky; top: 2.5rem; }
}
.below { margin-top: 3.5rem; }

.crumbs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; color: rgb(var(--c-ink) / 0.6); }
.crumbs li + li::before { content: '\203A'; margin-right: 0.5rem; color: rgb(var(--c-ink) / 0.4); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: rgb(var(--c-primary)); text-decoration: underline; text-underline-offset: 4px; }

h1 {
  max-width: 17ch;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.04; letter-spacing: -0.025em;
  color: rgb(var(--c-primary-dark));
}
.lede { margin-top: 1.25rem; max-width: 52ch; font-size: 17px; line-height: 1.65; color: rgb(var(--c-ink) / 0.75); }
.lede + .btn-link { display: inline-block; margin-top: 0.75rem; }
.aside-note { margin-top: 2rem; max-width: 44ch; font-size: 15px; line-height: 1.6; color: rgb(var(--c-ink) / 0.7); }
.aside-search { margin-top: 1.75rem; max-width: 30rem; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.stores a { border-radius: 0.5rem; transition: opacity 150ms; }
.stores a:hover { opacity: 0.85; }
.stores img { height: 2.75rem; width: auto; }
@media (min-width: 640px) { .stores img { height: 3rem; } }
.aside-note + .stores { margin-top: 1rem; }

/* Cards: the upload page's steps card */
.card {
  border: 1px solid rgb(var(--c-line)); border-radius: 0.75rem;
  background: rgb(var(--c-surface)); box-shadow: var(--card-shadow);
}
.card-section { padding: 1.25rem; }
.card-section + .card-section { border-top: 1px solid rgb(var(--c-line)); }
@media (min-width: 640px) { .card-section { padding: 1.75rem; } }
.card-title { font-family: var(--display); font-size: 1.25rem; font-weight: 600; line-height: 2rem; letter-spacing: -0.01em; color: rgb(var(--c-ink)); }
.card-note { margin-top: 0.25rem; max-width: 60ch; font-size: 0.875rem; line-height: 1.5; color: rgb(var(--c-ink) / 0.65); }
.card-body { margin-top: 1rem; }
.card-action { margin-top: 1.25rem; }

/* Today / Tomorrow */
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1rem; }
.day-head .card-note { margin-top: 0; text-align: right; }
.day-hijri { display: block; }
.day-times { width: 100%; margin-top: 1rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.day-times th, .day-times td { padding: 0.7rem 0; text-align: right; border-top: 1px solid rgb(var(--c-line) / 0.7); }
.day-times th:first-child { text-align: left; }
.day-times thead th { padding-top: 0; border-top: 0; font-size: 0.75rem; font-weight: 700; color: rgb(var(--c-ink) / 0.6); }
.day-times tbody th { font-weight: 700; }
.day-times td.begins { width: 32%; font-size: 0.9375rem; color: rgb(var(--c-ink) / 0.65); }
/* The jama'ah time is what people come for, so it gets the big figures. */
.day-times td.jamaah {
  width: 32%; font-family: var(--display); font-size: 1.625rem; font-weight: 600;
  line-height: 1.1; letter-spacing: -0.01em; color: rgb(var(--c-primary-dark));
}
.day-times tr.sunrise th, .day-times tr.sunrise td { font-weight: 400; color: rgb(var(--c-ink) / 0.55); }
.card-section.is-quiet .day-times td.jamaah { font-family: var(--body); font-size: 0.9375rem; font-weight: 700; color: rgb(var(--c-ink)); }
.card-section.is-quiet .day-times tbody th { font-weight: 400; }

/* The month: TimetableSheet.tsx, filled in */
.sheet {
  margin-top: 1.5rem;
  border: 1px solid rgb(var(--c-line)); border-radius: 3px;
  background: rgb(var(--c-surface)); box-shadow: var(--sheet-shadow);
  padding: 1.5rem 1.25rem 1.25rem;
}
.sheet:first-child { margin-top: 0; }
@media (min-width: 640px) { .sheet { padding: 1.5rem 1.75rem 1.25rem; } }
.sheet-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.25rem 1.5rem; }
.sheet-name { font-family: var(--display); font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: rgb(var(--c-primary-dark)); }
@media (min-width: 640px) { .sheet-name { font-size: 28px; } }
.sheet-address { margin-top: 0.25rem; font-size: 0.875rem; color: rgb(var(--c-ink) / 0.6); }
.sheet-month { font-family: var(--display); font-size: 1.125rem; font-weight: 500; letter-spacing: normal; color: rgb(var(--c-ink)); }
.sheet-rule { margin-top: 1rem; border-top: 2px solid rgb(var(--c-primary-dark)); }
.sheet-rule::after { content: ''; display: block; margin-top: 3px; border-top: 1px solid rgb(var(--c-primary-dark) / 0.6); }
.sheet-scroll { margin-top: 0.75rem; overflow-x: auto; }
.sheet-table { width: 100%; min-width: 46rem; border-collapse: collapse; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet-table th, .sheet-table td { padding: 0.5rem 0.5rem 0.5rem 0; white-space: nowrap; }
.sheet-table thead th { font-weight: 700; color: rgb(var(--c-ink) / 0.7); vertical-align: bottom; }
.sheet-table thead tr:first-child th { padding-bottom: 0; }
.sheet-table .sheet-sub th { padding-top: 0.125rem; font-size: 11px; font-weight: 400; color: rgb(var(--c-ink) / 0.55); }
.sheet-table tbody tr { border-top: 1px solid rgb(var(--c-line) / 0.7); }
.sheet-table tbody th { padding-left: 0.25rem; padding-right: 0.75rem; font-weight: 400; color: rgb(var(--c-ink)); }
.sheet-table tbody td { color: rgb(var(--c-ink) / 0.7); }
.sheet-table td.jamaah { font-weight: 700; color: rgb(var(--c-primary-dark)); }
.sheet-table tr.is-friday { background: rgb(var(--c-sage) / 0.7); }
.sheet-table .jumuah::after { content: " Jumu'ah"; font-size: 11px; }
.sheet-table tr.is-today th, .sheet-table tr.is-today td { font-weight: 700; color: rgb(var(--c-ink)); }
.sheet-table tr.is-today th { box-shadow: inset 3px 0 0 rgb(var(--c-primary)); }
.sheet-foot { margin-top: 1rem; font-size: 0.75rem; color: rgb(var(--c-ink) / 0.5); }

/* Lists of masjids and towns */
.section-title { font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; color: rgb(var(--c-ink)); }
.list-section { margin-top: 3rem; }
.list-section .card { margin-top: 1rem; }
.list > li + li { border-top: 1px solid rgb(var(--c-line)); }
.list-row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem;
  padding: 1rem 1.25rem; text-decoration: none; transition: background-color 150ms;
}
@media (min-width: 640px) { .list-row { padding: 1.1rem 1.75rem; } }
.list > li:first-child .list-row { border-radius: 0.75rem 0.75rem 0 0; }
.list > li:last-child .list-row { border-radius: 0 0 0.75rem 0.75rem; }
.list > li:only-child .list-row { border-radius: 0.75rem; }
.list-row:hover { background: rgb(var(--c-sage) / 0.4); }
.list-row.is-stacked { flex-direction: column; align-items: flex-start; }
.list-name { font-family: var(--display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; color: rgb(var(--c-primary-dark)); }
.list-meta { font-size: 0.875rem; color: rgb(var(--c-ink) / 0.6); }
.list-times { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 0.375rem; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: rgb(var(--c-ink) / 0.6); }
.list-times b { color: rgb(var(--c-ink)); }

.towns { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0 1.5rem; }
.towns a { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid rgb(var(--c-line) / 0.6); font-size: 0.9375rem; text-decoration: none; }
.towns a:hover span:first-child { color: rgb(var(--c-primary)); text-decoration: underline; text-underline-offset: 4px; }
.town-count { color: rgb(var(--c-ink) / 0.5); font-variant-numeric: tabular-nums; }

/* Search field: FloatingField + .floating-input */
.search-form { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.search-form .btn-primary { flex: 0 0 auto; }
.field { position: relative; flex: 1 1 14rem; }
.field-input {
  width: 100%; border: 1px solid rgb(var(--c-line)); border-radius: 0.5rem;
  background: rgb(var(--c-surface)); color: rgb(var(--c-ink));
  padding: 0.75rem; font: inherit; font-size: 15px; line-height: 1.25rem;
  transition: border-color 150ms, box-shadow 150ms;
}
.field-input:hover { border-color: rgb(var(--c-primary) / 0.5); }
.field-input:focus { outline: none; border-color: rgb(var(--c-primary)); box-shadow: 0 0 0 2px rgb(var(--c-primary) / 0.25); }
.field-input::-webkit-search-cancel-button { cursor: pointer; }
.field-label {
  pointer-events: none; position: absolute; left: 0.75rem; top: 50%;
  max-width: calc(100% - 1.5rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transform: translateY(-50%); transform-origin: left;
  font-size: 0.875rem; color: rgb(var(--c-ink) / 0.6);
  transition: top 150ms, transform 150ms, color 150ms;
}
.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
  top: 0; transform: translateY(-50%) scale(0.85);
  background: rgb(var(--c-surface)); padding: 0 0.25rem; margin-left: -0.25rem;
}
.field-input:focus + .field-label { color: rgb(var(--c-primary)); }
@media (pointer: coarse) { .field-input { font-size: 16px; } }

.faq { max-width: 44rem; }
.faq dt { margin-top: 1.25rem; font-weight: 700; }
.faq dd { margin-top: 0.25rem; max-width: 62ch; line-height: 1.6; color: rgb(var(--c-ink) / 0.7); }
.faq .btn-link { font-size: inherit; }
.updated { margin-top: 2.5rem; font-size: 0.875rem; color: rgb(var(--c-ink) / 0.6); }

/* Footer: SiteFooter.tsx */
.site-footer { border-top: 1px solid rgb(var(--c-line) / 0.7); background: rgb(var(--c-surface)); }
.footer-top { display: flex; flex-direction: column; gap: 1.5rem; padding: 2.5rem 0; }
@media (min-width: 768px) { .footer-top { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.footer-top .stores { margin-top: 0; flex-shrink: 0; }
.footer-name { font-family: var(--display); font-size: 1.75rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: rgb(var(--c-primary-dark)); }
.footer-text { margin-top: 0.5rem; max-width: 44ch; font-size: 15px; line-height: 1.65; color: rgb(var(--c-ink) / 0.7); }
.footer-bottom {
  display: flex; flex-direction: column-reverse; gap: 1rem; padding: 1.5rem 0;
  border-top: 1px solid rgb(var(--c-line) / 0.6); font-size: 0.875rem;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; } }
.footer-copy { color: rgb(var(--c-ink) / 0.65); }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-bottom a { border-radius: 0.125rem; color: rgb(var(--c-ink) / 0.7); text-decoration: none; text-underline-offset: 4px; }
.footer-bottom a:hover { color: rgb(var(--c-primary-dark)); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
