/* DhanRakh in-frame app screens — faithful to the REAL app (app_tokens.dart +
   the dhan_* widgets). Light theme (app default). Authored on a 340x736 canvas;
   the site scales the whole screen inside the device bezel.
   Key real components mirrored: DhanHomeHero (gradient + gold label + pills +
   gold ring), DhanNavBar (center-FAB), DhanTxnRow, DhanStatStrip, DhanInsightCard. */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,500&family=Noto+Sans+Devanagari:wght@400;600;700;800&display=swap');

:root {
  --emerald-700: #0b5d44;
  --emerald-500: #138a66;
  --emerald-900: #063b2c;
  --emerald-grad: linear-gradient(150deg, #138a66 0%, #0b5d44 50%, #063b2c 100%);
  --gold-grad: linear-gradient(135deg, #e3c878, #c9a227);

  --bg: #f0ece2;          /* lightBg (warm cream) */
  --surface: #faf7f0;     /* lightSurface */
  --surface-2: #e7e2d6;
  --ink: #0f1a15;
  --ink-2: #5a655e;
  --ink-3: #8c968e;
  --line: rgba(15, 26, 21, 0.08);
  --primary: #0b5d44;
  --primary-soft: #dfeae2;
  --gold-300: #e3c878;
  --gold-500: #c9a227;
  --gold-600: #b08a22;
  --on-emerald: #eefaf4;
  --on-gold: #2c2105;
  --positive: #0e9b63;
  --negative: #d2603f;

  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;
  --font: 'Hanken Grotesk', 'Noto Sans Devanagari', -apple-system, system-ui, sans-serif;

  --shadow-sm: 0 1px 2px rgba(12,30,22,.05), 0 6px 16px -8px rgba(12,30,22,.12);
  --shadow: 0 2px 6px rgba(12,30,22,.05), 0 18px 40px -16px rgba(12,30,22,.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 340px; height: 736px; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.screen { width: 340px; height: 736px; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.statusbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 22px 4px; font-size: 13px; font-weight: 800; }
.scroll { flex: 1; overflow: hidden; padding: 6px 18px 14px; display: flex; flex-direction: column; }
.num { font-variant-numeric: tabular-nums; }
.deva { font-family: 'Noto Sans Devanagari', var(--font); }

/* App bar (inner screens) */
.appbar { display: flex; align-items: center; gap: 12px; padding: 12px 6px 14px; }
.appbar .back { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--ink); }
.appbar .t { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.appbar .sp { flex: 1; }

/* Home top bar: brand chip + chrome */
.topbar { display: flex; align-items: center; gap: 9px; padding: 10px 4px 12px; }
.brand-gem { width: 30px; height: 30px; border-radius: 9px; background: var(--emerald-grad); display: grid; place-items: center; color: var(--gold-300); box-shadow: var(--shadow-sm); }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 800; }
.topbar .sp { flex: 1; }
.circle-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--ink-2); }

/* ── DhanHomeHero ── */
.hero {
  position: relative; overflow: hidden;
  background: var(--emerald-grad);
  border-radius: var(--r-lg);
  padding: 22px;
  color: var(--on-emerald);
  box-shadow: 0 18px 40px -10px rgba(11,93,68,.5);
}
.hero::after { content: ''; position: absolute; right: -10%; top: -55%; width: 70%; height: 100%; border-radius: 50%; background: radial-gradient(circle, rgba(227,200,120,.30), transparent 58%); }
.hero-label { display: flex; align-items: center; gap: 8px; position: relative; }
.hero-label .gico { width: 24px; height: 24px; border-radius: var(--r-sm); background: rgba(227,200,120,.16); display: grid; place-items: center; color: var(--gold-300); }
.hero-label span { font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-300); }
.hero-amt { font-size: 44px; font-weight: 900; letter-spacing: -1.6px; line-height: 1.02; margin-top: 4px; position: relative; }
.trend-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; padding: 6px 13px; border-radius: var(--r-pill); background: var(--gold-grad); color: var(--on-gold); font-size: 12.5px; font-weight: 800; box-shadow: 0 4px 14px rgba(201,162,39,.4); position: relative; }
.hero-pills { display: flex; gap: 22px; margin-top: 18px; position: relative; }
.hero-pills .k { font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: rgba(238,250,244,.66); }
.hero-pills .v { font-size: 15.5px; font-weight: 800; margin-top: 2px; }
.hero-pills .v.gold { color: var(--gold-300); }
.hero-ring { position: absolute; right: 20px; bottom: 18px; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold-300) calc(var(--p,68)*1%), rgba(255,255,255,.18) 0); }
.hero-ring::before { content: ''; position: absolute; inset: 6.5px; border-radius: 50%; background: #0e6b4f; }
.hero-ring b { position: relative; font-size: 13px; font-weight: 800; color: var(--on-emerald); }

/* ── Stat strip ── */
.stat-strip { display: flex; gap: 12px; margin-top: 16px; }
.stat { flex: 1; background: rgba(250,247,240,.85); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow-sm); padding: 11px; text-align: center; }
.stat .hair { height: 1px; margin: 0 8px 9px; background: linear-gradient(90deg, transparent, rgba(201,162,39,.5), transparent); }
.stat .k { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-size: 18px; font-weight: 900; letter-spacing: -.3px; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.stat .v.gold { color: var(--gold-600); }

/* ── Section header ── */
.sec { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 2px 8px; }
.sec b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.sec span { font-size: 13px; font-weight: 700; color: var(--gold-600); }

/* ── Txn row (TR1) ── */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .chip { width: 46px; height: 46px; border-radius: var(--r-sm); background: var(--primary-soft); display: grid; place-items: center; flex: 0 0 auto; color: var(--primary); }
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-size: 15px; font-weight: 700; }
.row .t2 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 1px; }
.row .amt { font-size: 16px; font-weight: 800; }
.row .amt.pos { color: var(--positive); }
.row .amt.neg { color: var(--negative); }

/* ── Insight card (accent edge) ── */
.insight { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary); padding: 14px 16px; margin-top: 11px; }
.insight.gold { border-left-color: var(--gold-500); }
.insight .ic { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; flex: 0 0 auto; background: rgba(11,93,68,.12); color: var(--primary); }
.insight.gold .ic { background: rgba(201,162,39,.14); color: var(--gold-600); }
.insight .grow { flex: 1; min-width: 0; }
.insight .t1 { font-size: 14.5px; font-weight: 800; }
.insight .t2 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 1px; }
.insight .val { font-size: 15px; font-weight: 800; color: var(--positive); }
.insight .val.gold { color: var(--gold-600); }

/* ── Bento ── */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 15px; box-shadow: var(--shadow-sm); min-height: 92px; }
.tile .gico { width: 36px; height: 36px; border-radius: 11px; background: rgba(11,93,68,.12); display: grid; place-items: center; color: var(--primary); margin-bottom: 10px; }
.tile.goldico .gico { background: rgba(201,162,39,.16); color: var(--gold-600); }
.tile .v { font-size: 21px; font-weight: 900; letter-spacing: -.5px; }
.tile .v.gold { color: var(--gold-600); }
.tile .k { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }

/* ── Bars ── */
.chart { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 16px; }
.chart .head { display: flex; justify-content: space-between; align-items: baseline; }
.chart .head b { font-size: 14px; font-weight: 800; }
.chart .head span { font-size: 12px; font-weight: 700; color: var(--positive); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 84px; margin-top: 14px; }
.bars .bar { flex: 1; background: var(--primary-soft); border-radius: 6px 6px 3px 3px; position: relative; }
.bars .bar.on { background: var(--primary); }
.bars .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 9px; font-weight: 700; color: var(--ink-3); }

/* ── Big ring (score) ── */
.score-ring { width: 184px; height: 184px; border-radius: 50%; margin: 8px auto 4px; display: grid; place-items: center; background: conic-gradient(var(--gold-500) calc(var(--p,80)*1%), var(--surface-2) 0); box-shadow: var(--shadow-sm); }
.score-ring::before { content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: var(--surface); }
.score-ring .in { position: relative; text-align: center; }
.score-ring .n { font-size: 44px; font-weight: 900; letter-spacing: -2px; }
.score-ring .c { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }

/* ── Buttons (B1) ── */
.btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 52px; border-radius: var(--r-sm); border: 0; font-family: var(--font); font-size: 15px; font-weight: 800; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn.gold { background: var(--gold-grad); color: var(--on-gold); box-shadow: var(--shadow); }
.btn.soft { background: rgba(11,93,68,.10); color: var(--primary); }

/* ── Chips ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 9px 15px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pill.on { background: var(--primary); color: #fff; }

/* ── Voice ── */
.voice-orb { width: 108px; height: 108px; border-radius: 50%; margin: 6px auto 0; background: var(--emerald-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 16px 38px -10px rgba(11,93,68,.6); position: relative; }
.voice-orb::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 2px solid rgba(11,93,68,.16); }
.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; margin-top: 16px; }
.wave i { width: 4px; border-radius: 99px; background: var(--gold-500); display: block; }
.parsed { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 16px; margin-top: 16px; }
.parsed .said { font-size: 14.5px; font-weight: 700; font-style: italic; color: var(--ink-2); }
.parsed .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.parsed .f { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.parsed .f .k { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.parsed .f .v { font-size: 15px; font-weight: 800; margin-top: 2px; }

.note { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.handle { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-2); margin: 10px auto 0; }

svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ── DhanNavBar (N2): center FAB ── */
.navbar { position: relative; height: 70px; background: var(--surface); border-top: 1px solid var(--line); display: flex; align-items: stretch; }
.navbar .cell { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--ink-3); padding-top: 6px; }
.navbar .cell.on { color: var(--primary); font-weight: 800; }
.navbar .cell svg { width: 23px; height: 23px; }
.navbar .gap { width: 64px; flex: 0 0 64px; }
.navbar .fab { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 56px; height: 56px; border-radius: var(--r-md); background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -4px rgba(11,93,68,.5); }
.navbar .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
