/* Standalone stylesheet for the public Kundli page (same brand tokens as
   frontend/form/). Opened by people outside the company, so it depends on
   nothing from the main SPA. Breakpoints follow the app: 900px / 600px. */
:root {
  --bg: #F4F6F5; --surface: #FFFFFF; --ink: #171B1F; --ink-muted: #667079;
  --border: rgba(23, 27, 31, 0.08); --border-strong: rgba(23, 27, 31, 0.16);
  --accent: #1F5F5B; --accent-soft: #E4EFEE; --danger: #C23D3D; --danger-bg: #FBEAEA;
  --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-md: 12px; --radius-lg: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-ui); background: var(--bg); color: var(--ink); }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.top h1 { font-size: 22px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-top: 14px; }
.panel h2 { font-size: 16px; margin: 0 0 10px; }
p.muted { color: var(--ink-muted); font-size: 14px; line-height: 1.5; margin: 6px 0; }
p.error { color: var(--danger); background: var(--danger-bg); border-radius: var(--radius-md); padding: 10px 12px; font-size: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-top: 12px; margin-bottom: 4px; color: var(--ink-muted); }
input, select, textarea { width: 100%; padding: 10px 12px; font-size: 16px; font-family: var(--font-ui); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font-family: var(--font-ui); font-size: 15px; font-weight: 600; padding: 10px 16px; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; min-height: 40px; }
button:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-small { font-size: 13px; padding: 6px 12px; min-height: 32px; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 4px 0; min-height: 0; font-weight: 500; }
.signin { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 8px; text-align: center; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 14px; cursor: pointer; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); outline: none; }
.tile b { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; min-height: 120px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.msg p { margin: 0; line-height: 1.5; white-space: pre-line; }
.msg p + p { margin-top: 8px; }
.msg--me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg--pandit { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-strong); border-bottom-left-radius: 4px; }
.msg .basis { font-size: 12px; color: var(--ink-muted); }
.msg .del { margin-top: 6px; font-size: 12px; color: var(--ink-muted); }
.hint { margin: auto; text-align: center; }
.composer { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; }

.chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--border-strong); border: 2px solid var(--border-strong); max-width: 420px; margin: 8px 0; }
.chart .cell { background: var(--surface); min-height: 68px; padding: 4px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.chart .cell small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 11px; }
.chart .cell.lagna { background: var(--accent-soft); }
.chart .center { grid-column: 2 / 4; grid-row: 2 / 4; background: var(--surface); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: var(--ink-muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .thread { max-height: 55vh; }
}

.tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tools [hidden] { display: none; }
body.locked { overflow: hidden; }
.chat.full { position: fixed; inset: 0; z-index: 20; margin: 0; border-radius: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; border: 0; }
.chat.full .thread { flex: 1; max-height: none; }

.send-col { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.combine-tick { display: flex; align-items: center; gap: 6px; font-size: 0.85em; cursor: pointer; white-space: nowrap; }
.pick { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 15px; font-weight: 500; color: var(--ink); }
.pick input { width: 18px; height: 18px; flex: none; }
.picker .actions { margin-top: 10px; }

.perperson { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.perperson li { margin: 3px 0; }
