:root {
  --bg: #EEF0F5; --surface: #FFFFFF; --surface-2: #F6F7FA; --line: #DCE0EA;
  --fg: #171B2B; --muted: #5E6578; --faint: #8A90A2;
  --accent: #A9761C; --accent-soft: #F3E6CC; --teal: #23716E; --on-accent: #FFFFFF;
  --great: #1F8A5B; --good: #5E9C3A; --mixed: #C78A1A; --bad: #C2462F;
  --great-bg: #DDF1E6; --good-bg: #E8F2DC; --mixed-bg: #F8ECD2; --bad-bg: #F7DFD9;
  --display: "Marcellus", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0D1120; --surface: #151A2C; --surface-2: #1B2135; --line: #283048;
  --fg: #E9E6DC; --muted: #A3A8B8; --faint: #747B90;
  --accent: #E0B15A; --accent-soft: #3A3122; --teal: #5FC0B8; --on-accent: #171B2B;
  --great: #4CC48A; --good: #94C665; --mixed: #E7AE45; --bad: #EE7860;
  --great-bg: #16352A; --good-bg: #253421; --mixed-bg: #3A2F18; --bad-bg: #3C211C; color-scheme: dark } }
html[lang="ar"] { --display: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; --body: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; }

* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.55 }
img { max-width: 100% }
[hidden] { display: none !important }
.wrap { max-width: 920px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)) }
header.bar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px) }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px 8px; flex-wrap: wrap }
.brand { display: flex; flex-direction: column; min-width: 0 }
.brand h1 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; margin: 0; line-height: 1.2 }
.brand small { color: var(--muted); font-size: .78rem }
.datenav, .topright { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
button, select, input { font: inherit; color: inherit }
.btn, .datenav button, .datenav input, select, .field input { font-size: .88rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 8px; padding: 7px 12px; cursor: pointer }
.datenav input { cursor: text; font-family: var(--mono); font-size: .8rem; padding: 6px 8px }
.btn:hover, .datenav button:hover { border-color: var(--accent) }
a.btn { text-decoration: none; display: inline-block }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700 }
.btn.big { padding: 11px 20px; font-size: 1rem }
.btn.link { background: none; border: 0; color: var(--accent); padding: 4px 0; text-decoration: underline }
.btn[disabled] { opacity: .6; cursor: default }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none }
nav.tabs::-webkit-scrollbar { display: none }
nav.tabs a { flex: 0 0 auto; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .86rem; padding: 8px 12px 10px; border-bottom: 2px solid transparent }
nav.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent) }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
main { padding-block: 18px 40px; display: grid; gap: 18px }
section.view { display: grid; gap: 18px }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0 }
.panel h2 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 0 0 10px; text-wrap: balance }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 700; color: var(--faint) }
html[lang="ar"] .eyebrow, html[lang="ar"] th, html[lang="ar"] .cal .h, html[lang="ar"] .wday .d { letter-spacing: 0 }
.muted { color: var(--muted) }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block }

.hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center }
.dial { width: 116px; height: 116px; position: relative }
.dial svg { width: 100%; height: 100% }
.dial .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center }
.dial .num b { font-family: var(--display); font-size: 2.2rem; font-weight: 400; line-height: 1 }
.dial .num span { font-size: .6rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); display: block }
.hero h2 { font-size: 1.5rem; margin: 2px 0 6px }
.hero p { margin: 0; color: var(--muted); max-width: 60ch }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px }
.chip { font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted) }
.chip.warn { background: var(--bad-bg); color: var(--bad); border-color: transparent }
.chip.gold { background: var(--accent-soft); color: var(--accent); border-color: transparent }
.chip.pro { background: var(--accent); color: var(--on-accent); border-color: transparent }

.acts { display: grid; gap: 8px }
.act { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) 2.6rem 5.4rem; align-items: center; gap: 10px }
.act .ic { font-size: 1.05rem; text-align: center }
.act .lbl { font-weight: 600; font-size: .9rem; min-width: 0 }
.meter { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 3px; border: 1px solid var(--line) }
.meter i { display: block; height: 100% }
.act .val { font-family: var(--mono); font-size: .9rem; text-align: end }
.pill { font-size: .72rem; font-weight: 700; text-align: center; padding: 2px 8px; border-radius: 999px }
.great { color: var(--great) } .good { color: var(--good) } .mixed { color: var(--mixed) } .bad { color: var(--bad) }
.pill.great { background: var(--great-bg) } .pill.good { background: var(--good-bg) } .pill.mixed { background: var(--mixed-bg) } .pill.bad { background: var(--bad-bg) }
.fill-great { background: var(--great) } .fill-good { background: var(--good) } .fill-mixed { background: var(--mixed) } .fill-bad { background: var(--bad) }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px }
.stack { display: grid; gap: 18px; align-content: start }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px }
.factors li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px }
.factors li.ico { grid-template-columns: 1.4rem minmax(0, 1fr) }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px }
.dot.p { background: var(--great) } .dot.n { background: var(--bad) } .dot.z { background: var(--faint) }
.factors b { font-weight: 600; font-size: .9rem }
.factors p { margin: 1px 0 0; font-size: .84rem; color: var(--muted) }
.callout { border-inline-start: 3px solid var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 10px 12px; font-size: .88rem }
.callout.gold { border-color: var(--accent); background: var(--accent-soft) }
.callout b { display: block; margin-bottom: 2px }
.lock { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 12px; font-size: .88rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap }

table { border-collapse: collapse; width: 100%; font-size: .86rem }
th { text-align: start; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line) }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top }
tr:last-child td { border-bottom: 0 }
.scroll { overflow-x: auto }
.glyph { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", var(--body); font-size: 1.05rem; width: 1.4rem; display: inline-block; text-align: center; color: var(--accent) }
.rx { color: var(--bad); font-weight: 700; font-size: .75rem; margin-inline-start: 4px }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px }
.wday { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; cursor: pointer; text-align: start; display: grid; gap: 4px; min-width: 0 }
.wday:hover { border-color: var(--accent) }
.wday.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent) }
.wday .d { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase }
.wday .n { font-family: var(--display); font-size: 1.5rem; line-height: 1.1 }
.wday .s { font-size: .74rem; justify-self: start }
.wday .t { font-size: .72rem; color: var(--muted); line-height: 1.3 }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px }
.cal .h { font-size: .68rem; text-transform: uppercase; color: var(--faint); text-align: center; font-weight: 700; padding-bottom: 4px }
.cell { aspect-ratio: 1 / 1.05; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); padding: 5px 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; text-align: start; min-width: 0; overflow: hidden }
.cell:hover { border-color: var(--accent) }
.cell.out { opacity: .35 }
.cell.today { box-shadow: inset 0 0 0 2px var(--accent) }
.cell .dn { font-size: .8rem; font-weight: 700 }
.cell .sc { font-family: var(--mono); font-size: .78rem }
.cell .ev { font-size: .72rem; line-height: 1; color: var(--accent) }
.cell.c-great { background: var(--great-bg) } .cell.c-good { background: var(--good-bg) } .cell.c-mixed { background: var(--mixed-bg) } .cell.c-bad { background: var(--bad-bg) }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 10px }
.legend span[style]::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; background: var(--sw) }
.monthhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px }
.monthhead h2 { margin: 0 }
.seg { display: flex; gap: 4px; flex-wrap: wrap }
.seg button { font-size: .82rem; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg) }

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: end }
.controls label, .field { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted) }
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px }
.rank li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer }
.rank li:hover { border-color: var(--accent) }
.rank .big { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; text-align: center }
.rank .big small { display: block; font-family: var(--body); font-size: .66rem; color: var(--muted) }
.rank b { font-size: .92rem } .rank p { margin: 2px 0 0; font-size: .8rem; color: var(--muted) }
.timeline { list-style: none; padding: 0; margin: 0; display: grid }
.timeline li { display: grid; grid-template-columns: 5.8rem 12px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line) }
.timeline li:last-child { border-bottom: 0 }
.timeline .when { font-size: .76rem; color: var(--muted); line-height: 1.35 }
.timeline b { font-size: .9rem } .timeline p { margin: 2px 0 0; font-size: .82rem; color: var(--muted) }
.timeline li.monthsep { display: block; font-family: var(--display); font-size: 1.05rem; padding: 14px 0 4px; color: var(--accent) }

.wheel { width: 100%; max-width: 520px; margin: 0 auto; display: block; direction: ltr }
.houses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px }
.house { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2) }
.house .hn { font-family: var(--display); font-size: 1.05rem }
.house p { margin: 3px 0 0; font-size: .8rem; color: var(--muted) }
.loading { color: var(--muted); font-size: .9rem; padding: 18px 0 }
footer { color: var(--faint); font-size: .76rem; padding-block: 0 30px; text-align: center }

/* landing, auth, onboarding */
.land { padding-block: 34px 20px; display: grid; gap: 26px }
.land-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap }
.land-top .logo { font-family: var(--display); font-size: 1.4rem }
.land h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; max-width: 18ch }
.land .lead { font-size: 1.05rem; color: var(--muted); max-width: 56ch; margin: 0 0 18px }
.cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.feats h3, .plans h3 { font-family: var(--display); font-weight: 400; font-size: 1.1rem; margin: 0 0 6px }
.feats p { margin: 0; color: var(--muted); font-size: .9rem }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.plans ul { margin: 0; padding-inline-start: 18px; font-size: .9rem; color: var(--muted); display: grid; gap: 4px }
.plans .panel.pro { border-color: var(--accent) }
.authbox { max-width: 420px; margin: 30px auto; display: grid; gap: 14px }
.form { display: grid; gap: 12px }
.field input, .field select { width: 100%; cursor: text; padding: 10px 12px; font-size: 1rem; font-weight: 400; background: var(--surface) }
.field small { font-weight: 400; color: var(--faint) }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); font-weight: 400 }
.msg { border-radius: 8px; padding: 9px 12px; font-size: .88rem }
.msg.err { background: var(--bad-bg); color: var(--bad) }
.msg.ok { background: var(--great-bg); color: var(--great) }
.citywrap { position: relative }
.citylist { position: absolute; inset-inline: 0; top: 100%; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 240px; overflow: auto; box-shadow: 0 8px 24px rgb(0 0 0 / .18) }
.citylist li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 400; color: var(--fg); font-size: .92rem }
.citylist li:hover, .citylist li[aria-selected="true"] { background: var(--accent-soft) }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.members td { vertical-align: middle }

@media (max-width: 700px) {
  .two, .feats, .plans, .row2 { grid-template-columns: 1fr }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)) }
  .act { grid-template-columns: 1.5rem minmax(0, 1fr) 2.4rem 4.8rem; gap: 8px }
  .hero { grid-template-columns: 1fr; justify-items: start }
  .dial { width: 96px; height: 96px }
  .cell { aspect-ratio: auto; min-height: 54px; padding: 4px }
  .cell .sc { font-size: .7rem }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }
