:root {
  color-scheme: dark;
  --bg: #050915;
  --panel: #0a1326;
  --panel-2: #0f1b33;
  --text: #edf1ff;
  --muted: #94a3c1;
  --cyan: #72d9ff;
  --green: #6ee4c1;
  --red: #ff9a9a;
  --border: #839aca26;
  --radius: 14px;
}

* { box-sizing: border-box; }
/* As seções usam display: grid/flex; sem isto, o atributo hidden não esconde nada. */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #15254866, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
a { color: var(--cyan); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}
.brand { color: var(--text); text-decoration: none; font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.brand span { color: var(--cyan); }

main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 8px 20px 40px; }

.banner { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #2a1618; color: var(--red); }

.landing { text-align: center; padding: 12vh 0 8vh; display: grid; justify-items: center; gap: 14px; }
.landing h1 { margin: 0; font-size: clamp(2rem, 6vw, 3rem); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.landing p { margin: 0 0 8px; color: var(--muted); max-width: 42ch; }

.primary, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.primary { background: var(--cyan); color: #04111c; }
.primary:hover { filter: brightness(1.08); }
.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.ghost:hover { background: var(--panel-2); }
.danger { color: var(--red); }
button:disabled { opacity: .55; cursor: wait; }

.account { display: grid; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; }
input, select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.note { color: var(--muted); font-size: .9rem; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.inline input { flex: 1 1 220px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.grow { flex: 1 1 220px; min-width: 0; }
.grow strong { display: block; font-weight: 600; }
.grow small { color: var(--muted); overflow-wrap: anywhere; }
.chip { font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.chip.ok { color: var(--green); background: #0e2a24; }
.chip.warn { color: #f2c46d; background: #2b2310; }
.chip.off { color: var(--red); background: #321518; }
.secret-form { display: flex; gap: 8px; flex: 1 1 100%; flex-wrap: wrap; }
.secret-form input { flex: 1 1 220px; }

.foot { text-align: center; padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 20px); font-size: .88rem; }
.foot a { color: var(--muted); }

/* ── Casca com a pessoa logada: barra lateral à esquerda, conteúdo à direita ─────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
body.signed { flex-direction: row; height: 100dvh; overflow: hidden; }
body.signed .shell { height: 100dvh; }
body.signed .topbar { max-width: none; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; min-height: 60px; }
body.signed main { position: relative; max-width: none; min-height: 0; padding: 0; overflow: hidden; }
body.signed .foot { display: none; }
body.signed .banner { position: absolute; z-index: 20; top: 4px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(640px, calc(100% - 32px)); margin: 0; box-shadow: 0 8px 24px #0009; }
.brand-top { display: none; }
body.signed[data-sidebar="closed"] .brand-top { display: inline; }
.chat-title { flex: 1; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title[hidden] + .mode { margin-left: auto; }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.mode { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); flex: none; }
.mode-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.mode-btn svg { width: 16px; height: 16px; fill: currentColor; }
.mode-btn:hover { color: var(--text); }
.mode-btn[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
#voice-toggle[aria-pressed="true"] { background: linear-gradient(120deg, #173d63, #3c2f6b); }
#voice-toggle[aria-pressed="true"] svg { fill: var(--cyan); }

.sidebar { width: 272px; flex: none; height: 100dvh; display: flex; flex-direction: column; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px); background: #070d1c; border-right: 1px solid var(--border); }
body[data-sidebar="closed"] .sidebar { display: none; }
/* Na voz a tela é só dela: sem barra lateral nem botão de abrir. */
body[data-view="voice"] .sidebar, body[data-view="voice"] .scrim, body[data-view="voice"] #sidebar-open { display: none !important; }
body.signed[data-view="voice"] .brand-top { display: inline; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 10px; min-height: 40px; }
.side-new { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 600; cursor: pointer; }
.side-new:hover { background: var(--panel-2); }
.side-new svg { width: 18px; height: 18px; fill: var(--cyan); }
.side-search { min-height: 38px; background: transparent; }
.side-list { flex: 1; min-height: 0; overflow: hidden auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: #839aca40 transparent; }
.side-period { margin: 12px 0 4px; padding: 0 10px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6f7f9f; }
.side-period:first-child { margin-top: 0; }
.side-empty { margin: 8px 10px; }
.side-item { display: flex; align-items: center; border-radius: 10px; }
.side-item:hover, .side-item:focus-within, .side-item[aria-current="true"] { background: var(--panel-2); }
.side-open { flex: 1; min-width: 0; min-height: 38px; padding: 0 10px; border: 0; background: none; color: var(--text); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: .93rem; }
.side-item:not([aria-current="true"]) .side-open { color: #c3cde4; }
.side-remove { flex: none; width: 32px; height: 32px; margin-right: 3px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0; }
.side-item:hover .side-remove, .side-remove:focus-visible { opacity: 1; }
.side-remove:hover { background: #321518; color: var(--red); }
@media (hover: none) { .side-item[aria-current="true"] .side-remove { opacity: 1; } }
.side-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.tabs { flex: 1; min-width: 0; display: flex; }
.tab { border: 0; background: transparent; color: var(--text); cursor: pointer; }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.side-user:hover, .side-user[aria-current="page"] { background: var(--panel-2); }
.side-user img { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); }
.who-text { min-width: 0; display: grid; }
.who-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: .92rem; }
.who-text small { color: var(--muted); font-size: .78rem; }
.side-logout { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.scrim { display: none; }
@media (max-width: 899px) {
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); box-shadow: 0 0 40px #000c; }
  body[data-sidebar="open"] .scrim { display: block; position: fixed; z-index: 39; inset: 0; background: #02050ccc; }
  .mode-btn { padding: 0 12px; }
}
.link { border: 0; padding: 0; background: none; color: var(--cyan); text-decoration: underline; cursor: pointer; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); }
.stats { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; overflow-wrap: anywhere; }

/* ── Conversa ───────────────────────────────────────────────────────── */
.account { height: 100%; overflow-y: auto; padding: 8px 20px 40px; align-content: start; }
.account > * { width: 100%; max-width: 860px; margin-inline: auto; }
.chat { display: flex; flex-direction: column; height: 100%; }
.column { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 24px; scrollbar-width: thin; scrollbar-color: #839aca40 transparent; }
.chat-dock { flex: none; padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 10px); }
.chat-dock .column { display: grid; gap: 10px; }
/* Conversa vazia: saudação e caixa de mensagem no meio da tela, como no OpenWebUI. */
.chat[data-empty="true"] { justify-content: center; padding-bottom: 8vh; }
.chat[data-empty="true"] .chat-scroll { flex: 0 1 auto; max-height: 45%; padding-bottom: 8px; }
.chat[data-empty="true"] .column { max-width: 720px; }
.hero { display: grid; justify-items: center; gap: 6px; margin-bottom: 14px; text-align: center; }
.hero img { border-radius: 16px; box-shadow: 0 0 32px #256cd155; }
.hero h2 { margin: 8px 0 0; font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 600; letter-spacing: -.02em; }
.hero p { margin: 0; max-width: 46ch; color: var(--muted); text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip-btn { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: #c3cde4; font-size: .9rem; cursor: pointer; }
.chip-btn:hover { background: var(--panel-2); color: var(--text); }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; align-content: start; }
.msg { display: grid; gap: 8px; min-width: 0; }
.msg.user { justify-self: end; max-width: min(620px, 88%); }
.msg.model { justify-self: stretch; }
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-head img { border-radius: 50%; }
.msg-head strong { font-size: .92rem; font-weight: 600; }
.bubble { overflow-wrap: anywhere; }
.msg.user .bubble { padding: 10px 16px; border-radius: 20px; border-bottom-right-radius: 6px; background: var(--panel-2); }
.msg.model .bubble { padding: 0 0 0 36px; line-height: 1.65; }
.msg.model .status, .msg.model .extras, .msg-actions { margin-left: 36px; }
.msg-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.msg.model:hover .msg-actions, .msg.model:last-child .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg.model:has(.bubble[hidden]) .msg-actions { display: none; }
.msg-action { min-height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer; }
.msg-action:hover { background: var(--panel-2); color: var(--text); }
@media (max-width: 560px) {
  .msg.model .bubble { padding-left: 0; }
  .msg.model .status, .msg.model .extras, .msg-actions { margin-left: 0; }
}
.bubble p { margin: 0 0 8px; }
.bubble p:last-child, .bubble ul:last-child, .bubble ol:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 8px; padding-left: 1.3em; }
.bubble code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.bubble pre { margin: 0 0 8px; padding: 10px; border-radius: 8px; background: var(--bg); overflow-x: auto; font-size: .88rem; }
.status { margin: 0; color: var(--muted); font-size: .9rem; }
.status:empty { display: none; }
.status:not(:empty)::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--cyan); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status::after { animation: none; } }
.extras { display: grid; gap: 8px; }
.extras:empty { display: none; }
.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #2a1618; color: var(--red); }

.widget { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); display: grid; gap: 8px; }
.widget summary { cursor: pointer; font-weight: 600; }
.widget .note { margin: 0; font-size: .85rem; }
.sources { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-size: .92rem; overflow-wrap: anywhere; }
.sources small { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist li::before { content: "○ "; color: var(--cyan); }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done::before { content: "● "; color: var(--green); }
.flashcard .front { margin: 0; font-size: 1.1rem; font-weight: 600; }
.flashcard .back { margin: 0; padding-top: 8px; border-top: 1px solid var(--border); color: var(--green); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz fieldset { margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.quiz legend { padding: 0; font-weight: 600; }
.option { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; cursor: pointer; }
.option input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--cyan); }
.results { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.results li { display: grid; gap: 2px; }
.results small { color: var(--muted); }
.results .r-true::marker { color: var(--green); }
.results .r-false::marker { color: var(--red); }

.composer { display: grid; gap: 4px; padding: 8px 8px 8px 8px; border-radius: 26px; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 10px 30px #0006; }
.composer:focus-within { border-color: #72d9ff55; }
.composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  padding: 10px 12px 4px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-row .grow { flex: 1; }
.round-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.round-btn svg { width: 20px; height: 20px; fill: currentColor; }
.round-btn:hover { background: var(--panel-2); color: var(--text); }
.round-btn.talk { background: linear-gradient(120deg, #173d63, #3c2f6b); border-color: #72d9ff55; color: var(--cyan); }
.round-btn.talk:hover { filter: brightness(1.2); }
.round-btn.send { background: var(--cyan); color: #04111c; }
.round-btn.send:hover { filter: brightness(1.08); background: var(--cyan); color: #04111c; }
.photo-panel { display: grid; gap: 8px; padding: 4px 4px 0; }
.photo-panel video { width: 100%; max-height: 46svh; border-radius: 14px; background: #000; object-fit: contain; }
.photo-panel video.mirrored { transform: scaleX(-1); }
.photo-panel .row { display: flex; justify-content: center; gap: 8px; }
.photo-panel .primary { min-height: 40px; }
.bubble .photo-thumb { display: block; max-width: 180px; max-height: 180px; border-radius: 10px; margin-bottom: 6px; }
.bubble .photo-tag { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.usage { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.usage:empty { display: none; }
.table-wrap { overflow-x: auto; margin: 0 0 8px; }
.bubble table { border-collapse: collapse; font-size: .92rem; }
.bubble th, .bubble td { padding: 4px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.bubble th { color: var(--muted); font-weight: 600; }

/* ── Voz: tela própria. A Elektra ocupa o espaço que sobra e nunca rola para fora. ───── */
.voice-view { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 20px calc(env(safe-area-inset-bottom, 0px) + 14px); background: radial-gradient(ellipse at 50% 42%, #14284f66, transparent 66%); }
.portrait-stage {
  position: relative; flex: 1 1 0; min-height: 180px; width: 100%; max-width: 760px; isolation: isolate; overflow: hidden;
  border-radius: 24px; background: radial-gradient(ellipse at 50% 55%, #14395a55, transparent 64%);
}
.portrait-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; mask-image: linear-gradient(to bottom, #000 82%, transparent 100%); }
.portrait-halo {
  position: absolute; z-index: 0; height: 88%; aspect-ratio: 1; top: 4%; left: 50%;
  transform: translateX(-50%) rotate(-23deg) scale(calc(1 + var(--voice-level, 0) * .04));
  border: 1px solid #4499ed37; border-radius: 50%; box-shadow: 0 0 28px #256cd126, inset 0 0 28px #256cd114;
}
.portrait-state {
  position: absolute; z-index: 4; bottom: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; border: 1px solid #75a7dd33; background: #071324e8;
  border-radius: 20px; padding: 5px 13px; font-size: .8rem; color: #a6ccec;
}
.portrait-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #60738f; }
body[data-voice="listening"] .portrait-state::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
body[data-voice="hearing"] .portrait-state::before,
body[data-voice="speaking"] .portrait-state::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
body[data-voice="thinking"] .portrait-state::before { background: #b18cff; }
body[data-voice="sleeping"] .portrait-state::before { background: #f2c46d; }
.input-meter { flex: none; width: 100%; height: 4px; max-width: 220px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.input-meter i { display: block; height: 100%; width: calc(var(--input-level, 0) * 100%); background: var(--cyan); transition: width .1s linear; }
.camera-video { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: contain; background: #000; }
.camera-video.mirrored { transform: scaleX(-1); }
.voice-note { flex: none; margin: 0; padding: 8px 12px; border-radius: 10px; background: #2a1618; color: var(--red); font-size: .9rem; text-align: center; }
.voice-cards { flex: 0 1 auto; min-height: 0; max-height: 36%; width: 100%; max-width: 560px; overflow-y: auto; display: grid; gap: 8px; align-content: start; scrollbar-width: thin; scrollbar-color: #839aca40 transparent; }
.voice-actions { flex: none; display: flex; justify-content: center; gap: 18px; }
.voice-btn { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .78rem; cursor: pointer; }
.voice-btn svg { box-sizing: content-box; width: 24px; height: 24px; padding: 16px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); fill: var(--text); }
.voice-btn:hover svg { filter: brightness(1.25); }
.voice-btn[aria-pressed="true"] svg { background: #173d63; border-color: var(--cyan); fill: var(--cyan); }
#voice-mute[aria-pressed="true"] svg { background: #2b2310; border-color: #f2c46d88; fill: #f2c46d; }
.voice-btn.end svg { background: #b3261e; border-color: #ff9a9a55; fill: #fff; }
.voice-btn.end { color: var(--red); }
.voice-view .usage { flex: none; }

/* ── F4: e-mail, agenda, confirmação, avisos ───────────────────────── */
.mail-list, .event-list, .confirm-details { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mail-list li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.mail-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mail-list li.unread strong::before { content: "● "; color: var(--cyan); }
.mail-list small, .mail-list span { color: var(--muted); font-size: .86rem; }
.event-list li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.event-list time { color: var(--cyan); font-variant-numeric: tabular-nums; }
.event-list small { color: var(--muted); }
.confirm { border-color: #f2c46d55; }
.confirm-details li { color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.confirm[data-status="done"] { border-color: #6ee4c155; }
.countdown { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.progress { height: 8px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--cyan); }
.notice { border-color: #72d9ff66; }
.integration { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.note.small { font-size: .8rem; flex-basis: 100%; margin: 0; }

/* ── Música ─────────────────────────────────────────────────────────── */
.music-bar { display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 8px 24px #0008; }
.music-frame iframe { display: block; width: 100%; max-width: 420px; aspect-ratio: 16 / 9; min-height: 200px; border: 0; border-radius: 10px; margin: 0 auto; }
.music-info { display: grid; gap: 2px; min-width: 0; }
.music-info strong, .music-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-info small { color: var(--muted); }
.music-bar .row { justify-content: center; }

/* ── Casa ───────────────────────────────────────────────────────────── */
.camera-shot { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 10px; background: #000; }
.battery-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.battery-list li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.battery-list li.low b { color: #f2c46d; }
.battery-list li.critical b { color: var(--red); }

/* Portaria, rotinas e confirmações pendentes */
.pending-actions { display: grid; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); }
.door-watch { display: grid; gap: 12px; margin-top: 14px; }
.door-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.door-event { display: flex; gap: 12px; align-items: flex-start; }
.door-event img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; background: var(--panel-2); }
.door-event .grow { display: grid; gap: 2px; min-width: 0; }
@media (max-width: 480px) { .door-event img { width: 96px; } }

/* E-mail: caixas, triagem e resumo */
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; }
label.check input { width: auto; }
.mail-digest-box { display: grid; gap: 8px; margin: 0 0 14px; }
.mail-digest-box > button { justify-self: end; }
#mail-accounts input { max-width: 260px; }
#mail-triage { display: grid; gap: 8px; margin-top: 14px; }
.mail-imap { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); }

/* ── souls: com quem é a conversa ─────────────────────────────────────────────────────────────── */
.soul-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.soul-btn { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 16px 8px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; text-align: left; }
.soul-btn:hover { background: var(--panel-2); }
.soul-btn[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.soul-btn img, .hero .soul-btn img { border-radius: 50%; box-shadow: none; object-fit: cover; }
.soul-btn span { display: grid; line-height: 1.2; }
.soul-btn small { color: var(--muted); font-size: .8rem; }
.side-soul { border-radius: 50%; vertical-align: -4px; margin-right: 6px; object-fit: cover; }
.msg-head img, #hero-icon { object-fit: cover; }
/* A cor do soul em uso (--soul-aura) vem do servidor, via applySoul(). */
body:not([data-soul="elektra"]) .hero img#hero-icon { box-shadow: 0 0 32px color-mix(in srgb, var(--soul-aura) 35%, transparent); }
body:not([data-soul="elektra"]) .soul-btn[aria-pressed="true"] { border-color: var(--soul-aura); box-shadow: 0 0 0 1px var(--soul-aura) inset; }
body:not([data-soul="elektra"]) .portrait-halo { border-color: color-mix(in srgb, var(--soul-aura) 25%, transparent); box-shadow: 0 0 28px color-mix(in srgb, var(--soul-aura) 15%, transparent), inset 0 0 28px color-mix(in srgb, var(--soul-aura) 8%, transparent); }

.lesson h3 { margin: 0; font-size: 1rem; }
.lesson h4 { margin: 6px 0 0; font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lesson-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.lesson-list li { display: grid; gap: 2px; }
.lesson-list s { color: var(--red); text-decoration-thickness: 1px; }
.lesson-list strong { color: var(--green); font-weight: 600; }
.lesson-list small { color: var(--muted); }
.lesson-tip { margin: 4px 0 0; padding: 8px 10px; border-left: 2px solid var(--cyan); background: #ffffff08; border-radius: 0 8px 8px 0; }

/* ── perfis na Conta ─────────────────────────────────────────────────────────────────────────── */
.soul-item { display: grid !important; gap: 8px; }
.soul-line { display: flex; align-items: center; gap: 12px; }
.soul-line img { border-radius: 50%; object-fit: cover; }
.soul-line small { display: block; color: var(--muted); }
.soul-schedule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.soul-schedule label { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.soul-schedule input[type="text"] { flex: 1; min-width: 160px; }
.soul-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid .full { grid-column: 1 / -1; }
.grid h3 { margin: 4px 0 0; font-size: 1rem; }
.soul-tools { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 12px; }
.soul-tools legend { color: var(--muted); font-size: .9rem; padding: 0 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.grid textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; resize: vertical; }
.soul-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
