/* ═══════════════════════════════════════════════════════════════════════
   Horā होरा — Optical Glass material system
   Colorless engineered crystal suspended in a bright, weightless chamber.
   Beauty from edges, thickness, refraction, reflection and light — not tint.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* The glass is nearly colorless; the environment provides all colour. */
  --ink:        #1b2330;   /* dark neutral text — readable on bright glass */
  --ink-soft:   #4a5568;
  --ink-faint:  #7c879b;
  --edge:       rgba(255,255,255,.85);   /* bright edge-light */
  --edge-cool:  rgba(150,200,255,.35);   /* faint atmospheric blue on edges */
  --spectral-r: rgba(255,120,150,.22);   /* dispersion, edges only */
  --spectral-b: rgba(120,180,255,.22);
  --glass-fill: rgba(255,255,255,.10);
  --glass-fill-2: rgba(255,255,255,.04);
  --hair:       rgba(255,255,255,.45);
  --shadow-far: rgba(40,60,95,.28);
  --radius:     22px;
  --accent:     #3d6cc8;   /* used sparingly for state, near-neutral */
  --good:       #1f8f5f;
  --bad:        #c0455f;
  --gold:       #9a7b3f;   /* whisper of warmth for the brand only */
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  min-height: 100%;
  overflow-x: hidden;
  /* Bright glass chamber: airy daylight white, faint cool atmosphere. */
  background:
    radial-gradient(120% 80% at 50% -10%, #ffffff 0%, #f4f8fc 36%, #ebf1f8 64%, #e3eaf4 100%);
  background-attachment: fixed;
}
.svg-defs { position: absolute; }

h1, h2, h3 { font-weight: 600; letter-spacing: .2px; }
.dev { font-weight: 500; opacity: .92; }
small { color: var(--ink-faint); font-size: .78rem; display: block; margin-top: 3px; }

/* ── Environment: infinite chamber ─────────────────────────────────────*/
.env { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* soft bright halo behind the content column keeps clear glass legible */
.env-halo {
  position: absolute; left: 50%; top: 40%; width: 980px; height: 1300px;
  transform: translate(-50%,-50%);
  background: radial-gradient(50% 40% at 50% 45%, rgba(255,255,255,.95), rgba(255,255,255,0) 72%);
  filter: blur(10px);
}
.env-light {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .8;
  will-change: transform, opacity;
  animation: breathe 16s ease-in-out infinite alternate;
}
.l2 { animation-duration: 21s; animation-delay: -7s; }
.l3 { animation-duration: 13s; animation-delay: -3s; }
@keyframes breathe {
  from { opacity: .68; scale: 1; }
  to   { opacity: .92; scale: 1.07; }
}
@keyframes ray-breathe {
  from { opacity: .42; }
  to   { opacity: .68; }
}
.l1 { width: 620px; height: 620px; top: -160px; left: -120px;
      background: radial-gradient(circle, rgba(255,255,255,.95), rgba(210,230,255,.35) 60%, transparent 70%); }
.l2 { width: 520px; height: 520px; bottom: -180px; right: -120px;
      background: radial-gradient(circle, rgba(255,252,244,.9), rgba(255,240,220,.3) 55%, transparent 70%); }
.l3 { width: 400px; height: 400px; top: 30%; right: 12%;
      background: radial-gradient(circle, rgba(235,245,255,.8), transparent 68%); }
/* volumetric god rays */
.godray {
  position: absolute; top: -30%; width: 42vw; height: 160%;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  filter: blur(24px); mix-blend-mode: screen; opacity: .5; will-change: transform;
}
.gr1 { left: 10%; transform: rotate(14deg); opacity: .62; animation: ray-breathe 19s ease-in-out infinite alternate; }
.gr2 { right: 8%; transform: rotate(-11deg); opacity: .46; animation: ray-breathe 26s ease-in-out infinite alternate-reverse; }

/* ── Dawn light behind the glass ───────────────────────────────────────
   Warm horizon bloom + rose counter-glow + a slow passing gleam. All layers
   sit beneath the fog and behind every glass surface, so the crystal's
   backdrop saturation lifts the colour into a vibrant, soothing glow.
   Long periods, big blurs, eased alternates — never a strobe. */
.dawn-horizon {
  position: absolute; left: -12%; right: -12%; bottom: -22%; height: 62%;
  background:
    radial-gradient(58% 68% at 30% 100%, rgba(255,176,120,.50), transparent 68%),
    radial-gradient(52% 60% at 72% 100%, rgba(255,208,140,.42), transparent 70%),
    radial-gradient(85% 55% at 50% 108%, rgba(255,148,128,.30), transparent 75%);
  filter: blur(46px); mix-blend-mode: screen; opacity: .55;
  transform-origin: 50% 100%;
  animation: dawn-breathe 26s ease-in-out infinite alternate;
  will-change: opacity, scale;
}
.dawn-rose {
  position: absolute; top: -8%; right: -10%; width: 58%; height: 64%;
  background:
    radial-gradient(60% 60% at 70% 30%, rgba(255,170,196,.34), transparent 70%),
    radial-gradient(50% 55% at 40% 55%, rgba(186,168,255,.22), transparent 72%);
  filter: blur(52px); mix-blend-mode: screen; opacity: .4;
  animation: dawn-breathe 34s ease-in-out infinite alternate-reverse;
  will-change: opacity, scale;
}
/* The gentle "flash": a broad gleam that crosses the chamber every ~45s,
   swelling mid-travel and fading at the edges — sunrise cresting a ridge. */
.dawn-sweep {
  position: absolute; top: -20%; left: -35%; width: 44%; height: 140%;
  background: linear-gradient(100deg,
    transparent 8%,
    rgba(255,196,150,.20) 32%,
    rgba(255,226,180,.42) 50%,
    rgba(255,186,168,.20) 68%,
    transparent 92%);
  filter: blur(42px); mix-blend-mode: screen; opacity: 0;
  animation: dawn-sweep 45s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes dawn-breathe {
  from { opacity: .34; scale: 1; }
  to   { opacity: .62; scale: 1.07; }
}
@keyframes dawn-sweep {
  0%   { transform: translateX(0)      skewX(-6deg); opacity: 0; }
  12%  { opacity: .28; }
  38%  { opacity: .55; }
  50%  { transform: translateX(180vw)  skewX(-6deg); opacity: .38; }
  62%  { opacity: 0; }
  100% { transform: translateX(180vw)  skewX(-6deg); opacity: 0; }
}
/* large transparent floating glass planes — only visible via edges/reflection */
.glass-plane {
  position: absolute; border-radius: 28px; will-change: transform;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.02) 55%, rgba(190,215,255,.06));
  border: 1px solid rgba(255,255,255,.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -30px 60px -50px rgba(120,160,220,.5),
    0 40px 80px -50px rgba(40,60,95,.3);
  backdrop-filter: blur(2px);
}
.gp1 { width: 460px; height: 300px; top: 12%; left: -8%; transform: rotate(-16deg); }
.gp2 { width: 380px; height: 520px; top: 24%; right: -7%; transform: rotate(12deg); }
.gp3 { width: 300px; height: 300px; bottom: 6%; left: 16%; transform: rotate(24deg); opacity: .8; }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; }
.fog {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 20% 80%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(50% 40% at 85% 25%, rgba(245,250,255,.45), transparent 60%);
  filter: blur(8px);
}

.stage { position: relative; z-index: 1; }

/* ── The glass material ────────────────────────────────────────────────*/
/* Layered technique: backdrop refraction + bright rim + inner reflections
   + visible thickness (bottom bevel) + pointer-driven specular. */
.glass {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--glass-fill), var(--glass-fill-2) 60%, rgba(200,222,255,.05));
  backdrop-filter: blur(9px) saturate(1.25) brightness(1.06);
  -webkit-backdrop-filter: blur(9px) saturate(1.25) brightness(1.06);
  border: 1px solid var(--hair);
  box-shadow:
    /* float shadow, layered for soft falloff */
    0 34px 60px -30px var(--shadow-far),
    0 12px 24px -16px rgba(40,60,95,.16),
    /* top rim edge-light (Fresnel) */
    inset 0 1px 0 0 rgba(255,255,255,.9),
    inset 0 0 0 1px rgba(255,255,255,.14),
    /* internal reflection, cool from below */
    inset 0 -22px 40px -34px rgba(120,160,220,.45),
    /* transmitted light glow inside top */
    inset 0 20px 44px -40px rgba(255,255,255,.9);
  transform-style: preserve-3d;
  transition: box-shadow .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1);
}
/* visible thickness — the machined bottom/side of the slab */
.glass::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: -7px; height: 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(150,185,235,.10));
  filter: blur(3px); opacity: .7; z-index: -1;
  transition: opacity .5s, transform .5s;
}
/* pointer-driven specular + scroll-driven traveling sweep */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(240px circle at var(--mx,30%) var(--my,20%), rgba(255,255,255,.55), transparent 55%),
    linear-gradient(115deg,
      transparent calc(var(--sweep, 50%) - 16%),
      rgba(255,255,255,.10) calc(var(--sweep, 50%) - 7%),
      rgba(255,255,255,.34) var(--sweep, 50%),
      rgba(255,255,255,.10) calc(var(--sweep, 50%) + 7%),
      transparent calc(var(--sweep, 50%) + 16%));
  opacity: .55; mix-blend-mode: screen;
  transition: opacity .4s;
}

/* Real refraction — SVG turbulence displacement bends the backdrop.
   Hero surfaces only (it is optically strongest and costs the most). */
@supports (backdrop-filter: url('#glassRefract')) {
  .glass.refract {
    backdrop-filter: url('#glassRefract') blur(7px) saturate(1.25) brightness(1.06);
    -webkit-backdrop-filter: url('#glassRefract') blur(7px) saturate(1.25) brightness(1.06);
  }
}
/* chromatic dispersion — spectral fringe on the edges only */
.glass {
  --disp: 0.6px;
}
.glass > * { position: relative; z-index: 1; }

/* refraction: distort what's behind the big surfaces */
.form-card, .res-head, .charts-card {
  /* layered so backdrop refraction stays subtle & legible */
}

/* ── Header ────────────────────────────────────────────────────────────*/
.topbar {
  margin: 20px auto 0; max-width: 1080px; width: calc(100% - 32px);
  padding: 16px 22px; border-radius: 20px;
  position: sticky; top: 12px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 15px; }
.brand-glyph {
  font-size: 34px; line-height: 1; color: transparent;
  background: linear-gradient(160deg, #fff, #cfe0f5 40%, var(--gold) 130%);
  -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 1px 1px rgba(255,255,255,.6);
  filter: drop-shadow(0 2px 6px rgba(150,180,230,.5));
}
.brand h1 { margin: 0; font-size: 1.5rem; color: var(--ink); }
.brand h1 .dev { color: var(--ink-soft); }
.tagline { margin: 2px 0 0; color: var(--ink-soft); font-size: .82rem; }

main { max-width: 1080px; margin: 0 auto; padding: 22px 16px 70px; }

/* ── Cards & panels ────────────────────────────────────────────────────*/
.card { padding: 24px; margin-bottom: 22px; }
.card h2 { margin: 0 0 18px; font-size: 1.16rem; color: var(--ink); }

/* ── Form ──────────────────────────────────────────────────────────────*/
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: flex; flex-direction: column; font-size: .82rem; color: var(--ink-soft); gap: 6px; }
.field.span2 { grid-column: 1 / -1; }
.field.checkbox { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; }
.field input[type=text], .field input[type=date], .field input[type=time], .field input[type=number] {
  color: var(--ink); font-size: .95rem; width: 100%; padding: 11px 13px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.22));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -6px 14px -10px rgba(120,160,220,.4),
              0 2px 6px -3px rgba(40,60,95,.18);
  backdrop-filter: blur(4px);
  transition: box-shadow .3s, border-color .3s;
}
.field input::placeholder { color: #97a2b5; }
.field input:focus {
  outline: none; border-color: rgba(255,255,255,.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 0 0 3px rgba(120,170,255,.28),
              0 4px 12px -4px rgba(40,60,95,.3);
}
.opt { color: var(--ink-faint); font-weight: 400; }
.resolved { color: var(--good); }
.resolved a { color: var(--accent); cursor: pointer; text-decoration: underline; }

.actions { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }

/* ── Glass buttons — miniature machined crystal objects ───────────────*/
.glass-btn {
  position: relative; font: inherit; cursor: pointer; border: none;
  padding: 12px 24px; border-radius: 15px; color: var(--ink);
  background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.22) 60%, rgba(200,222,255,.18));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -8px 16px -12px rgba(120,160,220,.5),
    inset 0 8px 18px -14px rgba(255,255,255,.9),
    0 10px 22px -10px rgba(40,60,95,.32),
    0 2px 5px -2px rgba(40,60,95,.2);
  backdrop-filter: blur(6px) saturate(1.2);
  transform: translateZ(0);
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s cubic-bezier(.22,1,.36,1);
  overflow: hidden; will-change: transform;
}
.glass-btn::before { /* traveling specular highlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120px circle at var(--bx,50%) var(--by,-10%), rgba(255,255,255,.85), transparent 55%);
  opacity: .8;
}
.glass-btn::after { /* spectral edge sparkle */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 1px 0 0 var(--spectral-r), inset -1px 0 0 var(--spectral-b);
  opacity: .0; transition: opacity .3s;
}
.glass-btn:hover::after { opacity: .9; }
.glass-btn:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -10px 20px -12px rgba(120,160,220,.6),
    0 18px 34px -12px rgba(40,60,95,.4),
    0 4px 10px -3px rgba(40,60,95,.24);
}
.glass-btn:active { transform: scale(.965); transition-duration: .08s; }
.glass-btn.primary {
  color: #16233a; font-weight: 650;
  background: linear-gradient(160deg, rgba(255,255,255,.7), rgba(215,232,255,.4) 55%, rgba(180,210,255,.3));
}
.glass-btn.ghost { color: var(--ink-soft); }

/* ── Error ─────────────────────────────────────────────────────────────*/
.error { padding: 14px 18px; margin-bottom: 18px; color: var(--bad); font-weight: 500; }

/* ── Results ───────────────────────────────────────────────────────────*/
.res-head { padding: 22px 24px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.res-head h2 { font-size: 1.5rem; margin: 0; color: var(--ink); }
.res-head .sub { color: var(--ink-soft); font-size: .86rem; }

.badge {
  display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--ink-soft);
  padding: 5px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.2));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 8px -4px rgba(40,60,95,.25);
  backdrop-filter: blur(4px);
}

.charts-card { padding: 22px; margin-bottom: 22px; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.chart-box h3 { text-align: center; margin: 0 0 12px; color: var(--ink-soft); font-size: .92rem; letter-spacing: .5px; }
.chart-svg { width: 100%; height: auto; display: block;
  filter: drop-shadow(0 12px 24px rgba(40,60,95,.22)); }

/* ── Tabs — floating glass chips ───────────────────────────────────────*/
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }
.tab {
  font-size: .84rem; color: var(--ink-soft); cursor: pointer; padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.16));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 10px -6px rgba(40,60,95,.28);
  backdrop-filter: blur(5px);
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, color .3s;
}
.tab:hover { transform: translateY(-2px); }
.tab.active {
  color: var(--ink); font-weight: 600;
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(220,235,255,.45));
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), inset 0 -8px 16px -12px rgba(120,160,220,.55),
              0 10px 20px -8px rgba(40,60,95,.34);
}
.panel { display: none; }
.panel.active { display: block; }

/* ── Tables ────────────────────────────────────────────────────────────*/
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid rgba(120,150,200,.18); }
th { color: var(--ink-soft); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; }
td small { display: inline; }
.dig-exalted, .dig-mulatrikona { color: var(--good); font-weight: 600; }
.dig-own, .dig-friend { color: #2b6ca8; }
.dig-debilitated, .dig-enemy { color: var(--bad); }
.pill {
  display: inline-block; font-size: .72rem; color: var(--ink-soft); padding: 1px 9px; border-radius: 999px;
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.7);
}
.retro { color: #b06a2c; font-weight: 700; }

/* ── Reading ───────────────────────────────────────────────────────────*/
.read-section { margin-bottom: 22px; }
.read-section h3 {
  color: var(--ink); font-size: 1.02rem; margin: 0 0 12px; padding-left: 12px;
  border-left: 3px solid rgba(120,170,255,.6);
}
.read-item {
  padding: 14px 16px; margin-bottom: 11px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.34), rgba(255,255,255,.12));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -14px 26px -30px rgba(120,160,220,.4),
              0 8px 18px -12px rgba(40,60,95,.22);
  backdrop-filter: blur(5px);
  transition: transform .4s cubic-bezier(.22,1,.36,1), box-shadow .4s;
}
.read-item:hover { transform: translateY(-2px) translateZ(0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 14px 28px -14px rgba(40,60,95,.32); }
.read-item .txt { font-size: .93rem; color: var(--ink); }
.read-item .src { color: var(--ink-faint); font-size: .75rem; margin-top: 7px; font-style: italic; }
.read-item.pos { border-left: 3px solid rgba(31,143,95,.7); }
.read-item.neg { border-left: 3px solid rgba(192,69,95,.7); }
.yoga-name { color: #2b6ca8; font-weight: 650; }
.disclaimer { color: var(--ink-faint); font-size: .8rem; font-style: italic; margin-top: 16px;
  border-top: 1px solid rgba(120,150,200,.2); padding-top: 12px; }

/* ── Daśā ──────────────────────────────────────────────────────────────*/
.dasha-now {
  padding: 14px 16px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.5), rgba(220,235,255,.2));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 10px 22px -12px rgba(40,60,95,.3);
  backdrop-filter: blur(5px);
}
.dasha-now b { color: #2b6ca8; }
.dasha-tree { font-size: .86rem; }
.dasha-tree details { border-bottom: 1px solid rgba(120,150,200,.18); }
.dasha-tree summary { padding: 8px 4px; cursor: pointer; color: var(--ink-soft); }
.dasha-tree summary.run { color: #2b6ca8; font-weight: 600; }
.dasha-tree .lvl2 { margin-left: 16px; }

/* ── Ashtakavarga ──────────────────────────────────────────────────────*/
.sav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sav-cell {
  padding: 10px; text-align: center; border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,.4), rgba(255,255,255,.14));
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -10px 18px -20px rgba(120,160,220,.5),
              0 6px 14px -8px rgba(40,60,95,.24);
  backdrop-filter: blur(4px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.sav-cell:hover { transform: translateY(-3px); }
.sav-cell .sign { font-size: .72rem; color: var(--ink-faint); }
.sav-cell .val { font-size: 1.3rem; font-weight: 700; color: var(--ink); }

/* ── Autocomplete ──────────────────────────────────────────────────────*/
.autocomplete { position: relative; }
.ac-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40; margin-top: 6px;
  max-height: 260px; overflow-y: auto; border-radius: 14px; padding: 4px;
}
.ac-item { padding: 9px 12px; cursor: pointer; font-size: .88rem; color: var(--ink); border-radius: 9px;
  transition: background .2s; }
.ac-item:hover, .ac-item.sel { background: rgba(255,255,255,.5); }
.ac-item .meta { color: var(--ink-faint); font-size: .74rem; }
.ac-empty { padding: 10px 12px; color: var(--ink-faint); font-size: .82rem; }

/* ── Intelligence panels (same material language) ─────────────────────*/
/* Both are pure geometry. Declaring the display explicitly matters: on an
   inline box width and height are ignored, so a <span> meter renders as an
   empty track and silently reports nothing. */
.meter {
  display: block;
  height: 8px; border-radius: 999px; margin: 8px 0 6px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.15));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 2px rgba(40,60,95,.18);
}
.meter-fill {
  display: block;
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(150,190,240,.7), rgba(90,140,210,.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
  transition: width .6s cubic-bezier(.22,1,.36,1);
}
.meter-fill.neg { background: linear-gradient(90deg, rgba(220,140,160,.7), rgba(192,69,95,.8)); }
.field select, select.glass-sel {
  color: var(--ink); font: inherit; font-size: .93rem; padding: 10px 13px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.22));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 6px -3px rgba(40,60,95,.18);
  backdrop-filter: blur(4px);
}
.dom-chip { font-size: .78rem; padding: 6px 12px; }
.contra { color: #b06a2c; font-weight: 600; }
/* Simple mode hides expert-level tabs and detail blocks */
.mode-simple .expert-tab, .mode-simple .expert-only { display: none !important; }
.mode-chip.active { color: var(--ink); font-weight: 650; }

.foot { max-width: 1080px; margin: 0 auto; padding: 0 16px 44px; }
.foot p { color: var(--ink-faint); font-size: .78rem; }

/* ── Responsive ────────────────────────────────────────────────────────*/
@media (max-width: 720px) {
  .grid, .charts-row { grid-template-columns: 1fr; }
  .sav-grid { grid-template-columns: repeat(4, 1fr); }
  .glass-plane { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Chart page: compact birth-details form ────────────────────────────
   Scoped to .form-card / #birthForm so the shared .grid/.field system used
   by generated panels (Milan, Muhūrta…) is untouched. Field widths signal
   the expected input: a date does not need the whole card. */
.form-card { max-width: 720px; margin-left: auto; margin-right: auto; }
.form-card h2 { margin: 0 0 4px; }
.form-card .form-intro { margin: 0 0 20px; }

#birthForm .frow { display: flex; flex-wrap: wrap; gap: 16px 18px; align-items: flex-start; }
#birthForm .frow + .frow { margin-top: 16px; }
#birthForm .field { gap: 5px; }
#birthForm .lbl { font-size: .78rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .01em; }
#birthForm .field small { font-size: .74rem; line-height: 1.45; color: var(--ink-faint); }
/* resolved line: space is reserved so the answer appearing shifts nothing */
#birthForm .field small.resolved { color: var(--good); display: block; min-height: 1.1rem; }

/* width ↔ expected input — sized to the browser's own field chrome
   (a date needs room for dd-mm-yyyy plus the picker icon) */
#birthForm .f-name { flex: 0 1 24ch; }
#birthForm .f-name input { width: 100%; }
#birthForm .f-place { flex: 1 1 260px; min-width: 0; }
#birthForm .f-date input { width: 16ch; }
#birthForm .f-time input { width: 16ch; }
#birthForm .f-date, #birthForm .f-time { max-width: 21ch; } /* helper wraps under its field */
#birthForm .f-num input { width: 12ch; }
#birthForm .f-tz { max-width: 30ch; }

/* checkbox rows: real 44px touch targets, label fully clickable */
#birthForm .field.checkbox {
  min-height: 44px; padding: 4px 2px; cursor: pointer;
  font-size: .85rem; color: var(--ink);
}
#birthForm .field.checkbox input {
  width: 20px; height: 20px; margin: 0; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
#birthForm .field.checkbox input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
/* sit the checkbox on the input line, not the row's baseline */
#birthForm .f-tuk { margin-top: 20px; align-self: flex-start; }

/* the one long input keeps generous suggestion targets */
.form-card .ac-item { padding: 12px; }

#birthForm .field-note { margin-top: 14px; }

/* ── The card's final line: quiet disclosure left, one confident action
   right. Closed, it is a single 48px row — no dead band above the button. */
.form-card .form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 18px; margin-top: 20px; padding-top: 8px;
  border-top: 1px solid rgba(120,150,200,.25);
}
.form-card .form-foot .advanced {
  margin-top: 0; border-top: none; padding-top: 0;
  flex: 1 1 auto; min-width: 0;
}
.form-card .advanced > summary { min-height: 44px; padding: 6px 8px 6px 0; }
.form-card .advanced > summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px;
}
/* opened, the fields take the full width and the action drops below them */
.form-card .form-foot:has(.advanced[open]) { flex-wrap: wrap; }
.form-card .form-foot:has(.advanced[open]) .advanced { flex-basis: 100%; }
.form-card .advanced .adv-row { margin: 6px 0 10px; }

/* one clear primary action: right on desktop, full-width on phones */
.form-card .form-foot .actions { margin: 0 0 0 auto; }
.form-card .actions .glass-btn.primary { min-height: 48px; padding: 12px 32px; font-size: 1rem; }

/* validate on blur — pure CSS enhancement over native constraints;
   the message sits with its field, never colour alone (text says why) */
#birthForm .field .err { display: none; color: var(--bad); font-weight: 600; }
#birthForm .field:has(input:user-invalid) .err { display: block; }
#birthForm input:user-invalid {
  border-color: rgba(192,69,95,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 3px rgba(192,69,95,.14);
}

@media (max-width: 560px) {
  #birthForm .frow { gap: 14px 12px; }
  #birthForm .f-name, #birthForm .f-place, #birthForm .f-tuk { flex: 1 1 100%; max-width: none; }
  #birthForm .f-tuk { margin-top: 0; }
  /* date + time share one row — both fit comfortably at 390 */
  #birthForm .f-date, #birthForm .f-time { flex: 1 1 calc(50% - 6px); min-width: 0; max-width: none; }
  #birthForm .f-date input, #birthForm .f-time input, #birthForm .f-num input { width: 100%; }
  #birthForm .f-num { flex: 1 1 calc(50% - 6px); min-width: 0; }
  #birthForm .f-tz, #birthForm .f-vargas { flex: 1 1 100%; max-width: none; }
  .form-card .form-foot { flex-wrap: wrap; }
  .form-card .form-foot .advanced { flex: 1 1 100%; }
  .form-card .form-foot .actions { width: 100%; margin: 0; }
  .form-card .actions .glass-btn.primary { width: 100%; }
}

/* ── Print / Save-PDF: clean paper document, every section expanded ────*/
@media print {
  body { background: #fff !important; color: #111; }
  .env, .form-card, .tabs, .no-print, .foot, #error { display: none !important; }
  .topbar { position: static; }
  .glass, .topbar, .card, .res-head, .charts-card {
    background: #fff !important; backdrop-filter: none !important;
    box-shadow: none !important; border: 1px solid #ccc !important;
    transform: none !important;
  }
  .glass::before, .glass::after { display: none !important; }
  .panel { display: block !important; margin-bottom: 18px; }
  .panel::before {
    content: attr(data-ptitle);
    display: block; font-size: 1.05rem; font-weight: 700; color: #111;
    border-bottom: 2px solid #999; padding-bottom: 4px; margin-bottom: 12px;
  }
  .panel, .read-item, .sav-cell, table { break-inside: avoid-page; }
  .read-item { border: 1px solid #ddd !important; background: #fff !important; }
  .chart-svg { filter: none !important; }
  a { color: #111; text-decoration: none; }
}

/* ── Post-review fixes (design pass, 2026-07-29) ───────────────────────*/
/* Helper text under the compact form fields was --ink-faint at .74rem —
   below the 4.5:1 AA floor on the bright glass. One step darker holds AA
   while staying visibly quieter than the label. */
.form-card small, .form-card .hint { color: var(--ink-soft); }
/* The mobile menu burger measured 40x40 — under the 44px touch minimum. */
.nav-burger { padding: 11px; }
