#mh-smart-scan{padding:18px;border:1px solid #b9d8f6;border-radius:20px;background:linear-gradient(150deg,#f4faff,#fff 65%);box-shadow:0 10px 30px #002a5d12;margin-bottom:16px;color:#072955}
#mh-smart-scan[hidden]{display:none}
.mh-smart-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.mh-smart-head small{font-size:9px;font-weight:800;letter-spacing:.18em;color:#0877d7}
.mh-smart-head h3{font-size:21px;margin:5px 0 0;line-height:1.2}
.mh-smart-head button{width:34px;height:34px;border:1px solid #c8ddf3;border-radius:50%;background:white;color:#072955;font-size:23px;cursor:pointer}
.mh-smart-modes{display:grid;grid-template-columns:1fr 1fr;gap:6px;background:#eaf3fb;padding:5px;border-radius:13px;margin:17px 0 10px}
.mh-smart-modes button{border:0;border-radius:9px;background:transparent;color:#225176;padding:10px 6px;font-size:12px;font-weight:600;font-family:inherit;cursor:pointer}
.mh-smart-modes button[aria-pressed="true"]{background:#fff;box-shadow:0 2px 10px #002a5d14;color:#005bb8}
#mh-smart-hint,#mh-smart-status,#mh-smart-results>p{font-size:12px;line-height:1.5;color:#385d7d;margin:10px 0}
.mh-smart-upload{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}
.mh-smart-upload label,#mh-smart-analyze,[data-smart-builder]{display:flex;justify-content:center;align-items:center;min-height:42px;padding:8px 10px;border:1px solid #b9d8f6;border-radius:11px;background:#fff;color:#005bb8;font-size:12px;font-weight:700;font-family:inherit;cursor:pointer;text-align:center}
#mh-smart-analyze,[data-smart-builder]{width:100%;background:#006fff;color:#fff;border-color:#006fff}
#mh-smart-analyze:disabled{opacity:.5;cursor:not-allowed}
#mh-smart-photo img{display:block;width:100%;max-height:180px;object-fit:contain;border-radius:12px;background:#e8f0f6;margin:8px 0}
#mh-smart-results input{width:100%;min-height:40px;border:1px solid #bdd5ec;border-radius:9px;padding:8px 10px;background:white;color:#072955;font:inherit;box-sizing:border-box}
.mh-smart-candidates{display:grid;gap:6px;margin:12px 0}
.mh-smart-candidates button{width:100%;border:1px solid #d4e4f2;border-radius:10px;background:#fff;padding:10px 12px;text-align:left;font-size:12px;font-weight:600;font-family:inherit;color:#07386a;cursor:pointer}
#mh-smart-exercise{border-top:1px solid #d9e7f4;padding-top:10px}
#mh-smart-exercise:empty{display:none}
#mh-smart-exercise h4{font-size:16px;margin:4px 0}
#mh-smart-exercise p{font-size:12px;line-height:1.5;color:#375977;margin:8px 0}
#mh-smart-exercise video,#mh-smart-exercise img{width:100%;max-height:210px;object-fit:contain;border-radius:10px;background:#ecf4fa}
#mh-smart-exercise .mh-smart-context{padding:10px;border-radius:10px;background:#eaf5ff;color:#084f96}
.mh-smart-title{display:grid;gap:5px;font-size:11px;font-weight:700;margin:12px 0}
#mh-sheet-rows{display:grid;gap:9px;max-height:260px;overflow:auto;margin-bottom:12px}
.mh-sheet-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:9px;border:1px solid #d4e4f2;border-radius:10px;background:#fff}
.mh-sheet-row label{display:grid;gap:4px;font-size:10px;color:#496b89}
.mh-sheet-row label:first-child{grid-column:1/-1}
.mh-sheet-row input{min-width:0}
@media(max-width:420px){#mh-smart-scan{padding:14px}.mh-smart-head h3{font-size:18px}.mh-smart-upload label{font-size:11px}}
/* The microphone stays active until the person ends the conversation. */
.mh-assistant-tools [data-mh-voice].is-live {
  background: #087cda;
  box-shadow: 0 0 0 5px rgba(0, 133, 255, .14), 0 0 18px rgba(0, 133, 255, .46);
  animation: mh-voice-live-pulse 1.6s ease-in-out infinite;
}
@keyframes mh-voice-live-pulse {
  50% { box-shadow: 0 0 0 9px rgba(0, 133, 255, .07), 0 0 25px rgba(0, 133, 255, .6); }
}
@media (prefers-reduced-motion: reduce) {
  .mh-assistant-tools [data-mh-voice].is-live { animation: none; }
}

.mh-live-voice-stage[hidden] { display: none; }
#mh-assistant-sheet.is-voice-active > :not(header):not(.assistant-grip):not(.mh-live-voice-stage) { display: none !important; }
#mh-assistant-sheet.is-voice-active .mh-live-voice-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 20px 24px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  color: #082b59;
}
.mh-live-voice-label { color: #7890ab; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.mh-live-voice-wave { height: 110px; display: flex; align-items: center; justify-content: center; gap: 4px; margin: 12px 0 6px; }
.mh-live-voice-wave i { display: block; width: 4px; height: var(--mh-wave-height, 5px); border-radius: 8px; background: #0879ef; transition: height 90ms ease-out; }
.mh-live-voice-wave i:nth-child(3n) { background: #36baf5; }
.mh-live-voice-state { font-size: 23px; line-height: 1.3; font-weight: 700; }
.mh-live-voice-hint { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: #607b99; font-size: 12px; }
.mh-live-voice-hint i { width: 7px; height: 7px; border-radius: 50%; background: #159c78; box-shadow: 0 0 0 3px #159c781c; }
.mh-live-voice-stage button { position: absolute; bottom: 28px; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: #062c60; color: white; box-shadow: 0 5px 18px #002b5d26; cursor: pointer; transition: background .18s, transform .18s, box-shadow .18s; }
@media (hover: hover) { .mh-live-voice-stage button:hover { background: #0879ef; transform: translateY(-2px); box-shadow: 0 8px 22px #0879ef40; } }
.mh-live-voice-stage button:focus-visible { outline: 2px solid #0879ef; outline-offset: 4px; }
@media (max-height: 700px) { #mh-assistant-sheet.is-voice-active .mh-live-voice-stage { padding-bottom: 78px; } .mh-live-voice-wave { height: 75px; } .mh-live-voice-stage button { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .mh-live-voice-wave i, .mh-live-voice-stage button { transition: none; } }

/* Scanner: câmera em primeiro plano e revisão separada, como no Agenda Livre. */
#mh-smart-scan[open] { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #102338; color: #fff; box-shadow: none; }
#mh-smart-scan::backdrop { background: #00142b; }
#mh-smart-scan * { box-sizing: border-box; }
#mh-smart-camera, .mh-smart-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
#mh-smart-camera { object-fit: cover; }
.mh-smart-shade { pointer-events: none; background: linear-gradient(180deg, #001022bc 0%, transparent 30%, transparent 46%, #001022df 100%); }
#mh-smart-scan .mh-smart-head { position: absolute; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px; align-items: center; }
#mh-smart-scan .mh-smart-head > div { display: flex; align-items: center; gap: 11px; }
#mh-smart-scan .mh-smart-head h3 { margin: 0; font-size: 18px; color: #fff; }
#mh-smart-scan .mh-smart-head small { display: block; margin-top: 3px; color: #d6e8f7; font-size: 11px; letter-spacing: 0; font-weight: 500; }
.mh-smart-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #38b8ff; box-shadow: 0 0 0 4px #38b8ff33; }
#mh-smart-scan .mh-smart-head button, .mh-smart-review-head button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff77; border-radius: 50%; background: #061a3190; color: #fff; font: 300 27px/1 inherit; cursor: pointer; }
#mh-smart-scan #mh-smart-hint { position: absolute; top: 17%; left: 20px; right: 20px; margin: 0; color: #fff; text-align: center; font-size: 14px; text-shadow: 0 1px 8px #000; }
.mh-smart-guide { position: absolute; top: 25%; left: 50%; width: min(68vw, 400px); height: 36%; transform: translateX(-50%); pointer-events: none; }
.mh-smart-guide i { position: absolute; width: 30px; height: 30px; border: 2px solid #64caff; }
.mh-smart-guide i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.mh-smart-guide i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.mh-smart-guide i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.mh-smart-guide i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.mh-smart-controls { position: absolute; bottom: 0; left: 50%; width: min(100%, 520px); transform: translateX(-50%); padding: 12px 22px calc(env(safe-area-inset-bottom, 0px) + 24px); text-align: center; }
#mh-smart-scan .mh-smart-modes { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; width: min(100%, 320px); margin: 0 0 14px; padding: 4px; border: 1px solid #ffffff4a; border-radius: 999px; background: #071d36bf; backdrop-filter: blur(10px); }
#mh-smart-scan .mh-smart-modes button { padding: 9px 12px; border-radius: 999px; color: #e0edf9; }
#mh-smart-scan .mh-smart-modes button[aria-pressed="true"] { background: #fff; color: #063369; }
#mh-smart-scan #mh-smart-status { margin: 0 auto 9px; min-height: 0; color: #fff; font-size: 12px; text-shadow: 0 1px 6px #000; }
#mh-smart-status:empty { display: none; }
.mh-smart-actions { display: flex; justify-content: center; align-items: center; gap: 27px; }
#mh-smart-scan .mh-smart-actions button { display: grid; place-items: center; padding: 0; cursor: pointer; }
#mh-smart-scan .mh-smart-gallery, #mh-smart-scan .mh-smart-retry { width: 44px; height: 44px; border: 1px solid #ffffff90; border-radius: 50%; background: #071d36a8; color: #fff; font-size: 26px; }
.mh-smart-gallery svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#mh-smart-scan #mh-smart-analyze { width: 68px; height: 68px; min-height: 0; border: 3px solid #fff; border-radius: 50%; background: transparent; }
#mh-smart-scan #mh-smart-analyze span { width: 52px; height: 52px; border-radius: 50%; background: #fff; transition: transform .2s, background .2s; }
#mh-smart-scan #mh-smart-analyze:disabled { opacity: .55; cursor: wait; }
.mh-smart-caption { display: block; margin-top: 8px; color: #fff; font-size: 11px; text-shadow: 0 1px 5px #000; }
#mh-smart-scan:not(.has-camera) .mh-smart-guide { opacity: .35; }
.mh-smart-review[hidden] { display: none !important; }
.mh-smart-review { position: absolute; z-index: 2; bottom: 0; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; width: min(100%, 600px); max-height: 84dvh; border-radius: 24px 24px 0 0; background: #fff; color: #072955; box-shadow: 0 -12px 40px #00162c70; }
.mh-smart-review-head { display: flex; align-items: center; gap: 12px; flex: none; padding: 14px 18px; border-bottom: 1px solid #e1edf7; }
.mh-smart-review-head strong { flex: 1; font-size: 15px; }
#mh-smart-scan .mh-smart-review-head button { width: 38px; height: 38px; border-color: #d5e5f4; background: #fff; color: #07386a; font-size: 24px; }
.mh-smart-review-scroll { overflow: auto; overscroll-behavior: contain; padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 22px); }
#mh-smart-scan.is-review .mh-smart-controls, #mh-smart-scan.is-review .mh-smart-guide, #mh-smart-scan.is-review #mh-smart-hint { display: none; }
@media (hover: hover) { #mh-smart-scan button:hover:not(:disabled) { filter: brightness(1.12); } #mh-smart-scan #mh-smart-analyze:hover span { transform: scale(.88); background: #bfe7ff; } }
#mh-smart-scan button:focus-visible { outline: 3px solid #4ebaff; outline-offset: 3px; }
@media (max-height: 650px) { #mh-smart-scan #mh-smart-hint { top: 16%; } .mh-smart-guide { top: 24%; height: 27%; } .mh-smart-controls { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); } }
