/* allindia — a launcher for India-specific apps. Same shell as familytree:
   full-screen on a phone, a phone-sized card on desktop. Each app opens in
   #win (an iframe per app, kept alive so reopening is instant). */

:root {
  --l-font-display: 'Archivo', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --l-font-label: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --l-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --ink: #111;
  --dim: #a1a1aa;
  --paper: #f1f0ec;
  --tile: #fff;
  --lpull-bg: var(--ink);
  --lpull-fg: var(--paper);
  --tile-dark: #1b1b1d;
  --card: #fff;
  --ink2: #1b1b1d;   /* headings, tile words */
  --sub: #3a3a3c;    /* chips, icon names */
  --faint: #6e6e73;  /* section labels */
  --dim2: #8a8a8e;   /* small print */
  --hair: #dedcd5;
  --chip: #c4c4c8;
  --inv: #1b1b1d;    /* a chosen chip, the install button */
  --inv-fg: #fff;
  --press: rgba(0,0,0,.07);
}

/* dark: chosen in Settings (html[theme="dark"]), or the phone's own setting
   when Settings says Auto (no theme attribute) */
html[theme="dark"] {
  --ink: #f2f2f2; --paper: #0f0f10; --tile: #1e1e20; --tile-dark: #2c2c2f; --card: #1e1e20;
  --ink2: #f2f2f2; --sub: #d0d0d4; --faint: #9a9aa0; --dim2: #8a8a8e; --hair: #2a2a2d; --chip: #48484c;
  --inv: #f2f2f2; --inv-fg: #111; --press: rgba(255,255,255,.1);
}
@media (prefers-color-scheme: dark) {
  html:not([theme]) {
    --ink: #f2f2f2; --paper: #0f0f10; --tile: #1e1e20; --tile-dark: #2c2c2f; --card: #1e1e20;
    --ink2: #f2f2f2; --sub: #d0d0d4; --faint: #9a9aa0; --dim2: #8a8a8e; --hair: #2a2a2d; --chip: #48484c;
    --inv: #f2f2f2; --inv-fg: #111; --press: rgba(255,255,255,.1);
  }
}

html, body { background: var(--paper); }
body { overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* the screen is laya's <lphone>: full screen on a phone, a real phone screen on
   a desktop (with a note beside it) — see laya.css / lphone.js */
lphone#screen { background: var(--paper); color: var(--ink); }

/* ── home ─────────────────────────────────────────────────────────── */
chome { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 34px) 16px calc(var(--lhome-h) + 28px); overflow-y: auto; overscroll-behavior: contain; }

/* today, big — light and bold words mixed, like a calendar page */
chead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 6px; }
ctoday { display: block; font: 400 1.85rem/1.02 var(--l-font-display); letter-spacing: -.02em; text-transform: uppercase; color: var(--ink2); }
ctoday b { font-weight: 900; }
cnone { display: block; padding: 22px 10px; font: 500 .95rem/1.4 var(--l-font-label); color: var(--dim2); }
cbackup { display: flex; align-items: center; gap: 10px; margin: 18px 6px 0; padding: 12px 14px 12px 16px; border-radius: 18px; background: var(--tile, #e9e7e1); font: 600 .86rem/1.35 var(--l-font-label); color: var(--sub); cursor: pointer; }
cbackup span { flex: 1; }
cbackup b { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; background: var(--inv); color: var(--inv-fg); font: 700 .82rem var(--l-font-label); }
#backupLast { margin-top: 10px; color: var(--sub); font-weight: 600; }
#btnSettings { flex: 0 0 auto; width: 76px; height: 76px; border: 0; border-radius: 26px; background: #c9d8f5; color: #1b2a4a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: transform .18s var(--l-spring); }
#btnSettings:active { transform: scale(.92); }
#btnSettings svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#btnSettings span { font: 600 .7rem var(--l-font-label); }

/* install: for anyone in a browser — light, with the why */
cinstall { position: relative; display: block; margin-top: 14px; padding: 18px 20px; border-radius: 24px; background: var(--card); color: var(--ink2); }
cinstall > b { display: block; padding-right: 30px; font: 900 1.35rem/1.1 var(--l-font-display); letter-spacing: -.02em; }
cinstall ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
cinstall li { position: relative; padding-left: 24px; font: 500 .92rem/1.35 var(--l-font-label); color: var(--sub); }
cinstall li::before { content: ''; position: absolute; left: 3px; top: .35em; width: 11px; height: 6px; border-left: 2.2px solid #1a9c6b; border-bottom: 2.2px solid #1a9c6b; transform: rotate(-45deg); }
cinstall cstep { display: block; margin-top: 16px; padding: 12px 14px; border-radius: 16px; background: var(--paper); font: 500 .9rem/1.35 var(--l-font-label); color: var(--sub); }
cinstall cstep b { font-weight: 700; color: var(--ink2); }
cinstall [data-act="install"] { display: block; width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 99px; background: var(--inv); color: var(--inv-fg); font: 800 1rem var(--l-font-display); cursor: pointer; }

/* the tiles: two columns, three sizes — tall photo, square light, square dark */
ctiles { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; grid-auto-flow: dense; gap: 12px; margin-top: 22px; }
ctiles:empty { display: none; }
ctile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 16px; border-radius: 30px; background: var(--tile); color: var(--ink2); overflow: hidden; cursor: pointer; transition: transform .18s var(--l-spring); }
ctile:active { transform: scale(.96); }
ctile[data-size="tall"] { grid-row: span 2; }
ctile[data-size="wide"] { grid-column: span 2; }
ctile[data-tone="dark"] { background: var(--tile-dark); color: #fff; }
/* a countdown: Swiss red, one big number */
ctile[data-tone="count"] { background: #e3120b; color: #fff; gap: 2px; }
ctile cnum { display: block; margin-bottom: 4px; font: 900 3.9rem/.8 var(--l-font-display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
ctile cnum[data-word] { font-size: 2.3rem; letter-spacing: -.04em; }
ctile[data-tone="count"] strong { font-size: 1.05rem; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
ctile[data-tone="photo"] { color: #fff; background: #333 center / cover no-repeat; }
ctile[data-tone="photo"]::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.4), transparent 22%, transparent 45%, rgba(0,0,0,.72)); }   /* the name on top, the words below stay readable */
ctile[data-tone="photo"] strong { font-size: 1.05rem; overflow-wrap: anywhere; }   /* a long one-word title still fits */
ctile > * { position: relative; }
/* the app's name, faint, top-left (no pill: the tile's own content is the point) */
ctile clabel { position: absolute; top: 14px; left: 16px; font: 700 .72rem var(--l-font-label); letter-spacing: .02em; opacity: .5; }
ctile[data-tone="photo"] clabel, ctile[data-tone="dark"] clabel, ctile[data-tone="count"] clabel { opacity: .75; }
/* radio: the station's card colour, a play / pause right on it */
ctile[data-tone="station"] { background: var(--st); color: #1b1b1d; }
ctile strong { display: block; font: 900 1.35rem/1.08 var(--l-font-display); letter-spacing: -.02em; }
ctile[data-tone="dark"] strong { font-size: 1.9rem; }
ctile small { display: block; font: 500 .82rem/1.3 var(--l-font-label); opacity: .75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
ctile cthumb { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; background: #eee center / cover no-repeat; }
ctile cplay { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #1b1b1d; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45); transition: transform .18s var(--l-spring); }
ctile cplay svg { position: relative; width: 20px; height: 20px; fill: #fff; }
ctile cplay:active { transform: scale(.9); }
ctile cplay ~ strong { font-size: 1.1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* stays clear of the button */

/* flat icons: a soft pastel square, a thin dark line drawing — no gloss, no glow */
cicon[data-flat] { background: var(--t); box-shadow: none; border-radius: 30%; }
cicon[data-flat]::after { display: none; }
cicon[data-flat] svg { width: 54%; height: 54%; fill: none; stroke: #1b1b1d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: none; }
/* hold a card: it settles and offers Hide */
ctile[data-editing] { transform: scale(.96); }
ctile [data-act="hide-card"] { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); padding: 10px 16px; border: 0; border-radius: 99px;
  background: var(--card); color: var(--ink2); font: 700 .85rem var(--l-font-label); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); white-space: nowrap; cursor: pointer; }
ctoast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 18px;
  border-radius: 99px; background: #1b1b1d; color: #fff; font: 600 .9rem var(--l-font-label); transform: translate(-50%, 160%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
ctoast[data-show] { transform: translate(-50%, 0); }
ctoast button { padding: 7px 14px; border: 0; border-radius: 99px; background: #fff; color: #111; font: 800 .82rem var(--l-font-display); cursor: pointer; }

/* every app: sections that run edge to edge (a hairline, no boxes) — yours, then to try */
cgrid { display: block; margin: 26px -16px 0; }
cgrid h2 { margin: 0; padding: 18px 22px 0; border-top: 1px solid var(--hair); font: 800 .74rem var(--l-font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
cicons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 6px; padding: 16px 10px 24px; }
cgrid button { border: none; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; color: inherit; transition: transform .18s var(--l-spring); }
cgrid button:active { transform: scale(.92); }
cgrid button cicon { width: 74px; }
cgrid b { font-family: var(--l-font-label); font-size: .8rem; font-weight: 600; letter-spacing: 0; line-height: 1.1; text-align: center; color: var(--sub); }

/* the icon: a squircle-ish tile with its own gradient (set per app from
   app.js via --g), a soft colored shadow, and a glassy top-left sheen */
cicon { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; border-radius: 28%; background: var(--g); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 -2px 6px rgba(0,0,0,.12) inset, 0 10px 24px -8px var(--glow), 0 3px 8px -2px rgba(0,0,0,.12); overflow: hidden; }
cicon::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 18% 0%, rgba(255,255,255,.38), rgba(255,255,255,0) 55%); pointer-events: none; }
cicon svg { width: 58%; height: 58%; filter: drop-shadow(0 3px 5px rgba(0,0,0,.18)); }

/* settings: a sheet over the home screen */
csettings { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgba(0,0,0,.35); }
csettings cpanel { max-height: calc(100% - env(safe-area-inset-top, 0px) - 24px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
csettings cpanel { display: block; width: 100%; padding: 22px 22px calc(env(safe-area-inset-bottom, 0px) + 28px); border-radius: 30px 30px 0 0; background: var(--paper); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } }
csettings header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
csettings header b { font: 900 1.9rem var(--l-font-display); letter-spacing: -.03em; }
csettings header button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--press); color: var(--ink2); font-size: 1rem; cursor: pointer; }
csettings h3 { margin-top: 20px; font: 800 .74rem var(--l-font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
csettings small { display: block; margin-top: 3px; font: 500 .82rem var(--l-font-label); color: var(--dim2); }
clangs, csizes, cthemes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
clangs button, csizes button, cthemes button { padding: 9px 15px; border: 1.5px solid var(--chip); border-radius: 99px; background: none; color: var(--sub); font: 700 .9rem var(--l-font-label); cursor: pointer; }
clangs button[data-on], csizes button[data-on], cthemes button[data-on] { background: var(--inv); border-color: var(--inv); color: var(--inv-fg); }
csizes button:nth-child(1) { font-size: .8rem; } csizes button:nth-child(3) { font-size: 1.05rem; }

/* the name, small, in a strip at the bottom — where ⌂ Home sits inside an app (laya.css lwindow) */
cbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: var(--lhome-h); padding-top: 15px; display: flex; justify-content: center; background: var(--paper); border-top: 1px solid var(--hair); }
cbrand { font: 800 15px/22px var(--l-font-display); letter-spacing: -.02em; color: var(--ink); }
cbrand sup { font-size: 1em; vertical-align: baseline; font-weight: 600; color: var(--dim2); }

/* the app window (lwindow) and pull-to-refresh (lpull) are laya's — see laya.css / llauncher.js */

/* the Tools folder: a soft square holding four tiny icons, like a phone's folder */
cicon[data-folder] { background: var(--tile); box-shadow: inset 0 0 0 1px var(--hair, #dedcd5); }
cminis { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 66%; }
cminis i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 30%; background: var(--t); }
cminis svg { width: 72% !important; height: 72% !important; fill: none; stroke: #1b1b1d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: none !important; }
#toolsSheet cgrid { margin: 10px -16px 0; }
#toolsSheet cicons { padding-bottom: 8px; }

/* publishing: the editor's way in, and the Publish switches */
ceditor { display: block; margin-top: 8px; }
ceditor > button[ceditor] { display: block; margin: 24px auto 0; padding: 8px 14px; border: 0; background: none; color: var(--sub); font: 600 .8rem var(--l-font-label); opacity: .7; cursor: pointer; }
cpin { display: flex; gap: 8px; margin-top: 12px; }
cpin input { flex: 1; min-width: 0; padding: 10px 16px; border: 1.5px solid var(--chip); border-radius: 99px; background: none; color: inherit; font: 600 1rem var(--l-font-label); -webkit-appearance: none; outline: none; }
cpin button { padding: 9px 18px; border: 0; border-radius: 99px; background: var(--inv); color: var(--inv-fg); font: 700 .9rem var(--l-font-label); cursor: pointer; }
