@font-face {
  font-family: "BalooWord";
  src: url("vendor/fonts/baloo2-word.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f2547;
  --muted: #8494ab;
  --ink2: #47617e;
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #dbe4f0;
  --gold: #dd9500;
  --soft: #eef4ff;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
::selection { background: #bfd4fb; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* header (fleet template) */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 44px; height: 44px; border-radius: 11px; }
.wordmark { font-family: "BalooWord", -apple-system, sans-serif; font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink); letter-spacing: 0.2px; }
.wordmark-ku { color: var(--blue); }
.tagline { font-size: 9.5px; letter-spacing: 0.5px; color: var(--muted); margin-top: 3px; font-weight: 600; line-height: 1.28; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle { display: flex; background: #e8eef7; border-radius: 999px; padding: 2px; }
.lang-btn { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 28px; }
.lang-btn.lang-active { background: var(--blue); color: #fff; box-shadow: 0 1px 3px rgba(15, 37, 71, 0.18); }
.version-badge { font-size: 12px; font-weight: 600; color: var(--blue); background: #e3ecfd; padding: 5px 10px; border-radius: 999px; }

.container { max-width: 560px; margin: 0 auto; padding: 18px 16px 28px; }
.group-label { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); margin: 16px 2px 8px; text-transform: uppercase; }

/* cards & buttons (fleet template) */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(15, 37, 71, 0.05), 0 10px 22px rgba(15, 37, 71, 0.05);
}
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-size: 15.5px; font-weight: 600; text-align: center; min-height: 48px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-secondary { background: #e8eef7; color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: 14px; min-height: 42px; border-radius: 11px; }
.btn-block { width: 100%; margin-top: 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; min-height: 40px;
}
.chip-active { border-color: var(--blue); background: #e3ecfd; color: var(--blue-dark); }

/* location */
.loc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.loc-name { font-family: "BalooWord", -apple-system, sans-serif; font-size: 21px; font-weight: 700; }
.loc-coord { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.loc-status { margin-top: 12px; background: #fdecea; color: #8f271f; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; }

/* compass */
.compass-card { text-align: center; }
.dial-wrap { position: relative; width: min(320px, 84vw); margin: 4px auto 0; }
.dial { width: 100%; height: auto; display: block; }
.dial-face { fill: #f7fafd; stroke: #dbe4f0; stroke-width: 2; }
.top-pointer { fill: var(--gold); }
.dial-wrap.aligned .dial-face { stroke: var(--gold); stroke-width: 3.5; }
.dial-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
  background: rgba(255, 255, 255, 0.88); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 8px 16px 7px;
}
.dial-wrap.aligned .dial-center { border-color: var(--gold); background: #fdf6dd; }
.dc-deg { font-size: 27px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dc-point { font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.status-pill {
  display: inline-block; margin-top: 14px; border-radius: 999px; padding: 8px 15px;
  font-size: 14px; font-weight: 700; background: #e8eef7; color: var(--ink2);
}
.status-pill.ok { background: #e2f3ea; color: #0a5c39; }
.status-pill.warn { background: #fdf3d3; color: #8a5c00; }
.calib-hint { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.head-line { margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.stat-row { display: flex; gap: 10px; margin-top: 16px; }
.stat-box { flex: 1; background: #f2f6fd; border: 1px solid #dde7f7; border-radius: 14px; padding: 12px 10px; }
.stat-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* footer (fleet template) */
.dev-footer { margin-top: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dev-by { position: relative; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 13px 18px; }
.dev-credit { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; text-decoration: none; }
.dev-credit svg { color: var(--blue); flex: none; }
.about-toggle { background: none; border: 0; padding: 6px 10px; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); cursor: pointer; min-height: 36px; }
.beetle-walker { position: absolute; left: 4%; top: 88%; width: 15px; height: 15px; color: #2563eb; pointer-events: none; animation: beetle-walk 11s linear infinite; }
.beetle-walker svg { display: block; }
@keyframes beetle-walk {
  0% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-180deg); }
  7% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-270deg); }
  38% { left: 96%; top: 88%; transform: translate(-50%, -50%) rotate(-270deg); }
  47% { left: 96%; top: 12%; transform: translate(-50%, -50%) rotate(-360deg); }
  78% { left: 4%; top: 12%; transform: translate(-50%, -50%) rotate(-450deg); }
  87% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-540deg); }
  100% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-540deg); }
}
@media (prefers-reduced-motion: reduce) { .beetle-walker { animation: none; display: none; } }

/* about sheet */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 35, 32, 0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  background: var(--card); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px;
  padding: 18px 18px 30px; max-height: 82vh; overflow: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-title { font-family: "BalooWord", -apple-system, sans-serif; font-size: 20px; font-weight: 700; }
.sheet-p { font-size: 14.5px; line-height: 1.55; color: var(--ink); margin-top: 10px; }
.cal-nav {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 21px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

.loc-area { font-size: 14.5px; font-weight: 700; color: var(--ink2); margin-top: 3px; }
.summary-box { background: var(--soft); border-radius: 14px; padding: 13px; font-weight: 700; color: var(--ink); }
.prayer-date { font-size: 13.5px; font-weight: 700; color: var(--muted); text-align: center; }
.prayer-card .summary-box { margin: 12px 0 6px; text-align: center; font-size: 15.5px; }
.prow { display: flex; align-items: center; justify-content: space-between; padding: 10.5px 10px; border-radius: 12px; }
.prow + .prow { border-top: 1px solid #eef2f8; }
.prow.next { background: var(--soft); border-top-color: transparent; }
.prow.next + .prow { border-top-color: transparent; }
.pname { font-size: 15.5px; font-weight: 600; }
.prow.next .pname { color: var(--blue-dark); font-weight: 800; }
.ptime { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prow.next .ptime { color: var(--blue-dark); }
