/* Estilos do controle web, tirados do design aprovado (Controle.dc.html). Medidas em px do design (390 de largura). */
:root {
  --bg: #0E1116; --surface: #1B2129; --key: #262D37; --segment: #2C3540; --outline: #3A4350; --divider: #222933;
  --text: #F2F4F7; --muted: #9AA4B2; --accent: #21C063; --accent-bg: #12301F; --accent-border: #1D4A30; --accent-text: #CFEFDC;
  --danger: #FF8A8A; --danger-bg: #2A1416; --danger-border: #3A1F22; --on-accent: #0E1116;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; padding: 0; }
input { font-family: inherit; -webkit-user-select: text; user-select: text; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.screen { min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 20px 20px; }
.screen.tall { padding-top: 56px; padding-bottom: 32px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--muted); }
h1 { margin: 20px 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
h1.sm { font-size: 26px; letter-spacing: -0.3px; margin-top: 16px; }
h2 { margin: 18px 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
p.lead { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.error { margin-top: 20px; font-size: 14px; line-height: 1.5; color: var(--danger); }
.ok-note { margin-top: 20px; font-size: 14px; color: var(--accent); font-weight: 500; }

/* Botões (.btn do design): encolhem e clareiam no toque */
.btn { border: none; background: transparent; transition: transform .14s cubic-bezier(.2,.8,.2,1), filter .2s ease, box-shadow .25s ease; }
.btn:active { transform: scale(.93); filter: brightness(1.35); }
.card { background: var(--surface); border: 1px solid var(--key); }
.primary { height: 56px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 700; width: 100%; }
.primary:disabled { background: var(--outline); }
.outline { height: 56px; border-radius: 16px; border: 2px solid var(--outline); font-size: 16px; font-weight: 600; width: 100%; }
.link { height: 44px; font-size: 15px; font-weight: 500; text-decoration: underline; width: 100%; }
.back { width: 44px; height: 44px; margin-left: -10px; border-radius: 22px; display: flex; align-items: center; justify-content: center; }
.okbtn { transition: transform .16s cubic-bezier(.3,1.5,.5,1), box-shadow .3s ease; box-shadow: 0 0 0 0 rgba(33,192,99,0), 0 10px 30px rgba(33,192,99,.28); }
.okbtn:active { transform: scale(.9); box-shadow: 0 0 0 10px rgba(33,192,99,.18), 0 4px 14px rgba(33,192,99,.4); }

/* Animações do design */
.scr { animation: scrIn .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes scrIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.tabR { animation: tabR .36s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tabR { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
.tabL { animation: tabL .36s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tabL { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pop { animation: pop .34s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
.ripple { position: fixed; z-index: 50; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; pointer-events: none;
  background: rgba(33,192,99,.42); animation: rip .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes rip { from { transform: scale(0); opacity: .85; } to { transform: scale(10); opacity: 0; } }
.okpulse { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; border: 3px solid var(--accent); animation: okp .65s ease-out forwards; }
@keyframes okp { from { transform: scale(1); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.live { animation: live 2.2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(33,192,99,.6); } 70% { box-shadow: 0 0 0 7px rgba(33,192,99,0); } 100% { box-shadow: 0 0 0 0 rgba(33,192,99,0); } }
.breathe { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.spin { animation: spin 1s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.slide { transition: transform .42s cubic-bezier(.3,1.25,.5,1); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Cabeçalho, aviso e abas */
.header { justify-content: space-between; min-height: 56px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
.dot.off { background: var(--muted); }
.round { width: 52px; height: 52px; border-radius: 26px; border: 1px solid var(--key); background: var(--surface); display: flex; align-items: center; justify-content: center; }
.round.danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.pillrow { margin-top: 8px; height: 32px; display: flex; align-items: center; justify-content: center; }
.pill { height: 30px; padding: 0 14px 0 10px; border-radius: 15px; background: var(--accent-bg); color: var(--accent-text); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.nav { position: relative; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--divider); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav .bar { position: absolute; top: -2px; left: 0; width: calc(100% / 3); height: 3px; display: flex; justify-content: center; }
.nav .bar span { width: 40px; height: 3px; border-radius: 2px; background: var(--accent); }
.nav button { height: 56px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); transition: color .25s ease; }
.nav button.on { color: var(--accent); }

/* Controle */
.seg { position: relative; margin-top: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
.seg .knob { position: absolute; top: 4px; left: 4px; bottom: 4px; width: calc(50% - 6px); border-radius: 10px; background: var(--segment); }
.seg button { position: relative; height: 40px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); transition: color .25s ease; }
.seg button.on { color: var(--text); }
.dpad { margin: 20px auto 0; position: relative; width: 300px; height: 300px; border-radius: 150px; background: var(--surface); border: 1px solid var(--key); }
.dpad .ring { position: absolute; inset: 78px; border-radius: 50%; border: 1px solid var(--key); }
.dir { position: absolute; border: none; background: transparent; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease; }
.dir svg { transition: transform .16s cubic-bezier(.3,1.5,.5,1); }
.dir:active { background: radial-gradient(circle at center, rgba(33,192,99,.32), rgba(33,192,99,0) 72%); }
.dir:active svg { transform: scale(1.25); }
.dir.up { top: 0; left: 99px; width: 100px; height: 88px; border-radius: 50px 50px 24px 24px; }
.dir.down { bottom: 0; left: 99px; width: 100px; height: 88px; border-radius: 24px 24px 50px 50px; }
.dir.left { top: 99px; left: 0; width: 88px; height: 100px; border-radius: 50px 24px 24px 50px; }
.dir.right { top: 99px; right: 0; width: 88px; height: 100px; border-radius: 24px 50px 50px 24px; }
.okwrap { position: absolute; top: 89px; left: 89px; width: 120px; height: 120px; }
.ok { position: relative; width: 120px; height: 120px; border-radius: 60px; background: var(--accent); color: var(--on-accent); font-size: 26px; font-weight: 700; border: none; }
.pad { position: relative; margin-top: 20px; height: 300px; border-radius: 24px; border: 1px solid var(--key); overflow: hidden;
  background-color: #11161C; background-image: radial-gradient(rgba(154,164,178,.16) 1px, transparent 1.3px); background-size: 22px 22px; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pad .hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; pointer-events: none; font-size: 15px; font-weight: 600; }
.pad .foot { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bigkey { height: 64px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 500; }
.vol { flex: 1; height: 64px; border-radius: 20px; display: flex; align-items: center; }
.vol button { flex: 1; height: 62px; border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.sq { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; }

/* Apps */
.status { margin-top: 4px; padding: 14px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 12px; }
.status .k { font-size: 12px; color: var(--muted); }
.status .v { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.membar { height: 6px; border-radius: 3px; background: var(--key); overflow: hidden; }
.membar div { height: 6px; width: 100%; border-radius: 3px; background: var(--accent); transform-origin: left center; }
.half { height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.half.go { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.half.go:disabled { background: var(--outline); }
.half.line { border: 2px solid var(--outline); font-weight: 600; }
.shortcut { min-height: 66px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--accent-border); background: var(--accent-bg); text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.shortcut b { font-size: 15px; font-weight: 600; }
.shortcut span { font-size: 12px; line-height: 1.3; color: var(--accent-text); }
.newsc { min-height: 66px; border-radius: 14px; border: 2px dashed var(--outline); color: var(--muted); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.appbtn { height: 50px; border-radius: 14px; font-size: 14px; font-weight: 600; transition: border-color .3s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.appbtn.on { border-color: var(--accent); }

/* Campos, caixas do código, interruptores */
.field { margin-top: 8px; height: 56px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--accent); background: var(--surface); color: var(--text);
  font-size: 17px; outline: none; box-shadow: 0 0 0 4px rgba(33,192,99,0.12); width: 100%; }
.field.plain { height: 52px; border-color: var(--key); box-shadow: none; font-size: 16px; }
.codes { margin-top: 12px; display: grid; gap: 8px; position: relative; }
.codes .box { height: 64px; border-radius: 14px; background: var(--surface); border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.codes .box.cur { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(33,192,99,0.15); }
.codes .caret { width: 2px; height: 28px; background: var(--accent); }
.codes input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }
.tip { margin-top: 24px; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--accent-border); background: var(--accent-bg); font-size: 14px; line-height: 1.5; color: var(--accent-text); }
.settings { border-radius: 18px; overflow: hidden; }
.setrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 16px; border: none; border-bottom: 1px solid var(--key); background: transparent; text-align: left; }
.setrow:last-child { border-bottom: none; }
.setrow b { display: block; font-size: 16px; font-weight: 600; }
.setrow small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.track { position: relative; flex-shrink: 0; width: 52px; height: 32px; border-radius: 16px; background: var(--outline); transition: background-color .25s ease; }
.track i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 12px; background: var(--muted); box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .28s cubic-bezier(.3,1.4,.5,1), background-color .2s ease; }
.track.on { background: var(--accent); }
.track.on i { background: #fff; transform: translateX(20px); }
.step { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 6px 6px 16px; border-radius: 14px; }
.step .n { width: 28px; height: 28px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step .t { flex: 1; font-size: 16px; font-weight: 600; }
.chip { height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--outline); font-size: 14px; font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.danger-btn { height: 44px; padding: 0 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 600; }
.copyrow { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 8px 8px 14px; border-radius: 14px; }
.copyrow span { flex: 1; font-size: 15px; font-weight: 600; }
.small-btn { height: 36px; padding: 0 12px; border-radius: 10px; background: var(--key); font-size: 13px; font-weight: 600; }
ol.howto { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.haptic-switch { position: fixed; left: -9999px; opacity: 0; }
button { touch-action: manipulation; }
body { -webkit-touch-callout: none; }
.tip .btn { color: var(--accent-text); width: 32px; height: 32px; margin: -6px -8px 0 0; display: flex; align-items: center; justify-content: center; }
.tip { margin-top: 12px; }
.vol span { flex: 0 0 auto; }
.half { min-width: 0; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.half svg { flex-shrink: 0; }
