/* Jen - family look of JC's systems: dark blue #1e3a5f, white cards, light page. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #eef1f5; color: #17222e; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #1e3a5f; color: #fff; }
.top-logo { height: 38px; width: auto; border-radius: 6px; background: #fff; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .name { font-size: 19px; font-weight: 700; }
.topbar .sub { font-size: 12.5px; color: #b9c9dd; }
.icon-btn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; width: 42px; height: 42px; font-size: 19px; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; flex: none; }
.icon-btn.off { opacity: .45; }

.gate-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 34px 14px; }
.card { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(23,34,46,.10); padding: 20px; }
.card.gate { width: 100%; max-width: 420px; }
.gate-logo { display: block; max-width: 190px; margin: 0 auto 10px; }
.card h1 { text-align: center; color: #1e3a5f; font-size: 26px; margin-bottom: 6px; }
.card h2 { color: #1e3a5f; font-size: 18px; margin-bottom: 8px; }
.muted { color: #5a6a7d; font-size: 14px; line-height: 1.45; }
.gate .muted { text-align: center; margin-bottom: 14px; }
.ok { color: #15803d; font-weight: 700; }
.warn { color: #b45309; font-weight: 700; }

label { display: block; font-size: 13.5px; font-weight: 600; color: #33475e; margin: 13px 0 5px; }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin-top: 15px; }
label.check input { width: 20px; height: 20px; accent-color: #1e3a5f; flex: none; }
input[type=text], input[type=password], select, textarea { width: 100%; border: 1px solid #c4cedb; border-radius: 10px; font-size: 16px; padding: 10px 12px; background: #fff; color: #17222e; font-family: inherit; }
textarea { line-height: 1.4; resize: vertical; }
.btn { background: #e4eaf2; color: #1e3a5f; border: 0; border-radius: 10px; padding: 11px 16px; font-size: 15.5px; font-weight: 600; cursor: pointer; }
.btn.primary { background: #1e3a5f; color: #fff; }
.btn.danger { background: #fdecec; color: #b91c1c; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.big { width: 100%; margin-top: 18px; padding: 13px; font-size: 16.5px; }
.btnrow { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.card form .btn.primary { margin-top: 16px; }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 15px; margin-bottom: 12px; }
.alert.error { background: #fdecec; color: #b91c1c; border: 1px solid #f3b4b4; font-weight: 600; }
.alert.success { background: #e7f6ec; color: #166534; border: 1px solid #a9dcbb; }

.page { padding: 14px; display: flex; flex-direction: column; gap: 14px; max-width: 680px; width: 100%; margin: 0 auto; }

.convbar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #dde5ee; }
.convbar select { flex: 1; min-width: 0; padding: 8px 10px; font-size: 14.5px; }

#chat { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; }
.row.me { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.row.her .bubble { background: #fff; border: 1px solid #d3dce8; border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(23,34,46,.06); }
.row.me .bubble { background: #1e3a5f; color: #fff; border-bottom-right-radius: 6px; }
.bubble.thinking { color: #5a6a7d; font-style: italic; }

#bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #d3dce8; display: flex; gap: 8px; align-items: flex-end; }
#text { flex: 1; border: 1px solid #c4cedb; border-radius: 14px; font-size: 16px; padding: 11px 13px; max-height: 110px; resize: none; }
#bar button { border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 21px; cursor: pointer; flex: none; }
#mic { background: #e4eaf2; }
#mic.listening { background: #dc2626; color: #fff; animation: pulse 1.1s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
#send { background: #1e3a5f; color: #fff; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #17222e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; max-width: 88%; text-align: center; display: none; z-index: 60; }
