@font-face { font-family: "Noto Sans Malayalam"; font-weight: 400; font-display: swap; src: url("fonts/NotoSansMalayalam-Regular.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Malayalam"; font-weight: 600; font-display: swap; src: url("fonts/NotoSansMalayalam-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Malayalam"; font-weight: 700; font-display: swap; src: url("fonts/NotoSansMalayalam-Bold.woff2") format("woff2"); }

:root {
  --ink: #2a2118; --muted: #786a58; --line: #e3d7c4; --paper: #fffdf8;
  --accent: #7a4b1e; --accent-2: #b0391d; --soft: #f6eedf;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans Malayalam", "Manjari", system-ui, sans-serif; color: var(--ink); background: #faf6ee; line-height: 1.5; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.2rem; }

.top { background: var(--accent); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: .7rem; padding-bottom: .7rem; }
.top h1 { margin: 0; font-size: 1.5rem; letter-spacing: .02em; }
.lang-switch { display: flex; gap: .3rem; }
.lang-switch button { font: inherit; font-size: .85rem; background: transparent; color: #f3e4cf; border: 1px solid #c79d6f; border-radius: 4px; padding: .2rem .6rem; cursor: pointer; }
.lang-switch button.on { background: #fff; color: var(--accent); border-color: #fff; }

main.wrap { padding-top: 1.6rem; padding-bottom: 2rem; }
.tagline { color: var(--muted); margin-top: 0; }
h2 { font-size: 1.3rem; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 .6rem; }

.errors { background: #fdecea; border: 1px solid #f2b8b0; color: #8a1f12; border-radius: 6px; padding: .4rem 1rem; margin-bottom: 1rem; }
.errors p { margin: .3rem 0; }

/* Form */
.birth-form { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; max-width: 720px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.span2 { grid-column: span 2; }
label, legend { display: block; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=date], input[type=time], input[type=tel], input[type=email], input[type=search], input[type=password], input[type=number] {
  display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; padding: .5rem .65rem;
  border: 1px solid #cdbda5; border-radius: 6px; background: #fff;
}
input:focus { outline: 2px solid #e0b884; border-color: var(--accent); }
small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; margin-top: .25rem; }
fieldset.gender { border: 0; padding: 0; margin: 0; }
fieldset.gender label { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin-right: 1.2rem; margin-top: .3rem; }
.coords { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: .8rem; background: var(--soft); border-radius: 8px; padding: .8rem; }
.coords label { font-size: .82rem; }
.span3 { grid-column: span 3; }

.place-box { position: relative; }
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 4.1rem; margin: 0; padding: .2rem 0; list-style: none; background: #fff;
  border: 1px solid #cdbda5; border-radius: 6px; box-shadow: 0 6px 18px rgba(60,40,10,.15); max-height: 300px; overflow-y: auto; }
.suggestions li { padding: .45rem .7rem; cursor: pointer; }
.suggestions li .sub { color: var(--muted); font-size: .8rem; }
.suggestions li[aria-selected=true], .suggestions li:hover { background: var(--soft); }
.suggestions li.empty { color: var(--muted); cursor: default; }

.btn-primary { margin-top: 1.4rem; font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .7rem 1.6rem; cursor: pointer; }
.btn-primary:hover { background: #643c15; }
.head-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.btn-pdf { font: inherit; font-size: .9rem; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .45rem 1rem; cursor: pointer; }
.btn-pdf:disabled { opacity: .7; cursor: wait; }
.btn-secondary { font-size: .9rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: .4rem .9rem; text-decoration: none; white-space: nowrap; }

/* AI reading */
.ai-box { background: #fffaf0; border: 1px solid #e6cfa9; border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.ai-box h3 { margin-top: 0; }
.ai-sec h4 { margin: 1rem 0 .3rem; color: var(--accent); font-size: 1.02rem; }
.ai-sec p { margin: .35rem 0; line-height: 1.8; }
.ai-meta, .ai-disclaimer { color: var(--muted); font-size: .78rem; margin: .6rem 0 0; }
.ai-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ai-actions .btn-primary { margin-top: .8rem; }
.ai-status { color: var(--muted); font-size: .88rem; margin-top: .8rem; }
.ai-status.err { color: var(--accent-2); }

/* Predictions */
.predictions { display: grid; gap: .7rem; }
.pred { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
.pred h4 { margin: 0 0 .3rem; font-size: 1rem; }
.pred h4 .subj { color: var(--accent-2); font-weight: 600; margin-left: .3rem; }
.pred p { margin: 0; line-height: 1.7; }
.pred-janana_vakyam { background: #fbf3e4; border-color: #e6cfa9; }
.pred-janana_vakyam p { font-size: 1.02rem; }
.pred p.why { margin-top: .5rem; font-size: .9rem; color: #4a3b2a; background: #fbf6ec; border-radius: 6px; padding: .45rem .65rem; }
.pred p.advice { margin-top: .5rem; font-size: .9rem; color: #2f5a34; background: #eef6ec; border-radius: 6px; padding: .45rem .65rem; }
.pred p.why strong, .pred p.advice strong { font-weight: 700; }
.pred-bhava { border-left: 4px solid #d6c3a1; }
.pred-bhava.v-strong { border-left-color: #6fa86f; }
.pred-bhava.v-moderate { border-left-color: #d9b45a; }
.pred-bhava.v-weak { border-left-color: #d9906a; }
.pred-bhava .verdict { float: right; font-size: .78rem; font-weight: 700; padding: .1rem .6rem; border-radius: 10px; }
.v-strong .verdict { background: #e3f1e1; color: #2f6b31; }
.v-moderate .verdict { background: #f7eed3; color: #7a5a12; }
.v-weak .verdict { background: #f9e1d6; color: #8a2e12; }
.pred-bhava .conclusion { font-size: .98rem; }
details.factors { margin-top: .4rem; }
details.factors summary { cursor: pointer; font-size: .84rem; color: var(--muted); }
.sub-h { margin: 1.2rem 0 .5rem; font-size: 1rem; color: var(--accent); }
.pred-dasha { border-left: 4px solid #d6c3a1; }
.pred-dasha.v-favourable { border-left-color: #6fa86f; }
.pred-dasha.v-mixed { border-left-color: #d9b45a; }
.pred-dasha.v-challenging { border-left-color: #d9906a; }
.pred-dasha .verdict { float: right; font-size: .78rem; font-weight: 700; padding: .1rem .6rem; border-radius: 10px; }
.v-favourable .verdict { background: #e3f1e1; color: #2f6b31; }
.v-mixed .verdict { background: #f7eed3; color: #7a5a12; }
.v-challenging .verdict { background: #f9e1d6; color: #8a2e12; }
.pred-dasha p + p { margin-top: .45rem; }
.pred-dasha h5 { margin: .9rem 0 .3rem; font-size: .92rem; }
table.grahanila.apahara-table td { font-size: .86rem; vertical-align: top; white-space: normal; }
table.grahanila.apahara-table td.nowrap { white-space: nowrap; }
.apahara-table tr.tone-stress td:last-child { color: #8a2e12; }
.apahara-table tr.tone-support td:last-child { color: #2f6b31; }
.apahara-table tr.now td { background: #fdf1e8; }
.apahara-table tr.past td { opacity: .55; }
.pred-notes { margin: .45rem 0 0; padding-left: 1.1rem; font-size: .86rem; color: #5b4a36; }
.pred-notes li { margin: .15rem 0; }
.facts-row { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .5rem 0 0; font-size: .85rem; }
.facts-row dt { color: var(--muted); display: inline; }
.facts-row dt::after { content: ": "; }
.facts-row dd { display: inline; margin: 0; font-weight: 600; }

/* Analysis */
.analysis .dig-exalted, .analysis .dig-moolatrikona, .analysis .dig-own { color: #2f7a3a; font-weight: 600; }
.analysis .dig-debilitated, .analysis .dig-enemy { color: var(--accent-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .65rem .9rem; }
.card p { margin: .35rem 0 0; font-size: .88rem; }
.card-title { font-weight: 600; }
.card.dosha { border-left: 3px solid #d9906a; }
.card.dosha.cancelled { border-left-color: #8fb98f; }
.card.yoga { border-left: 3px solid #c9a24a; }
.card .facts { color: var(--muted); font-size: .82rem; }
.card .mitig { color: #2f7a3a; font-size: .82rem; }
.card .caution { color: var(--accent-2); font-size: .82rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 10px; background: var(--soft); color: var(--muted); margin-left: .3rem; }
.av td, .av th { text-align: center; padding: .35rem .4rem; }
.av td:first-child, .av th:first-child { text-align: left; }
.av .lagna-col { background: #fbefe2; }
.av .sav-row td { font-weight: 600; }
.av .sav-row td.good { color: #2f7a3a; }
.av .sav-row td.weak { color: var(--accent-2); }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.pill.ezhara { background: #f7dfd5; color: #8a2e12; }
.pill.kandaka { background: #f3ead2; color: #7a5a12; }
.pill.ashtama { background: #e7dff2; color: #4b2f7a; }
.shani-legend p { margin: .3rem 0; font-size: .86rem; }
.shani tr.past td { opacity: .5; }
.shani tr.now td { background: #fdf1e8; }

/* Bhava Chalit */
.bhava-wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.bhava-chart { margin: 0; flex: 0 1 360px; }
.bhava-chart svg { width: 100%; height: auto; }
.bhava-side { flex: 1 1 380px; }
.shifts { margin: 0 0 .7rem; background: #fdf1e8; border: 1px solid #f0cdb5; border-radius: 6px; padding: .5rem .8rem; }
.shifts.none { background: var(--paper); border-color: var(--line); color: var(--muted); }
.bhava-table td:last-child { white-space: normal; }
.bhava-table .shifted { color: var(--accent-2); font-weight: 600; }

/* Dasha */
.dasha-head p { margin: .3rem 0; }
.dasha-head .now { color: var(--accent-2); }
.dasha-list { margin-top: .8rem; }
.dasha-list details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto 6.5rem; gap: .8rem; align-items: center; }
.dasha-list details > summary::-webkit-details-marker { display: none; }
.dasha-list details > summary::before { content: "▸"; color: var(--muted); position: absolute; margin-left: -1.1rem; }
.dasha-list details[open] > summary::before { content: "▾"; }
.maha { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .45rem; padding: .55rem .9rem .55rem 2rem; position: relative; }
.maha > summary { font-weight: 600; }
.maha.now { border-color: #d79b74; box-shadow: 0 0 0 2px #f6dccb; }
.dates { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 400; font-size: .9rem; }
.age { color: var(--muted); font-size: .8rem; font-weight: 400; text-align: right; }
ul.apahara, ul.prat { list-style: none; margin: .5rem 0 .2rem; padding: 0; }
ul.apahara > li { border-top: 1px solid var(--line); padding: .35rem 0 .35rem 1.2rem; position: relative; }
ul.apahara > li > details > summary { grid-template-columns: 1fr auto 6.5rem; font-size: .92rem; }
ul.prat { margin-left: .2rem; }
ul.prat > li { display: grid; grid-template-columns: 1fr auto 6.5rem; gap: .8rem; padding: .18rem 0 .18rem 1rem; font-size: .85rem; color: var(--muted); }
ul.prat > li .dates { color: var(--muted); font-size: .85rem; }
li.now > details > summary .lord, ul.prat > li.now, ul.prat > li.now .dates { color: var(--accent-2); font-weight: 600; }
li.prebirth { opacity: .5; }

/* Result */
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.result-head h2 { margin-bottom: .2rem; }
.meta { color: var(--muted); margin: 0; font-size: .9rem; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.summary div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.summary dt { font-size: .8rem; color: var(--muted); }
.summary dd { margin: .15rem 0 0; font-weight: 600; }
.alt { color: var(--muted); font-weight: 400; font-size: .82em; }

.charts { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.charts figure { margin: 0; flex: 1 1 360px; max-width: 460px; }
.charts svg { width: 100%; height: auto; }

.table-scroll { overflow-x: auto; }
table.grahanila { border-collapse: collapse; width: 100%; background: var(--paper); font-size: .9rem; }
.grahanila th, .grahanila td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; white-space: nowrap; }
.grahanila th { background: var(--soft); font-weight: 600; }
.grahanila .lagna-row td:first-child { color: var(--accent-2); font-weight: 600; }
.grahanila .upagraha-row td { color: var(--muted); }
.grahanila td.r { color: var(--accent-2); font-weight: 600; text-align: center; }
.note { color: var(--muted); font-size: .8rem; margin-top: .6rem; }

.foot { color: var(--muted); font-size: .78rem; padding-bottom: 2rem; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .coords { grid-template-columns: 1fr 1fr; }
  .coords label:last-of-type, .span3 { grid-column: span 2; }
  .result-head { flex-direction: column; }
}

@media print {
  .head-actions { display: none; }
  .ai-actions { display: none; }
  @page { size: A4; margin: 12mm; }
  .wrap { max-width: none; padding: 0; }
  .table-scroll { overflow: visible; }
  table.grahanila { font-size: 8.5pt; }
  .grahanila th, .grahanila td { padding: .25rem .35rem; white-space: normal; }
  .grahanila .alt { display: block; }
  .charts figure, .bhava-chart, .card, .maha, tr { break-inside: avoid; }
  .dasha-list details:not([open]) ul { display: none; }
  details.factors > ul { display: block; }
  h3, h4 { break-after: avoid; page-break-after: avoid; }
  h3 + .note, h3 + div, h3 + p { break-before: avoid; page-break-before: avoid; }
  .pred { break-inside: avoid; }
  .dasha-list details { break-inside: avoid; }
  .top, .lang-switch, .btn-secondary, .foot { display: none; }
  body { background: #fff; }
}

/* Ask about your chart */
.chat-box { background: #fffaf0; border: 1px solid #e6cfa9; border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.chat-head h3 { margin: 0; }
.chat-clear { font: inherit; font-size: .8rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 6px; padding: .25rem .6rem; cursor: pointer; }
.chat-clear:hover { color: var(--accent-2); border-color: var(--accent-2); }
.chat-intro { margin: .5rem 0 .8rem; }
.chat-log { display: flex; flex-direction: column; gap: .7rem; max-height: 34rem; overflow-y: auto; }
.chat-log:empty { display: none; }
.msg { max-width: 88%; border-radius: 10px; padding: .55rem .85rem; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg-ai { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); }
.msg-who { font-size: .72rem; font-weight: 600; opacity: .75; margin-bottom: .15rem; }
.msg-body p { margin: .35rem 0; }
.msg-body ul { margin: .35rem 0; padding-left: 1.2rem; }
.msg-body.streaming { white-space: pre-wrap; }
.msg-body.streaming:empty::after, .msg-body.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
.msg-body.err { color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }
.chat-examples { display: flex; flex-wrap: wrap; gap: .45rem; margin: .4rem 0 .2rem; }
.chip { font: inherit; font-size: .84rem; background: var(--paper); color: var(--accent); border: 1px solid #e0c79e; border-radius: 999px; padding: .3rem .8rem; cursor: pointer; text-align: left; }
.chip:hover { background: var(--soft); }
.chat-form { margin-top: .8rem; }
.chat-form textarea { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; resize: vertical; background: #fff; }
.chat-form textarea:focus { outline: 2px solid #e0b884; border-color: var(--accent); }
.chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.chat-actions .btn-primary { margin-top: .5rem; }
.chat-actions .btn-primary:disabled { opacity: .55; cursor: default; }
.chat-left { color: var(--muted); font-size: .8rem; }
@media print { .chat-box { display: none; } }
.chat-examples[hidden], .chat-clear[hidden] { display: none; }

/* ===== Franchise app ===== */
.top-row { gap: 1rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.main-nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.main-nav a { color: #f3e4cf; text-decoration: none; font-size: .88rem; padding: .3rem .55rem; border-radius: 5px; }
.main-nav a:hover { background: rgba(255,255,255,.12); }
.main-nav a.on { background: #fff; color: var(--accent); }
.top-right { display: flex; align-items: center; gap: .8rem; font-size: .85rem; }
.lang-switch a { color: #f3e4cf; text-decoration: none; border: 1px solid #c79d6f; border-radius: 4px; padding: .15rem .5rem; font-size: .8rem; }
.lang-switch a.on { background: #fff; color: var(--accent); border-color: #fff; }
.who a { color: #fff; text-decoration: none; font-weight: 600; }
.who small { display: block; color: #e9d5b8; font-size: .72rem; }
.link-btn { font: inherit; font-size: .82rem; background: none; border: 0; color: #f3e4cf; text-decoration: underline; cursor: pointer; padding: 0; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.btn-small { font: inherit; font-size: .8rem; color: var(--accent); background: #fff; border: 1px solid var(--accent); border-radius: 5px; padding: .2rem .55rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-small:hover, .btn-secondary:hover { background: var(--soft); }
button.btn-secondary { font: inherit; font-size: .9rem; background: #fff; cursor: pointer; }
.page-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h2 { margin: 0; flex: 1; }
.page-head .btn-primary { margin-top: 0; }
.flash { border-radius: 6px; padding: .55rem 1rem; margin-bottom: .8rem; font-size: .92rem; }
.flash-ok { background: #e8f4e6; border: 1px solid #b7d9b0; color: #24561c; }
.flash-warn { background: #fff6e0; border: 1px solid #ecd28f; color: #6d5005; }
.flash-error { background: #fdecea; border: 1px solid #f2b8b0; color: #8a1f12; }

.login-box, .verify-box { max-width: 380px; margin: 2rem auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem; }
.verify-box { max-width: 560px; }
.login-box label, .form-narrow label, .admin-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; margin-bottom: .8rem; }
.login-box input, .form-narrow input, .admin-form input, .admin-form select, .filters input, .filters select, form.inline input, form.inline select, .order-form input[type=number], .order-form select {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.login-box .btn-primary { width: 100%; }
.form-narrow { max-width: 420px; }
.admin-form { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.3rem; max-width: 820px; }
.admin-form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.admin-form .span2 { grid-column: span 2; }
.admin-form small { color: var(--muted); font-size: .75rem; }
.verify-ok { color: #24561c; font-weight: 700; font-size: 1.1rem; }
.verify-bad { color: #8a1f12; font-weight: 700; font-size: 1.1rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.tile.accent { background: #fff6e8; border-color: #e6cfa9; }
.tile-n { display: block; font-size: 1.45rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile-l { display: block; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 760px) { .two-col, .admin-form .grid { grid-template-columns: 1fr; } .admin-form .span2 { grid-column: auto; } }
table.list td, table.list th { vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bad { color: var(--accent-2); font-weight: 600; }
tr.void td { opacity: .55; text-decoration: line-through; }
tr.void td:last-child, tr.void td:first-child { text-decoration: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.alerts { padding-left: 1.2rem; font-size: .9rem; }
.alerts li { margin: .25rem 0; }
.alert-below_min { color: #8a4b05; }
.alert-spike { color: var(--accent-2); }
.filters { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .8rem; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: .2rem; }
.totals { color: var(--muted); font-size: .9rem; }
.search input { min-width: 220px; }
.add-user { margin-top: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; }

.client-card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; line-height: 1.6; }
.order-form { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.3rem; max-width: 760px; }
.services { border: 0; padding: 0; margin: 0 0 1rem; }
.services legend { font-weight: 600; margin-bottom: .5rem; }
.svc { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: start; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; background: #fff; cursor: pointer; }
.svc input { grid-row: span 2; margin-top: .3rem; }
.svc-name { font-weight: 600; }
.svc-desc { font-size: .82rem; color: var(--muted); }
.svc.off { opacity: .55; cursor: default; }
.svc:has(input:checked) { border-color: var(--accent); background: #fff8ee; }
.fee-row { display: flex; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.fee-row label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.fee-row input.below { border-color: #e0a54a; background: #fff8e8; }
.fee-info { font-size: .9rem; line-height: 1.6; }
.fee-info small { color: var(--muted); display: block; max-width: 380px; }
.confirm { display: flex; gap: .5rem; align-items: flex-start; margin-top: 1rem; font-size: .9rem; }
.partner-box { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.partner-box[hidden], .combo-msg[hidden] { display: none; }
.combo-msg { color: var(--accent-2); }
.order-meta { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
details.correction, details.events { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; margin: .8rem 0; }
details.correction summary, details.events summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.correction .birth-form { border: 0; padding: .8rem 0 0; }
details.correction label:not(fieldset.gender label) { display: flex; flex-direction: column; gap: .3rem; margin: .6rem 0; }
details.correction input[type=text] { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; }

/* Report protection: no selection on screen; printing shows a notice instead of the report. */
.protected { user-select: none; -webkit-user-select: none; background-repeat: repeat; }
.protected textarea, .protected input { user-select: text; -webkit-user-select: text; }
.print-block { display: none; }
@media print {
  body.page-order main > *:not(.print-block) { display: none !important; }
  body.page-order .print-block { display: block !important; font-size: 16pt; padding: 3cm 1cm; text-align: center; }
  .main-nav, .top-right { display: none; }
  .statement-kv { font-size: 11pt; }
}
a.btn-primary { display: inline-block; text-decoration: none; }

/* Gender choice: one row, aligned, everywhere (client form and correction form). */
fieldset.gender { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.4rem; }
fieldset.gender legend { width: 100%; margin-bottom: .2rem; }
fieldset.gender label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .35rem; margin: 0 !important; font-weight: 400; }
fieldset.gender input[type=radio] { margin: 0; width: auto; }
.filters input, form.inline input, .add-user input { width: auto; display: inline-block; margin-top: 0; }

/* Porutham */
.porutham .verdict-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-radius: 8px; padding: .7rem 1rem; margin: .5rem 0 1rem; border: 1px solid #d9c4a0; background: #fff8ee; }
.porutham .verdict-box strong { font-size: 1.15em; }
.porutham .verdict-excellent, .porutham .verdict-good { background: #edf6ea; border-color: #b7d9b0; color: #24561c; }
.porutham .verdict-average { background: #fff6e0; border-color: #ecd28f; color: #6d5005; }
.porutham .verdict-poor, .porutham .verdict-not_recommended { background: #fdecea; border-color: #f2b8b0; color: #8a1f12; }
.porutham tr.pm-good .pm-res { color: #24561c; font-weight: 700; }
.porutham tr.pm-medium .pm-res { color: #8a5a00; font-weight: 700; }
.porutham tr.pm-bad .pm-res { color: #a0281a; font-weight: 700; }
.porutham td.hit { background: #fdf0e6; }
.porutham .pm-summary li.bad { color: #a0281a; }
.porutham h4 { margin: 1rem 0 .4rem; }

/* Panchangam */
.panch-form { max-width: 820px; margin-bottom: 1rem; }
.panch-form .btn-secondary { margin-top: .8rem; }
.panch-date { background: #fff6e8; border: 1px solid #e6cfa9; border-radius: 10px; padding: .9rem 1.2rem; margin-bottom: 1rem; }
.pd-main { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.pd-me { font-size: 1.05rem; font-weight: 600; margin-top: .2rem; }
.pd-place { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.panch-table th { width: 26%; text-align: left; }
.panch-table .until { color: var(--muted); font-size: .88rem; margin: 0 .5rem 0 .25rem; }

/* Porutham people in the order form */
.partner-box { margin: 0 0 1rem; }
fieldset.person { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem 1rem; margin: 0 0 .9rem; background: #fff; position: relative; }
fieldset.person legend { font-weight: 700; color: var(--accent); padding: 0 .3rem; }
fieldset.person .grid { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; }
fieldset.person .span2 { grid-column: span 2; }
fieldset.person label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; }
fieldset.person .coords { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; background: var(--soft); border-radius: 6px; padding: .5rem .6rem; }
fieldset.person .place-box { position: relative; }
.fill-btn { position: absolute; top: -.2rem; right: .8rem; }
.birth-optional { margin: 0 0 .4rem; }
@media (max-width: 640px) { fieldset.person .grid, fieldset.person .coords { grid-template-columns: 1fr; } fieldset.person .span2 { grid-column: auto; } .fill-btn { position: static; margin-bottom: .5rem; } }

/* Whose Jathakam */
.subject-box { margin: 0 0 1rem; }
.subject-box[hidden], #subject-other[hidden] { display: none; }
fieldset.subject-choice { border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; margin: 0 0 .8rem; background: #fff; }
fieldset.subject-choice legend { font-weight: 700; color: var(--accent); padding: 0 .3rem; }
fieldset.subject-choice label { display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }
fieldset.subject-choice label.off { opacity: .6; }
.for-other { color: var(--accent); }
fieldset.person select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
