/* SJG Workplace: design prototype (Phase 1). Brand tokens from brands/siddha-jyotish-guru/brand.json */
:root {
  --mayur: #0D5C58;
  --mayur-deep: #0A4744;
  --mayur-wash: #E4EFEC;
  --sindoor: #C93A2B;
  --haldi: #F2B632;
  --haldi-wash: #FDF1D2;
  --ink: #123230;
  --ink-2: #4E6461;
  --ink-3: #7D8F8C;
  --line: #E8DFCD;
  --paper: #FFFDF8;
  --chandan: #FBF3E4;
  --white: #FFFFFF;
  --num: "Martel", Georgia, serif;
  --text: "Mukta", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--mayur); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--num); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.rail { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--white); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; font-size: 12px; font-weight: 500; color: var(--ink-3); text-decoration: none;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--mayur); }
.main { padding: 0 16px 96px; min-width: 0; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0 14px;
}
.top h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: 14px 0 0; padding: 4px 0;
  background: none; border: 0; color: var(--ink-2); font-size: 15px;
}

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 228px 1fr; }
  .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 0; height: 100vh; padding: 22px 14px;
    background: var(--chandan); border-right: 1px solid var(--line);
  }
  .rail .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 700; font-size: 17px; line-height: 1.15; }
  .rail .brand img { width: 34px; height: 34px; }
  .rail .brand small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
  .rail a {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
    color: var(--ink-2); text-decoration: none; font-weight: 500;
  }
  .rail a svg { width: 20px; height: 20px; }
  .rail a:hover { background: rgba(13, 92, 88, 0.06); }
  .rail a.on { background: var(--white); color: var(--mayur); box-shadow: inset 3px 0 0 var(--mayur); }
  .rail .me { margin-top: auto; padding: 10px; font-size: 14px; color: var(--ink-2); }
  .main { padding: 0 40px 60px; }
  .top { padding: 30px 0 20px; }
  .top h1 { font-size: 30px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #D6CAB2; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--mayur); border-color: var(--mayur); color: var(--white); }
.btn.primary:hover { background: var(--mayur-deep); }
.btn.wa svg { color: #1F9D55; }
.btn.block { width: 100%; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions .btn { padding: 0 8px; }

/* ---------- segmented toggle ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--chandan); border: 1px solid var(--line); border-radius: 10px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 50, 48, 0.12); }
.seg button .count { margin-left: 4px; color: var(--ink-3); font-weight: 500; }

/* ---------- day strip ---------- */
.days { display: flex; gap: 6px; overflow-x: auto; margin: 14px -16px 4px; padding: 2px 16px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 56px; display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 7px 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--white);
}
.day .wd { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.day .dn { font-family: var(--num); font-weight: 700; font-size: 19px; line-height: 1.35; }
.day .dots { height: 6px; display: flex; gap: 3px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--mayur); opacity: 0.55; }
.day.on { background: var(--mayur); border-color: var(--mayur); color: var(--white); }
.day.on .wd { color: rgba(255, 255, 255, 0.8); }
.day.on .dots i { background: var(--haldi); opacity: 1; }
@media (min-width: 900px) { .days { margin: 18px 0 6px; padding: 2px 0 8px; } }

/* ---------- schedule (time list) ---------- */
.sched { list-style: none; margin: 8px 0 0; padding: 0; }
.slot {
  display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.slot:hover { background: rgba(251, 243, 228, 0.6); }
.slot .t { font-family: var(--num); font-weight: 700; font-size: 18px; line-height: 1.2; }
.slot .t.via { color: var(--ink-3); display: flex; }
.slot .t.via svg { width: 20px; height: 20px; }
.slot .t small { display: block; font-family: var(--text); font-weight: 400; font-size: 12px; color: var(--ink-3); }
.slot .who { min-width: 0; }
.slot .who b { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .who span { display: block; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .mark { display: flex; gap: 6px; align-items: center; }
.slot.done .t, .slot.done b { color: var(--ink-3); }
.now {
  position: relative; height: 0; border-top: 2px solid var(--sindoor); margin: -1px 0 0 66px; list-style: none;
}
.now span {
  position: absolute; left: -66px; top: -11px; padding: 0 6px; border-radius: 4px;
  background: var(--sindoor); color: var(--white); font-family: var(--num); font-weight: 700; font-size: 12px; line-height: 20px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sindoor); display: inline-block; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--chandan); color: var(--ink-2); white-space: nowrap;
}
.tag.inq { background: var(--haldi-wash); color: #7A5600; }
.tag.paid { background: var(--mayur-wash); color: var(--mayur); }
.chev { width: 18px; height: 18px; color: var(--ink-3); }
.empty { padding: 28px 4px; color: var(--ink-2); }

/* ---------- sections ---------- */
.sec { margin-top: 26px; }
.sec > h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec > h2 a, .sec > h2 button { font-size: 14px; font-weight: 600; color: var(--mayur); text-decoration: none; background: none; border: 0; padding: 0; }
.muted { color: var(--ink-2); }
.later { color: var(--ink-3); font-size: 14px; }

/* ---------- home ---------- */
.home { display: grid; gap: 4px; }
.month {
  display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white);
}
.month div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month div:nth-child(2n) { border-right: 0; }
.month div:nth-last-child(-n+2) { border-bottom: 0; }
.month b { display: block; font-family: var(--num); font-weight: 700; font-size: 22px; line-height: 1.35; }
.month span { font-size: 14px; color: var(--ink-2); }
@media (min-width: 900px) {
  .home { grid-template-columns: 1.25fr 1fr; column-gap: 40px; align-items: start; }
  .home .wide { grid-column: 1 / -1; }
  .month { grid-template-columns: repeat(4, 1fr); }
  .month div { border-bottom: 0; }
  .month div:nth-child(2n) { border-right: 1px solid var(--line); }
  .month div:last-child { border-right: 0; }
}

/* ---------- spreadsheet table ---------- */
.grid { width: 100%; border-collapse: collapse; background: var(--white); font-size: 15px; }
.gridwrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: calc(100vh - 210px); }
.grid th, .grid td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; white-space: nowrap; }
.grid tr > :first-child { border-left: 0; }
.grid tr > :last-child { border-right: 0; }
.grid thead th { position: sticky; top: 0; background: #F4EFE4; font-weight: 600; font-size: 14px; color: var(--ink-2); border-top: 0; z-index: 1; }
.grid td.r, .grid th.r { text-align: right; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--chandan); }
.grid td.prob { max-width: 340px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.grid .sr { font-family: var(--num); font-weight: 700; color: var(--mayur); }

/* ---------- list rows (phone) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row .sr { font-family: var(--num); font-weight: 700; color: var(--mayur); font-size: 16px; }
.row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row span { display: block; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > div { min-width: 0; }
.desk { display: none; }
@media (min-width: 900px) { .desk { display: block; } .phone { display: none; } }

.search {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--white) no-repeat 13px 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237D8F8C' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  margin-bottom: 12px;
}
@media (min-width: 900px) { .search { max-width: 420px; } }

/* ---------- session (appointment) ---------- */
.session { display: grid; gap: 0; }
.who-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 10px 0 16px; }
.who-head .sr {
  font-family: var(--num); font-weight: 800; font-size: 30px; color: var(--mayur); line-height: 1;
  padding: 10px 12px 6px; border: 1.5px solid var(--mayur); border-radius: 10px; min-width: 76px; text-align: center;
}
.who-head .sr small { display: block; font-family: var(--text); font-weight: 500; font-size: 11px; color: var(--ink-2); padding-top: 3px; }
.who-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; }
.who-head p { margin: 2px 0 0; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 15px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; }
.facts dd .num { font-weight: 700; }
.problem { margin: 0; padding: 12px 14px; background: var(--chandan); border-radius: 10px; font-size: 16px; }
.problem small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13px; }

.msgs { list-style: none; margin: 0; padding: 0; }
.msg { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: 0; }
.msg .dot { margin-top: 8px; }
.msg .dot.seen { background: transparent; }
.msg p { margin: 0; }
.msg small { color: var(--ink-3); font-size: 13px; }
.compose { display: grid; gap: 8px; margin-top: 10px; }
.compose textarea { min-height: 72px; resize: vertical; }

.phase { padding: 12px 14px; border: 1px dashed #D9CDB4; border-radius: 10px; color: var(--ink-2); font-size: 15px; }
.phase b { color: var(--ink); font-weight: 600; }

.past { list-style: none; margin: 0; padding: 0; }
.past li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.past li:last-child { border-bottom: 0; }

@media (min-width: 900px) {
  .session { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: start; }
  .session .kside { position: sticky; top: 24px; }
  .actions { grid-template-columns: repeat(3, max-content); }
}

/* ---------- kundli page mock ---------- */
.kpage {
  background: var(--white); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(18, 50, 48, 0.35);
  padding: 18px 18px 22px; font-size: 13px; line-height: 1.45;
}
.kpage .om { text-align: center; font-weight: 600; color: var(--sindoor); font-size: 14px; }
.kpage .hd { display: flex; justify-content: space-between; margin: 6px 0 8px; font-weight: 600; }
.kpage .nm { text-align: center; font-weight: 700; font-size: 16px; }
.kpage .bd { text-align: center; color: var(--ink-2); margin-bottom: 8px; }
.kpage table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.kpage td, .kpage th { border: 1px solid #CFC6B4; padding: 2px 6px; text-align: left; }
.kpage th { background: #F6F1E6; font-weight: 600; }
.kpage .md { margin-top: 8px; }
.kmeta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.kmeta button { background: none; border: 0; padding: 0; color: var(--mayur); font-weight: 600; font-size: 14px; }
.upload {
  display: grid; place-items: center; gap: 10px; text-align: center; padding: 40px 20px;
  border: 1.5px dashed #CDBF9F; border-radius: 12px; background: var(--chandan); color: var(--ink-2);
}

/* ---------- sheet (new inquiry / book) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18, 50, 48, 0.35); z-index: 40; animation: fade 0.18s ease-out; }
.sheet {
  position: fixed; inset: 0; z-index: 41; background: var(--paper); display: flex; flex-direction: column;
  animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet header h2 { margin: 0; font-size: 19px; font-weight: 700; }
.sheet header button { background: none; border: 0; padding: 6px; color: var(--ink-2); }
.sheet .body { flex: 1; overflow-y: auto; padding: 16px 16px 24px; }
.sheet footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
@media (min-width: 900px) {
  .sheet { inset: 0 0 0 auto; width: 500px; border-left: 1px solid var(--line); box-shadow: -20px 0 50px -30px rgba(18, 50, 48, 0.45); animation-name: slide; }
  .sheet .body { padding: 20px 24px 28px; }
  .sheet header, .sheet footer { padding-left: 24px; padding-right: 24px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 15px; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.in {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid #DDD2BC; background: var(--white); font-size: 16px;
}
textarea.in { height: auto; min-height: 84px; padding: 11px 14px; line-height: 1.45; }
.in:focus { outline: none; border-color: var(--mayur); box-shadow: 0 0 0 3px rgba(13, 92, 88, 0.15); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phonein { display: grid; grid-template-columns: 74px 1fr; gap: 8px; }
.match {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 10px; background: var(--mayur-wash); color: var(--mayur); font-size: 15px;
}
.match .num { font-size: 20px; }
.match b { display: block; color: var(--ink); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button {
  height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid #DDD2BC; background: var(--white); font-weight: 600; font-size: 15px;
}
.choice button.on { border-color: var(--mayur); background: var(--mayur-wash); color: var(--mayur); }
.rupee { position: relative; }
.rupee span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--num); font-weight: 700; color: var(--ink-2); }
.rupee .in { padding-left: 32px; font-family: var(--num); font-weight: 700; }
.divide { height: 1px; background: var(--line); margin: 6px 0 18px; }

/* calendar */
.cal { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 10px 10px 12px; }
.cal .mh { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; font-weight: 700; }
.cal .mh button { background: none; border: 0; padding: 4px 8px; color: var(--ink-2); font-size: 18px; }
.cal .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .g .w { font-size: 12px; color: var(--ink-3); padding-bottom: 2px; }
.cal .g button {
  aspect-ratio: 1; max-height: 46px; border: 0; border-radius: 50%; background: none;
  font-family: var(--num); font-weight: 700; font-size: 15px; color: var(--ink);
}
.cal .g button.open { background: var(--mayur-wash); color: var(--mayur); }
.cal .g button.on { background: var(--mayur); color: var(--white); }
.cal .g button:disabled { color: #C9C2B3; background: none; cursor: default; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.times button {
  height: 44px; border-radius: 10px; border: 1px solid #DDD2BC; background: var(--white);
  font-family: var(--num); font-weight: 700; font-size: 15px; color: var(--mayur);
}
.times button.on { background: var(--mayur); border-color: var(--mayur); color: var(--white); }
.times button:disabled { color: #C9C2B3; text-decoration: line-through; cursor: default; }

/* settings */
.set { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.set li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.set li:last-child { border-bottom: 0; }
.set li span { color: var(--ink-2); font-size: 15px; }
.set code { font-size: 14px; color: var(--ink-2); }
@media (min-width: 900px) { .narrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-items: start; } .narrow .sec:first-child { margin-top: 26px !important; } }

/* remedies */
.rem { list-style: none; margin: 0; padding: 0; }
.rem li { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.rem b { font-weight: 600; }
.ings { display: flex; gap: 8px; flex-wrap: wrap; }
.ing { display: grid; grid-template-columns: 40px auto; gap: 8px; align-items: center; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 14px; }
.ing i { width: 40px; height: 40px; border-radius: 7px; background: var(--chandan); display: grid; place-items: center; font-style: normal; color: var(--ink-3); font-size: 11px; }
.ing small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.2; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; font-size: 15px; max-width: calc(100vw - 32px);
  animation: rise 0.2s ease-out;
}
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- v2: admin view-as bar ---------- */
.asbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 16px; background: var(--haldi); color: var(--ink); font-size: 15px;
}
.asbar button { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(18, 50, 48, 0.25); background: rgba(255, 255, 255, 0.55); font-weight: 600; font-size: 14px; }

/* ---------- v2: session split with PDF viewer ---------- */
.main.wide { max-width: none; }
.session { display: block; }
.kside { margin-top: 26px; }
.pdfhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
iframe.pdf { width: 100%; height: calc(100vh - 92px); border: 1px solid var(--line); border-radius: 10px; background: #E9E4D8; }
@media (min-width: 900px) {
  .session { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 36px; align-items: start; }
  .kside { margin-top: 0; position: sticky; top: 16px; }
  .main.wide { padding-right: 24px; }
}

/* ---------- v2: home dashboard ---------- */
.dash { display: grid; gap: 0; }
.colL, .colR { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; }
.tiles {
  order: 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden;
}
.tiles > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.tiles > div:nth-child(2n) { border-right: 0; }
.tiles > div:nth-last-child(-n+2) { border-bottom: 0; }
.tiles span { font-size: 14px; color: var(--ink-2); }
.tiles b { font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.tiles small { font-size: 13px; color: var(--ink-2); }
.tiles small.up { color: var(--mayur); }
@media (min-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .colL, .colR { display: block; }
  .tiles, .dash .span { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles > div { border-bottom: 0; }
  .tiles > div:nth-child(2n) { border-right: 1px solid var(--line); }
  .tiles > div:last-child { border-right: 0; }
}

.legend { display: flex; gap: 16px; font-size: 14px; color: var(--ink-2); margin: -2px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.e, .bar.e { background: #008A7C; }
.sw.s, .bar.s { background: #B97F0E; }
.cc { display: grid; grid-template-columns: 48px 1fr; height: 240px; }
.yax, .plot { display: flex; flex-direction: column; }
.ya, .area { flex: 1; position: relative; }
.xpad, .xl { height: 26px; flex: none; }
.ya span { position: absolute; right: 8px; transform: translateY(50%); font-size: 12px; line-height: 1; color: var(--ink-3); }
.area .gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #ECE5D6; }
.area .gl:first-child { border-top-color: #CFC4AE; }
.groups { position: absolute; inset: 0; display: flex; }
.mg { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.xl { display: flex; }
.xl span { flex: 1; text-align: center; padding-top: 5px; font-size: 13px; color: var(--ink-2); }
.bar { position: relative; display: block; width: min(24px, 32%); border-radius: 4px 4px 0 0; }
.bar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }

#tip {
  position: fixed; z-index: 70; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--white); font-size: 13px; white-space: nowrap;
}
[data-tip] { cursor: default; }

.heat .grid td.hc { font-variant-numeric: tabular-nums; font-weight: 600; border-color: #FFFFFF; border-width: 2px; }
.heat .grid tbody tr { cursor: default; }
.heat .grid tbody tr:hover td:not(.hc) { background: var(--chandan); }
.heat .grid td.tot { font-weight: 700; font-variant-numeric: tabular-nums; }
.heat { max-height: none; }

.calh { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calh .w { font-size: 12px; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.calh .cd { position: relative; height: 46px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.calh .cd small { position: absolute; top: 3px; left: 5px; font-size: 11px; opacity: 0.75; }
.calh .cd b { font-size: 16px; font-weight: 600; }
.calh .cd.fut { background: transparent !important; border: 1px dashed #DCD2BE; color: var(--mayur) !important; }
.calh .cd.today { box-shadow: inset 0 0 0 2px var(--sindoor); }

.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.goals li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.goals li > div:first-child { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.goals li > div:first-child span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.goals small { font-size: 13px; color: var(--ink-2); min-width: 34px; text-align: right; }
.meter { height: 10px; border-radius: 999px; background: #D5EAE5; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: #008A7C; }

.minis { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 600px) { .minis { grid-template-columns: 1fr 1fr; } }
.mini { margin: 0; }
.mini figcaption { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.mini figcaption b { color: var(--ink); font-weight: 600; }
.ml { position: relative; height: 90px; border-bottom: 1px solid #CFC4AE; }
.ml svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ml .end { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #008A7C; box-shadow: 0 0 0 2px var(--paper); }
.ml .hits { position: absolute; inset: 0; display: flex; }
.ml .hits span { flex: 1; }
.ml .hits span:hover { background: rgba(0, 138, 124, 0.06); }
.mx { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); padding-top: 4px; }

/* ---------- v2: new inquiry client picker ---------- */
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; }
.match { grid-template-columns: auto 1fr auto; }
.match .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.match.picked { margin-bottom: 16px; }
.picks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--white); overflow: hidden; }
.picks li + li { border-top: 1px solid var(--line); }
.picks button { width: 100%; display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; text-align: left; }
.picks button:hover { background: var(--chandan); }
.picks .sr, .row .sr, .grid .sr { font-family: var(--num); font-weight: 700; color: var(--mayur); }
.picks b { display: block; font-weight: 600; }
.picks small { color: var(--ink-2); font-size: 14px; }
.row { grid-template-columns: 70px 1fr auto; }
.who-head .sr { font-size: 22px; padding: 12px 12px 6px; min-width: 92px; }
.mg .bars { height: 100%; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.asbar + .shell .rail { top: 44px; height: calc(100vh - 44px); }

/* ---------- v3: full width pages ---------- */
@media (min-width: 900px) {
  .rem { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); column-gap: 32px; }
  .main { padding-right: 32px; }
}
.exp { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 24px; }
.exp li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.exp li span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- v4: colour-separated sections ---------- */
:root { --page: #F4ECDD; --panel: #FFFFFF; --soft: #F1EBDD; }
body { background: var(--page); }
.dash { grid-template-columns: minmax(0, 1fr); }
.dash > *, .colL > *, .colR > * { min-width: 0; }
.rail { background: #FFFBF3; }
.rail a.on { background: var(--mayur-wash); box-shadow: inset 3px 0 0 var(--mayur); }

/* panels: white surfaces on the sandalwood page */
.panel, .dash .sec, .sleft .sec {
  background: var(--panel); border-radius: 14px; padding: 14px 16px 16px; border: 0;
}
.dash .sec, .sleft .sec { margin-top: 14px; }
.panel { margin-top: 10px; padding-top: 4px; padding-bottom: 4px; }
.panel .empty { padding: 20px 4px; }
.dash .sec > h2, .sleft .sec > h2 { margin-bottom: 10px; }

/* tinted panels give each kind of section its own colour */
.dash .o1, .panel.mint { background: #E3F0EC; }
.dash .o2, .panel.warm, .sleft .sec.warm { background: #FCF1D6; }
.sleft .sec.warm .problem { background: transparent; padding: 0; }
.panel.deep { background: var(--mayur); color: var(--white); }
.panel.deep p { color: rgba(255, 255, 255, 0.82); }
.panel.deep .sr { color: var(--haldi); border-color: rgba(242, 182, 50, 0.7); }
.panel.deep .sr small { color: rgba(255, 255, 255, 0.75); }
.who-head.panel { margin: 10px 0 10px; padding: 14px 16px; }

/* list rows inside panels: lighter dividers, none on the last row */
.sched .slot, .row, .msg, .past li, .rem li { border-bottom-color: rgba(18, 50, 48, 0.08); }
.sched li:last-child .slot, .rows li:last-child .row { border-bottom: 0; }
.dash .o1 .slot:hover, .dash .o2 .slot:hover { background: rgba(255, 255, 255, 0.55); }

/* the stat band: the one bold, brand-coloured block */
.tiles { background: var(--mayur); border: 0; border-radius: 14px; }
.tiles > div { border-color: rgba(255, 255, 255, 0.14) !important; }
.tiles span { color: rgba(255, 255, 255, 0.78); }
.tiles b { color: var(--white); }
.tiles small, .tiles small.up { color: var(--haldi); }

/* tables and pickers sit on white */
.gridwrap { border-color: #E6DCC8; }
.heat.gridwrap { border: 0; }
.rows.phone { background: var(--panel); border-radius: 14px; padding: 0 14px; }
.rem li { background: var(--panel); border-radius: 14px; padding: 14px 16px; border-bottom: 0; margin-bottom: 14px; }
.set { border: 0; }
.search { border-color: #E6DCC8; }
.day { border-color: transparent; }
.seg { background: #EAE0CC; border-color: transparent; }
.kside .pdfhead .seg { background: #EAE0CC; }
iframe.pdf { border: 0; border-radius: 14px; }
.upload { background: var(--panel); }
.sheet { background: var(--page); }
.sheet .in, .sheet .choice button { border-color: #E2D7C1; }
.tabbar { border-top-color: #E6DCC8; }
.phase { background: transparent; }
.sleft .sec .phase { border-color: #DCCFB5; }
@media (min-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 18px; }
  .dash .colL > .sec:first-child, .dash .colR > .sec:first-child { margin-top: 18px; }
  .tiles { margin-bottom: 4px; }
}
@media (max-width: 899px) {
  .top { padding-top: 14px; }
  .top h1 { font-size: 24px; }
  .dash .sec, .sleft .sec { padding: 12px 14px 14px; }
  .actions .btn { font-size: 14px; gap: 6px; }
  .actions .btn svg { width: 16px; height: 16px; }
}

/* ---------- live app ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 380px; background: var(--panel); border-radius: 16px; padding: 28px 24px 24px; }
.login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-weight: 700; font-size: 18px; line-height: 1.2; }
.login .brand img { width: 40px; height: 40px; }
.login .brand small { display: block; font-weight: 400; font-size: 14px; color: var(--ink-2); }
.err { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #FBE3DF; color: #8E2A1F; font-size: 15px; }
.loading { padding: 40px 4px; color: var(--ink-3); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.links button { background: none; border: 0; padding: 0; color: var(--mayur); font-weight: 600; font-size: 14px; }
.links button.danger { color: var(--sindoor); }
.making { display: grid; place-items: center; gap: 8px; text-align: center; padding: 40px 20px; border-radius: 14px; background: var(--panel); color: var(--ink-2); }
.making.failed { background: #FBE3DF; color: #8E2A1F; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.from-kundli { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; background: var(--mayur-wash); font-size: 14px; color: var(--mayur); }
.from-kundli .btn { height: 36px; font-size: 14px; }
.tag.cancel { background: #F3DCD8; color: #8E2A1F; }
.signout { margin-top: 26px; }
a.btn { text-decoration: none; }
#sheet.still .sheet, #sheet.still .scrim { animation: none; }
