/* ==========================================================================
   Anamnese Interativa — Doctors Institute (app/)
   Identidade "Prontuário Editorial" (decisão 21/07): instrumento clínico
   de luxo — papel branco, tipografia como única voz, hairlines em vez de
   sombra, cor só em dots de status. Substitui o teal/gold do quiz NO APP;
   o quiz mantém a identidade dele (não alterado).
   Mobile-first (min 320px), desktop centra em max-width: 1040px.
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #5C5C5C;
  --ink-3: #8A8A8A;
  --hairline: #E8E8E8;
  --well: #F7F7F7;
  --ok: #1F7A4D;
  --warn: #A05E03;
  --err: #B3261E;

  --sans: "Hanken Grotesk", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 2px;
  --transition: 160ms ease;
  --page-padding: clamp(20px, 4vw, 64px);

  --content-max: 1040px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

em, i, cite { font-style: normal; }
button { background: none; border: none; cursor: pointer; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

::selection { background: var(--ink); color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

/* ---------------------------- Tipografia ---------------------------- */

.wordmark {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow-numbered {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}
.eyebrow-numbered .num { color: var(--ink-3); }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Assinatura da marca: primeira palavra do título em 600, resto em 300 */
h1 strong, h2 strong, h3 strong,
.screen-title strong {
  font-weight: 600;
}

.screen-title {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p { color: var(--ink); }
.text-muted { color: var(--ink-2); }
.text-faint { color: var(--ink-3); }

.tabular { font-variant-numeric: tabular-nums; }

/* ---------------------------- Botões ---------------------------- */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 550 14.5px/1 var(--sans);
  letter-spacing: 0.01em;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}
.primary-button:hover { background: #000; border-color: #000; }
.primary-button:disabled { background: var(--ink-3); border-color: var(--ink-3); cursor: not-allowed; }
.primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button.full { width: 100%; }
.primary-button.small { min-height: 40px; padding: 10px 18px; font-size: 13px; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 4px;
  color: var(--ink);
  font: 550 14px/1 var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-3);
  transition: text-decoration-color var(--transition), color var(--transition);
}
.secondary-button:hover { text-decoration-color: var(--ink); }
.secondary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button.full { width: 100%; }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font: 550 13.5px/1 var(--sans);
  letter-spacing: 0.01em;
  padding: 8px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-3);
  transition: text-decoration-color var(--transition), color var(--transition), opacity var(--transition);
}
.text-button:hover { text-decoration-color: var(--ink); }
.text-button:disabled { color: var(--ink-3); text-decoration-color: transparent; cursor: not-allowed; }
.text-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--err);
  font: 550 13px/1 var(--sans);
  padding: 8px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}
.danger-button:hover { opacity: 0.72; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--ink-2);
  flex: none;
  transition: color var(--transition), background var(--transition);
}
.icon-button:hover { color: var(--ink); background: var(--well); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------- Layout raiz ---------------------------- */

#app { min-height: 100vh; }

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: screen-in 220ms var(--transition) both;
}
.screen[hidden] { display: none !important; }

@keyframes screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px var(--page-padding) 64px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------------------------- Demo banner ---------------------------- */

.demo-banner {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  background: var(--well);
  border-bottom: 1px solid var(--hairline);
}

/* ---------------------------- Topbar ---------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-brand { display: flex; align-items: center; }
.topbar-nav {
  display: none;
  align-items: center;
  gap: 4px;
}
.topbar-nav-link {
  padding: 8px 14px;
  border-radius: var(--radius);
  font: 550 13px/1 var(--sans);
  color: var(--ink-2);
  transition: color var(--transition), background var(--transition);
}
.topbar-nav-link:hover { color: var(--ink); background: var(--well); }
.topbar-nav-link.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.topbar-user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.topbar-user-button:hover { background: var(--well); }
.topbar-user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font: 600 11px/1 var(--sans);
  flex: none;
}
.topbar-user-name {
  font: 550 13px/1 var(--sans);
  color: var(--ink);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-user-button svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--ink-3);
}

.topbar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(10, 10, 10, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 40;
}
.topbar-menu[hidden] { display: none; }
.topbar-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-align: left;
  font: 550 13.5px/1 var(--sans);
  color: var(--ink);
  transition: background var(--transition);
}
.topbar-menu-item:hover { background: var(--well); }
.topbar-menu-item.tone-danger { color: var(--err); }
.topbar-menu-sep { height: 1px; background: var(--hairline); margin: 6px 4px; }
.topbar-menu-lang { display: flex; gap: 6px; padding: 4px 8px 8px; }

/* ---------------------------- Pills de idioma ---------------------------- */

.lang-pills {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.lang-pill {
  padding: 7px 16px;
  border-radius: calc(var(--radius) - 1px);
  font: 550 12.5px/1 var(--sans);
  color: var(--ink-2);
  transition: color var(--transition), background var(--transition);
}
.lang-pill.is-active { color: var(--paper); background: var(--ink); }
.lang-pill.is-small { padding: 6px 12px; font-size: 11.5px; }

/* ---------------------------- Login ---------------------------- */

.screen-login {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px var(--page-padding) 48px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-brand { margin-bottom: 22px; }
.login-eyebrow { margin-bottom: 18px; }
#login-title {
  font-size: clamp(28px, 6vw, 38px);
  max-width: 18ch;
  text-wrap: balance;
}
.login-lead {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 40ch;
  margin: 16px 0 28px;
}
.login-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.login-actions .primary-button { max-width: 320px; }
.login-privacy {
  font-size: 12px;
  color: var(--ink-2);
  max-width: 36ch;
  line-height: 1.5;
}
.login-lang-wrap { margin-top: 6px; }
.auth-tabs {
  width: 100%;
  max-width: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--hairline);
}
.auth-tab {
  padding: 10px 6px 12px;
  color: var(--ink-3);
  font: 550 13px/1 var(--sans);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.auth-tab.is-active { color: var(--ink); border-color: var(--ink); }
.login-form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form .field input { width: 100%; }
.auth-error,
.auth-success {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid currentColor;
  font-size: 12px;
  line-height: 1.4;
}
.auth-error { color: var(--err); background: #FFF8F7; }
.auth-success { color: var(--ok); background: #F5FBF7; }
.auth-forgot { font-size: 12px; margin-top: -8px; }
.login-divider { width: 100%; max-width: 320px; display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.login-divider::before,
.login-divider::after { content: ''; height: 1px; flex: 1; background: var(--hairline); }
.login-google { width: 100%; max-width: 320px; min-height: 48px; padding: 13px 20px; border: 1px solid var(--hairline); text-decoration: none; }
.login-google svg { width: 18px; height: 18px; }
.login-demo-note { display: flex; align-items: flex-start; gap: 7px; max-width: 320px; color: var(--ink-2); font-size: 12px; text-align: left; line-height: 1.45; }

/* ---------------------------- Campos de formulário ---------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.field-label {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-label .opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-3);
  font-size: 11px;
}
.field input,
.field select,
.field textarea {
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--well);
  color: var(--ink);
  font-size: 15px;
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  background: var(--paper);
}
.field textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%235C5C5C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); }
.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid { border-color: var(--err); }
.field-error {
  min-height: 14px;
  font-size: 12px;
  color: var(--err);
}
.field-hint {
  font-size: 11.5px;
  color: var(--ink-3);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  cursor: pointer;
  text-align: left;
}
.check-field input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--ink);
  flex: none;
}

/* ---------------------------- Pills de escolha (choice) ---------------------------- */

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-option {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--paper);
  font: 550 13px/1 var(--sans);
  color: var(--ink-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.pill-option:hover { border-color: var(--ink-3); color: var(--ink); }
.pill-option.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.yesno-group { display: flex; gap: 8px; }
.yesno-pill {
  flex: 1;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--paper);
  font: 550 14px/1 var(--sans);
  color: var(--ink-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.yesno-pill.is-selected { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* ---------------------------- Cards genéricos ---------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---------------------------- Tags / marcadores de status ---------------------------- */
/* Cor só aparece em dots de status — nunca em texto corrido nem em botões. */

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  flex: none;
}
.status-dot.tone-ok { background: var(--ok); }
.status-dot.tone-warn { background: var(--warn); }
.status-dot.tone-err { background: var(--err); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------------------------- Empty state ---------------------------- */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 64px 20px;
  color: var(--ink-2);
}
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.empty-state-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { font-size: 21px; font-weight: 400; color: var(--ink); }
.empty-state p { max-width: 38ch; font-size: 14px; }

/* ---------------------------- Tela: Clientes ---------------------------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.clientes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-field svg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 8px 0 26px;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  border-radius: 0;
}
.search-field input:focus { border-color: var(--ink); outline: none; }
.search-field input::placeholder { color: var(--ink-3); }

/* Cards de lista: sem caixa — linhas de um livro-razão */
.cliente-list {
  display: flex;
  flex-direction: column;
}
.cliente-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  transition: background var(--transition);
}
.cliente-card:hover { background: var(--well); }
.cliente-card-main { min-width: 0; flex: 1; }
.cliente-card-name {
  font: 550 16px/1.3 var(--sans);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cliente-card-meta {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
}
.cliente-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* ---------------------------- Ficha da cliente (#/cliente/{id}) ---------------------------- */

.cliente-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
}
.cliente-header-name { font-size: clamp(28px, 5vw, 38px); max-width: 20ch; }
.cliente-header-origem { margin-top: 10px; }
.cliente-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 14px;
}
.cliente-contact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.cliente-contact svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cliente-contact.is-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.cliente-contact.is-link:hover { text-decoration-color: var(--ink); }
.cliente-contact.is-disabled { opacity: 0.5; cursor: not-allowed; }

.cliente-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.cliente-header-buttons { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; }

.cliente-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

/* ---------------------------- Linha do tempo ---------------------------- */
/* Espinha vertical hairline única; data em tabular-nums à esquerda,
   conteúdo à direita; dot 6px indica o tipo/tom do evento. */

.timeline-title {
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 84px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--hairline);
}
@media (min-width: 560px) {
  .timeline::before { left: 100px; }
}

.timeline-item {
  display: grid;
  grid-template-columns: 64px 40px 1fr;
  column-gap: 6px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 560px) {
  .timeline-item { grid-template-columns: 76px 48px 1fr; }
}
.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font: 550 12px/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: right;
  padding-top: 3px;
}

.timeline-marker {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.timeline-marker .status-dot { position: relative; z-index: 2; }

.timeline-body { min-width: 0; }
.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 4px;
}
.timeline-heading { font: 550 14.5px/1.3 var(--sans); color: var(--ink); }
.timeline-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.timeline-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }

/* ---------------------------- Modais ---------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 10, 10, 0.4);
  padding: 0;
  animation: overlay-in 160ms var(--transition) both;
}
.modal-overlay[hidden] { display: none !important; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 24px; }
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--hairline), 0 24px 48px rgba(10, 10, 10, 0.16);
  animation: modal-in 200ms var(--transition) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 4px;
}
.modal-header h2 { font-size: 21px; font-weight: 400; }
.modal-header p { color: var(--ink-2); font-size: 13px; margin-top: 4px; }

.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--hairline);
  margin-top: 4px;
}
.modal-footer-actions { display: flex; gap: 16px; align-items: center; margin-left: auto; }

/* ---------------------------- Cards de escolha (anamnese facial/capilar) ---------------------------- */

.choice-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .choice-cards { grid-template-columns: 1fr 1fr; }
}
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  transition: background var(--transition), border-color var(--transition);
}
.choice-card:hover { background: var(--well); border-color: var(--ink-3); }
.choice-card-icon { color: var(--ink-2); margin-bottom: 2px; }
.choice-card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.choice-card-title { font: 550 15px/1.3 var(--sans); color: var(--ink); }
.choice-card-hint { font-size: 12.5px; color: var(--ink-2); }

/* ---------------------------- Tela: Follow-ups (#/followups) ---------------------------- */

.followups-subtitle {
  margin-bottom: 30px;
  max-width: 60ch;
  font-size: 14.5px;
}
.followups-group { margin-bottom: 36px; }
.followups-group:last-child { margin-bottom: 0; }
.followups-group-title {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}
.timeline-client-link {
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline);
  transition: text-decoration-color var(--transition);
}
.timeline-client-link:hover { text-decoration-color: var(--ink); }

/* ---------------------------- Placeholder "em construção" ---------------------------- */

.placeholder-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 64px 20px;
}
.placeholder-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--ink-3);
}
.placeholder-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.placeholder-screen h2 { font-size: clamp(24px, 5vw, 30px); max-width: 22ch; font-weight: 300; }
.placeholder-screen p { color: var(--ink-2); font-size: 14.5px; max-width: 44ch; }

/* ---------------------------- Toasts ---------------------------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: 0 12px 32px rgba(10, 10, 10, 0.22);
  animation: toast-in 200ms var(--transition) both;
}
.toast .status-dot { flex: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------- Spinner ---------------------------- */

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  border-top-color: var(--ink);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.screen-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-2);
}

/* ---------------------------- Responsivo: topbar nav ---------------------------- */

@media (min-width: 720px) {
  .topbar-nav { display: flex; }
}

/* ---------------------------- Impressão (esconder chrome do app) ---------------------------- */

@media print {
  .topbar, .demo-banner, .toast-stack { display: none !important; }
}

/* ---------------------------- Wizard de anamnese (#/anamnese/{id}) ---------------------------- */

.wizard-head { margin-bottom: 26px; }
.wizard-progress {
  height: 3px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.wizard-progress-bar {
  height: 100%;
  background: var(--ink);
  transition: width 220ms ease;
}
.wizard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.wizard-autosave {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 0 36px;
}

.wizard-field.field { gap: 8px; }

/* Revelação suave do campo de detalhe do yesno_detail quando SIM */
.wizard-detail-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 200ms ease, opacity 180ms ease;
}
.wizard-detail-reveal.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 4px;
}
.wizard-detail-inner { overflow: hidden; min-height: 0; }
.wizard-detail-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--well);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color var(--transition), background var(--transition);
}
.wizard-detail-input:focus { border-color: var(--ink); background: var(--paper); }
.wizard-detail-input::placeholder { color: var(--ink-3); }

/* Grade de cards numerados (visual_scale) */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
}
.scale-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 10px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-2);
  text-align: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.scale-card:hover { border-color: var(--ink-3); color: var(--ink); }
.scale-card.is-selected { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.scale-card-num { font: 600 15px/1 var(--sans); font-variant-numeric: tabular-nums; }
.scale-card-label { font: 550 10px/1.25 var(--sans); }

/* ---------------------------- Mapa do couro cabeludo (areas_afectadas — scalp-map.js) ---------------------------- */
/* As imagens são silhuetas clínicas reais em outline. O SVG transparente fica
   sobre elas apenas para criar áreas clicáveis; a seleção é um realce leve, sem
   cobrir o desenho nem voltar ao aspecto de gráfico abstrato. */

.scalp-map {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.scalp-map-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  width: 100%;
}
.scalp-map-view {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.scalp-map-view-caption {
  text-align: center;
  padding-top: 2px;
}
.scalp-map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: visible;
}
.scalp-map-image,
.scalp-map-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.scalp-map-image {
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.scalp-map-svg {
  overflow: visible;
}
.scalp-region {
  fill: transparent;
  stroke: transparent;
  stroke-width: 8;
  stroke-dasharray: 18 14;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill var(--transition), stroke var(--transition), opacity var(--transition);
}
.scalp-region:hover,
.scalp-region:focus-visible {
  fill: rgba(18, 48, 47, 0.09);
  stroke: var(--ink-2);
  opacity: 1;
}
.scalp-region.is-selected {
  fill: rgba(18, 48, 47, 0.18);
  stroke: var(--ink);
  opacity: 1;
}
/* <path tabindex="0"> não é um controle nativo: o navegador não suprime
   sozinho o outline padrão de UA. O realce visual fica dentro do desenho. */
.scalp-region:focus { outline: none; }
.scalp-map.is-readonly .scalp-region { cursor: default; }
.scalp-map.is-readonly .scalp-region:hover,
.scalp-map.is-readonly .scalp-region:focus-visible {
  fill: transparent;
  stroke: transparent;
}
.scalp-map-hint {
  min-height: 16px;
  font: 600 12px/1.2 var(--sans);
  color: var(--ink-2);
  text-align: center;
}
.scalp-map-list {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.wizard-field--readonly .scalp-map-list { color: var(--ink); }

@media (max-width: 680px) {
  .scalp-map-views {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .scalp-map-view {
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
  }
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

/* Etapas visuais que abrem a anamnese antes do histórico clínico. */
.intake-step-heading { margin-bottom: 18px; }
.intake-step-intro { display: flex; flex-direction: column; gap: 9px; margin-bottom: 4px; }
.intake-step-intro h2 { font-size: clamp(24px, 4vw, 34px); }
.intake-step-intro p { max-width: 60ch; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.intake-area-fields { padding-top: 16px; }
.intake-area-fields .field-label { margin-bottom: 3px; }

/* Etapa final: declaração + assinatura */
.wizard-declaration {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 0 8px;
}
.wizard-declaration-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 68ch;
}

.wizard-signature { margin-top: 8px; }
.wizard-signature-canvas-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  margin-top: 8px;
  touch-action: none;
}
.wizard-signature-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
  touch-action: none;
}
.wizard-signature-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.wizard-signature-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* ---------------------------- Sessão de fotos guiada ---------------------------- */

.photo-step-heading { margin-bottom: 18px; }
.photo-workspace {
  --photo-bg: #0B0B0B;
  --photo-panel: #121212;
  --photo-line: rgba(255,255,255,.16);
  --photo-soft: rgba(255,255,255,.62);
  --photo-muted: rgba(255,255,255,.42);
  display: grid;
  grid-template-columns: minmax(230px, .78fr) minmax(0, 1.7fr);
  grid-template-areas:
    "guide capture"
    "strip strip"
    "footer footer";
  overflow: hidden;
  border: 1px solid #272727;
  border-radius: 22px;
  background: var(--photo-bg);
  color: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
.photo-guide {
  grid-area: guide;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 42px);
  border-right: 1px solid var(--photo-line);
}
.photo-guide-topline { display: flex; justify-content: space-between; gap: 14px; color: var(--photo-soft); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.photo-guide-topline strong { color: #fff; font-size: 18px; font-weight: 400; letter-spacing: .08em; }
.photo-guide-topline small { color: var(--photo-muted); font-size: 9px; font-weight: 600; }
.photo-guide-model { display: flex; justify-content: center; align-items: center; min-height: 250px; color: rgba(255,255,255,.85); }
.photo-guide-media { display: block; width: min(100%, 330px); aspect-ratio: 1; object-fit: cover; border: 1px solid var(--photo-line); border-radius: 16px; background: #1a1a1a; }
.photo-guide-model .photo-outline-icon { width: min(75%, 190px); height: auto; stroke-width: 1.2; }
.photo-outline-icon { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.photo-guide-copy { max-width: 29ch; }
.photo-kicker { color: var(--photo-soft); font-size: 10px; font-weight: 600; letter-spacing: .16em; line-height: 1.3; text-transform: uppercase; }
.photo-guide-copy h2 { margin: 14px 0; color: #fff; font-size: clamp(26px, 3vw, 42px); font-weight: 300; line-height: 1.06; letter-spacing: -.04em; }
.photo-guide-copy > p:last-child { color: var(--photo-muted); font-size: 13px; line-height: 1.6; }
.photo-capture { grid-area: capture; min-width: 0; padding: clamp(20px, 3vw, 34px); background: linear-gradient(145deg, #101010, #0B0B0B); }
.photo-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.photo-rules span { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--photo-line); border-radius: 10px; color: var(--photo-soft); font-size: 10px; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
.photo-rules b { color: #fff; font-size: 14px; font-weight: 400; }
.photo-consent { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--photo-line); border-radius: 10px; color: var(--photo-soft); cursor: pointer; font-size: 11px; line-height: 1.45; }
.photo-consent input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: #fff; }
.photo-frame { position: relative; min-height: 360px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 16px; background-color: #080808; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 33.333% 33.333%; }
.photo-frame::before { content: ''; position: absolute; inset: 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; pointer-events: none; }
.photo-empty { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--photo-soft); text-align: center; }
.photo-empty-guide { width: 76px; height: 76px; object-fit: contain; opacity: .9; filter: invert(1); }
.photo-empty .photo-outline-icon { width: 76px; height: 76px; color: #fff; }
.photo-empty strong { color: #fff; font-size: 16px; }
.photo-empty span { color: var(--photo-muted); font-size: 11px; }
.photo-preview { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 360px; object-fit: contain; }
.photo-live-video { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 360px; object-fit: contain; transform: scaleX(-1); }
.photo-capture-shutter { position: absolute; z-index: 2; left: 50%; bottom: 20px; transform: translateX(-50%); min-height: 40px; padding: 10px 18px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; background: #fff; color: #000; font-size: 12px; font-weight: 600; }
.photo-theme-switcher { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-bottom: 12px; color: var(--photo-muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.photo-theme-switcher button { min-height: 28px; padding: 6px 10px; border: 1px solid var(--photo-line); border-radius: 999px; background: transparent; color: var(--photo-soft); font: inherit; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.photo-theme-switcher button.is-active { border-color: currentColor; color: #fff; background: rgba(255,255,255,.1); }
.photo-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-controls .primary-button, .photo-controls .secondary-button { min-height: 44px; padding: 12px 18px; }
.photo-controls .primary-button { background: #fff; border-color: #fff; color: #000; }
.photo-controls .primary-button:hover { background: #e8e8e8; border-color: #e8e8e8; }
.photo-controls .secondary-button { border: 1px solid var(--photo-line); border-radius: 999px; color: #fff; text-decoration: none; }
.photo-controls .secondary-button:hover { border-color: rgba(255,255,255,.55); }
.photo-control-hint { margin-top: 8px; color: var(--photo-muted); font-size: 10px; }
.photo-progress-card { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--photo-line); border-radius: 10px; background: rgba(255,255,255,.08); }
.photo-progress-card > div:first-child { display: flex; justify-content: space-between; gap: 16px; color: var(--photo-soft); font-size: 11px; }
.photo-progress-card strong { color: #fff; font-size: 13px; }
.photo-progress-card span { text-align: right; }
.photo-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.16); }
.photo-progress span { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width 220ms ease; }
.photo-strip { grid-area: strip; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--photo-line); }
.photo-thumb { position: relative; min-width: 0; aspect-ratio: .78; overflow: hidden; border: 1px solid var(--photo-line); border-radius: 10px; background: #171717; color: #fff; text-align: left; transition: border-color var(--transition), transform var(--transition); }
.photo-thumb:hover { border-color: rgba(255,255,255,.55); transform: translateY(-2px); }
.photo-thumb.is-current { border-color: #fff; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.photo-thumb-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--photo-muted); font-size: 18px; }
.photo-thumb-meta { position: absolute; inset: auto 8px 7px; display: flex; justify-content: space-between; align-items: center; gap: 5px; color: #fff; font-size: 10px; text-shadow: 0 1px 8px #000; }
.photo-thumb-meta b { font-size: 11px; font-weight: 600; }
.photo-thumb-meta small { color: rgba(255,255,255,.7); font-size: 8px; text-transform: uppercase; }
.photo-footer { grid-area: footer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px 22px; border-top: 1px solid var(--photo-line); }
.photo-footer .text-button { color: var(--photo-soft); }
.photo-footer .text-button:hover { color: #fff; }
.photo-footer-actions { display: flex; align-items: center; gap: 16px; }
.photo-footer .primary-button { min-height: 46px; border-color: #fff; background: #fff; color: #000; }
.photo-footer .primary-button:disabled { border-color: #3b3b3b; background: #3b3b3b; color: rgba(255,255,255,.46); }

/* A página principal é clara; o modo escuro continua disponível na própria sessão. */
.photo-workspace.theme-light {
  --photo-bg: #fff;
  --photo-panel: #fafafa;
  --photo-line: rgba(10,10,10,.14);
  --photo-soft: rgba(10,10,10,.72);
  --photo-muted: rgba(10,10,10,.5);
  border-color: #e6e6e6;
  background: #fff;
  color: #0a0a0a;
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
}
.photo-workspace.theme-light .photo-guide-topline strong,
.photo-workspace.theme-light .photo-guide-copy h2,
.photo-workspace.theme-light .photo-rules b,
.photo-workspace.theme-light .photo-empty strong,
.photo-workspace.theme-light .photo-progress-card strong,
.photo-workspace.theme-light .photo-thumb-meta { color: #0a0a0a; text-shadow: none; }
.photo-workspace.theme-light .photo-guide-model { color: #0a0a0a; }
.photo-workspace.theme-light .photo-capture { background: linear-gradient(145deg, #fff, #f7f7f7); }
.photo-workspace.theme-light .photo-frame { border-color: rgba(10,10,10,.18); background-color: #fff; background-image: linear-gradient(rgba(10,10,10,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(10,10,10,.06) 1px, transparent 1px); }
.photo-workspace.theme-light .photo-frame::before { border-color: rgba(10,10,10,.16); }
.photo-workspace.theme-light .photo-empty-guide { filter: none; }
.photo-workspace.theme-light .photo-consent input { accent-color: #0a0a0a; }
.photo-workspace.theme-light .photo-controls .primary-button,
.photo-workspace.theme-light .photo-footer .primary-button { border-color: #0a0a0a; background: #0a0a0a; color: #fff; }
.photo-workspace.theme-light .photo-controls .primary-button:hover,
.photo-workspace.theme-light .photo-footer .primary-button:hover { border-color: #000; background: #000; }
.photo-workspace.theme-light .photo-controls .secondary-button { color: #0a0a0a; }
.photo-workspace.theme-light .photo-controls .secondary-button:hover { border-color: rgba(10,10,10,.5); }
.photo-workspace.theme-light .photo-capture-shutter { border-color: #0a0a0a; background: #0a0a0a; color: #fff; }
.photo-workspace.theme-light .photo-progress-card { background: rgba(10,10,10,.05); }
.photo-workspace.theme-light .photo-progress { background: rgba(10,10,10,.14); }
.photo-workspace.theme-light .photo-progress span { background: #0a0a0a; }
.photo-workspace.theme-light .photo-thumb { background: #f0f0f0; color: #0a0a0a; }
.photo-workspace.theme-light .photo-thumb:hover { border-color: rgba(10,10,10,.55); }
.photo-workspace.theme-light .photo-thumb.is-current { border-color: #0a0a0a; }
.photo-workspace.theme-light .photo-thumb-meta small { color: rgba(10,10,10,.65); }
.photo-workspace.theme-light .photo-footer .text-button { color: var(--photo-soft); }
.photo-workspace.theme-light .photo-footer .text-button:hover { color: #0a0a0a; }
.photo-workspace.theme-light .photo-theme-switcher button.is-active { background: rgba(10,10,10,.08); color: #0a0a0a; }

@media (max-width: 780px) {
  .photo-workspace { grid-template-columns: 1fr; grid-template-areas: "guide" "capture" "strip" "footer"; border-radius: 16px; }
  .photo-guide { min-height: 0; gap: 28px; padding: 24px; border-right: 0; border-bottom: 1px solid var(--photo-line); }
  .photo-guide-model { min-height: 150px; }
  .photo-guide-copy { max-width: none; }
  .photo-guide-copy h2 { font-size: 32px; }
  .photo-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-frame, .photo-preview, .photo-live-video { min-height: min(70vw, 380px); }
  .photo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-inline: 14px; }
  .photo-footer { align-items: flex-start; flex-direction: column; padding-inline: 16px; }
  .photo-footer-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 440px) {
  .photo-rules span { padding: 9px; font-size: 8px; }
  .photo-controls > * { width: 100%; }
  .photo-footer-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .photo-footer-actions .primary-button { width: 100%; }
}

/* Leitura (anamnese finalizada) */
.wizard-readonly-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}
.wizard-field--readonly { gap: 4px; }
.wizard-field--readonly .field-label { text-transform: uppercase; }
.wizard-answer { font-size: 15px; color: var(--ink); line-height: 1.5; }
.wizard-fields--readonly { padding-top: 18px; }
.wizard-signature-preview {
  display: block;
  max-width: 320px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  margin-top: 8px;
}
