@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@700&family=Fredoka:wght@700&display=swap');
:root {
  --bg: #0f1222;
  --panel: rgba(24, 28, 51, 0.72);
  --line: #2a3054;
  --text: #f2f3fa;
  --muted: #9aa0c3;
  --accent: #7c5cff;
  --accent-2: #2fd3a6;
  --warn: #ffb547;
  --danger: #ff5c7a;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }
.brand { font-weight: 800; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: .35em; }

/* The hybrED logo (artwork in /brand: dark-bg for our dark screens, light-bg
   for white backgrounds). Sized by the surrounding font size. */
.logo { height: 1.2em; width: auto; display: block; filter: drop-shadow(0 0 .35em rgba(165,125,217,.35)); }
a.brand { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 14px;
}
.btn {
  display: inline-block; text-align: center; text-decoration: none;
  padding: 14px 20px; border-radius: 14px;
  background: var(--accent); color: white; font-weight: 700;
}
.btn.ghost { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.card, .msg, .chip, .caption, .steps li { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.crisis { border-color: var(--danger); background: #2a1420; }
.crisis a { color: white; font-weight: 700; }

/* Icons */
svg.lucide, .ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.badge {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; color: white;
  background: linear-gradient(145deg, var(--a), var(--b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 6px rgba(0,0,0,.2), 0 8px 22px -6px var(--a);
}
.badge svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.badge.sm { width: 34px; height: 34px; border-radius: 11px; }
.badge.sm svg { width: 19px; height: 19px; }
.badge.lg { width: 96px; height: 96px; border-radius: 28px; }
.badge.lg svg { width: 50px; height: 50px; }
.avatar { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--c); color: #0b0d1c; flex: none; }
.avatar svg { width: 62%; height: 62%; }

/* Worked examples from Dash */
.example { font-size: 16px; line-height: 1.5; }
.example h3 { margin: 0 0 8px; font-size: 17px; color: #c9b6ff; }
.example ol, .example ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.example p { margin: 8px 0 0; }
.example strong { color: var(--accent-2); }
.example .katex { font-size: 1.12em; }
.exampleCard { align-self: stretch; border-radius: 18px; padding: 14px 16px; background: linear-gradient(160deg, rgba(124,92,255,.22), rgba(47,211,166,.10)); border: 1px solid rgba(165,140,255,.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: exIn .4s ease both; }
.exampleCard .exLabel { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c9b6ff; margin-bottom: 8px; }
@keyframes exIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.msg.photo { padding: 6px; }
.msg.photo img { display: block; max-width: 210px; max-height: 260px; border-radius: 12px; }

/* Glass: frosted and see-through with a soft top shine, shared by buttons,
   tiles and chat bubbles. Set --tint (any color) to tint the glass. */
.glass {
  position: relative; isolation: isolate;
  background:
    linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.04) 60%),
    var(--tint, transparent);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), inset 0 -10px 20px -14px rgba(255,255,255,.25), 0 10px 26px -14px rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.glass::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 60%; z-index: -1;
  border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.17), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
/* Glossy icon squares */
.badge { position: relative; overflow: hidden; }
.badge::after { content: ""; position: absolute; inset: 0 0 52%; background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.04)); border-radius: inherit; border-bottom-left-radius: 50% 18%; border-bottom-right-radius: 50% 18%; pointer-events: none; }
