/* iOS design tokens shared by the new home and the restyled inner pages.
   Dark is the default; the app's own boot script sets data-theme="light". */
:root {
  --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --ios-rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;

  --bg: #000000;
  --bg-elev: #1c1c1e;
  --bg-elev-2: #2c2c2e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.16);
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.32);
  --sep: rgba(84, 84, 88, 0.6);
  --tint: #3d8bff;
  --tint-soft: rgba(61, 139, 255, 0.18);
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --pink: #ff375f;
  --purple: #bf5af2;
  --indigo: #5e5ce6;
  --teal: #40c8e0;
  --yellow: #ffd60a;
  --glass: rgba(30, 30, 32, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --glass-shine: rgba(255, 255, 255, 0.07);
  --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.55);
  --r-card: 22px;
  --r-row: 14px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f2f2f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #f2f2f7;
  --fill: rgba(118, 118, 128, 0.14);
  --fill-2: rgba(118, 118, 128, 0.08);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.2);
  --tint: #0a6cff;
  --tint-soft: rgba(10, 108, 255, 0.1);
  --green: #28b84c;
  --orange: #f08c00;
  --red: #ff3b30;
  --pink: #ff2d55;
  --purple: #af52de;
  --indigo: #5856d6;
  --teal: #20a4c0;
  --yellow: #f2b600;
  --glass: rgba(249, 249, 252, 0.72);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-shine: rgba(255, 255, 255, 0.7);
  --shadow-float: 0 10px 34px rgba(30, 40, 80, 0.16);
  color-scheme: light;
}

/* ---------- Liquid Glass material ---------- */
:root {
  --lg-fill: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.05) 45%, rgba(255,255,255,.08) 100%), rgba(28,28,32,.38);
  --lg-blur: blur(16px) saturate(190%) brightness(1.08) contrast(1.05);
  --lg-rim: linear-gradient(160deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.08) 30%, rgba(255,255,255,0) 55%, rgba(255,255,255,.12) 80%, rgba(255,255,255,.4) 100%);
  --lg-shadow: inset 0 1px 1px rgba(255,255,255,.35), inset 0 -1px 1px rgba(0,0,0,.25), 0 10px 34px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.25);
  --lg-drop: radial-gradient(120% 140% at 50% 0%, rgba(255,255,255,.28), rgba(255,255,255,.06) 60%), rgba(255,255,255,.08);
}
html[data-theme="light"] {
  --lg-fill: linear-gradient(180deg, rgba(255,255,255,.75) 0%, rgba(255,255,255,.45) 50%, rgba(255,255,255,.6) 100%), rgba(255,255,255,.25);
  --lg-blur: blur(16px) saturate(200%) brightness(1.04);
  --lg-rim: linear-gradient(160deg, rgba(255,255,255,1) 0%, rgba(255,255,255,.3) 30%, rgba(0,0,0,.04) 60%, rgba(255,255,255,.9) 100%);
  --lg-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -1px 1px rgba(0,0,0,.04), 0 10px 30px rgba(40,50,90,.16), 0 1px 4px rgba(40,50,90,.1);
  --lg-drop: radial-gradient(120% 140% at 50% 0%, rgba(255,255,255,.95), rgba(255,255,255,.55) 70%), rgba(10,108,255,.06);
}
.lg, .tabbar, .ios-back, .ios-home, #top-control-strip, .sheet, .avatar-glass {
  isolation: isolate;
  background: var(--lg-fill) !important;
  -webkit-backdrop-filter: var(--lg-blur) !important; backdrop-filter: var(--lg-blur) !important;
  box-shadow: var(--lg-shadow) !important;
}
.lg, .ios-back, .ios-home { position: relative; }
/* Light-catching rim: a gradient border drawn with a mask. */
.lg::after, .tabbar::after, .ios-back::after, .ios-home::after, #top-control-strip::after, .sheet::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
