/* Astro GPT app: same palette as the site theme (charcoal + orange, Outfit) */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/theme/outfit-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/theme/outfit-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --o: #f27d3a; --o2: #ffb547; --o-soft: #f27d3a1f; --o-line: #f27d3a55;
  --bg: #faf7f4; --card: #ffffff; --card2: #f4efea; --line: #ebe4dc; --text: #161616; --body: #474747;
  --muted: #6b6b6b; --good: #1f9d55; --bad: #d64545; --mixed: #c98a1a;
  --r: 18px; --shadow: 0 1px 2px #0000000d, 0 8px 24px #0000000a;
  color-scheme: light;
}
html.dark {
  --bg: #111111; --card: #1b1b1b; --card2: #222222; --line: #ffffff14; --text: #f5f5f5; --body: #cfcfcf;
  --muted: #9d9d9d; --good: #3ccf7a; --bad: #ff6b6b; --mixed: #f3b33d; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.55 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1000px 480px at 50% -200px, var(--o-soft), transparent 70%); background-repeat: no-repeat;
  min-height: 100vh; }
a { color: var(--o); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--muted); }
.boot img { margin: 0 auto; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: var(--muted); padding: 7px 13px; border-radius: 999px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--card2); }
.nav a.on { color: var(--text); background: var(--card2); }
.spacer { flex: 1; }
.coins { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 600;
  background: var(--o-soft); color: var(--o); border: 1px solid var(--o-line); cursor: pointer; }
.coins:hover { text-decoration: none; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe1a1, var(--o2) 45%, var(--o));
  display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; color: #6b2e0b; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid;
  place-items: center; cursor: pointer; color: var(--text); }
.iconbtn svg { width: 18px; height: 18px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 46px; min-width: 220px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 6px; box-shadow: 0 12px 40px #00000040; display: none; }
.menu-pop.open { display: block; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px;
  color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--card2); text-decoration: none; }
.menu-pop .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; }
.tabbar { display: none; }
main.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 90px; }
main.narrow { max-width: 560px; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card.tight { padding: 14px 16px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.eyebrow { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--o); font-weight: 600; }
.hl { color: var(--o); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 600; cursor: pointer; background: linear-gradient(135deg, var(--o2), var(--o));
  color: #1a0d05; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--card2); color: var(--text); border-color: var(--line); }
.btn.line { background: none; color: var(--o); border-color: var(--o-line); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: none; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.full { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card2); color: var(--body); cursor: pointer; font-size: 13.5px; }
.chip:hover { border-color: var(--o-line); color: var(--text); text-decoration: none; }
.chip.on { border-color: var(--o); color: var(--o); background: var(--o-soft); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card2);
  color: var(--muted); }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.pill.mixed { background: color-mix(in srgb, var(--mixed) 18%, transparent); color: var(--mixed); }
.pill.o { background: var(--o-soft); color: var(--o); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.stat { background: var(--card2); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 17px; } .stat span { color: var(--muted); font-size: 13px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.t tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.note { font-size: 13px; color: var(--muted); }
.err { color: var(--bad); font-size: 14px; }
.ok { color: var(--good); font-size: 14px; }
.loading { animation: pulse 1.4s ease-in-out infinite; color: var(--muted); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* forms */
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; }
.in, select.in, textarea.in { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--text); outline: none; }
.in:focus { border-color: var(--o); }
textarea.in { resize: vertical; min-height: 46px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px #0000001f; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--body); cursor: pointer; }
.place-box { position: relative; }
.place-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-top: 4px; overflow: hidden; box-shadow: 0 12px 40px #00000040; }
.place-list button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; cursor: pointer; }
.place-list button:hover { background: var(--card2); }
.place-list small { display: block; }

/* auth */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 30px 16px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth h1 { font-size: 26px; }

/* dashboard */
.hero-ask { padding: 24px; background: linear-gradient(160deg, color-mix(in srgb, var(--o) 14%, var(--card)), var(--card) 60%); }
.askbox { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.askbox textarea { min-height: 52px; max-height: 180px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tone-good { color: var(--good); } .tone-bad { color: var(--bad); } .tone-mixed { color: var(--mixed); }
.engine { display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .15s; }
.engine:hover { border-color: var(--o-line); text-decoration: none; }
.engine .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--o-soft); color: var(--o); }
.engine .ic svg { width: 20px; height: 20px; }
.person { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--o-soft); color: var(--o);
  font-weight: 700; flex: none; }
.list > * + * { border-top: 1px solid var(--line); }
.list > * { padding: 12px 0; }
.list a.item { display: flex; justify-content: space-between; gap: 10px; color: var(--text); }
.list a.item:hover { text-decoration: none; color: var(--o); }

/* chart */
.chartbox { max-width: 420px; margin: 0 auto; }
.chartbox svg { width: 100%; height: auto; display: block; }
svg .ln { stroke: var(--o); stroke-width: 1.4; fill: none; opacity: .85; }
svg .hs { fill: var(--muted); font-size: 12px; }
svg .pl { fill: var(--text); font-size: 13px; font-weight: 600; }
svg .pl.as { fill: var(--o); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); justify-content: center; margin-top: 10px; }

/* match */
.ring { width: 170px; height: 170px; margin: 0 auto; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .val b { font-size: 38px; line-height: 1; } .ring .val span { color: var(--muted); font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--o2), var(--o)); }
.koota { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.koota .bar { grid-column: span 2; }

/* panchang */
.daystrip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.daystrip button { flex: none; min-width: 62px; padding: 8px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; text-align: center; }
.daystrip button.on { border-color: var(--o); background: var(--o-soft); color: var(--o); }
.daystrip b { display: block; font-size: 18px; }
.limb { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.limb b { font-size: 16px; }

/* reading text */
.md { color: var(--body); }
.md p { margin: 0 0 .7em; } .md ul { margin: 0 0 .7em; padding-left: 20px; } .md li { margin: .2em 0; }
.md h3, .md h4 { color: var(--text); margin: .9em 0 .35em; font-size: 15.5px; }
.md strong { color: var(--text); }

/* chat */
.chat { display: grid; grid-template-columns: 280px 1fr; gap: 16px; height: calc(100vh - 140px); min-height: 480px; }
.chat-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-side .convs { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.conv { display: block; padding: 9px 12px; border-radius: 12px; color: var(--body); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.conv:hover { background: var(--card2); text-decoration: none; color: var(--text); }
.conv.on { background: var(--o-soft); color: var(--o); }
.chat-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; }
.msg.user { align-self: flex-end; background: var(--o-soft); border: 1px solid var(--o-line); padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; display: flex; gap: 10px; }
.msg.assistant .bubble { background: var(--card2); padding: 12px 16px; border-radius: 16px 16px 16px 4px; min-width: 60px; }
.msg .meta { display: flex; gap: 6px; margin-top: 6px; }
.msg .meta button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; }
.msg .meta button.on, .msg .meta button:hover { color: var(--o); }
.msg .meta svg { width: 15px; height: 15px; }
.typing::after { content: "▍"; animation: pulse 1s infinite; color: var(--o); }
.chat-input { border-top: 1px solid var(--line); padding: 12px; }
.chat-input .askbox { margin: 0; }
.follow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* sheet / modal */
.overlay { position: fixed; inset: 0; z-index: 50; background: #000000a0; display: grid; place-items: center; padding: 16px; }
.sheet { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px; position: relative; }
.sheet .x { position: absolute; right: 14px; top: 14px; }
.pack { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--card2); margin-top: 10px; }
.pack b { font-size: 17px; } .pack .price { font-size: 19px; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px #0005; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-side { display: none; }
  .chat-side.show { display: flex; max-height: 300px; }
  .chat-main { height: calc(100vh - 170px); min-height: 460px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .top { padding: 10px 16px; }
  main.page { padding: 18px 16px 96px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  h1 { font-size: 24px; }
  .msg { max-width: 94%; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--o); }
  .tabbar a:hover { text-decoration: none; }
}
@media (max-width: 420px) { .g4 { grid-template-columns: 1fr 1fr; } .coins .lbl { display: none; } }
/* inline icons */
svg.i { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.btn svg.i { width: 18px; height: 18px; }
.card-head h3, h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 svg.i, h3 svg.i, h2 svg.i { color: var(--o); }

/* very narrow panes: keep the header on one line */
@media (max-width: 380px) {
  .top { gap: 8px; padding: 8px 12px; }
  .brand .bt { display: none; }
  .iconbtn { width: 34px; height: 34px; }
  .coins { padding: 5px 10px; }
}
