:root{--ink:#17212b;--muted:#667582;--line:#e3e8ec;--soft:#f5f7f8;--white:#fff;--accent:#7a5334;--accent2:#222e37;--danger:#a33737;--ok:#24704b;--warn:#8a6415;--shadow:0 16px 42px rgba(20,32,42,.08)}
*{box-sizing:border-box}html,body{margin:0;padding:0;background:#f7f8f9;color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}a{color:inherit}.topbar{height:66px;background:#1e2931;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:10}.brand{font-family:Georgia,serif;font-size:20px;letter-spacing:.01em}.brand small{font-family:inherit;font-size:10px;color:#c8b09a;text-transform:uppercase;letter-spacing:.14em;margin-left:9px}.topbar .user{font-size:13px;color:#d8dee2}.shell{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 66px)}.sidebar{background:#fff;border-right:1px solid var(--line);padding:22px 14px}.sidebar a{display:block;text-decoration:none;padding:10px 12px;border-radius:8px;font-size:14px;color:#34434e;margin-bottom:4px}.sidebar a.active,.sidebar a:hover{background:#f0ece8;color:#5e402c}.main{padding:30px;max-width:1320px;width:100%}.hero{background:linear-gradient(135deg,#efe8e1,#f9f7f5);padding:28px;border:1px solid #e5ddd5;border-radius:14px;margin-bottom:22px}.hero h1{font-family:Georgia,serif;font-weight:400;font-size:34px;margin:0 0 8px}.hero p{margin:0;color:#5c6973;max-width:850px;line-height:1.6}.grid{display:grid;gap:18px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;box-shadow:var(--shadow)}.card h2,.card h3{margin:0 0 10px}.card h2{font-family:Georgia,serif;font-weight:400}.muted{color:var(--muted)}.notice{padding:13px 15px;border-radius:9px;background:#fff5dd;border:1px solid #ead59f;color:#6b541b;font-size:13px;line-height:1.5;margin:0 0 18px}.flash{padding:12px 14px;border-radius:8px;margin-bottom:14px}.flash.success{background:#e9f5ee;color:#235e40}.flash.error{background:#fdecec;color:#8b3030}.flash.info{background:#eaf2f8;color:#31556e}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;min-height:42px;padding:10px 16px;background:var(--accent2);color:#fff;text-decoration:none;font-weight:700;font-size:13px;cursor:pointer}.btn.secondary{background:#fff;color:#35434d;border:1px solid #ccd5db}.btn.accent{background:var(--accent)}.btn.danger{background:var(--danger)}.actions{display:flex;gap:9px;flex-wrap:wrap}.field{margin-bottom:15px}.field label{display:block;font-size:12px;font-weight:800;color:#3f4d57;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;border:1px solid #ccd5db;border-radius:8px;background:#fff;padding:11px 12px;font:inherit;color:var(--ink)}.field textarea{min-height:150px;resize:vertical}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 20%,#efe5dc,transparent 34%),#f5f7f8}.login-card{width:min(460px,100%);background:#fff;border:1px solid var(--line);border-radius:16px;padding:30px;box-shadow:0 28px 70px rgba(20,32,42,.13)}.login-card h1{font-family:Georgia,serif;font-weight:400;margin:0 0 5px}.login-card p{color:var(--muted);line-height:1.55}.matter-list{display:grid;gap:10px}.matter{display:block;text-decoration:none;border:1px solid var(--line);border-radius:9px;padding:14px;background:#fff}.matter:hover{border-color:#b6c1c9}.matter strong{display:block;margin-bottom:4px}.badges{display:flex;gap:7px;flex-wrap:wrap}.badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:#edf1f3;font-size:11px;color:#52616c}.badge.role{background:#efe8e1;color:#6d4a30}.chat{display:grid;gap:12px;margin-bottom:18px}.bubble{max-width:88%;padding:14px 16px;border-radius:12px;line-height:1.6;white-space:pre-wrap}.bubble.user{justify-self:end;background:#24323c;color:#fff;border-bottom-right-radius:3px}.bubble.assistant{justify-self:start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:3px}.feedback-box{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px}.stat strong{display:block;font-size:28px;font-family:Georgia,serif;font-weight:400}.stat span{font-size:12px;color:var(--muted)}table{width:100%;border-collapse:collapse;font-size:13px}th,td{text-align:left;padding:10px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#64727d}.status-active{color:var(--ok)}.status-pending{color:var(--warn)}.small{font-size:12px}.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:#f4f6f7;padding:2px 5px;border-radius:4px}.empty{padding:28px;text-align:center;color:var(--muted);border:1px dashed #cbd4da;border-radius:10px;background:#fafbfb}@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{display:flex;overflow:auto;border-right:0;border-bottom:1px solid var(--line);padding:10px}.sidebar a{white-space:nowrap;margin:0 4px 0 0}.main{padding:18px}.grid.two,.grid.three{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}.topbar{padding:0 16px}.brand small{display:none}}

/* Logged-in voice intake */
.voice-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:-6px;margin-bottom:15px}.voice-btn{background:#fff;color:#6b4933;border:1px solid #cdb9aa;min-height:40px}.voice-btn:hover{background:#f7f1ed}.voice-btn.recording{background:#8b3a32;color:#fff;border-color:#8b3a32}.voice-btn.recording::before{content:'●';margin-right:7px}.voice-btn.voice-unavailable{opacity:.58}.voice-note{font-size:12px;color:var(--muted)}.assistant-tools{margin-top:8px}.speak-btn{background:transparent;border:0;padding:3px 0;color:#6b4933;font:inherit;font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.bubble-wrap{display:grid;justify-items:start}.bubble-wrap.user{justify-items:end}.bubble-wrap .bubble{max-width:100%}

/* V3.2 public voice-first experience */
.public-voice-page{background:#fbfaf8;min-height:100vh}.voice-app{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(circle at 50% 28%,rgba(221,208,195,.42),transparent 32%),#fbfaf8}.voice-brandbar{height:66px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;max-width:1180px;width:100%;margin:0 auto}.voice-brand{text-decoration:none;font-family:Georgia,serif;font-size:21px;color:#1f2b33}.voice-brand small{font-family:ui-sans-serif,system-ui,sans-serif;font-size:9px;text-transform:uppercase;letter-spacing:.16em;color:#927357;margin-left:7px}.staff-link{text-decoration:none;font-size:12px;color:#7b858c;opacity:.78}.staff-link:hover{opacity:1}.voice-main{width:min(820px,calc(100% - 32px));margin:0 auto;flex:1;display:flex;flex-direction:column;align-items:center;padding:7vh 0 34px}.voice-welcome{text-align:center;width:100%;transition:all .35s ease}.voice-welcome h1{font-family:Georgia,serif;font-weight:400;font-size:clamp(42px,7vw,72px);line-height:1.04;margin:0;color:#202a31;letter-spacing:-.025em}.voice-welcome p{font-size:17px;line-height:1.6;color:#66727a;margin:18px auto 28px;max-width:520px}.voice-orb{width:112px;height:112px;border-radius:999px;border:0;background:#263640;box-shadow:0 18px 46px rgba(38,54,64,.24),inset 0 0 0 1px rgba(255,255,255,.12);display:grid;place-items:center;margin:0 auto;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,background .18s ease}.voice-orb:hover{transform:translateY(-2px);box-shadow:0 22px 50px rgba(38,54,64,.29),inset 0 0 0 1px rgba(255,255,255,.14)}.voice-orb:disabled{opacity:.55;cursor:default;transform:none}.voice-orb svg{width:46px;height:46px;fill:#fff}.voice-orb.listening{background:#8b443d;animation:voicePulse 1.5s infinite}.voice-orb.listening svg{transform:scale(1.04)}.voice-orb.unsupported{opacity:.42}.voice-status{min-height:22px;margin-top:16px;color:#6d777d;font-size:14px}.live-transcript{margin:18px auto 4px;max-width:680px;padding:14px 18px;border-radius:14px;background:rgba(255,255,255,.78);border:1px solid #e7e0da;color:#334047;line-height:1.55;font-size:15px;box-shadow:0 8px 28px rgba(39,49,56,.06)}.keyboard-link{border:0;background:transparent;color:#8a6d58;text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:12px;cursor:pointer;margin-top:12px}.guest-type-form{width:min(620px,100%);display:flex;gap:9px;margin:12px auto 0}.guest-type-form[hidden]{display:none}.guest-type-form textarea{flex:1;min-height:86px;resize:vertical;border:1px solid #d8d2cd;background:#fff;border-radius:14px;padding:13px 15px;font:inherit;color:#26333b;outline:none}.guest-type-form textarea:focus{border-color:#9d8877;box-shadow:0 0 0 3px rgba(157,136,119,.12)}.voice-send{align-self:flex-end;min-height:44px;border:0;border-radius:10px;background:#263640;color:#fff;padding:0 18px;font-weight:700;cursor:pointer}.voice-conversation{width:100%;display:grid;gap:18px;margin-top:10px}.voice-message{display:grid;gap:6px;max-width:88%}.voice-message.user{justify-self:end}.voice-message.assistant{justify-self:start}.voice-message-label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#8a9398}.voice-message.user .voice-message-label{text-align:right}.voice-message-bubble{white-space:pre-wrap;line-height:1.65;padding:15px 18px;border-radius:18px;background:#fff;border:1px solid #e5e0dc;box-shadow:0 10px 30px rgba(36,45,51,.055);font-size:15px;color:#27343b}.voice-message.user .voice-message-bubble{background:#263640;color:#fff;border-color:#263640;border-bottom-right-radius:5px}.voice-message.assistant .voice-message-bubble{border-bottom-left-radius:5px}.voice-thinking{display:flex;gap:6px;align-self:flex-start;background:#fff;border:1px solid #e5e0dc;padding:14px 18px;border-radius:18px;margin-top:16px}.voice-thinking[hidden]{display:none}.voice-thinking span{width:7px;height:7px;border-radius:50%;background:#8b979e;animation:dotBounce 1.2s infinite}.voice-thinking span:nth-child(2){animation-delay:.15s}.voice-thinking span:nth-child(3){animation-delay:.3s}.voice-followup{display:flex;align-items:center;gap:12px;margin-top:24px;align-self:center;color:#5f6a70;font-size:13px}.voice-followup[hidden]{display:none}.small-orb{width:62px;height:62px;margin:0}.small-orb svg{width:27px;height:27px}.voice-privacy{margin-top:auto;padding-top:34px;max-width:680px;text-align:center;font-size:11px;line-height:1.55;color:#93999d}.voice-app.engaged .voice-main{padding-top:24px}.voice-app.engaged .voice-welcome.compact h1{font-size:25px;letter-spacing:0}.voice-app.engaged .voice-welcome.compact>p,.voice-app.engaged .voice-welcome.compact>#public-mic,.voice-app.engaged .voice-welcome.compact>.voice-status,.voice-app.engaged .voice-welcome.compact>.keyboard-link,.voice-app.engaged .voice-welcome.compact>.guest-type-form{display:none}.voice-app.engaged .voice-welcome.compact{margin-bottom:8px}@keyframes voicePulse{0%,100%{box-shadow:0 18px 46px rgba(139,68,61,.28),0 0 0 0 rgba(139,68,61,.18)}50%{box-shadow:0 18px 46px rgba(139,68,61,.32),0 0 0 14px rgba(139,68,61,0)}}@keyframes dotBounce{0%,60%,100%{transform:translateY(0);opacity:.55}30%{transform:translateY(-4px);opacity:1}}@media(max-width:640px){.voice-brandbar{padding:0 18px}.voice-main{width:calc(100% - 28px);padding-top:8vh}.voice-welcome h1{font-size:48px}.voice-welcome p{font-size:15px;margin-top:14px}.voice-orb{width:100px;height:100px}.voice-message{max-width:94%}.guest-type-form{flex-direction:column}.voice-send{align-self:stretch}.voice-privacy{padding-top:26px}.staff-link{font-size:11px}}


/* V3.4 natural voice controls */
.ai-voice-disclosure{font-size:.82rem;opacity:.62;margin-top:-2px}
.voice-select{width:100%;padding:11px 12px;border:1px solid #c8d0d5;border-radius:10px;background:#fff;font:inherit}
.voice-settings-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.voice-settings-actions .secondary{background:#eef2f4;color:#24323c}

/* V3.5 automatic spoken conversation */
.voice-app.speaking .voice-orb,
.voice-app.voice-preparing .voice-orb { box-shadow: 0 0 0 10px rgba(31, 41, 55, .06), 0 16px 44px rgba(31, 41, 55, .18); }
.voice-app.speaking .voice-status { font-weight: 700; }
.voice-message-actions { margin-top: 8px; }
.voice-replay {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font: inherit;
  font-size: .86rem;
  text-decoration: underline;
  cursor: pointer;
  opacity: .72;
}
.voice-replay:hover, .voice-replay:focus-visible { opacity: 1; }

/* V3.7 Realtime hands-free voice */
.realtime-public-page{background:#fbfaf8;min-height:100vh}
.realtime-app{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(circle at 50% 24%,rgba(221,208,195,.42),transparent 34%),#fbfaf8}
.realtime-main{width:min(820px,calc(100% - 36px));margin:0 auto;min-height:calc(100vh - 66px);display:flex;flex-direction:column;align-items:center;padding:8vh 0 26px}
.realtime-hero{text-align:center;width:100%;transition:.25s ease}
.realtime-hero h1{font-family:Georgia,serif;font-size:clamp(42px,7vw,72px);line-height:1.02;font-weight:400;letter-spacing:-.035em;margin:0;color:#202d35}
.realtime-subtitle{max-width:620px;margin:18px auto 8px;color:#66747c;font-size:17px;line-height:1.6}
.realtime-start{margin-top:30px;transition:transform .2s ease,box-shadow .2s ease,opacity .2s ease}
.realtime-start.connecting{animation:rtPulse 1.25s infinite;opacity:.82}
.realtime-status{margin-top:15px;color:#58666f;font-size:13px;min-height:20px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.72);border:1px solid rgba(216,216,213,.9);transition:.2s ease}.realtime-status[data-mode="speaking"]{color:#6d4a2f;background:#fff9f4}.realtime-status[data-mode="thinking"]{color:#655647;background:#faf7f1}.realtime-status[data-mode="listening"]{color:#36505f;background:#f6fafb}
.realtime-live-indicator{display:inline-flex;align-items:center;gap:7px;margin-top:12px;padding:7px 11px;border:1px solid #e0dedb;background:rgba(255,255,255,.78);border-radius:999px;font-size:12px;color:#54616a}
.realtime-live-indicator[hidden]{display:none}
.live-dot{width:8px;height:8px;border-radius:50%;background:#3d7a57;box-shadow:0 0 0 4px rgba(61,122,87,.10)}
.realtime-hero.connected h1{font-size:clamp(28px,4vw,40px);letter-spacing:-.02em}
.realtime-hero.connected .realtime-subtitle,.realtime-hero.connected .ai-voice-disclosure{display:none}
.realtime-conversation{width:min(680px,100%);margin-top:26px;display:flex;flex-direction:column;align-items:center}
.realtime-conversation[hidden]{display:none}
.realtime-presence{display:flex;align-items:center;gap:17px;min-height:96px;padding:16px 20px;background:rgba(255,255,255,.84);border:1px solid #e3e0dc;border-radius:22px;box-shadow:0 18px 50px rgba(26,37,45,.07);width:min(520px,100%)}
.presence-ring{width:62px;height:62px;border-radius:50%;display:grid;place-items:center;position:relative;background:#26343d;flex:0 0 62px;box-shadow:0 8px 22px rgba(31,43,51,.15)}
.presence-ring span{position:absolute;width:5px;border-radius:99px;background:#fff;opacity:.92;animation:rtBars 1.15s ease-in-out infinite}
.presence-ring span:nth-child(1){height:14px;left:18px;animation-delay:-.15s}
.presence-ring span:nth-child(2){height:27px;left:29px}
.presence-ring span:nth-child(3){height:18px;left:40px;animation-delay:-.32s}
.presence-copy{display:flex;flex-direction:column;gap:4px;text-align:left}
.presence-copy strong{font-family:Georgia,serif;font-weight:400;font-size:21px;color:#26343d}
.presence-copy span{font-size:13px;color:#6f7b82;line-height:1.45}
.state-thinking .presence-ring,.state-verifying .presence-ring{background:#6c5948}
.state-finishing .presence-ring{background:#8a684e}.state-finishing .presence-ring span{animation-duration:.8s;opacity:.72}
.state-speaking .presence-ring{background:#7a5334}
.state-speaking .presence-ring span{animation-duration:.58s}
.state-listening .presence-ring{box-shadow:0 8px 22px rgba(31,43,51,.15),0 0 0 8px rgba(38,52,61,.05)}
.realtime-caption{margin:24px auto 0;min-height:58px;width:min(640px,100%);text-align:center;font-size:18px;line-height:1.55;color:#303e47;padding:0 12px}
.realtime-caption.user-caption{color:#5d6870}
.realtime-caption.assistant-caption{color:#26343d;font-weight:550}
.realtime-controls{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:25px}
.end-conversation,.transcript-toggle,.realtime-fallback button{border:1px solid #d4d7d8;background:#fff;color:#4d5961;border-radius:999px;padding:9px 14px;font:inherit;font-size:12px;cursor:pointer}
.end-conversation:hover,.transcript-toggle:hover,.realtime-fallback button:hover{border-color:#aeb6ba;color:#26343d}
.realtime-transcript{width:min(680px,100%);margin-top:20px;border-top:1px solid #e3e3e1;padding-top:14px;max-height:280px;overflow:auto}
.realtime-transcript[hidden]{display:none}
.rt-transcript-row{display:grid;grid-template-columns:105px 1fr;gap:12px;padding:9px 5px;font-size:12px;line-height:1.55;border-bottom:1px solid #eeeeec;text-align:left}
.rt-transcript-row strong{color:#56626a}.rt-transcript-row span{color:#727b81}
.realtime-fallback{width:min(560px,100%);margin-top:22px;text-align:center;background:#fff4ee;border:1px solid #ead4c7;border-radius:14px;padding:16px;color:#744b38}
.realtime-fallback[hidden]{display:none}
.realtime-fallback p{margin:0 0 12px;line-height:1.5;font-size:13px}
.realtime-audio{display:none}
@keyframes rtPulse{0%,100%{transform:scale(1);box-shadow:0 18px 46px rgba(139,68,61,.26),0 0 0 0 rgba(139,68,61,.14)}50%{transform:scale(1.025);box-shadow:0 18px 46px rgba(139,68,61,.30),0 0 0 15px rgba(139,68,61,0)}}
@keyframes rtBars{0%,100%{transform:scaleY(.72)}50%{transform:scaleY(1.18)}}
@media(max-width:640px){.realtime-main{width:calc(100% - 28px);padding-top:7vh}.realtime-subtitle{font-size:15px}.realtime-presence{padding:14px 16px}.presence-ring{width:54px;height:54px;flex-basis:54px}.presence-copy strong{font-size:19px}.realtime-caption{font-size:16px}.rt-transcript-row{grid-template-columns:82px 1fr}}

/* Learning Center */
.learning-transcript{max-height:720px;overflow:auto;padding-right:4px}
.review-note{padding:14px 0;border-top:1px solid rgba(24,42,52,.10)}
.review-note:first-child{border-top:0}
.checkline{display:flex;gap:10px;align-items:flex-start;margin:14px 0 18px;font-size:.94rem;line-height:1.45}
.checkline input{margin-top:3px}

/* V4.1 verified memory */
.link-button{border:0;background:transparent;padding:0;cursor:pointer;font:inherit}
.memory-saved-chip{display:inline-flex;margin-top:10px;padding:6px 10px;border-radius:999px;background:#edf6f0;color:#2b6849;border:1px solid #d5e9dd;font-size:11px}
.memory-panel{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px;background:rgba(20,30,37,.36);backdrop-filter:blur(4px)}
.memory-panel[hidden]{display:none}
.memory-card{position:relative;width:min(470px,100%);background:#fff;border:1px solid #e1e5e7;border-radius:18px;padding:26px;box-shadow:0 30px 90px rgba(20,31,39,.22);text-align:left}
.memory-card h2{font-family:Georgia,serif;font-weight:400;margin:0 32px 8px;font-size:25px}
.memory-card p{margin:0 0 18px;color:#6b777e;line-height:1.5;font-size:13px}
.memory-card label{display:block;font-size:12px;font-weight:800;margin-bottom:7px;color:#43505a}
.memory-inline{display:flex;gap:8px}
.memory-inline input{flex:1;min-width:0;border:1px solid #cdd5da;border-radius:10px;padding:12px 13px;font:inherit}
.memory-inline button{border:0;border-radius:10px;background:#263640;color:#fff;font-weight:700;padding:0 15px;cursor:pointer}
.memory-close{position:absolute;right:14px;top:12px;border:0;background:transparent;font-size:28px;line-height:1;color:#7c858a;cursor:pointer}
.memory-status{min-height:20px;margin-top:12px;font-size:12px;color:#59666e}
@media(max-width:640px){.memory-card{padding:22px 18px}.memory-inline{flex-direction:column}.memory-inline button{min-height:44px}.memory-card h2{margin-left:0}}
