/* Self-hosted Inter variable font */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #09090b;
  --card: #18181b;
  --card-hover: #1f1f23;
  --muted: #71717a;
  --muted-light: #a1a1aa;
  --text: #fafafa;
  --text-secondary: #e4e4e7;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --accent: #CAA380;
  --accent-hover: #CAA380;
  --accent-subtle: rgba(202, 163, 128, 0.15);
  --good: #2B5746;
  --good-subtle: rgba(43, 87, 70, 0.15);
  --warn: #f59e0b;
  --warn-subtle: rgba(245, 158, 11, 0.15);
  --gradient-1: linear-gradient(135deg, #CAA380 0%, #A88560 100%);
  --gradient-2: linear-gradient(135deg, #2B5746 0%, #1e3d31 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(202, 163, 128, 0.15);

  /* Semi-transparent surfaces */
  --surface-1: rgba(255, 255, 255, 0.01);
  --surface-2: rgba(255, 255, 255, 0.02);
  --surface-3: rgba(255, 255, 255, 0.03);
  --surface-5: rgba(255, 255, 255, 0.05);
  --table-bg: rgba(0, 0, 0, 0.2);
  --head-bg: rgba(24, 24, 27, 0.95);
  --bg-gradient-1: rgba(202, 163, 128, 0.10);
  --bg-gradient-2: rgba(43, 87, 70, 0.08);
  --card-sheen: rgba(255, 255, 255, 0.02);
  --midline-bg: linear-gradient(135deg, rgba(43, 87, 70, 0.2) 0%, rgba(43, 87, 70, 0.15) 100%);
  --midline-border: rgba(43, 87, 70, 0.35);
  --dropdown-hover: rgba(202, 163, 128, 0.10);
  --btn-hover-bg: rgba(202, 163, 128, 0.25);
  --today-row-hover: rgba(43, 87, 70, 0.2);
  --next-bg: rgba(43, 87, 70, 0.1);
  --next-border: rgba(43, 87, 70, 0.25);
  --current-border: rgba(202, 163, 128, 0.25);
  --good-border: rgba(43, 87, 70, 0.3);
  --accent-border: rgba(202, 163, 128, 0.3);
  --active-bg: rgba(16, 185, 129, 0.15);
  --active-border: rgba(16, 185, 129, 0.4);
  --active-hover-bg: rgba(16, 185, 129, 0.25);
  --active-hover-border: rgba(16, 185, 129, 0.5);
  --pattern-opacity: 0.06;
  --color-scheme: dark;
}

/* Light theme */
[data-theme="light"] {
  --bg: #EEEBE3;
  --card: #ffffff;
  --card-hover: #f5f5f5;
  --muted: #71717a;
  --muted-light: #52525b;
  --text: #18181b;
  --text-secondary: #3f3f46;
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);
  --accent: #CAA380;
  --accent-hover: #CAA380;
  --accent-subtle: rgba(202, 163, 128, 0.12);
  --good: #2B5746;
  --good-subtle: rgba(43, 87, 70, 0.1);
  --warn: #f59e0b;
  --warn-subtle: rgba(245, 158, 11, 0.1);
  --gradient-1: linear-gradient(135deg, #CAA380 0%, #A88560 100%);
  --gradient-2: linear-gradient(135deg, #2B5746 0%, #1e3d31 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(202, 163, 128, 0.12);

  --surface-1: rgba(0, 0, 0, 0.01);
  --surface-2: rgba(0, 0, 0, 0.02);
  --surface-3: rgba(0, 0, 0, 0.03);
  --surface-5: rgba(0, 0, 0, 0.04);
  --table-bg: rgba(0, 0, 0, 0.02);
  --head-bg: rgba(255, 255, 255, 0.95);
  --bg-gradient-1: rgba(202, 163, 128, 0.08);
  --bg-gradient-2: rgba(43, 87, 70, 0.04);
  --card-sheen: rgba(255, 255, 255, 0.4);
  --midline-bg: linear-gradient(135deg, rgba(43, 87, 70, 0.1) 0%, rgba(43, 87, 70, 0.08) 100%);
  --midline-border: rgba(43, 87, 70, 0.25);
  --dropdown-hover: rgba(202, 163, 128, 0.08);
  --btn-hover-bg: rgba(202, 163, 128, 0.18);
  --today-row-hover: rgba(43, 87, 70, 0.12);
  --next-bg: rgba(43, 87, 70, 0.08);
  --next-border: rgba(43, 87, 70, 0.2);
  --current-border: rgba(202, 163, 128, 0.2);
  --good-border: rgba(43, 87, 70, 0.25);
  --accent-border: rgba(202, 163, 128, 0.25);
  --active-bg: rgba(43, 87, 70, 0.1);
  --active-border: rgba(43, 87, 70, 0.3);
  --active-hover-bg: rgba(43, 87, 70, 0.15);
  --active-hover-border: rgba(43, 87, 70, 0.4);
  --pattern-opacity: 0.45;
  --color-scheme: light;
}

* {
  box-sizing: border-box;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

html {
  font-size: 16px;
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease !important;
}

body {
  margin: 0;
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--text);
  color-scheme: var(--color-scheme);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--bg-gradient-1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, var(--bg-gradient-2), transparent),
    var(--bg);
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Full-screen Islamic geometry background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("assets/asset_background_pattern.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--pattern-opacity);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.title-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.title-banner:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(202, 163, 128, 0.15);
}

.page-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.title-arabic {
  font-size: 36px;
  font-weight: 700;
  color: var(--good);
  font-family: "Amiri", "Traditional Arabic", "Simplified Arabic", "Times New Roman", serif;
  letter-spacing: 4px;
}

.title-english {
  font-size: 24px;
  font-weight: 700;
  color: var(--good);
  letter-spacing: 8px;
  text-transform: uppercase;
  font-family: Georgia, "Times New Roman", serif;
}

/* Toolbar */
.bar {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  min-height: 40px;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--surface-5);
  border-color: var(--border-light);
}

.chip--hidden {
  display: none;
}

.chip--visible {
  display: flex;
}

/* City Search */
.city-search-chip {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.city-search-chip input {
  width: 100%;
  min-width: 120px;
}

.city-search-chip input::placeholder {
  color: var(--muted);
}

.locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.locate-btn:hover {
  color: var(--accent-hover);
  background: var(--accent-subtle);
}

.locate-btn.locating {
  animation: pulse 1s ease infinite;
  color: var(--accent);
}

.city-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: none;
}

.city-dropdown.active {
  display: block;
}

.city-dropdown-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.city-dropdown-item:last-child {
  border-bottom: none;
}

.city-dropdown-item:hover {
  background: var(--dropdown-hover);
}

.city-dropdown-item .name {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}

.city-dropdown-item .country {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.city-dropdown-item .coords {
  font-size: 10px;
  color: var(--muted);
  font-family: monospace;
  margin-top: 2px;
}

.city-dropdown-loading,
.city-dropdown-empty,
.city-dropdown-error {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.city-dropdown-error {
  color: var(--warn);
}

select,
input {
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
}

select option {
  background: var(--card);
  color: var(--text);
}

input[type="number"] {
  width: 60px;
}

input[type="date"] {
  min-width: 110px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--accent-subtle);
  color: var(--accent-hover);
  border-radius: 10px;
  cursor: pointer;
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--active {
  background: var(--active-bg);
  border-color: var(--active-border);
  color: var(--good);
}

.btn--active:hover {
  background: var(--active-hover-bg);
  border-color: var(--active-hover-border);
}

/* Layout Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.sidebar-card {
  animation: fadeIn 0.4s ease-out;
}

.sidebar-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 8px 32px rgba(202, 163, 128, 0.18);
}

.sidebar-inner {
  position: relative;
  padding: 20px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Converter */
.converter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.converter-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.converter-tab:hover {
  color: var(--text-secondary);
}

.converter-tab.active {
  background: var(--accent-subtle);
  color: var(--accent-hover);
  font-weight: 600;
}

.converter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.converter-panel.hidden {
  display: none;
}

.converter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.converter-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.converter-input:focus {
  border-color: var(--accent);
}

.converter-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.converter-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--accent);
}

.converter-date-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.converter-date-row .converter-input {
  flex: 1;
  min-width: 0;
}

.converter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.converter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.converter-field .converter-input {
  padding: 8px 6px;
  text-align: center;
  font-size: 13px;
}

.converter-field select.converter-input {
  text-align: left;
  padding: 8px 4px;
  font-size: 11px;
}

.converter-result {
  margin-top: 4px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  text-align: center;
}

.converter-result-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}

.converter-result-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-hover);
  line-height: 1.4;
}

/* Main Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--card-sheen) 0%, transparent 40%);
  pointer-events: none;
}

.inner {
  position: relative;
  padding: 24px;
}

/* Card Header */
.head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.headline {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-light);
}

.hijri-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--good);
  letter-spacing: -0.5px;
}

.midline {
  justify-self: center;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--midline-bg);
  border: 1px solid var(--good-border);
  font-weight: 600;
  font-size: 15px;
  color: var(--good);
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: default;
}

.midline:hover {
  transform: translateY(-2px);
  border-color: var(--good);
  box-shadow: 0 6px 24px rgba(43, 87, 70, 0.22);
}

.big {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.big .label {
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 500;
}

.big .time {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--good);
}

.big .meta {
  color: var(--muted-light);
  font-size: 12px;
}

/* Stats Section */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat:hover {
  background: var(--surface-5);
  transform: translateY(-2px);
}

.stat .n {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat .k {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat--current {
  background: var(--accent-subtle);
  border-color: var(--current-border);
}

.stat--current .n {
  color: var(--accent-hover);
}

.stat--next {
  text-align: center;
  background: var(--next-bg);
  border-color: var(--next-border);
}

.stat--next .n {
  color: var(--good);
  font-weight: 600;
}

/* Table */
.table {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--table-bg);
}

.row {
  display: grid;
  grid-template-columns: 1.4fr repeat(6, 1fr);
  gap: 12px;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  transition: background 0.15s ease;
}

.row:last-child {
  border-bottom: none;
}

.row:hover {
  background: var(--surface-3);
}

.row.row--head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--head-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.row.row--head:hover {
  background: var(--head-bg);
}

.row.row--alt {
  background: var(--surface-2);
}

.row.today-row {
  background: var(--good-subtle);
}

.row.today-row:hover {
  background: var(--today-row-hover);
}

.cell {
  font-size: 13px;
  color: var(--text-secondary);
}

.headcell {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.datecell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.datecell span:first-child {
  font-weight: 500;
  color: var(--text);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-light);
  background: var(--surface-3);
  white-space: nowrap;
}

.badge.today {
  color: var(--good);
  border-color: var(--good-border);
  background: var(--good-subtle);
}

.mono {
  font-variant-numeric: tabular-nums;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 16px 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.footer a {
  color: var(--accent-hover);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer p {
  margin: 0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.card {
  animation: fadeIn 0.4s ease-out;
}

.row {
  animation: fadeIn 0.3s ease-out;
  animation-fill-mode: both;
}

.row:nth-child(1) { animation-delay: 0.02s; }
.row:nth-child(2) { animation-delay: 0.04s; }
.row:nth-child(3) { animation-delay: 0.06s; }
.row:nth-child(4) { animation-delay: 0.08s; }
.row:nth-child(5) { animation-delay: 0.1s; }
.row:nth-child(6) { animation-delay: 0.12s; }
.row:nth-child(7) { animation-delay: 0.14s; }
.row:nth-child(8) { animation-delay: 0.16s; }
.row:nth-child(9) { animation-delay: 0.18s; }
.row:nth-child(10) { animation-delay: 0.2s; }

/* Tablet: stack sidebar below main */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 16px 12px;
  }

  .title-banner {
    border-radius: 16px;
    padding: 16px;
  }

  .title-banner {
    padding: 32px 16px;
    min-height: 140px;
  }

  .title-arabic {
    font-size: 26px;
  }

  .title-english {
    font-size: 14px;
    letter-spacing: 4px;
  }

  .bar {
    padding: 12px;
    gap: 8px;
    overflow: hidden;
  }

  .left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .city-search-chip {
    grid-column: 1 / -1;
    min-width: unset;
    width: auto;
  }

  #chipLatLng {
    grid-column: 1 / -1;
  }

  #toggleAdvanced {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .chip {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
    min-width: 0;
    overflow: hidden;
  }

  .chip input[type="number"],
  .chip input[type="text"] {
    min-width: 0;
    width: 100%;
  }

  .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
    justify-content: center;
  }

  .inner {
    padding: 16px;
  }

  .head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    text-align: center;
  }

  .title {
    order: 1;
    width: 100%;
    text-align: center;
  }

  .midline {
    order: 3;
    width: 100%;
    font-size: 13px;
  }

  .big {
    order: 2;
    width: 100%;
    text-align: center;
  }

  .big .time {
    font-size: 28px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat--current {
    grid-column: span 2;
  }

  .col-sunrise {
    display: none;
  }

  .row {
    grid-template-columns: auto repeat(5, 1fr);
    gap: 4px;
    padding: 10px 8px;
  }

  .cell {
    font-size: 11px;
  }

  .headcell {
    font-size: 9px;
    letter-spacing: 0.2px;
  }

  .datecell {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .datecell span:first-child {
    display: none;
  }

  .badge {
    min-width: 36px;
    min-height: 18px;
    font-size: 9px;
    padding: 2px 6px;
  }

  .sidebar-inner {
    padding: 16px;
  }

  .converter-tab {
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-title {
  margin: 0 0 24px;
  font-size: 20px;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 80px;
}

.social-btn:hover {
  transform: translateY(-2px);
}

.social-btn span {
  font-size: 12px;
  font-weight: 500;
}

.social-btn.facebook {
  background: #1877f2;
  color: white;
}

.social-btn.twitter {
  background: #000000;
  color: white;
}

.social-btn.whatsapp {
  background: #25d366;
  color: white;
}

.social-btn.email {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-download {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.download-btn {
  width: 100%;
  justify-content: center;
}

/* Daily Ayah */
.ayah-arabic {
  font-family: "Amiri", "Traditional Arabic", serif;
  font-size: 22px;
  line-height: 2;
  text-align: right;
  direction: rtl;
  color: var(--good);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ayah-english {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
}

.ayah-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ayah-ref-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.ayah-ref-num {
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}

.ayah-loading,
.ayah-error {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}

/* Islamic Q&A Search */
.islamqa-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.islamqa-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 4px 4px 12px;
  transition: border-color 0.2s ease;
}

.islamqa-input-wrap:focus-within {
  border-color: var(--accent);
}

.islamqa-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}

.islamqa-input::placeholder {
  color: var(--muted);
}

.islamqa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--good);
  border: none;
  border-radius: 7px;
  color: white;
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.islamqa-btn:hover {
  opacity: 0.85;
}

.islamqa-hint {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

/* ── Content Tabs ────────────────────────────────────────────── */
.content-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.content-tabs::-webkit-scrollbar { display: none; }

.content-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.content-tab:hover { color: var(--text); }
.content-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: block; }
.tab-content[hidden] { display: none; }

/* ── Content disclaimer ──────────────────────────────────────── */
.content-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--warn-subtle);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-light);
}

.content-disclaimer svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--warn);
}

.content-disclaimer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.content-disclaimer a:hover {
  text-decoration: underline;
}

/* ── Article / Book grid ─────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.article-card,
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.article-card:hover,
.book-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 8px 32px rgba(202, 163, 128, 0.14);
}

.article-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-excerpt {
  font-size: 12px;
  color: var(--muted-light);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
}

.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
  background: var(--surface-3);
  padding: 12px;
  box-sizing: border-box;
}
.book-cover-placeholder,
.article-cover-placeholder {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
}
.book-cover-placeholder {
  aspect-ratio: 3 / 4;
}
.article-cover-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--good-subtle) 0%, var(--accent-subtle) 100%);
  color: var(--accent);
}

/* Skeleton loading cards */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-5) 50%, var(--surface-3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-cover--tall {
  aspect-ratio: 3 / 4;
}

.skeleton-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-5) 50%, var(--surface-3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-line--title {
  height: 16px;
  width: 85%;
}

.skeleton-line--short {
  width: 55%;
}

/* Loading / error inside grids */
.islamqa-loading,
.islamqa-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.islamqa-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--good);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.islamqa-browse-btn:hover { opacity: 0.85; }

/* ── Contact ─────────────────────────────────────────────────── */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 36px 0;
  align-items: start;
}

@media (max-width: 900px) {
  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.contact-heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.25;
}

.contact-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.contact-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.contact-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.contact-highlight svg {
  flex-shrink: 0;
  color: var(--good);
}

.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-light);
  letter-spacing: 0.3px;
}

.contact-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.contact-input::placeholder {
  color: var(--muted);
}

.contact-input:focus {
  border-color: var(--accent);
}

.contact-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.contact-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--good);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
