/* Driver app — Yango Pro grammar. Tokens first; every colour below is a token. */
@font-face { font-family: "YS Text"; src: url("https://yastatic.net/s3/home/fonts/ys/4/text-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "YS Text"; src: url("https://yastatic.net/s3/home/fonts/ys/4/text-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "YS Text"; src: url("https://yastatic.net/s3/home/fonts/ys/4/text-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Amharic: the phone's own Ethiopic font first (most Androids carry Noto Sans
   Ethiopic); the bundled subset downloads only where none is installed, and
   only when Ethiopic text is actually on screen (unicode-range). */
@font-face { font-family: "Yango Ethiopic"; font-weight: 400 500; font-display: swap; unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F;
  src: local("Noto Sans Ethiopic"), local("NotoSansEthiopic-Regular"), url("ethiopic-Regular.woff2") format("woff2"); }
@font-face { font-family: "Yango Ethiopic"; font-weight: 700; font-display: swap; unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F;
  src: local("Noto Sans Ethiopic Bold"), local("NotoSansEthiopic-Bold"), url("ethiopic-Bold.woff2") format("woff2"); }

:root {
  --ground: #F4F4F2;
  --sheet: #FFFFFF;
  --sheet-2: #F0EFEB;
  --ink: #21201F;
  --ink-2: #5C5A57;            /* 6.6:1 on white */
  --ink-3: #75726E;            /* 4.7:1 on white — the floor for small text */
  --line: #E6E4DF;
  --yellow: #FCE000;           /* Yango yellow: press me / you earned this */
  --yellow-ink: #21201F;
  --yellow-soft: #FFF6B8;
  --yellow-deep: #E8C800;
  --red: #E5281B;              /* brand red: badges and the one urgent thing */
  --red-soft: #FDE8E6;
  --green: #12804A;
  --green-soft: #E3F4EA;
  --amber: #A05A00;
  --amber-soft: #FFF0D6;
  --shadow: 0 1px 2px rgba(33, 32, 31, .06), 0 8px 24px -12px rgba(33, 32, 31, .18);
  --r-sheet: 24px;
  --r-row: 16px;
  --r-pill: 999px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "YS Text", "Yango Ethiopic", "Noto Sans Ethiopic", "Ebrima", "Nyala", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #121211;
  --sheet: #1E1E1C;
  --sheet-2: #2A2A27;
  --ink: #F2F1EE;
  --ink-2: #C4C1BB;
  --ink-3: #A29F99;
  --line: #34332F;
  --yellow-soft: #3A3410;
  --red-soft: #3D1A17;
  --green: #4CC384;
  --green-soft: #15301F;
  --amber: #F2B04B;
  --amber-soft: #352710;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.4; }
body { min-height: 100vh; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
::selection { background: var(--yellow); color: var(--yellow-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
[hidden] { display: none !important; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); opacity: .6; } }

/* ---------- page ---------- */
.page { padding: 12px 16px calc(var(--tab-h) + var(--safe-b) + 24px); max-width: 560px; margin: 0 auto; animation: in .22s cubic-bezier(.2,.8,.2,1); }
.page.sub { padding-top: 8px; }
@keyframes in { from { opacity: .001; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .page, .sheet, .toast { animation: none !important; } }

.top { display: flex; align-items: center; gap: 12px; padding: 8px 0 16px; }
.top h1 { font-size: 26px; line-height: 1.15; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.top .sub { color: var(--ink-3); font-size: 14px; margin: 2px 0 0; }
.top .grow { flex: 1; min-width: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--yellow-ink); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.lang-btn { height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--sheet); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; }
.back { width: 40px; height: 40px; border-radius: 50%; background: var(--sheet); display: grid; place-items: center; box-shadow: var(--shadow); flex: none; }

.h2 { font-size: 19px; font-weight: 700; margin: 28px 2px 12px; letter-spacing: -0.01em; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.h2 .aside { font-size: 14px; font-weight: 500; color: var(--ink-3); }

/* ---------- sheets ---------- */
.sheet-card { background: var(--sheet); border-radius: var(--r-sheet); padding: 20px; box-shadow: var(--shadow); }
.sheet-card + .sheet-card { margin-top: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; color: var(--ink-3); }

/* The hero: the yellow sheet. */
.hero { background: var(--yellow); color: var(--yellow-ink); border-radius: 28px; padding: 22px 22px 20px; position: relative; overflow: hidden; }
.hero::after { /* the four-point spark, Yango's own mark-shape, drawn not borrowed */
  content: ""; position: absolute; right: -36px; top: -30px; width: 190px; height: 190px; opacity: .22;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C54 32 68 46 100 50C68 54 54 68 50 100C46 68 32 54 0 50C32 46 46 32 50 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C54 32 68 46 100 50C68 54 54 68 50 100C46 68 32 54 0 50C32 46 46 32 50 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.hero-label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .78; }
.hero-num { font-size: 76px; line-height: .95; font-weight: 700; letter-spacing: -0.045em; margin: 10px 0 2px; display: flex; align-items: baseline; gap: 8px; }
.hero-num small { font-size: 20px; letter-spacing: 0; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(255,255,255,.62); font-size: 14px; font-weight: 700; color: var(--yellow-ink); }
.chip svg { width: 16px; height: 16px; }
.chip.ghost { background: var(--sheet-2); color: var(--ink); }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.live { background: var(--green-soft); color: var(--green); height: 30px; font-size: 13px; }
.chip.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.hero .goalbar { margin-top: 18px; background: rgba(255,255,255,.55); border-radius: 18px; padding: 14px 14px 12px; position: relative; z-index: 1; }

/* ---------- progress ---------- */
.bar { height: 10px; border-radius: 10px; background: var(--sheet-2); overflow: hidden; }
.hero .bar { background: rgba(33,32,31,.12); }
.bar > i { display: block; height: 100%; border-radius: 10px; background: var(--ink); transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1); }
.sheet-card .bar > i { background: var(--yellow-deep); }
.bar.done > i { background: var(--green); }
@keyframes grow { from { transform: scaleX(0); } }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.goal-num { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.goal-num .of { font-size: 18px; color: var(--ink-3); font-weight: 500; }

/* Week strip: eight weeks as eight stones. */
.weeks { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 6px; margin-top: 14px; }
.wk { height: 40px; border-radius: 12px; background: var(--sheet-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.wk.done { background: var(--yellow); color: var(--yellow-ink); }
.wk.now { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.wk.missed { background: var(--sheet-2); color: var(--ink-3); text-decoration: line-through; }
.wk svg { width: 18px; height: 18px; }

/* ---------- quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { background: var(--sheet); border-radius: 20px; padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--shadow); font-size: 13px; font-weight: 500; text-align: center; min-height: 92px; position: relative; }
.qa .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--sheet-2); }
.qa .ic svg { width: 24px; height: 24px; }
.qa.hot .ic { background: var(--yellow); color: var(--yellow-ink); }
.qa .dot { position: absolute; top: 10px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------- list rows ---------- */
.list { background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--sheet-2); display: grid; place-items: center; flex: none; }
.item .ic svg { width: 22px; height: 22px; }
.item .ic.y { background: var(--yellow); color: var(--yellow-ink); }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; font-weight: 500; font-size: 16px; }
.item .tx span { display: block; font-size: 14px; color: var(--ink-3); margin-top: 1px; }
.item .end { flex: none; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; }
.item .chev { width: 18px; height: 18px; color: var(--ink-3); }
.pts { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pts.plus { color: var(--green); }
.pts.minus { color: var(--ink-3); text-decoration: line-through; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 54px; border-radius: 18px; background: var(--yellow); color: var(--yellow-ink); font-weight: 700; font-size: 17px; transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.98); filter: brightness(.96); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.dark { background: var(--ink); color: var(--sheet); }
.btn.soft { background: var(--sheet-2); color: var(--ink); }
.btn.sm { height: 42px; font-size: 15px; border-radius: 14px; width: auto; padding: 0 18px; display: inline-flex; }
.btn svg { width: 20px; height: 20px; }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

/* ---------- inputs ---------- */
.field { display:block; width:100%; height:54px; margin-top:8px; padding:0 16px; border-radius:16px; border:0; background:var(--sheet-2); font-size:18px; font-weight:500; color:var(--ink); outline:none; box-shadow:inset 0 0 0 2px transparent; transition:box-shadow .15s; }
.field:focus { box-shadow:inset 0 0 0 2px var(--ink); }
.field.code { letter-spacing:.5em; text-align:center; font-size:24px; font-variant-numeric:tabular-nums; }
.field::placeholder { color:var(--ink-3); }

/* ---------- leaderboard ---------- */
.seg { display: flex; background: var(--sheet-2); border-radius: var(--r-pill); padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; height: 38px; border-radius: var(--r-pill); font-weight: 500; font-size: 15px; color: var(--ink-2); }
.seg button[aria-selected="true"] { background: var(--yellow); color: var(--yellow-ink); font-weight: 700; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin: 8px 0 14px; }
.pod { background: var(--sheet); border-radius: 20px 20px 14px 14px; padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow); }
.pod .medal { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 700; background: var(--sheet-2); }
.pod.p1 { padding-top: 22px; background: var(--yellow); color: var(--yellow-ink); }
.pod.p1 .medal { background: rgba(255,255,255,.7); width: 48px; height: 48px; font-size: 20px; }
.pod b { display: block; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod span { font-size: 13px; font-weight: 700; }
.rk { width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.item.me { background: var(--yellow-soft); }
.mebar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); margin-top: 12px; background: var(--ink); color: var(--sheet); border-radius: 18px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.mebar .rk { color: var(--yellow); font-size: 18px; }
.mebar .grow { flex: 1; min-width: 0; }
.mebar small { display: block; opacity: .75; font-size: 13px; }

/* ---------- tasks ---------- */
.task-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: #fff; flex: none; }
.task-ic svg { width: 22px; height: 22px; }
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.pts { background: var(--yellow); color: var(--yellow-ink); }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.approved { background: var(--green-soft); color: var(--green); }
.badge.rejected { background: var(--red-soft); color: var(--red); }
.badge.closed { background: var(--sheet-2); color: var(--ink-3); }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: 20px; min-height: 170px; padding: 18px; text-align: center; background: var(--sheet-2); position: relative; overflow: hidden; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-width: 100%; max-height: 260px; border-radius: 12px; }
.drop svg { width: 34px; height: 34px; color: var(--ink-3); }
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }

/* quiz */
.opt { display: block; width: 100%; text-align: left; padding: 16px; border-radius: 16px; background: var(--sheet); box-shadow: inset 0 0 0 2px var(--line); font-weight: 500; margin-top: 10px; }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); background: var(--yellow-soft); }
.opt.right { box-shadow: inset 0 0 0 2px var(--green); background: var(--green-soft); }
.timer { height: 6px; border-radius: 6px; background: var(--sheet-2); overflow: hidden; margin: 6px 0 4px; }
.timer i { display: block; height: 100%; background: var(--ink); transform-origin: left; }

/* ---------- empty / notice ---------- */
.empty { text-align: center; padding: 32px 20px; }
.empty .art { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 14px; background: var(--yellow); display: grid; place-items: center; color: var(--yellow-ink); }
.empty .art svg { width: 36px; height: 36px; }
.empty h3 { margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto; color: var(--ink-2); max-width: 32ch; }
.notice { border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.notice.bad { background: var(--red-soft); color: var(--red); }
.notice.ok { background: var(--green-soft); color: var(--green); }
.notice.info { background: var(--sheet-2); color: var(--ink-2); }
.notice b { color: var(--ink); }

/* ---------- long text (faq, rules) ---------- */
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; color: var(--ink-2); white-space: pre-line; }
.qa-item { border-top: 1px solid var(--line); }
.qa-item summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; font-weight: 500; cursor: pointer; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary svg { width: 18px; height: 18px; flex: none; transition: transform .2s; color: var(--ink-3); margin-top: 2px; }
.qa-item[open] summary svg { transform: rotate(90deg); }
.qa-item p { padding: 0 0 14px; }

/* rewards */
.tier { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.tier + .tier { border-top: 1px solid var(--line); }
.tier .place { width: 64px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier .amt { margin-left: auto; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier .amt small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); }
.big-total { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }

/* refer */
.linkbox { display: flex; align-items: center; gap: 10px; background: var(--sheet-2); border-radius: 16px; padding: 12px 12px 12px 14px; margin-top: 12px; }
.linkbox code { flex: 1; min-width: 0; font-family: var(--font); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--sheet); border-top: 1px solid var(--line); display: flex; z-index: 20; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--ink-3); text-decoration: none; position: relative; }
.tabs a .pill { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabs a[aria-current="page"] .pill { background: var(--yellow); color: var(--yellow-ink); }
.tabs a .dot { position: absolute; top: 8px; left: calc(50% + 12px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ---------- toast + bottom sheet ---------- */
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--sheet); border-radius: 16px; padding: 12px 18px; font-weight: 500; max-width: 480px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: tin .25s cubic-bezier(.2,.8,.2,1); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--sheet); border-radius: 28px 28px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); max-height: 88vh; overflow: auto; animation: up .28s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 8px; font-size: 21px; }
@keyframes up { from { transform: translateY(100%); } }

/* celebration */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.burst i { position: absolute; top: 40%; left: 50%; width: 10px; height: 14px; border-radius: 3px; background: var(--yellow); animation: fly 1.1s cubic-bezier(.15,.7,.3,1) forwards; }
.burst i:nth-child(3n) { background: var(--red); }
.burst i:nth-child(3n+1) { background: var(--ink); }
@keyframes fly { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--sheet-2), var(--sheet), var(--sheet-2)); background-size: 200% 100%; animation: sh 1.2s linear infinite; border-radius: 16px; }
@keyframes sh { to { background-position: -200% 0; } }

@media (min-width: 600px) { .hero-num { font-size: 88px; } }
@media (max-width: 350px) { .quick { grid-template-columns: repeat(2, 1fr); } .hero-num { font-size: 60px; } }
