:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1e2524;
  background: #f7f5f2;
  color-scheme: light;
  --ink: #1e2524;
  --muted: #6d7774;
  --line: #e5e0da;
  --paper: #fff;
  --soft: #f2efeb;
  --brand: #173f38;
  --brand-soft: #e4efec;
  --danger: #a82e2e;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f7f5f2; }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 720px); margin: 0 auto; min-height: 100vh; background: #f7f5f2; position: relative; }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(14px + env(safe-area-inset-top)) 18px 12px; background: rgba(247,245,242,.94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(229,224,218,.7); }
.brand { font-weight: 900; font-size: 18px; letter-spacing: -.02em; }
.header-subtitle { color: var(--muted); font-size: 12px; margin-top: 1px; }
.pill, .secure-chip, .coming-badge { border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; }
.pill { background: #ebe8e3; color: #66706e; }
.secure-chip { background: var(--brand-soft); color: var(--brand); }
.coming-badge { display: inline-block; width: fit-content; margin-top: 10px; background: #f0ece6; color: #776d62; padding: 5px 8px; }
.app-main { padding: 18px 18px calc(96px + env(safe-area-inset-bottom)); }
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; color: #667873; }
h1 { margin: 4px 0 0; font-size: 28px; line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
p { line-height: 1.5; }
.hero-card { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding: 22px; border-radius: 24px; background: var(--brand); color: #fff; box-shadow: 0 12px 36px rgba(23,63,56,.16); }
.hero-card .eyebrow { color: #c6d9d4; }
.hero-card h1 { font-size: 30px; }
.hero-card p { margin: 8px 0 0; color: #d8e6e2; font-size: 14px; }
.hero-stat { min-width: 88px; text-align: center; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); padding: 12px; border-radius: 18px; }
.hero-stat strong { display: block; font-size: 30px; }
.hero-stat span { font-size: 10px; color: #d8e6e2; }
.section-block { margin-top: 24px; }
.compact-bottom { margin-bottom: 8px; }
.section-heading, .screen-title-row, .session-live-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-heading { margin-bottom: 10px; }
.screen-title-row { margin-bottom: 18px; }
.session-heading { align-items: flex-start; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 17px; box-shadow: 0 8px 26px rgba(45,42,37,.04); }
.stack { display: grid; gap: 10px; }
.empty-state { color: var(--muted); text-align: center; }
.empty-state p { margin: 4px 0; font-size: 14px; }
.text-btn, .back-btn { border: 0; background: transparent; color: var(--brand); font-weight: 800; padding: 8px 0; }
.back-btn { margin: -4px 0 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--brand); color: #fff; font-size: 24px; line-height: 1; }
.appointment-card { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.appointment-time { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.appointment-main strong { display: block; font-size: 15px; }
.appointment-main small { display: block; margin-top: 4px; color: var(--muted); }
.mode-chip { padding: 6px 8px; border-radius: 999px; background: #f1eeea; color: #6c655d; font-size: 10px; font-weight: 800; white-space: nowrap; }
.appointment-card.next { border-color: #b9d1ca; background: #f9fcfb; }
.appointment-card button { grid-column: 2 / -1; min-height: 42px; }
.quick-grid, .mode-grid, .action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card, .mode-card { text-align: left; min-height: 126px; border-radius: 20px; border: 1px solid var(--line); background: #fff; padding: 16px; color: var(--ink); }
.quick-card > span, .mode-icon { display: block; font-size: 24px; margin-bottom: 14px; }
.quick-card strong, .mode-card strong { display: block; }
.quick-card small, .mode-card small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.mode-card { min-height: 170px; }
.mode-card:active { transform: scale(.99); }
.date-strip { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
.date-btn { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 10px 4px; color: var(--ink); }
.date-btn span, .date-btn small { display: block; }
.date-btn span { font-size: 16px; font-weight: 900; }
.date-btn small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.date-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.date-btn.active small { color: #d5e5e1; }
.search-box { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; margin-bottom: 14px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; padding: 13px 0; }
.patient-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; color: var(--ink); }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.avatar.large { width: 64px; height: 64px; font-size: 22px; }
.patient-card-main { flex: 1; min-width: 0; }
.patient-card-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-card-main small { display: block; color: var(--muted); margin-top: 4px; }
.patient-detail-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 20px; }
.muted-copy { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
button { min-height: 50px; border-radius: 15px; border: 0; font-weight: 800; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--brand); color: #fff; }
.secondary { background: var(--brand-soft); color: var(--brand); }
.danger { background: var(--danger); color: #fff; }
.ghost { background: #f1efec; color: #4e5856; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.top-gap { margin-top: 10px; width: 100%; }
.form-card, .session-card { display: grid; gap: 14px; }
label { font-size: 13px; font-weight: 700; }
input[type="text"], input[type="tel"], input[type="date"], input[type="time"], select { width: 100%; border: 1px solid #d9d5cf; border-radius: 14px; padding: 13px; background: #fcfbfa; outline: none; margin-top: 7px; }
select { appearance: auto; }
input:focus, select:focus { border-color: #849a94; box-shadow: 0 0 0 3px rgba(132,154,148,.15); }
.field-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; }
.online-preview { margin-top: 12px; }
.online-preview p { color: var(--muted); font-size: 14px; }
.settings-card { padding: 6px 17px; }
.setting-line { display: flex; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid #eeeae5; font-size: 13px; }
.setting-line:last-child { border-bottom: 0; }
.setting-line strong { text-align: right; }
.muted-text { color: var(--muted); }
.notice-card { margin-top: 12px; }
.notice-card p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.session-live-head { margin-bottom: 16px; }
.status-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 12px; }
.status-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; min-width: 0; }
.status-card span { display: block; color: #79817f; font-size: 10px; margin-bottom: 5px; }
.status-card strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: #4f5957; }
.consent-row input { margin-top: 2px; width: 19px; height: 19px; }
.recording-panel { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 20px; border-radius: 18px; background: #f3f1ee; min-height: 116px; }
.recording-panel.active { background: #fff0f0; }
.recording-panel.paused { background: #fff8e9; }
.recording-dot { width: 14px; height: 14px; border-radius: 50%; background: #aaa; flex: none; }
.recording-panel.active .recording-dot { background: #d83c3c; animation: pulse 1.2s infinite; }
.recording-panel.paused .recording-dot { background: #d89d2c; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.72); opacity: .55; } }
.recording-label { font-size: 12px; font-weight: 900; color: #59615f; }
.timer { margin-top: 4px; font-size: 32px; font-variant-numeric: tabular-nums; font-weight: 900; letter-spacing: .02em; }
.warning { padding: 12px 14px; border-radius: 14px; background: #fff1d9; border: 1px solid #f1d296; color: #76551d; font-size: 13px; font-weight: 700; }
.hidden { display: none !important; }
.recovery-card, .result-card { margin-top: 12px; }
.result-card { text-align: center; }
.success-mark { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 24px; font-weight: 900; }
.result-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 9px 0 14px; color: var(--muted); font-size: 12px; }
audio { width: 100%; margin-bottom: 14px; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: left; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 30; width: min(100%,720px); display: grid; grid-template-columns: repeat(4,1fr); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav-item { min-height: 54px; border: 0; border-radius: 14px; background: transparent; color: #78807e; padding: 6px; }
.nav-item span, .nav-item small { display: block; }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item small { margin-top: 5px; font-size: 10px; font-weight: 800; }
.nav-item.active { color: var(--brand); background: #edf3f1; }
.app-dialog { width: min(calc(100% - 24px), 520px); border: 0; border-radius: 24px; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.app-dialog::backdrop { background: rgba(20,30,28,.42); backdrop-filter: blur(4px); }
.dialog-body { display: grid; gap: 14px; padding: 20px; }
.dialog-close { width: 38px; min-height: 38px; border-radius: 50%; background: #f1efec; color: #5c6462; font-size: 22px; }
@media (max-width: 390px) {
  .app-main { padding-left: 14px; padding-right: 14px; }
  .app-header { padding-left: 14px; padding-right: 14px; }
  .hero-card { padding: 18px; }
  .hero-stat { min-width: 78px; }
  .appointment-card { grid-template-columns: 52px 1fr; }
  .mode-chip { grid-column: 2; width: fit-content; }
  .status-grid { grid-template-columns: 1fr; }
  .status-card { display: flex; justify-content: space-between; gap: 12px; }
  .status-card span { margin: 0; }
}
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f7f5f2; }
.auth-card { width: min(100%, 420px); display: grid; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 18px 50px rgba(45,42,37,.08); }
.auth-card h1 { margin-bottom: 0; }
.auth-card p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-card input[type="email"], .auth-card input[type="password"] { width: 100%; border: 1px solid #d9d5cf; border-radius: 14px; padding: 13px; background: #fcfbfa; outline: none; margin-top: 7px; }
.auth-brand { margin-bottom: 4px; }

/* V0.4 — sala online */
.online-link-card { margin-bottom: 12px; }
.online-link-card p { color: var(--muted); font-size: 14px; }
.share-link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.share-link-row input { min-width: 0; margin: 0; border: 1px solid #d9d5cf; border-radius: 14px; padding: 13px; background: #fcfbfa; color: #59615f; }
.share-link-row button { min-width: 82px; }
.video-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 12px 0; }
.video-card { position: relative; overflow: hidden; border-radius: 20px; background: #1e2423; aspect-ratio: 4 / 3; border: 1px solid rgba(0,0,0,.08); }
.video-card video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1e2423; }
.video-card.local { position: absolute; width: 31%; max-width: 150px; aspect-ratio: 3 / 4; right: 24px; margin-top: 14px; z-index: 4; border: 2px solid rgba(255,255,255,.92); box-shadow: 0 10px 28px rgba(0,0,0,.22); }
.video-label { position: absolute; left: 10px; bottom: 10px; padding: 5px 8px; border-radius: 999px; background: rgba(20,25,24,.68); color: #fff; font-size: 10px; font-weight: 800; backdrop-filter: blur(7px); }
.call-controls-card { display: grid; gap: 10px; margin-top: 12px; }
.call-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.online-consent-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eeeae5; font-size: 12px; }
.online-consent-status strong { text-align: right; }
.patient-room-body { min-height: 100vh; margin: 0; background: #f7f5f2; color: var(--ink); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.patient-room-shell { width: min(100%,720px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.patient-join-card { display: grid; gap: 15px; margin: 5vh auto 0; max-width: 520px; }
.patient-join-card h1, .patient-call-head h1 { margin: 3px 0 0; }
.patient-join-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.patient-call-wrap { position: relative; }
.patient-call-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.patient-video-grid { position: relative; }
.patient-video-grid .video-card.local { right: 12px; top: 76px; margin: 0; }
@media (min-width: 700px) {
  .video-grid { grid-template-columns: 1fr; }
  .video-card.remote { aspect-ratio: 16/9; }
}

.top-gap-small { margin-top: 8px; }

/* V0.4.3 — tela cheia, chat e pós-sessão */
.call-stage { position: relative; border-radius: 22px; overflow: hidden; background: #171d1c; }
.call-stage .video-grid { margin: 0; }
.stage-action { position: absolute; z-index: 8; right: 10px; top: 10px; min-height: 38px; padding: 0 12px; border-radius: 999px; background: rgba(17,24,23,.72); color: #fff; border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.call-stage:fullscreen, .call-stage:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; background: #000; }
.call-stage:fullscreen .video-grid, .call-stage:-webkit-full-screen .video-grid { height: 100%; }
.call-stage:fullscreen .video-card.remote, .call-stage:-webkit-full-screen .video-card.remote { height: 100%; aspect-ratio: auto; border-radius: 0; border: 0; }
.call-stage:fullscreen .video-card.local, .call-stage:-webkit-full-screen .video-card.local { position: absolute; right: max(16px,env(safe-area-inset-right)); bottom: max(24px,env(safe-area-inset-bottom)); top: auto; width: min(25vw,180px); }
.chat-card { display: grid; gap: 12px; margin-top: 12px; text-align: left; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chat-head h2 { margin: 2px 0 0; }
.chat-badge { padding: 5px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 900; }
.chat-messages { height: 190px; overflow-y: auto; background: #f7f6f4; border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { margin: auto; max-width: 260px; color: var(--muted); font-size: 12px; text-align: center; }
.chat-message { max-width: 86%; padding: 9px 11px; border-radius: 14px; display: grid; gap: 3px; font-size: 13px; overflow-wrap: anywhere; }
.chat-message strong { font-size: 10px; opacity: .68; }
.chat-message.own { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.chat-message.remote { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-form input { margin: 0; min-width: 0; }
.chat-form button { min-width: 82px; }
.post-session-card { margin-top: 8px; text-align: center; }
.post-session-card h2 { margin: 4px 0 16px; }
.post-session-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.post-session-stats > div { background: #f7f6f4; border: 1px solid var(--line); border-radius: 16px; padding: 13px 10px; }
.post-session-stats span, .post-session-stats strong { display: block; }
.post-session-stats span { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.post-session-stats strong { font-size: 14px; }
.patient-ended-card { max-width: 520px; margin: 10vh auto 0; text-align: center; }
.patient-ended-card p { color: var(--muted); line-height: 1.5; }
.session-history-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eeeae5; }
.session-history-row:last-child { border-bottom: 0; }
.session-history-meta span, .session-history-meta small { display: block; }
.session-history-meta small { color: var(--muted); margin-top: 4px; }
.session-history-row button { min-height: 38px; padding: 0 11px; }
@media (max-width: 440px) { .post-session-stats { grid-template-columns: 1fr; } .chat-messages { height: 160px; } }

/* Clinical focus V0.5 */
.clinical-nav { grid-template-columns: repeat(3,1fr); }
.clinical-overview-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.metric-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:14px; min-height:92px; display:flex; flex-direction:column; justify-content:space-between; }
.metric-card span { color:var(--muted); font-size:12px; font-weight:700; }
.metric-card strong { font-size:22px; line-height:1.1; }
.full-width { width:100%; }
.small-btn { min-height:38px; padding:8px 12px; }
.clinical-tabs { display:flex; gap:8px; overflow-x:auto; padding:16px 0 6px; scrollbar-width:none; }
.clinical-tabs::-webkit-scrollbar { display:none; }
.clinical-tab { min-height:40px; white-space:nowrap; padding:8px 12px; border:1px solid var(--line); background:#fff; color:var(--muted); border-radius:999px; font-weight:800; }
.clinical-tab.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.clinical-panel { display:none; }
.clinical-panel.active { display:block; }
.clinical-document { display:grid; gap:14px; }
.clinical-field { padding-bottom:12px; border-bottom:1px solid var(--line); }
.clinical-field:last-child { border-bottom:0; padding-bottom:0; }
.clinical-field strong { display:block; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:5px; }
.clinical-field p { margin:0; white-space:pre-wrap; line-height:1.55; }
.timeline { display:grid; gap:12px; }
.timeline-item { background:#fff; border:1px solid var(--line); border-radius:18px; padding:15px; }
.timeline-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.timeline-head strong { display:block; }
.timeline-head small { color:var(--muted); }
.ai-badge { display:inline-flex; font-size:10px; font-weight:900; border-radius:999px; padding:5px 8px; background:#eeeaf8; color:#63517e; }
.timeline-section { margin-top:10px; }
.timeline-section strong { font-size:11px; text-transform:uppercase; color:var(--muted); letter-spacing:.05em; }
.timeline-section p { margin:4px 0 0; white-space:pre-wrap; line-height:1.5; }
.clinical-dialog { max-height:92vh; overflow:auto; }
.clinical-form-grid { display:grid; gap:12px; }
.clinical-dialog textarea { resize:vertical; min-height:72px; }
.session-summary-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:14px; }
.session-summary-card .session-title-row { display:flex; justify-content:space-between; gap:10px; }
.session-summary-card p { white-space:pre-wrap; line-height:1.5; }
@media(max-width:520px){.clinical-overview-grid{grid-template-columns:1fr 1fr}.clinical-overview-grid .metric-card:last-child{grid-column:1/-1}.clinical-dialog{width:calc(100% - 14px)}}

/* V0.5 — anamnese livre + transcrição/relatório IA */
.anamnesis-fields { display:grid; gap:12px; }
.anamnesis-editor-row { border:1px solid var(--line); border-radius:16px; padding:12px; background:#fbfaf8; display:grid; gap:9px; }
.anamnesis-editor-head { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; }
.anamnesis-editor-head input { margin:0; font-weight:800; }
.anamnesis-editor-row textarea { margin:0; min-height:96px; }
.anamnesis-editor-row .anam-remove { min-height:38px; padding:8px 10px; }
.timeline-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.timeline-actions .review-evolution-btn { min-height:34px; padding:6px 9px; font-size:11px; }
.report-dialog { width:min(94vw,760px); }
.ai-progress { display:flex; gap:13px; align-items:center; padding:15px; border:1px solid var(--line); border-radius:16px; background:#f8f6f2; }
.ai-progress strong { display:block; margin-bottom:3px; }
.ai-progress p { margin:0; color:var(--muted); line-height:1.45; font-size:13px; }
.ai-spinner { width:28px; height:28px; border-radius:50%; border:3px solid #e4ddd4; border-top-color:var(--brand); animation:aiSpin .85s linear infinite; flex:0 0 auto; }
@keyframes aiSpin { to { transform:rotate(360deg); } }
.report-content { display:grid; gap:12px; }
.report-field { padding:13px 0; border-bottom:1px solid var(--line); }
.report-field:last-child { border-bottom:0; }
.report-field strong { display:block; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-size:11px; margin-bottom:5px; }
.report-field p { margin:0; white-space:pre-wrap; line-height:1.58; }
.transcript-details { margin-top:14px; border:1px solid var(--line); border-radius:14px; padding:11px 13px; background:#fbfaf8; }
.transcript-details summary { cursor:pointer; font-weight:800; }
.transcript-text { white-space:pre-wrap; margin-top:12px; line-height:1.58; font-size:13px; max-height:42vh; overflow:auto; }
@media(max-width:520px){.anamnesis-editor-head{grid-template-columns:1fr}.anamnesis-editor-row .anam-remove{justify-self:start}.report-dialog{width:calc(100% - 12px)}}


/* V0.5.4 — clinical continuity + responsive workspace */
.app-shell { width:min(100%,1180px); }
.app-main { width:100%; }
.bottom-nav { width:min(100%,1180px); }
textarea { width:100%; border:1px solid #d9d5cf; border-radius:14px; padding:13px; background:#fcfbfa; outline:none; margin-top:7px; font:inherit; color:var(--ink); }
textarea:focus { border-color:#849a94; box-shadow:0 0 0 3px rgba(132,154,148,.15); }
.patient-insight-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.insight-card { background:#fff; border:1px solid var(--line); border-radius:20px; padding:16px; display:flex; gap:12px; align-items:flex-start; box-shadow:0 8px 26px rgba(45,42,37,.035); }
.insight-card:nth-child(3) { grid-column:1/-1; }
.insight-icon { width:42px; height:42px; border-radius:14px; background:var(--brand-soft); display:grid; place-items:center; flex:0 0 auto; font-size:20px; }
.insight-card strong { display:block; margin-bottom:5px; }
.insight-card p { margin:0; color:#4f5957; white-space:pre-wrap; line-height:1.5; }
.mood-large { font-size:25px; }
.mood-fieldset { border:1px solid var(--line); border-radius:16px; padding:12px; margin:0; background:#fbfaf8; }
.mood-fieldset legend { padding:0 5px; font-size:12px; font-weight:900; color:var(--muted); }
.mood-fieldset input { margin-top:10px; }
.mood-picker { display:flex; flex-wrap:wrap; gap:8px; }
.mood-option { width:46px; min-height:46px; padding:0; border-radius:14px; border:1px solid var(--line); background:#fff; font-size:24px; line-height:1; transition:transform .12s ease,border-color .12s ease,background .12s ease; }
.mood-option:hover { transform:translateY(-1px); }
.mood-option.selected { border-color:var(--brand); background:var(--brand-soft); box-shadow:0 0 0 2px rgba(23,63,56,.12); }
.mood-picker.compact { justify-content:center; gap:6px; }
.mood-picker.compact .mood-option { width:40px; min-height:40px; font-size:21px; border-radius:12px; }
.quick-mood-block { margin:4px 0 14px; padding:12px; border:1px solid var(--line); border-radius:16px; background:#fbfaf8; }
.quick-mood-block > span { display:block; color:var(--muted); font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; margin-bottom:9px; }
.mood-inline { font-size:22px; margin-right:6px; vertical-align:-2px; }
.timeline-actions .edit-evolution-btn, .session-history-actions .edit-session-btn { min-height:34px; padding:6px 9px; font-size:11px; }
.session-history-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.session-history-meta p { margin:7px 0 0; color:#4f5957; }
.session-plan-snippet { margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); font-size:12px; color:var(--muted); }
.session-plan-snippet strong { color:var(--ink); }
@media (min-width: 860px) {
  .app-header { padding-left:30px; padding-right:30px; }
  .app-main { padding:28px 30px 112px; }
  .hero-card { padding:30px; }
  .hero-card h1 { font-size:clamp(32px,4vw,44px); }
  .quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .clinical-overview-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .patient-detail-head { padding:18px 20px; background:#fff; border:1px solid var(--line); border-radius:22px; box-shadow:0 8px 26px rgba(45,42,37,.035); }
  #patientStartSessionBtn { width:auto; min-width:230px; margin-left:auto; display:block; }
  .clinical-tabs { position:sticky; top:82px; z-index:12; background:rgba(247,245,242,.94); backdrop-filter:blur(12px); padding:12px 0; }
  .clinical-panel { max-width:1000px; margin:0 auto; }
  .patient-insight-grid { grid-template-columns:1fr 1fr 0.72fr; }
  .insight-card:nth-child(3) { grid-column:auto; }
  .timeline { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .clinical-document { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .clinical-field { border:1px solid var(--line); border-radius:16px; padding:14px; background:#fff; }
  .clinical-field:last-child { padding-bottom:14px; }
  .app-dialog { max-width:680px; }
  .report-dialog { max-width:920px; }
}
@media (max-width: 620px) {
  .app-main { padding-left:14px; padding-right:14px; }
  .hero-card { padding:18px; border-radius:20px; align-items:stretch; }
  .hero-card h1 { font-size:28px; }
  .hero-stat { min-width:78px; }
  .patient-detail-head { margin-bottom:14px; }
  .patient-insight-grid { grid-template-columns:1fr; }
  .insight-card:nth-child(3) { grid-column:auto; }
  .clinical-tabs { margin-left:-14px; margin-right:-14px; padding-left:14px; padding-right:14px; }
  .section-block { margin-top:20px; }
  .card, .timeline-item, .metric-card { border-radius:17px; }
  .session-history-row { grid-template-columns:1fr; }
  .session-history-actions { justify-content:flex-start; }
  .mood-option { width:43px; min-height:43px; }
}


/* V0.5.4 — identidade aquarela, girassol e cores da Isadora */

:root {
  --ink: #26463b;
  --muted: #6f7c74;
  --line: rgba(124, 126, 92, .18);
  --paper: rgba(255,255,255,.78);
  --soft: #fbf7ef;
  --brand: #2f7e62;
  --brand-soft: #ecf7ef;
  --accent-gold: #f5b84c;
  --accent-peach: #f6d6c7;
  --accent-rose: #f1d5dd;
  --accent-mint: #d8efe4;
  --accent-sky: #dfeeed;
  --shadow-soft: 0 16px 40px rgba(73, 68, 40, .08);
}
html, body { background: linear-gradient(180deg, #fbf5eb 0%, #f8f1e5 55%, #f4efe7 100%); }
body {
  position: relative;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(0.2px);
}
body::before {
  width: 420px;
  height: 420px;
  left: -110px;
  top: -70px;
  background:
    radial-gradient(circle at 30% 32%, rgba(245, 184, 76, .28), transparent 0 22%),
    radial-gradient(circle at 67% 44%, rgba(127, 187, 144, .24), transparent 0 18%),
    radial-gradient(circle at 52% 67%, rgba(244, 149, 124, .12), transparent 0 22%);
}
body::after {
  width: 380px;
  height: 380px;
  right: -120px;
  bottom: 40px;
  background:
    radial-gradient(circle at 45% 40%, rgba(245, 184, 76, .18), transparent 0 24%),
    radial-gradient(circle at 58% 62%, rgba(127, 187, 144, .20), transparent 0 18%),
    radial-gradient(circle at 28% 68%, rgba(232, 181, 205, .16), transparent 0 18%);
}
.app-shell,
.patient-room-shell {
  position: relative;
  z-index: 1;
}
.app-shell {
  width: min(100%, 1240px);
  background: transparent;
}
.app-header {
  background: rgba(251, 248, 242, .78);
  border-bottom: 1px solid rgba(137, 150, 124, .16);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 24px rgba(127, 102, 54, .04);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -.04em;
  color: #20463a;
}
.brand::before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: url('icon.svg') center/contain no-repeat;
  flex: none;
  filter: drop-shadow(0 6px 10px rgba(227, 165, 53, .20));
}
.auth-brand { margin-bottom: 0; }
.auth-tagline {
  margin-top: -4px;
  color: #b06d38;
  font-size: 14px;
  line-height: 1.45;
}
h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: #26463b;
}
.eyebrow {
  color: #7e9f6f;
  letter-spacing: .18em;
}
.header-subtitle,
.muted-copy,
.notice-card p,
.patient-card-main small,
.hero-card p,
.online-link-card p,
.empty-state,
.setting-line,
.auth-card p {
  color: #65736d;
}
.card,
.quick-card,
.mode-card,
.metric-card,
.patient-card,
.search-box,
.auth-card,
.app-dialog,
.status-card,
.session-history-row,
.timeline-item,
.online-link-card,
.video-card,
.chat-card,
.call-controls-card,
.post-session-card {
  background:
    radial-gradient(circle at 90% 16%, rgba(248, 211, 109, .10), transparent 0 20%),
    radial-gradient(circle at 15% 85%, rgba(162, 210, 180, .11), transparent 0 18%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,252,248,.90));
  border: 1px solid rgba(144, 140, 102, .16);
  box-shadow: var(--shadow-soft);
}
.app-dialog::backdrop { background: rgba(75, 89, 79, .28); }
.hero-card {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 16%, rgba(245, 184, 76, .25), transparent 0 16%),
    radial-gradient(circle at 88% 22%, rgba(127, 187, 144, .20), transparent 0 17%),
    radial-gradient(circle at 78% 82%, rgba(238, 196, 168, .22), transparent 0 16%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(250,244,234,.98));
  border: 1px solid rgba(144, 140, 102, .18);
  box-shadow: 0 20px 42px rgba(140, 112, 58, .10);
}
.hero-card::before {
  content: "🌻";
  position: absolute;
  right: 20px;
  top: 18px;
  font-size: clamp(30px, 5vw, 46px);
  opacity: .92;
}
.hero-card .eyebrow,
.hero-card p { color: #587063; }
.hero-card h1 { font-size: clamp(30px, 4.2vw, 46px); }
.hero-stat {
  background: rgba(255,255,255,.62);
  color: #2f7e62;
  border: 1px solid rgba(112, 148, 112, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.hero-stat span { color: #6b7e75; }
.metric-card { border-radius: 22px; }
.clinical-overview-grid .metric-card:nth-child(1) { background: linear-gradient(180deg, rgba(255,226,168,.52), rgba(255,255,255,.92)); }
.clinical-overview-grid .metric-card:nth-child(2) { background: linear-gradient(180deg, rgba(214,240,226,.58), rgba(255,255,255,.92)); }
.clinical-overview-grid .metric-card:nth-child(3) { background: linear-gradient(180deg, rgba(243,213,221,.50), rgba(255,255,255,.92)); }
.quick-card, .mode-card {
  border-radius: 24px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick-card:hover, .mode-card:hover, .patient-card:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(123, 107, 56, .12); }
.quick-card:nth-child(1) { background: linear-gradient(180deg, rgba(255,236,188,.55), rgba(255,255,255,.92)); }
.quick-card:nth-child(2) { background: linear-gradient(180deg, rgba(221,241,231,.58), rgba(255,255,255,.92)); }
.quick-card > span, .mode-icon { font-size: 28px; }
.patient-card,
.timeline-item,
.session-history-row,
.clinical-document,
.online-link-card,
.chat-card,
.call-controls-card,
.post-session-card {
  border-radius: 22px;
}
.avatar {
  background: linear-gradient(180deg, #fff0c9, #f8c45f);
  color: #6d4a19;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.56);
}
.avatar.large {
  border: 4px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 20px rgba(176, 120, 42, .12);
}
button {
  border-radius: 16px;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
button:not(:disabled):active { transform: scale(.985); }
.primary {
  background: linear-gradient(135deg, #327f66, #2e6f57);
  box-shadow: 0 10px 22px rgba(47, 126, 98, .22);
}
.secondary {
  background: linear-gradient(180deg, #fff6da, #fce9b7);
  color: #71541b;
  box-shadow: 0 8px 18px rgba(223, 168, 57, .14);
}
.ghost { background: linear-gradient(180deg, #fff8f2, #f5eee6); color: #5d655e; }
.danger { background: linear-gradient(135deg, #d56d67, #bd4f48); }
.icon-btn {
  background: linear-gradient(135deg, #f7cb63, #ef9f31);
  color: #654310;
  box-shadow: 0 10px 18px rgba(239, 159, 49, .20);
}
.search-box {
  background: rgba(255,255,255,.82);
  border-radius: 18px;
}
.search-box input,
input[type="text"], input[type="tel"], input[type="date"], input[type="time"],
input[type="email"], input[type="password"], input[type="search"], select, textarea {
  background: rgba(255, 252, 248, .90);
  border: 1px solid rgba(166, 160, 120, .28);
  border-radius: 16px;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(59, 135, 104, .45);
  box-shadow: 0 0 0 4px rgba(82, 164, 127, .10);
}
.clinical-tab {
  background: rgba(255,255,255,.85);
  border-color: rgba(136, 137, 98, .20);
  color: #62726a;
}
.clinical-tab.active {
  background: linear-gradient(135deg, #2f7e62, #3b8e71);
  border-color: transparent;
}
.insight-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(144, 140, 102, .16);
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 216, 109, .18), transparent 0 18%),
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(251,248,241,.93));
  box-shadow: var(--shadow-soft);
}
.patient-insight-grid {
  display: grid;
  gap: 12px;
}
.insight-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff4cb, #f6c24d);
  color: #6f4c14;
  font-size: 23px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.58);
}
.mood-card .insight-icon {
  background: linear-gradient(180deg, #dff0e4, #a8dbb4);
  color: #2f7e62;
}
.timeline-head,
.section-heading,
.screen-title-row,
.session-live-head,
.dialog-head { align-items: center; }
.ai-badge {
  background: #eef0ff;
  color: #5f599a;
}
.call-stage {
  background: linear-gradient(135deg, #24473c, #365f4d);
  box-shadow: 0 18px 34px rgba(48, 62, 56, .18);
}
.stage-action {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.24);
}
.video-label {
  background: rgba(27, 44, 38, .70);
}
.chat-messages {
  background: rgba(251,249,244,.82);
}
.chat-message.own { background: linear-gradient(135deg, #2f7e62, #3b8e71); }
.chat-message.remote { background: rgba(255,255,255,.92); }
.post-session-stats > div,
.status-card { background: rgba(255,255,255,.68); }
.bottom-nav { background: rgba(250,247,241,.90); }
.auth-gate,
.patient-room-body {
  background:
    radial-gradient(circle at 10% 8%, rgba(245,184,76,.18), transparent 0 18%),
    radial-gradient(circle at 90% 10%, rgba(164,210,182,.18), transparent 0 15%),
    linear-gradient(180deg, #fbf5eb, #f5efe3);
}
.auth-card,
.patient-join-card,
.patient-ended-card {
  background:
    radial-gradient(circle at 88% 14%, rgba(255,214,121,.18), transparent 0 18%),
    radial-gradient(circle at 14% 90%, rgba(176, 219, 192, .16), transparent 0 20%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,252,247,.92));
}
.notice-card h2::after,
.section-heading h2::after,
.screen-title-row h1::after,
.patient-call-head h1::after,
.patient-join-card h1::after {
  content: ' 🌻';
  font-size: .9em;
}
@media (min-width: 860px) {
  .app-main { padding: 28px 28px calc(96px + env(safe-area-inset-bottom)); }
  .screen[data-screen="home"] {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 24px;
  }
  .screen[data-screen="home"] > .hero-card { grid-column: 1 / -1; }
  .screen[data-screen="home"] > .section-block:nth-of-type(1) { grid-column: 1; }
  .screen[data-screen="home"] > .section-block:nth-of-type(2) { grid-column: 2; align-self: start; }
  .screen[data-screen="home"] > .section-block:nth-of-type(3) { grid-column: 1 / -1; }
  #patientList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .patient-insight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .clinical-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .screen[data-screen="patients"],
  .screen[data-screen="patient-detail"],
  .screen[data-screen="more"],
  .screen[data-screen="session-setup"],
  .screen[data-screen="online-room"] {
    max-width: 1120px;
  }
}
@media (max-width: 700px) {
  .brand { font-size: 24px; }
  .brand::before { width: 30px; height: 30px; }
  .hero-card { padding: 20px; }
  .hero-card::before { right: 14px; top: 12px; font-size: 34px; }
  .patient-insight-grid,
  .clinical-overview-grid { grid-template-columns: 1fr; }
}
