:root { color: #171717; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #f6f6f6; }
button, textarea, input { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell { width: min(100%, 620px); height: 100dvh; margin: auto; background: #fff; position: relative; overflow: hidden; }
.view { height: 100%; padding-bottom: 74px; }
.coach-view { display: flex; flex-direction: column; }
.topbar, .profile-header { height: 62px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(255,255,255,.96); flex: none; }
.icon-button { width: 38px; height: 38px; background: none; font-size: 25px; color: #1f1f1f; }
.model-title { background: none; font-weight: 650; font-size: 16px; }
.model-title span { color: #777; padding-left: 4px; }
.conversation { flex: 1; min-height: 0; overflow: auto; }
.welcome { min-height: 100%; padding: 110px 28px 40px; display: flex; align-items: center; flex-direction: column; }
.brand-mark, .assistant-mark { display: grid; place-items: center; background: #111; color: #fff; font-weight: 700; }
.brand-mark { width: 58px; height: 58px; border-radius: 16px; font-size: 18px; margin-bottom: 24px; }
.welcome h1 { font-size: 24px; margin: 0 0 10px; }
.welcome p { color: #6e6e73; font-size: 14px; line-height: 1.65; text-align: center; max-width: 420px; margin: 0; }
.starter-list { width: min(100%, 460px); display: grid; gap: 10px; margin-top: 40px; }
.starter-list button { background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 14px 16px; text-align: left; color: #242424; }
.message-list { padding: 24px 22px; }
.message-row { display: flex; gap: 12px; margin: 0 0 25px; align-items: flex-start; }
.message-row.user { justify-content: flex-end; }
.assistant-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; flex: none; }
.message-bubble { max-width: 82%; white-space: pre-wrap; line-height: 1.7; font-size: 15px; overflow-wrap: anywhere; }
.user .message-bubble { background: #f1f1f1; border-radius: 18px 18px 6px 18px; padding: 10px 14px; }
.message-image { display: block; width: min(240px, 64vw); max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.composer-area { padding: 6px 16px 12px; flex: none; }
.attachment-preview { width: 72px; height: 72px; position: relative; margin: 5px 0 7px 8px; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }
.attachment-preview button { position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; border-radius: 50%; padding: 0; background: #222; color: #fff; line-height: 20px; }
.usage-line, .composer-area small { display: block; text-align: center; color: #999; font-size: 11px; }
.composer { display: flex; align-items: center; gap: 7px; border: 1px solid #d2d2d2; border-radius: 26px; padding: 6px 7px; margin: 5px 0 7px; box-shadow: 0 2px 12px #0000000d; }
.attach-button, .send-button { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.attach-button { background: none; font-size: 23px; line-height: 34px; transform: translateY(-1px); }
.send-button { background: #dedede; color: white; font-size: 22px; font-weight: 700; }
.send-button.active { background: #111; }
textarea { border: 0; outline: 0; resize: none; min-height: 34px; max-height: 120px; flex: 1; padding: 8px 0; line-height: 1.4; }
.profile-view { overflow: auto; background: #f6f6f6; }
.profile-header { justify-content: flex-start; background: #fff; }
.profile-header h1 { font-size: 20px; margin: 0; }
.account-section { background: #fff; padding: 30px 20px 26px; text-align: center; }
.avatar-picker { display: block; width: 100px; height: 100px; border-radius: 50%; background: #171717; color: #fff; position: relative; margin: auto; cursor: pointer; overflow: visible; }
.avatar-picker img, #avatarFallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 37px; font-weight: 650; }
.avatar-picker b { position: absolute; right: -2px; bottom: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #222; font-size: 18px; }
.nickname-input { display: block; width: 240px; margin: 16px auto 4px; text-align: center; border: 0; outline: 0; font-size: 20px; font-weight: 650; }
.account-section p { color: #999; font-size: 12px; margin: 0; }
.usage-band { background: #fff; margin-top: 12px; display: flex; align-items: center; padding: 22px 0; }
.usage-band > div { flex: 1; text-align: center; display: grid; gap: 4px; }
.usage-band strong { font-size: 28px; }.usage-band span { color: #777; font-size: 12px; }.usage-band i { width: 1px; height: 42px; background: #e5e5e5; }
.profile-section { margin-top: 20px; }.profile-section > label { display: block; color: #777; font-size: 13px; padding: 0 20px 9px; }
.invite-panel { background: #fff; padding: 23px 20px; }.invite-panel h2 { font-size: 17px; margin: 0; }.invite-panel p { color: #6d6d6d; line-height: 1.55; font-size: 13px; margin: 9px 0 17px; }
.primary-button { width: 100%; height: 43px; border-radius: 7px; color: #fff; background: #111; font-weight: 600; }
.invite-code { border-top: 1px solid #eee; margin-top: 15px; padding-top: 14px; color: #777; font-size: 13px; display: flex; justify-content: space-between; }.invite-code button { background: none; color: #198754; }.invite-code b { color: #222; margin-right: 12px; }
.menu-section { background: #fff; margin-top: 20px; }.menu-section button { width: 100%; background: #fff; text-align: left; border-bottom: 1px solid #eee; padding: 17px 20px; color: #444; }.menu-section span { color: #222; margin-left: 14px; }.menu-section b { float: right; color: #aaa; font-size: 24px; font-weight: 300; line-height: 14px; }.version { display: block; color: #aaa; font-size: 11px; text-align: center; padding: 30px 0; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid #eee; }.tabbar button { flex: 1; background: #fff; color: #8e8e93; font-size: 11px; display: grid; place-content: center; gap: 4px; }.tabbar span { font-size: 20px; line-height: 1; }.tabbar .active { color: #111; font-weight: 650; }
.drawer-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.32); }
.history-drawer { position: absolute; z-index: 21; inset: 0 auto 0 0; width: min(84%, 360px); padding: max(18px, env(safe-area-inset-top)) 14px 18px; background: #f7f7f7; box-shadow: 8px 0 30px rgba(0,0,0,.12); overflow: auto; }
.history-drawer header { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 15px; }.history-drawer h2 { margin: 0; font-size: 19px; }.history-drawer header button { background: none; font-size: 27px; color: #555; }
.drawer-new-chat { width: 100%; padding: 12px 13px; border: 1px solid #ddd; border-radius: 9px; background: #fff; text-align: left; font-weight: 600; }
.history-list { margin-top: 16px; display: grid; gap: 5px; }.history-item { width: 100%; padding: 11px 12px; border-radius: 8px; background: transparent; color: #333; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.history-item:hover, .history-item.active { background: #e8e8e8; }
.resources-view { overflow: auto; background: #f6f6f6; }
.resources-intro { margin: 12px 0 0; padding: 40px 24px 34px; background: #fff; text-align: center; }
.resources-mark { width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 15px; background: #111; color: #fff; font-size: 24px; }
.resources-intro h2 { margin: 0; font-size: 20px; }.resources-intro p { max-width: 360px; margin: 10px auto 20px; color: #777; font-size: 13px; line-height: 1.6; }
.resource-upload { display: inline-block; padding: 11px 22px; border-radius: 8px; background: #111; color: #fff; font-size: 14px; cursor: pointer; }
.resource-list { padding: 20px 16px; }.resource-empty { color: #999; text-align: center; font-size: 13px; }.resource-item { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 8px; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; }.resource-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #f0f0f0; font-size: 12px; font-weight: 650; }.resource-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }.resource-size { margin-left: auto; color: #999; font-size: 11px; }.resource-open { color: #666; font-size: 12px; white-space: nowrap; }
@media (min-width: 700px) { body { padding: 22px 0; }.app-shell { height: calc(100dvh - 44px); border-radius: 16px; box-shadow: 0 8px 40px #00000012; } }
/* Email authentication */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f7f7f5; }
.auth-panel { width: min(100%, 420px); padding: 34px; background: #fff; border: 1px solid #e4e4e1; border-radius: 12px; box-shadow: 0 18px 50px rgba(24, 24, 20, .08); }
.auth-panel h1 { margin: 18px 0 8px; font-size: 25px; }
.auth-panel > p { margin: 0 0 24px; color: #6f716b; line-height: 1.6; font-size: 14px; }
.auth-panel label { display: grid; gap: 8px; margin: 14px 0; color: #4b4d48; font-size: 13px; }
.auth-panel input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1px solid #d7d9d3; border-radius: 8px; font: inherit; color: #20211e; background: #fff; }
.auth-panel input:focus { outline: 2px solid rgba(39, 96, 74, .2); border-color: #27604a; }
.auth-panel .primary-button { width: 100%; margin-top: 8px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 18px; border-radius: 9px; background: #f0f1ed; }
.auth-tabs button { border: 0; border-radius: 7px; padding: 9px; background: transparent; color: #777; cursor: pointer; font: inherit; }
.auth-tabs button.active { background: #fff; color: #20211e; box-shadow: 0 1px 4px rgba(24, 24, 20, .1); }
.text-button { display: block; margin: 14px auto 0; padding: 4px; border: 0; background: transparent; color: #27604a; cursor: pointer; }
.auth-panel .form-error { min-height: 20px; margin-top: 14px; color: #a63c32; font-size: 13px; }
.account-email { margin: 7px 0 0; color: #6f716b; font-size: 13px; }
