/* phone-replica.css — the Addtivity Finance iPhone app, redrawn for the browser.
 *
 * Companion to app-replica.css, which does the same job for the Windows program.
 * Every token here is copied from the real Expo app, not invented:
 *   AddtivityFinanceMobile/src/theme/index.ts   (palette, spacing, radius, font scale)
 *   src/app/(tabs)/_layout.tsx                  (tab bar: 86pt, pill behind the icon only)
 *   src/components/chrome.tsx                   (BrandBar, NavIcon)
 *   src/components/ui-kit.tsx                   (Card, SegControl, Progress, StatCard)
 * The palette is the same "Addtivity Light" set the desktop uses — all 18 keys
 * match 1:1, which is why the two replicas look like one product.
 *
 * If the app's theme changes, change it here too. The demo's one promise is that
 * it looks like the thing you download.
 *
 * Two traps worth knowing:
 *  - Money out is TEAL, not red. Red (#C4453B) means over budget or negative net
 *    worth only. The app's own comment: "spending is not an error."
 *  - The active tab pill wraps the ICON only, never the label.
 */

.ph{
  --ph-bg:#F9F6ED; --ph-card:#FFFFFF; --ph-card-border:#E6DDC9;
  --ph-field-bg:#FDFCF6; --ph-field-border:#DBD0B4;
  --ph-hover:#F1EADA; --ph-selected:#E6DDC9;
  --ph-chrome:#023D3E; --ph-nav-header:#7FA9AA;
  --ph-accent:#023D3E; --ph-accent2:#D2D758;
  --ph-text:#023D3E; --ph-text-dim:#5E7A7B; --ph-danger:#C4453B;
  --ph-on-accent:#F9F6ED;
  --ph-sb-text:#F9F6ED; --ph-sb-text-dim:#9EBFC0; --ph-sb-selected:#0A5455;
  --ph-chart:#7B72EE; --ph-green:#16A34A; --ph-badge:#F87171;

  /* the phone body: a 375x812 screen inside a dark bezel */
  width:375px; flex-shrink:0;
  border-radius:44px;
  padding:11px;
  background:#12201F;
  box-shadow:0 26px 54px rgba(0,0,0,0.42), inset 0 0 0 1.5px #2C4241;
  font-family:-apple-system,"SF Pro Text","Segoe UI",system-ui,Helvetica,Arial,sans-serif;
  color:var(--ph-text);
  text-align:left;
}

.ph-screen{
  position:relative;
  height:734px;
  border-radius:34px;
  overflow:hidden;
  background:var(--ph-bg);
  display:flex;
  flex-direction:column;
}

/* ---- BrandBar: teal, runs under the status bar (padding, never margin) ---- */
.ph-brandbar{
  flex-shrink:0;
  background:var(--ph-chrome);
  padding:8px 16px 12px;
}
.ph-brand-row{ display:flex; align-items:center; }
.ph-statusbar{
  display:flex; align-items:center; justify-content:space-between;
  height:26px; padding:0 6px 2px;
  color:var(--ph-sb-text); font-size:12px; font-weight:600;
  letter-spacing:0.2px;
}
.ph-statusbar .ph-status-icons{ display:flex; align-items:center; gap:5px; }
.ph-brand-mark{ width:30px; height:30px; flex-shrink:0; }
.ph-brand-text{ margin-left:12px; }
.ph-brand-name{
  font-family:'Melodrama',Georgia,serif; font-weight:500;
  font-size:17px; line-height:19px; color:var(--ph-sb-text);
}
.ph-brand-sub{
  font-size:11px; font-weight:700; letter-spacing:1.1px;
  color:var(--ph-accent2); margin-top:1px; text-transform:uppercase;
}

/* ---- scrolling body ---- */
.ph-body{
  flex:1; min-height:0; overflow-y:auto;
  padding:16px 16px 28px;
  scrollbar-width:none;
}
.ph-body::-webkit-scrollbar{ display:none; }

.ph-h1{
  font-family:'Melodrama',Georgia,serif; font-weight:500;
  font-size:26px; line-height:1.15; margin:0; color:var(--ph-text);
}
.ph-sub{ font-size:12px; color:var(--ph-text-dim); margin:2px 0 12px; line-height:1.4; }
.ph-h2{ font-size:16px; font-weight:600; margin:0 0 4px; }
.ph-dim{ font-size:12px; color:var(--ph-text-dim); line-height:17px; margin:0; }
.ph-cap{ font-size:11px; color:var(--ph-text-dim); line-height:14px; margin:0; }

/* ---- Card: white, 1px cream border, r12 — and NO shadow ---- */
.ph-card{
  background:var(--ph-card);
  border:1px solid var(--ph-card-border);
  border-radius:12px;
  padding:16px;
  margin-bottom:12px;
}

/* ---- QuickTiles: the only shadowed thing on the screen ---- */
.ph-tiles{
  display:flex; gap:12px;
  margin:0 -16px 12px; padding:0 16px;
  overflow-x:auto; scrollbar-width:none;
}
.ph-tiles::-webkit-scrollbar{ display:none; }
.ph-tile{
  width:152px; flex-shrink:0;
  background:var(--ph-card);
  border:1px solid var(--ph-card-border);
  border-radius:14px; padding:12px;
  box-shadow:0 2px 8px rgba(2,61,62,0.05);
}
.ph-tile-chip{
  width:30px; height:30px; border-radius:10px;
  background:var(--ph-selected);
  display:flex; align-items:center; justify-content:center;
  margin-bottom:8px; color:var(--ph-accent);
}
.ph-tile-t{ font-size:13px; font-weight:600; color:var(--ph-text); }
.ph-tile-s{ font-size:11px; color:var(--ph-text-dim); line-height:14px; margin-top:2px; }

/* ---- stat cards: 2 x 2 ---- */
.ph-stats{ display:flex; gap:12px; }
.ph-stats .ph-card{ flex:1; min-width:0; }
.ph-stat-chip{
  width:32px; height:32px; border-radius:11px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:8px;
}
.ph-stat-label{
  font-size:10px; font-weight:700; letter-spacing:0.5px;
  color:var(--ph-text-dim); text-transform:uppercase;
}
.ph-stat-value{
  font-size:22px; font-weight:700; margin:2px 0;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.ph-stat-cap{ font-size:11px; color:var(--ph-text-dim); line-height:14px; }

/* ---- SegControl: pill, teal when selected ---- */
.ph-seg{
  display:inline-flex; align-items:center;
  background:var(--ph-card); border:1px solid var(--ph-card-border);
  border-radius:999px; padding:3px;
  margin:8px 0 12px;
}
.ph-seg span{
  font-size:12px; font-weight:600; color:var(--ph-text-dim);
  padding:6px 14px; border-radius:999px; white-space:nowrap;
}
.ph-seg span.on{ background:var(--ph-accent); color:var(--ph-on-accent); }

/* ---- Progress: 8pt, both track and fill fully rounded ---- */
.ph-prog{
  height:8px; border-radius:999px;
  background:var(--ph-selected);
  overflow:hidden; margin-top:6px;
}
.ph-prog > i{
  display:block; height:100%; border-radius:999px;
  background:var(--ph-accent);
}
.ph-prog > i.over{ background:var(--ph-danger); }

/* budget line: header row with a 10px category swatch and a Remove ghost button */
.ph-budget-head{ display:flex; align-items:center; gap:8px; }
.ph-swatch{ width:10px; height:10px; border-radius:3px; flex-shrink:0; }
.ph-budget-head .ph-h2{ flex:1; margin:0; }
.ph-ghost{
  border:1px solid var(--ph-field-border); border-radius:999px;
  padding:9px 16px; font-size:12px; font-weight:600;
  color:var(--ph-text); background:transparent; white-space:nowrap;
}
.ph-nums{ font-size:12px; color:var(--ph-text-dim); margin:2px 0 0;
  font-variant-numeric:tabular-nums; }
.ph-nums.over{ color:var(--ph-danger); }

/* ---- budget banks: horizontal cards that fill from the bottom ---- */
.ph-banks{
  display:flex; gap:8px; overflow-x:auto;
  padding:8px 16px 8px 0; margin:0 -16px 0 0;
  scrollbar-width:none;
}
.ph-banks::-webkit-scrollbar{ display:none; }
.ph-bank{
  position:relative; overflow:hidden;
  width:128px; min-height:132px; flex-shrink:0;
  background:var(--ph-card); border:1px solid var(--ph-card-border);
  border-radius:14px; padding:12px;
}
.ph-bank-fill{
  position:absolute; left:0; right:0; bottom:0;
  background:#CDD8D8;
}
.ph-bank-fill.over{ background:#F6E3E1; }
.ph-bank > *:not(.ph-bank-fill){ position:relative; }
.ph-bank-chip{
  width:34px; height:34px; border-radius:11px;
  background:var(--ph-selected);
  display:flex; align-items:center; justify-content:center;
  color:var(--ph-accent); margin-bottom:6px;
}
.ph-bank-name{ font-size:11px; font-weight:700; line-height:14px; }
.ph-bank-amt{ font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; margin-top:3px; }
.ph-bank-due{ font-size:11px; color:var(--ph-text-dim); margin-top:3px; }
.ph-bank-due.over{ color:var(--ph-danger); font-weight:700; }

/* ---- list rows ---- */
.ph-row{
  display:flex; align-items:center; gap:12px;
  padding:11px 0;
  border-bottom:0.5px solid var(--ph-card-border);
}
.ph-row:last-child{ border-bottom:none; }
.ph-row-ic{
  width:30px; height:30px; border-radius:10px; flex-shrink:0;
  background:var(--ph-selected);
  display:flex; align-items:center; justify-content:center;
  color:var(--ph-accent);
}
.ph-row-ic.plate{ background:var(--ph-card); border:1px solid var(--ph-card-border);
  font-size:12px; font-weight:700; }
.ph-row-mid{ flex:1; min-width:0; }
.ph-row-t{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ph-row-s{ font-size:11px; color:var(--ph-text-dim); margin-top:1px; }
.ph-row-v{ font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ph-row-v.in{ color:var(--ph-green); }
.ph-row-ch{ font-size:14px; color:var(--ph-text-dim); margin-left:2px; }

/* ---- charts ---- */
.ph-chart svg{ display:block; width:100%; height:auto; }
.ph-legend{ display:flex; flex-wrap:wrap; margin-top:6px; }
.ph-legend span{ display:inline-flex; align-items:center; margin:4px 12px 0 0; font-size:11px; color:var(--ph-text-dim); }
.ph-legend i{ width:9px; height:9px; border-radius:2px; margin-right:5px; flex-shrink:0; }
.ph-legend b{ font-size:11px; font-weight:600; color:var(--ph-text); margin-left:4px; }

/* ---- tab bar: 86pt, teal, pill behind the icon only ---- */
.ph-tabbar{
  flex-shrink:0; height:86px;
  background:var(--ph-chrome);
  border-top:1px solid var(--ph-sb-selected);
  display:flex; align-items:flex-start;
  padding:8px 0 0;
}
.ph-tab{
  flex:1; display:flex; flex-direction:column; align-items:center;
  padding-top:2px; color:var(--ph-sb-text-dim); position:relative;
}
.ph-tab-ic{
  min-width:46px; padding:5px 12px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
}
.ph-tab.on{ color:var(--ph-sb-text); }
.ph-tab.on .ph-tab-ic{ background:var(--ph-sb-selected); }
.ph-tab-label{
  font-size:10px; font-weight:700; letter-spacing:0.2px; margin-top:3px;
}
.ph-tab-badge{
  position:absolute; top:-1px; right:calc(50% - 22px);
  background:var(--ph-badge); color:#0B1220;
  font-size:9.5px; font-weight:700;
  border-radius:999px; padding:1px 4px; min-width:17px; text-align:center;
}
.ph-home-ind{
  position:absolute; left:50%; transform:translateX(-50%);
  bottom:7px; width:134px; height:5px; border-radius:999px;
  background:var(--ph-sb-text); opacity:0.5;
}
