/* =========================================================
   JARVIS – visual HUD futurista
   ========================================================= */
:root {
  --bg-0: #02060f;
  --bg-1: #050d1d;
  --panel: rgba(6, 22, 40, 0.55);
  --panel-strong: rgba(8, 30, 54, 0.8);
  --line: rgba(0, 229, 255, 0.22);
  --line-strong: rgba(0, 229, 255, 0.55);
  --cyan: #00e5ff;
  --cyan-soft: #7df3ff;
  --blue: #2f7bff;
  --orange: #ff8a1f;
  --red: #ff3b5c;
  --green: #2bffb1;
  --text: #d8f6ff;
  --muted: #6f9db3;
  --c: 16px; /* tamanho do chanfro dos cantos */
  --font-tech: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --glow: 0 0 12px rgba(0, 229, 255, 0.55), 0 0 32px rgba(0, 229, 255, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 35%, #0a1d38 0%, var(--bg-1) 45%, var(--bg-0) 100%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
.hidden { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Fundo ---------- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-grid {
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: grid-drift 40s linear infinite;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}
.bg-hex {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66 0 50V16L28 0l28 16v34L28 66v34' fill='none' stroke='%2300e5ff' stroke-opacity='0.12'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  mask-image: radial-gradient(circle at 85% 12%, #000 0%, transparent 42%);
  -webkit-mask-image: radial-gradient(circle at 85% 12%, #000 0%, transparent 42%);
}
.bg-vignette { background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.65) 100%); }
.bg-scan {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
@keyframes grid-drift { to { background-position: 44px 44px, 44px 44px; } }

/* ---------- Telas ---------- */
.screen {
  position: relative; z-index: 1;
  display: none;
  min-height: 100vh; min-height: 100dvh;
}
.screen.active { display: flex; animation: screen-in 0.6s ease both; }
@keyframes screen-in { from { opacity: 0; filter: blur(6px); transform: scale(0.985); } }

.logo {
  font-family: var(--font-tech);
  font-weight: 900;
  letter-spacing: 0.32em;
  color: var(--cyan-soft);
  text-shadow: var(--glow);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  padding-left: 0.32em;
}

/* ---------- Painéis com cantos chanfrados ---------- */
.panel {
  position: relative;
  background: linear-gradient(160deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line);
  padding: 18px 20px;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.05);
}
.chamfer {
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.chamfer::before, .chamfer::after {
  content: ""; position: absolute; height: 2px; width: calc(var(--c) * 1.42);
  background: var(--cyan); box-shadow: var(--glow); transform-origin: 0 50%; transform: rotate(45deg);
}
.chamfer::before { left: calc(100% - var(--c)); top: -1px; }
.chamfer::after { left: -1px; top: calc(100% - var(--c) - 1px); }
.panel-label {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--cyan);
  opacity: 0.85;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.panel-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.panel-title { font-family: var(--font-tech); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; margin-bottom: 16px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px;
  font-family: var(--font-tech); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-soft);
  border: 1px solid var(--line-strong);
  background: rgba(0, 229, 255, 0.07);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible { background: rgba(0, 229, 255, 0.18); color: #fff; box-shadow: var(--glow); outline: none; }
.btn svg { width: 20px; height: 20px; }
.btn.danger { color: var(--orange); border-color: rgba(255, 138, 31, 0.5); background: rgba(255, 138, 31, 0.07); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--cyan-soft); border: 1px solid var(--line); border-radius: 50%;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--orange); border-color: var(--orange); box-shadow: 0 0 12px rgba(255, 138, 31, 0.5); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Avatares hexagonais ---------- */
.hex-avatar {
  --s: 64px;
  width: var(--s); height: calc(var(--s) * 1.1);
  display: grid; place-items: center;
  font-family: var(--font-tech); font-weight: 700; font-size: calc(var(--s) * 0.38);
  color: #001a22;
  background: linear-gradient(160deg, var(--cyan-soft), var(--cyan) 55%, var(--blue));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  flex-shrink: 0;
}
.hex-avatar.big { --s: 96px; }
.hex-avatar.small { --s: 30px; }
.hex-avatar.managed { background: linear-gradient(160deg, #ffd29a, var(--orange) 60%, #b5520a); }

/* ---------- Tela de inicialização ---------- */
#boot { flex-direction: column; align-items: center; justify-content: center; gap: 18px; cursor: pointer; padding: 24px; }
.boot-core { width: min(260px, 60vw); aspect-ratio: 1; }
.boot-core canvas, .login-core canvas { width: 100%; height: 100%; display: block; }
.boot-lines { list-style: none; font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 0.18em; color: var(--muted); min-height: 5.6em; text-align: center; }
.boot-lines li { animation: line-in 0.3s ease both; line-height: 1.6; }
.boot-lines li.ok::after { content: "  ✓"; color: var(--green); }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } }
.boot-bar { width: min(320px, 70vw); height: 3px; background: rgba(0, 229, 255, 0.12); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: var(--glow); transition: width 0.35s ease; }
.boot-skip { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; }

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; padding-left: 0.32em; opacity: 0.6;
}
.glitch::before { color: var(--blue); animation: glitch 2.4s infinite steps(1); }
.glitch::after { color: var(--orange); animation: glitch 3.1s infinite steps(1) reverse; opacity: 0.35; }
@keyframes glitch {
  0%, 92%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  93% { transform: translate(-3px, 1px); clip-path: inset(20% 0 55% 0); }
  95% { transform: translate(3px, -1px); clip-path: inset(60% 0 10% 0); }
  97% { transform: translate(-2px, 0); clip-path: inset(40% 0 35% 0); }
}

/* ---------- Login ---------- */
#login { flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px 16px 40px; }
.login-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-core { width: 150px; aspect-ratio: 1; }
.tagline { color: var(--muted); letter-spacing: 0.12em; font-size: 0.9rem; }
.login-panel { width: min(520px, 100%); animation: screen-in 0.4s ease both; }

.profiles { display: grid; gap: 12px; }
.profile-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 14px 16px; border: 1px solid var(--line); background: rgba(0, 229, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.profile-card:not(:disabled):hover, .profile-card:not(:disabled):focus-visible {
  background: rgba(0, 229, 255, 0.12); border-color: var(--line-strong); transform: translateX(4px); outline: none;
}
.profile-card:disabled { cursor: not-allowed; opacity: 0.65; }
.profile-card .name { font-family: var(--font-tech); font-size: 1rem; letter-spacing: 0.08em; }
.profile-card .role { color: var(--muted); font-size: 0.95rem; }
.profile-card .status { margin-left: auto; font-family: var(--font-tech); font-size: 0.58rem; letter-spacing: 0.14em; color: var(--cyan); text-align: right; }
.profile-card .status.warn { color: var(--orange); }

#pinStep { display: flex; flex-direction: column; align-items: center; text-align: center; }
.back-btn { align-self: flex-start; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.1em; margin-bottom: 6px; }
.back-btn:hover { color: var(--cyan); }
.avatar-scan { position: relative; width: 140px; height: 140px; display: grid; place-items: center; margin-bottom: 14px; }
.scan-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed var(--line-strong);
  animation: spin 12s linear infinite;
}
.scan-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--cyan); border-bottom-color: var(--blue); animation: spin 3s linear infinite reverse; }
.scanline { position: absolute; left: 12%; right: 12%; height: 2px; top: 50%; background: var(--cyan); box-shadow: var(--glow); opacity: 0; }
.avatar-scan.scanning .scanline { opacity: 1; animation: scan 1.1s ease-in-out infinite alternate; }
.avatar-scan.scanning .hex-avatar { filter: brightness(1.3) drop-shadow(0 0 12px var(--cyan)); }
.avatar-scan.granted .scan-ring { border-color: var(--green); }
.avatar-scan.granted .hex-avatar { background: linear-gradient(160deg, #b9ffe6, var(--green)); }
.avatar-scan.denied { animation: shake 0.4s; }
.avatar-scan.denied .scan-ring { border-color: var(--red); }
@keyframes scan { from { top: 8%; } to { top: 92%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.hint { color: var(--muted); font-size: 0.95rem; margin: -8px 0 14px; min-height: 1.2em; }
.pin-dots { display: flex; gap: 14px; margin-bottom: 20px; }
.pin-dots span {
  width: 14px; height: 16px; border: 1px solid var(--line-strong);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: transparent; transition: background 0.15s, box-shadow 0.15s;
}
.pin-dots span.on { background: var(--cyan); box-shadow: var(--glow); }
.pin-dots.error span { background: var(--red); }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; margin-bottom: 16px; }
.pinpad button {
  height: 60px; font-family: var(--font-tech); font-size: 1.3rem; color: var(--cyan-soft);
  border: 1px solid var(--line); background: rgba(0, 229, 255, 0.04);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: background 0.15s, color 0.15s;
}
.pinpad button:hover { background: rgba(0, 229, 255, 0.14); color: #fff; }
.pinpad button:active { background: var(--cyan); color: #00121a; }
.pinpad button.fn { font-size: 0.7rem; letter-spacing: 0.1em; color: var(--muted); }
.btn-bio { margin-top: 4px; }
.msg { min-height: 1.4em; margin-top: 12px; font-size: 0.98rem; color: var(--cyan-soft); }
.msg.error { color: var(--red); }
.msg.warn { color: var(--orange); }

/* ---------- Painel principal ---------- */
#home { flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(2, 10, 22, 0.9), rgba(2, 10, 22, 0.4));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.brand { font-family: var(--font-tech); font-weight: 900; letter-spacing: 0.3em; color: var(--cyan-soft); text-shadow: var(--glow); display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.brand-hex { width: 18px; height: 20px; background: var(--cyan); box-shadow: var(--glow); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.sys { font-family: var(--font-tech); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--muted); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.8s infinite; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-family: var(--font-tech); font-size: 0.8rem; letter-spacing: 0.1em; }

.hud {
  flex: none;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  gap: 16px;
  padding: 16px 20px 20px;
  height: calc(100vh - 62px);
  height: calc(100dvh - 62px);
  min-height: 560px;
}
.col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.col-left, .col-right { overflow-y: auto; scrollbar-width: none; }
.col-left::-webkit-scrollbar, .col-right::-webkit-scrollbar { display: none; }
.col > .panel { flex-shrink: 0; }
.area-core { flex: 1 1 45%; min-height: 180px; display: grid; place-items: center; }
.area-chat { flex: 1 1 55%; display: flex; flex-direction: column; min-height: 220px; }
.col > * { animation: panel-in 0.6s ease both; }
.col-center > * { animation-delay: 0.12s; }
.col-right > * { animation-delay: 0.24s; }
.col > *:nth-child(2) { animation-delay: 0.32s; }
.col > *:nth-child(3) { animation-delay: 0.4s; }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px); } }

.greeting { font-family: var(--font-tech); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.05em; margin-bottom: 6px; }
.clock { font-family: var(--font-tech); font-weight: 500; font-size: 2.8rem; color: var(--cyan-soft); text-shadow: var(--glow); line-height: 1.1; }
.clock .sec { font-size: 1.2rem; color: var(--cyan); opacity: 0.7; }
.date { color: var(--muted); font-size: 1.05rem; }

.w-main { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.w-icon { width: 64px; height: 64px; color: var(--cyan-soft); filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6)); }
.w-icon svg { width: 100%; height: 100%; stroke-width: 1.3; }
.w-temp { font-family: var(--font-tech); font-size: 2.3rem; color: #fff; line-height: 1; }
.w-desc { color: var(--cyan-soft); font-size: 1.05rem; }
.w-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.w-grid div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0, 229, 255, 0.1); padding-bottom: 4px; }
.w-grid span { color: var(--muted); font-size: 0.92rem; }
.w-grid b { font-weight: 600; }
.w-loc { margin-top: 12px; font-family: var(--font-tech); font-size: 0.58rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }

.core-wrap { position: relative; height: 100%; max-height: 440px; aspect-ratio: 1; max-width: 100%; }
.core-wrap canvas { width: 100%; height: 100%; display: block; }
.core-state {
  position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%);
  font-family: var(--font-tech); font-size: 0.66rem; letter-spacing: 0.3em; color: var(--cyan);
  padding: 4px 12px; border: 1px solid var(--line); background: rgba(2, 10, 22, 0.6); white-space: nowrap;
}
.core-state.alert { color: var(--orange); border-color: rgba(255, 138, 31, 0.5); }

.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 6px; min-height: 120px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.msg-row { display: flex; flex-direction: column; max-width: 88%; animation: line-in 0.25s ease both; }
.msg-row .who { font-family: var(--font-tech); font-size: 0.55rem; letter-spacing: 0.2em; color: var(--muted); margin-bottom: 3px; }
.msg-row .bubble { padding: 9px 13px; line-height: 1.35; font-size: 1.02rem; border: 1px solid var(--line); white-space: pre-line; }
.msg-row.jarvis { align-self: flex-start; }
.msg-row.jarvis .bubble { background: rgba(0, 229, 255, 0.07); clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.msg-row.jarvis .who { color: var(--cyan); }
.msg-row.user { align-self: flex-end; align-items: flex-end; }
.msg-row.user .bubble { background: rgba(47, 123, 255, 0.14); border-color: rgba(47, 123, 255, 0.4); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.msg-row.alert .bubble { border-color: rgba(255, 138, 31, 0.6); background: rgba(255, 138, 31, 0.1); }

.chat-input { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.chat-input input {
  flex: 1; min-width: 0; padding: 12px 14px; background: rgba(0, 10, 20, 0.6);
  border: 1px solid var(--line); outline: none; font-size: 1.05rem;
}
.chat-input input:focus { border-color: var(--line-strong); box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.15); }
.chat-input input::placeholder { color: var(--muted); }
.mic-btn {
  width: 48px; height: 52px; flex-shrink: 0; display: grid; place-items: center;
  color: var(--cyan-soft); border: 1px solid var(--line-strong); background: rgba(0, 229, 255, 0.08);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: all 0.2s;
}
.mic-btn svg { width: 22px; height: 22px; }
.mic-btn:hover { background: rgba(0, 229, 255, 0.2); }
.mic-btn.listening { background: var(--cyan); color: #00121a; animation: pulse 1s infinite; }
.mic-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.send-btn {
  padding: 13px 16px; font-family: var(--font-tech); font-size: 0.66rem; letter-spacing: 0.16em;
  color: #00121a; background: var(--cyan); box-shadow: var(--glow);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.send-btn:hover { background: #fff; }
.chat-hint { font-size: 0.85rem; color: var(--muted); margin-top: 6px; min-height: 1.1em; }

.family, .modules { list-style: none; display: grid; gap: 8px; }
.family li { display: flex; align-items: center; gap: 12px; }
.family .hex-avatar { --s: 38px; }
.family .info b { display: block; font-family: var(--font-tech); font-size: 0.82rem; letter-spacing: 0.06em; font-weight: 500; }
.family .info span { color: var(--muted); font-size: 0.9rem; }
.family .you { margin-left: auto; font-family: var(--font-tech); font-size: 0.55rem; letter-spacing: 0.15em; color: var(--green); }

.modules li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid rgba(0, 229, 255, 0.1); background: rgba(0, 0, 0, 0.18); }
.modules .n { font-family: var(--font-tech); font-size: 0.7rem; color: var(--cyan); width: 22px; }
.modules .t { flex: 1; font-size: 0.98rem; }
.modules .s { font-family: var(--font-tech); font-size: 0.52rem; letter-spacing: 0.14em; padding: 3px 6px; border: 1px solid; }
.modules .s.on { color: var(--green); border-color: rgba(43, 255, 177, 0.5); }
.modules .s.off { color: var(--muted); border-color: rgba(111, 157, 179, 0.4); }
.modules li.locked .t { color: var(--muted); }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 14px; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 46px; height: 24px; border: 1px solid var(--line-strong); position: relative; background: rgba(0, 0, 0, 0.3); transition: background 0.2s; flex-shrink: 0; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--muted); transition: all 0.2s; }
.toggle input:checked + .track { background: rgba(0, 229, 255, 0.15); }
.toggle input:checked + .track .knob { left: 25px; background: var(--cyan); box-shadow: var(--glow); }
.toggle input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }
.bio-setting p { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.bio-setting .ok { color: var(--green); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .hud {
    grid-template-columns: minmax(0, 1fr);
    height: auto; min-height: 0;
    max-width: 720px; width: 100%; margin: 0 auto;
    padding: 14px 14px max(24px, env(safe-area-inset-bottom));
  }
  .col { display: contents; }
  .area-greet { order: 1; }
  .area-core { order: 2; min-height: 0; }
  .area-chat { order: 3; }
  .area-weather { order: 4; }
  .area-family { order: 5; }
  .area-modules { order: 6; }
  .area-settings { order: 7; }
  .core-wrap { height: auto; width: min(70vw, 340px); }
  .chat-log { max-height: 42vh; }
  .sys { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .topbar { padding: 10px 14px; }
  .brand { font-size: 0.8rem; letter-spacing: 0.22em; }
  #topUser { display: none; }
  .clock { font-size: 2.3rem; }
  .pinpad { grid-template-columns: repeat(3, 64px); }
  .send-btn { padding: 13px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
