/* ============ FONTS (self-hosted, no CDN) ============ */
@font-face {
  font-family: 'Almarai';
  src: url('../fonts/almarai-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Almarai';
  src: url('../fonts/almarai-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Almarai';
  src: url('../fonts/almarai-extrabold.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-regular.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ============ TOKENS (light cream) ============ */
:root {
  --bg: #F5F1EA;
  --panel: #FFFFFF;
  --panel-2: #F0EBE2;
  --panel-3: #EDE7DC;
  --accent: #D97757;
  --accent-soft: rgba(217,119,87,0.14);
  --text: #2B2620;
  --muted: #8A8175;
  --line: rgba(0,0,0,.09);
  --green: #2FA968;
  --red: #C0492F;
  --green-soft: rgba(47,169,104,0.12);
  --red-soft: rgba(192,73,47,0.12);
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.04);
}

/* ============ BASE ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Almarai', system-ui, sans-serif;
  min-height: 100%;
}
.num { font-family: 'Inter', 'Almarai', sans-serif; font-feature-settings: "tnum" 1; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* page container — matches Tasks (920px, centered, natural page scroll) */
#app {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

/* ============ SCREENS / ROUTER ============ */
/* Natural document flow: one screen visible at a time, the PAGE scrolls (no inner column). */
.screen {
  display: none;
  flex-direction: column;
  padding: 0 16px calc(34px + env(safe-area-inset-bottom));
}
.screen.active {
  display: flex;
  animation: screenIn .28s ease;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* leaving screen is removed by the router; keep it hidden meanwhile */
.screen.leaving { display: none; }

/* ============ TOPBAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 2px 10px;
  background: linear-gradient(var(--bg) 70%, rgba(245,241,234,0));
}
.back-btn {
  width: 64px; height: 64px; min-width: 64px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .12s ease, background .2s;
}
.back-btn:active { transform: scale(.92); background: var(--panel-2); }
.topbar h1 { font-size: 24px; font-weight: 800; margin: 0; }
.topbar .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ============ LOCK SCREEN ============ */
#lock {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0 22px 6vh;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}
.lock-top { margin-top: 12vh; }
.lock-logo {
  width: 92px; height: 92px; border-radius: 28px;
  margin: 0 auto 22px;
  background: linear-gradient(150deg, var(--accent), #c96545);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  box-shadow: 0 14px 38px rgba(217,119,87,.3);
}
.lock-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.lock-hint { font-size: 16px; color: var(--muted); margin: 0; }

.dots { display: flex; gap: 18px; justify-content: center; margin: 30px 0 6px; }
.dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: transparent; border: 2.5px solid var(--muted);
  transition: all .18s ease;
}
.dot.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.12); }
.dot.error { background: var(--red); border-color: var(--red); }
.shake { animation: shake .42s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-12px)}
  40%{transform:translateX(11px)} 60%{transform:translateX(-8px)} 80%{transform:translateX(6px)}
}

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; width: 100%; max-width: 330px; margin: 8px auto 4px;
}
.key {
  height: 80px; border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: 'Inter', sans-serif;
  font-size: 32px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease, background .2s;
  box-shadow: var(--shadow);
}
.key:active { transform: scale(.9); background: var(--accent-soft); }
.key.blank { background: transparent; box-shadow: none; border: none; pointer-events: none; }
.key.del { font-size: 28px; background: transparent; box-shadow: none; border: none; color: var(--muted); }

.remember {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 26px 0 6vh; font-size: 16px; color: var(--text);
}
.toggle {
  width: 58px; height: 34px; border-radius: 20px;
  background: #D8D0C4; position: relative; transition: background .22s;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content:''; position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .22s ease;
}
.toggle.on::after { transform: translateX(-24px); }

/* ============ HOME ============ */
.greeting { padding: 26px 4px 8px; }
.greeting .hi { font-size: 17px; color: var(--muted); }
.greeting .name { font-size: 32px; font-weight: 800; margin-top: 2px; }

.big-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  margin-top: 18px;
  display: flex; align-items: center; gap: 22px;
  min-height: 132px;
  box-shadow: var(--shadow);
  transition: transform .14s ease, background .2s;
  position: relative; overflow: hidden;
}
.big-card:active { transform: scale(.97); background: var(--panel-2); }
.big-card .ic {
  width: 78px; height: 78px; min-width: 78px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.big-card .ic.tasks { background: var(--green-soft); }
.big-card .ic.money { background: var(--accent-soft); }
.big-card .ct { flex: 1; }
.big-card .ct .t { font-size: 26px; font-weight: 800; }
.big-card .ct .d { font-size: 15px; color: var(--muted); margin-top: 4px; }
.big-card .arrow { font-size: 26px; color: var(--muted); }
.big-card .glow {
  position: absolute; left: -40px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  filter: blur(40px); opacity: .14;
}
.big-card .glow.tasks { background: var(--green); }
.big-card .glow.money { background: var(--accent); }
.big-card .ic.market { background: rgba(212,160,23,0.16); }
.big-card .glow.market { background: #D4A017; }
.big-card .ic.fx { background: rgba(47,108,169,0.14); }
.big-card .glow.fx { background: #2F6CA9; }

/* ============ HERO (portfolio) ============ */
.hero {
  background: linear-gradient(160deg, #FFFFFF, var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  margin-top: 6px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero .label { font-size: 15px; color: var(--muted); }
.hero .total {
  font-size: 52px; font-weight: 800; margin: 6px 0 2px;
  line-height: 1.05;
}
.hero .change {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; margin-top: 8px;
  padding: 8px 16px; border-radius: 999px;
}
.hero .change.up { color: var(--green); background: var(--green-soft); }
.hero .change.down { color: var(--red); background: var(--red-soft); }
.hero .cash { font-size: 14px; color: var(--muted); margin-top: 14px; }

.seg {
  display: flex; gap: 8px; margin-top: 18px;
  background: var(--panel-3); padding: 7px; border-radius: 18px;
}
.seg button {
  flex: 1; height: 66px; border-radius: 13px;
  font-size: 18px; font-weight: 700; color: var(--muted);
  transition: all .2s;
}
.seg button.on { background: var(--accent); color: #fff; }

/* section heading */
.sec-title {
  font-size: 22px; font-weight: 800; margin: 28px 4px 14px;
  display: flex; align-items: center; gap: 10px;
}
.sec-title .badge { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; }

/* ============ STOCK CARDS ============ */
.stock-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  transition: transform .13s ease, background .2s;
}
.stock-card:active { transform: scale(.97); background: var(--panel-2); }
.tkr {
  width: 64px; height: 64px; min-width: 64px; border-radius: 18px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Almarai', sans-serif; font-weight: 800; font-size: 30px;
}
.stock-card .info { flex: 1; min-width: 0; }
.stock-card .info .co { font-size: 20px; font-weight: 700; }
.stock-card .info .tk { font-size: 13px; color: var(--muted); font-family: 'Inter', sans-serif; margin-top: 2px; }
.stock-card .vals { text-align: left; }
.stock-card .vals .v { font-size: 21px; font-weight: 800; }
.stock-card .vals .ch { font-size: 14px; font-weight: 700; margin-top: 3px; }
.up-txt { color: var(--green); }
.down-txt { color: var(--red); }

/* winner/loser colored cards */
.wl-card {
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  transition: transform .13s ease;
}
.wl-card:active { transform: scale(.97); }
.wl-card.win { background: var(--green-soft); border: 1px solid rgba(47,169,104,.25); }
.wl-card.lose { background: var(--red-soft); border: 1px solid rgba(192,73,47,.25); }
.wl-card .em { font-size: 34px; }
.wl-card .info { flex: 1; }
.wl-card .info .co { font-size: 20px; font-weight: 700; }
.wl-card .info .tk { font-size: 13px; color: var(--muted); font-family: 'Inter', sans-serif; }
.wl-card .amt { font-size: 23px; font-weight: 800; text-align: left; }

/* chips / filters */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 4px 4px; }
.chip {
  height: 66px; min-width: 66px; padding: 0 24px; border-radius: 16px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transition: all .18s;
}
.chip:active { transform: scale(.94); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* earnings cards */
.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.earn-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px; box-shadow: var(--shadow); text-align: center;
}
.earn-card .yr { font-size: 17px; color: var(--muted); font-family: 'Inter', sans-serif; }
.earn-card .amt { font-size: 30px; font-weight: 800; margin-top: 8px; }

/* news */
.news-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: transform .13s ease;
}
.news-card:active { transform: scale(.985); }
.news-card .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.news-card .meta .tk2 {
  font-family: 'Almarai', sans-serif; font-weight: 700; font-size: 15px;
  background: var(--accent-soft); color: var(--accent);
  padding: 6px 14px; border-radius: 999px;
}
.news-card .meta .when { font-size: 15px; color: var(--muted); }
.news-card .head { font-size: 19px; font-weight: 700; line-height: 1.5; }

/* news — layered per-stock cards (face = takeaway + sentiment, headlines on tap) */
.news-stock {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.news-face {
  display: block; width: 100%; text-align: right; background: none; border: 0;
  padding: 18px 20px; cursor: pointer; font: inherit; color: inherit;
  transition: transform .13s ease;
}
.news-face:active { transform: scale(.99); }
.news-face-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.news-face-top .tk2 {
  font-family: 'Almarai', sans-serif; font-weight: 800; font-size: 16px;
  background: var(--accent-soft); color: var(--accent);
  padding: 6px 14px; border-radius: 999px;
}
.news-take { font-size: 18px; font-weight: 700; line-height: 1.55; }
.news-more { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--accent); }
.news-heads { padding: 4px 20px 16px; border-top: 1px solid var(--line); }
.news-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-line:last-child { border-bottom: 0; }
.news-line-body { flex: 1; }
.news-line-head { font-size: 16px; font-weight: 600; line-height: 1.5; }
.news-line-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.news-empty { padding: 14px 0; color: var(--muted); font-size: 15px; }
.chip-sent {
  flex-shrink: 0; font-family: 'Almarai', sans-serif; font-weight: 800; font-size: 13px;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.chip-sent.pos { background: rgba(46,160,67,.14); color: #1f8a3b; }
.chip-sent.neg { background: rgba(207,52,52,.14); color: #c0392b; }
.chip-sent.neu { background: rgba(0,0,0,.06); color: var(--muted); }

/* headline row as a link — keep the row look, open the article on tap */
a.news-line { text-decoration: none; color: inherit; transition: background .15s ease; border-radius: 12px; }
a.news-line:active { background: var(--panel-2); }

/* a non-collapsing news card (used on the stock detail page) */
.news-face.static { cursor: default; }
.news-face.static:active { transform: none; }

/* ============ GLOBAL STOCK SEARCH (top of wallet) ============ */
.wsearch { margin: 14px 0 4px; }
.wsearch-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 0 18px; min-height: 64px;
  box-shadow: var(--shadow);
}
.wsearch-ic { font-size: 22px; opacity: .65; }
.wsearch-input {
  flex: 1; min-width: 0; height: 60px; border: 0; background: none; outline: none;
  font-family: 'Almarai', sans-serif; font-size: 20px; font-weight: 700; color: var(--text);
}
.wsearch-input::placeholder { color: var(--muted); font-weight: 700; }
.wsearch-clear {
  width: 44px; height: 44px; min-width: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--muted); background: var(--panel-2);
}
.wsearch-clear:active { transform: scale(.9); }

.sugg-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sugg {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: right;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 0 20px; min-height: 64px; box-shadow: var(--shadow);
  transition: transform .12s ease, background .2s;
}
.sugg:active { transform: scale(.98); background: var(--panel-2); }
.sugg-badge {
  font-family: 'Inter', 'Almarai', sans-serif; font-weight: 800; font-size: 20px;
  color: var(--accent); background: var(--accent-soft);
  padding: 8px 16px; border-radius: 12px;
}
.sugg-go { font-size: 16px; font-weight: 700; color: var(--muted); }
.sugg-empty {
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 16px;
  padding: 18px; text-align: center; font-size: 16px; font-weight: 700;
}

/* ============ NEWS SEARCH + SORT ============ */
.news-controls { margin: 2px 0 14px; }
.news-search-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 0 16px; min-height: 58px; box-shadow: var(--shadow);
}
.news-search {
  flex: 1; min-width: 0; height: 54px; border: 0; background: none; outline: none;
  font-family: 'Almarai', sans-serif; font-size: 18px; font-weight: 700; color: var(--text);
}
.news-search::placeholder { color: var(--muted); font-weight: 700; }
.sort-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sortc {
  min-height: 52px; padding: 0 18px; border-radius: 14px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  font-family: 'Almarai', sans-serif; font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow); transition: all .18s;
}
.sortc:active { transform: scale(.95); }
.sortc.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* empty / loading note */
.empty-note {
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 20px 18px; margin: 2px 4px;
  font-size: 16px; font-weight: 700; text-align: center;
}

/* hero all-time / year profit line */
.hero-profit {
  margin-top: 16px; padding: 14px 18px; border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero-profit.up { background: var(--green-soft); }
.hero-profit.down { background: var(--red-soft); }
.hero-profit.muted { background: var(--panel-3); color: var(--muted); justify-content: center; font-weight: 700; }
.hero-profit .hp-label { font-size: 16px; font-weight: 700; }
.hero-profit.up .hp-label { color: var(--green); }
.hero-profit.down .hp-label { color: var(--red); }
.hero-profit .hp-val { font-size: 28px; font-weight: 800; }
.hero-profit.up .hp-val { color: var(--green); }
.hero-profit.down .hp-val { color: var(--red); }

/* profit-per-year bars (big, tappable) */
.ybar {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; min-height: 64px;
  transition: transform .13s ease, background .2s, border-color .2s;
}
.ybar:active { transform: scale(.98); }
.ybar.sel { border-color: var(--accent); background: var(--accent-soft); }
.yb-year { font-size: 20px; font-weight: 800; width: 56px; min-width: 56px; }
.yb-track {
  flex: 1; height: 18px; border-radius: 999px;
  background: var(--panel-3); overflow: hidden;
}
.yb-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.yb-fill.up { background: var(--green); }
.yb-fill.down { background: var(--red); }
.yb-amt { font-size: 18px; font-weight: 800; min-width: 92px; text-align: left; }

/* detail hero sub line */
.detail-hero .dh-sub { font-size: 16px; color: var(--muted); margin-top: 8px; }
.detail-hero .val { font-size: 44px; }

/* placeholder screen */
.placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  text-align: center; color: var(--muted); padding-bottom: 12vh;
}
.placeholder .pic { font-size: 76px; }
.placeholder .pt { font-size: 24px; font-weight: 800; color: var(--text); }
.placeholder .pd { font-size: 16px; max-width: 280px; line-height: 1.6; }

/* detail screen */
.detail-hero {
  background: linear-gradient(160deg, #FFFFFF, var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 24px;
  text-align: center; box-shadow: var(--shadow); margin-top: 4px;
}
.detail-hero .tk { font-size: 16px; color: var(--muted); }
.detail-hero .val { font-size: 46px; font-weight: 800; margin: 6px 0; }
.detail-hero .ch { font-size: 19px; font-weight: 700; display:inline-flex; padding: 7px 15px; border-radius: 999px; }
.detail-hero .ch.up { color: var(--green); background: var(--green-soft); }
.detail-hero .ch.down { color: var(--red); background: var(--red-soft); }

.spark-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-top: 16px; box-shadow: var(--shadow);
}
.spark-wrap .cap { font-size: 14px; color: var(--muted); margin-bottom: 8px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow); text-align: center;
}
.stat-card .l { font-size: 16px; color: var(--muted); }
.stat-card .n { font-size: 28px; font-weight: 800; margin-top: 8px; }

/* his position banner on a stock's detail page */
.hold-banner {
  background: linear-gradient(160deg, #FFFFFF, var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 22px; box-shadow: var(--shadow); text-align: center; margin-top: 6px;
}
.hold-banner .hb-label { font-size: 15px; color: var(--muted); }
.hold-banner .hb-val { font-size: 40px; font-weight: 800; margin: 6px 0; }
.hold-banner .hb-pl {
  display: inline-flex; font-size: 18px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.hold-banner .hb-pl.up { color: var(--green); background: var(--green-soft); }
.hold-banner .hb-pl.down { color: var(--red); background: var(--red-soft); }

.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(14px);} to {opacity:1; transform:none;} }

/* ============ LIVE MARKET PRICES ============ */
.mkt-bar { display: flex; align-items: center; justify-content: space-between; margin: 6px 4px 14px; }
.mkt-asof { font-size: 14px; font-weight: 800; color: var(--green); }
.mkt-asof.muted { color: var(--muted); font-weight: 700; }
.mkt-edit {
  min-height: 50px; padding: 0 22px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 16px; font-weight: 700; color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, background .2s;
}
.mkt-edit:active { transform: scale(.95); background: var(--panel-2); }

.mkt-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.mkt-x {
  width: 48px; height: 48px; min-width: 48px; border-radius: 14px;
  background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  transition: transform .12s ease;
}
.mkt-x:active { transform: scale(.9); }
.mkt-name { flex: 1; min-width: 0; }
.mkt-label { font-size: 21px; font-weight: 800; }
.mkt-sym { font-size: 13px; color: var(--muted); margin-top: 3px; }
.mkt-vals { text-align: left; }
.mkt-price { font-size: 25px; font-weight: 800; line-height: 1.1; }
.mkt-ch { font-size: 15px; font-weight: 700; margin-top: 5px; }
.mkt-ch.is-muted { color: var(--muted); }

.mkt-add {
  width: 100%; min-height: 64px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  border: 1px dashed var(--accent); font-size: 19px; font-weight: 800;
  margin-top: 4px; transition: transform .12s ease, opacity .2s;
}
.mkt-add:active { transform: scale(.98); }
.mkt-add:disabled { opacity: .55; }
.mkt-hint { text-align: center; font-size: 14px; color: var(--muted); margin: 12px 8px 0; }

/* ============ CURRENCY CONVERTER ============ */
.fx-top { margin: 6px 0 18px; }
.fx-amount-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 10px 14px; box-shadow: var(--shadow);
}
.fx-amount {
  flex: 1; min-width: 0; height: 60px; border: 0; background: none; outline: none;
  font-family: 'Inter', 'Almarai', sans-serif; font-size: 34px; font-weight: 800; color: var(--text);
}
.fx-base {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 56px; padding: 0 18px; border-radius: 16px;
  background: var(--accent-soft); color: var(--accent);
  font-family: 'Inter', 'Almarai', sans-serif; font-size: 22px; font-weight: 800;
  transition: transform .12s ease;
}
.fx-base:active { transform: scale(.96); }
.fx-asof { font-size: 14px; font-weight: 800; color: var(--green); margin: 12px 4px 0; }
.fx-asof.muted { color: var(--muted); font-weight: 700; }
.fx-bar { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 14px; }
.fx-bar-label { font-size: 15px; font-weight: 800; color: var(--muted); }

.fx-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.fx-rname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.fx-flag { font-size: 30px; line-height: 1; }
.fx-rcode { font-size: 20px; font-weight: 800; }
.fx-rlabel { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fx-rvals { text-align: left; }
.fx-rout { font-size: 26px; font-weight: 800; line-height: 1.1; }
.fx-rrate { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ============ SEARCH / PICKER SHEET ============ */
.sym-sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: symfade .2s ease;
}
@keyframes symfade { from { opacity: 0; } to { opacity: 1; } }
.sym-card {
  width: 100%; max-width: 560px;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 18px 18px max(22px, env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  animation: symup .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes symup { from { transform: translateY(40px); } to { transform: translateY(0); } }
.sym-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
.sym-title { font-size: 21px; font-weight: 800; }
.sym-close {
  width: 44px; height: 44px; min-width: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--muted); background: var(--panel-2);
}
.sym-close:active { transform: scale(.9); }
.sym-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: right; }
.sym-name { font-size: 18px; font-weight: 800; color: var(--text); }
.sym-sub { font-size: 13px; color: var(--muted); }
