:root {
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: #252620;
  background: #eeece5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #eeece5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: wait; opacity: .6; }
main { width: min(760px, 100%); min-height: 100vh; margin: auto; padding: 34px 28px 46px; }
header { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.identity, .auth-brand { display: flex; align-items: center; gap: 13px; }
.mark { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 13px; background: #24251f; color: #f6f3ea; font: 600 18px Georgia, serif; }
h1 { margin: 0; font: 600 22px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.identity p, .auth-brand p { margin: 4px 0 0; color: #77776e; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
h2 { margin: 0; font: 600 22px/1.2 Georgia, serif; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.connection { display: flex; align-items: center; gap: 7px; color: #65665e; font-size: 13px; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #66825c; }
.user-chip { display: flex; align-items: center; gap: 8px; max-width: 190px; border: 1px solid #d5d1c6; border-radius: 999px; padding: 5px 11px 5px 5px; background: #f8f5ed; color: #3b3c36; }
.user-chip > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #dcd4c5; font-weight: 700; }
.user-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-menu { position: absolute; z-index: 20; top: 83px; right: max(calc((100vw - 704px) / 2), 28px); width: 190px; padding: 7px; border: 1px solid #d8d4ca; border-radius: 14px; background: #fbf9f3; box-shadow: 0 16px 50px rgba(42, 39, 31, .18); }
.account-menu button { width: 100%; border: 0; border-radius: 8px; padding: 10px; background: transparent; color: #34352f; text-align: left; }
.account-menu button:hover { background: #eeebe2; }
.assistant-card { position: relative; min-height: 310px; padding: 28px; border-radius: 28px; overflow: hidden; text-align: center; background: #252620; color: #f6f3ea; box-shadow: 0 18px 60px rgba(46, 43, 33, .15); }
.assistant-card::after { content: ""; position: absolute; right: -90px; bottom: -130px; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 48px rgba(255,255,255,.025), 0 0 0 96px rgba(255,255,255,.02); pointer-events: none; }
.eyebrow { color: #aaa99e; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.dark { margin: 0 0 7px; color: #85857d; }
.voice-state { height: 72px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 26px auto 12px; }
.voice-state i { display: block; width: 5px; height: 14px; border-radius: 9px; background: #d3aa75; transition: height .25s ease; }
.voice-state i:nth-child(2), .voice-state i:nth-child(4) { height: 27px; }
.voice-state i:nth-child(3) { height: 44px; }
.voice-state.listening i, .voice-state.speaking i { animation: wave .8s ease-in-out infinite alternate; }
.voice-state.listening i:nth-child(2), .voice-state.speaking i:nth-child(4) { animation-delay: -.4s; }
.voice-state.listening i:nth-child(3), .voice-state.speaking i:nth-child(2) { animation-delay: -.65s; }
.voice-state.thinking i { animation: think 1s ease-in-out infinite; }
#status { min-height: 25px; margin: 0 0 22px; font: 400 19px/1.4 Georgia, serif; }
.listen-button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px; border: 0; border-radius: 999px; padding: 12px 19px; background: #f3eee3; color: #252620; font-weight: 650; }
.listen-button svg, .message-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stop-button { position: relative; z-index: 1; margin-left: 8px; border: 0; padding: 12px 14px; background: transparent; color: #aaa99e; }
.recording-info { position: relative; z-index: 1; width: max-content; margin: 19px auto 0; display: flex; align-items: center; gap: 8px; color: #e8cfc8; font-size: 13px; }
.recording-dot { width: 9px; height: 9px; border-radius: 50%; background: #e66050; box-shadow: 0 0 0 5px rgba(230,96,80,.13); animation: record-pulse 1s ease-in-out infinite; }
#countdown { min-width: 25px; margin-left: 4px; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.assistant-card.recording { outline: 3px solid rgba(230,96,80,.45); outline-offset: -3px; }
.assistant-card.recording .listen-button { background: #e66050; color: #fff; }
.mic-settings { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(150px, 260px); align-items: center; justify-content: center; gap: 5px 10px; margin-top: 20px; color: #aaa99e; font-size: 11px; text-align: left; }
.mic-settings label { letter-spacing: .08em; text-transform: uppercase; }
.mic-settings select { min-width: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 7px 9px; background: #34352e; color: #f4f0e7; font: inherit; }
#mic-result { grid-column: 2; color: #8d8e84; }
#mic-result.good { color: #9fc393; }
#mic-result.bad { color: #e7a69c; }
.conversation-wrap { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 3px 12px; border-bottom: 1px solid #d6d3ca; }
.section-head h2 { font-size: 18px; }
.section-head span { color: #88877f; font-size: 12px; }
#conversation { display: grid; gap: 14px; padding: 20px 0; }
.empty-state { color: #929087; font: 16px/1.5 Georgia, serif; text-align: center; padding: 22px 0; }
.message { max-width: 84%; padding: 13px 16px; border-radius: 5px 17px 17px 17px; background: #faf8f2; color: #31322c; line-height: 1.5; white-space: pre-wrap; box-shadow: 0 3px 12px rgba(55,52,43,.05); }
.message.user { margin-left: auto; border-radius: 17px 5px 17px 17px; background: #dcd4c5; }
.message-form { position: sticky; bottom: 18px; display: flex; gap: 8px; padding: 7px 7px 7px 18px; border: 1px solid #d6d2c6; border-radius: 18px; background: rgba(250,248,242,.94); box-shadow: 0 12px 40px rgba(55,52,43,.12); backdrop-filter: blur(14px); }
.message-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #292a24; }
input::placeholder { color: #96948b; }
.message-form button { width: 43px; height: 43px; display: grid; place-items: center; border: 0; border-radius: 13px; background: #252620; color: #f7f3e9; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: radial-gradient(circle at 50% 15%, #f8f5ed, #e7e3d9 72%); }
.auth-card { width: min(460px, 100%); border: 1px solid rgba(92, 87, 72, .12); border-radius: 26px; padding: 28px; background: rgba(252, 250, 245, .95); box-shadow: 0 24px 80px rgba(49, 45, 34, .14); }
.auth-brand { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid #e2ded4; }
.auth-form { display: grid; gap: 17px; }
.auth-form h2 { margin-bottom: 7px; }
.muted { margin: 0; color: #77776e; line-height: 1.5; }
.auth-form label, .dialog-card label, .inline-form label { display: grid; gap: 7px; color: #5c5c55; font-size: 12px; font-weight: 650; letter-spacing: .03em; }
.auth-form input, .dialog-card input { width: 100%; border: 1px solid #cfcbc0; border-radius: 11px; padding: 12px 13px; outline: 0; background: #fffefa; color: #292a24; font-size: 15px; letter-spacing: normal; }
.auth-form input:focus, .dialog-card input:focus { border-color: #7a776c; box-shadow: 0 0 0 3px rgba(64, 62, 54, .09); }
.primary-button, .secondary-button { min-height: 44px; display: inline-grid; place-items: center; border-radius: 11px; padding: 11px 16px; font-weight: 700; text-decoration: none; }
.primary-button { border: 0; background: #252620; color: #f7f3e9; }
.secondary-button { border: 1px solid #c9c5ba; background: #f7f4eb; color: #33342e; }
.text-button { border: 0; padding: 7px; background: transparent; color: #77776e; }
.form-error { min-height: 18px; margin: -4px 0; color: #a54339; font-size: 13px; line-height: 1.4; }
.field-hint { margin: -7px 0 0; color: #818078; font-size: 12px; }
.totp-setup { display: grid; justify-items: center; gap: 10px; }
.totp-setup .field-hint { max-width: 35em; margin: 0; text-align: center; }
.totp-qr { width: 236px; height: 236px; display: grid; place-items: center; border: 8px solid #fffdf9; border-radius: 12px; background: #fffdf9; box-shadow: 0 5px 18px rgba(45, 42, 34, .12); }
.totp-qr img, .totp-qr canvas, .totp-qr svg { display: block; width: 220px; height: 220px; max-width: 100%; }
.totp-qr:empty { display: none; }
.secret-box { display: grid; gap: 5px; border-radius: 12px; padding: 13px 15px; background: #252620; color: #f8f4ea; }
.secret-box span { color: #aaa99e; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.secret-box strong { overflow-wrap: anywhere; font: 600 15px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .05em; }

dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 40px); border: 0; border-radius: 22px; padding: 0; overflow: auto; background: #fbf9f3; color: #292a24; box-shadow: 0 30px 100px rgba(28, 26, 21, .32); }
dialog::backdrop { background: rgba(35, 34, 29, .47); backdrop-filter: blur(5px); }
.dialog-card { display: grid; gap: 17px; margin: 0; padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid #dedad0; }
.close-dialog { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ebe7dd; color: #44453f; font-size: 25px; line-height: 1; }
#recovery-codes { margin: 0; border-radius: 12px; padding: 17px; background: #252620; color: #f5efe1; font: 600 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; user-select: all; }
.admin-dialog-card { min-width: min(760px, calc(100vw - 28px)); }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.temporary-password { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; border: 1px solid #c8a875; border-radius: 12px; padding: 13px; background: #fff5e3; }
.temporary-password span { grid-column: 1 / -1; color: #806232; font-size: 12px; }
.temporary-password strong { align-self: center; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.temporary-password button, .row-actions button { border: 1px solid #cac6bc; border-radius: 8px; padding: 7px 9px; background: #f8f5ed; color: #474842; font-size: 12px; }
.user-list { display: grid; gap: 9px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #dedad0; border-radius: 12px; padding: 13px; }
.user-row > div:first-child { display: grid; gap: 4px; }
.user-row span { color: #77776e; font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

@keyframes wave { to { height: 58px; } }
@keyframes think { 50% { opacity: .3; transform: translateY(-5px); } }
@keyframes record-pulse { 50% { opacity: .45; transform: scale(.8); } }
@media (max-width: 620px) {
  main { padding: 22px 16px 30px; }
  .assistant-card { min-height: 295px; padding: 24px 16px; border-radius: 23px; }
  .connection, #user-name { display: none; }
  .user-chip { padding-right: 5px; }
  .account-menu { top: 72px; right: 16px; }
  .message { max-width: 92%; }
  .mic-settings { grid-template-columns: 1fr; text-align: center; }
  #mic-result { grid-column: 1; }
  .auth-card { padding: 23px 19px; }
  .inline-form { grid-template-columns: 1fr; }
  .user-row { align-items: flex-start; flex-direction: column; }
  .row-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
