/* Resenha 1.5: the active visual system. Legacy theme keys and DOM contracts stay intact. */
@font-face { font-family: Figtree; src: url('fonts/Figtree-variable.ttf') format('truetype'); font-weight: 300 900; font-style: normal; font-display: swap; }
html, body { font-family: Figtree, 'Segoe UI', system-ui, sans-serif; font-size: 14px; }
body { background: var(--bg-rail); }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
button { transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out); }
#titlebar { height: 38px; background: var(--bg-rail); color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.screen { top: 38px; }
#main { padding: 10px 16px 16px; gap: 10px; background: var(--bg-rail); }
#rail { display: none; }
#sidebar, #sidebar.first-pane { width: var(--side-w, 240px); border-radius: 24px; background: var(--bg-main); border: 1px solid var(--line2); overflow: hidden; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line2); }
.side-brand img { width: 54px; height: 48px; object-fit: contain; flex: none; }
.side-brand > span { font-size: 23px; font-weight: 750; letter-spacing: -.055em; color: var(--text-hi); }
.side-brand small { display: block; margin-top: 6px; font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
#room-header { height: 44px; margin: 12px 12px 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; background: var(--bg-panel); }
#room-menu { top: 132px; }
#channels { padding: 4px 12px 16px; }
.cat { padding: 20px 6px 6px; font-size: 11px; font-weight: 650; letter-spacing: .06em; color: var(--muted); }
.channel { border-radius: 12px; min-height: 38px; padding: 9px 10px; margin-bottom: 3px; gap: 9px; font-size: 13px; border: 1px solid transparent; }
.channel.active { background: var(--active); border-color: var(--line); color: var(--link); }
.channel.active .ic { color: var(--link); }
.channel.voice.connected { color: var(--green); background: var(--bg-panel); }
.channel.voice.connected .ic { color: var(--green); }
.voice-users { margin: 0 4px 8px 12px; padding: 4px 0 4px 6px; border-left: 1px solid var(--line); }
.vu, .ou { padding: 7px 5px; font-size: 12px; }
.tag { font-size: 11px; opacity: 1; background: var(--active); color: var(--link); }
.friend-row { display: flex; align-items: center; width: 100%; gap: 8px; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
.friend-row:hover { background: var(--hover); }
.friend-row > span { min-width: 0; overflow-wrap: anywhere; }
.friend-row .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.friend-row .badge { margin-left: auto; border-radius: 6px; padding: 2px 5px; background: var(--blurple); color: #fff; }
#voice-panel { margin: 8px 12px; padding: 10px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 16px; }
.vp-status > div { min-width: 0; }
#vp-title { font-size: 12px; }
#vp-sub { font-size: 11px; }
.vp-btn { border-radius: 10px; height: 36px; border: 1px solid var(--line2); background: var(--bg-input); }
#user-panel, #voice-panel.hidden + #user-panel { height: 64px; border-radius: 0; border-top: 1px solid var(--line2); background: transparent; margin: 0; padding: 8px; }
#up-name { font-size: 12px; }
#up-sub { font-size: 11px; }
.icon-btn { border-radius: 10px; }
#call, #chat { border: 1px solid var(--line2); border-radius: 24px; margin: 0; overflow: hidden; background: var(--bg-main); box-shadow: none; }
#call { min-width: 280px; }
#chat { width: var(--chat-w, 360px); min-width: 280px; max-width: 52vw; }
.splitter { width: 2px; margin: 0 -4px; background: transparent; }
.pane-header { height: 66px; min-height: 66px; padding: 14px 20px; gap: 10px; border-bottom: 1px solid var(--line2); }
.pane-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pane-heading small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pane-heading > span { font-size: 20px; font-weight: 650; letter-spacing: -.035em; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#call-count { font-size: 11px; padding: 5px 8px; border-radius: 20px; background: var(--bg-input); white-space: nowrap; }
#call-stage { padding: 16px; gap: 12px; }
.tile { border-radius: 18px; background: var(--bg-panel); border: 1px solid var(--line); box-shadow: none; }
.tile .avatar { width: 72px; height: 72px; font-size: 26px; box-shadow: 0 0 0 1px var(--line); }
.tile .label, html.light .tile .label { background: var(--bg-input); color: var(--text-hi); border: 1px solid var(--line); border-radius: 20px; padding: 5px 9px; font-size: 11px; bottom: 10px; left: 10px; }
.tile:not(.is-screen) .tile-tools { opacity: 1; top: 10px; right: 8px; }
.tile.is-screen { background: #000; border-color: var(--line); }
.tile.is-screen .label, html.light .tile.is-screen .label { background: #12141de8; color: #fff; border-color: #ffffff24; }
.tile-tools button { border-radius: 10px; }
.tile:focus-within .tile-tools { opacity: 1; }
.focus-strip { height: 118px; gap: 8px; }
.focus-strip .tile { flex: 1; min-width: 0; max-width: 180px; aspect-ratio: auto; }
.focus-strip .tile .avatar { width: 42px; height: 42px; font-size: 18px; transform: translateY(12px); }
.focus-strip .tile .label { max-width: calc(100% - 16px); left: 8px; bottom: 7px; font-size: 11px; padding: 4px 6px; }
.stream-invite { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 30px 16px; text-align: center; color: var(--text-hi); background: var(--bg-panel); }
.stream-invite strong { font-size: 16px; font-weight: 600; }
.stream-invite .muted { font-size: 12px; }
#pips { width: min(300px, 48%); }
#pips .tile { min-height: 175px; box-shadow: 0 8px 20px #0003; }
#call-controls { padding: 12px 16px 18px; gap: 10px; background: transparent; }
.cc-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-input); color: var(--text-hi); }
.cc-btn:hover { background: var(--hover); }
.cc-btn.on { background: var(--active); color: var(--link); }
.cc-btn.off, html.light .cc-btn.off { background: var(--active); color: var(--red); }
.cc-btn.danger { background: #8f2540; border-color: #d2506a; color: #fff; }
.live { font-size: 11px; letter-spacing: .04em; }
#messages { padding: 12px 0 8px; }
.msg { padding: 4px 16px 4px 60px; }
.msg.head { margin-top: 15px; }
.msg .avatar { width: 32px; height: 32px; left: 16px; font-size: 13px; }
.msg .author { font-size: 12px; }
.msg .time { font-size: 11px; }
.msg .text { font-size: 13px; line-height: 1.65; background: var(--bg-panel); padding: 9px 12px; border-radius: 0 14px 14px 14px; border: 1px solid var(--line2); margin-top: 5px; }
.msg:not(.head) .text { border-radius: 12px; margin-top: 0; }
.msg:hover { background: var(--msg-hover); }
.msg .hover-time { width: 51px; }
.welcome { padding: 12px 18px; }
.welcome .big-hash { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 16px; background: var(--active); color: var(--link); }
.welcome h1 { font-size: 20px; font-weight: 650; letter-spacing: -.035em; }
.welcome .muted { font-size: 12px; }
#composer { margin: 0 14px 14px; padding: 0; background: var(--bg-input); border: 1px solid var(--line); border-radius: 18px; }
#composer:focus-within { border-color: var(--link); }
.composer-row { background: transparent; border-radius: 18px; padding: 4px 8px; }
#input { font-size: 13px; line-height: 1.6; min-width: 0; }
.btn { border: 1px solid var(--line); border-radius: 12px; font-size: 12px; padding: 10px 15px; font-weight: 600; background: var(--btn); color: var(--text-hi); }
.btn.primary, .btn.primary:hover { color: #fff; border-color: transparent; }
.btn.green { color: #fff; background: #087e59; border-color: transparent; }
.btn.danger { color: #fff; }
.card { background: var(--bg-main); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: none; }
.card h2 { font-size: 24px; font-weight: 650; letter-spacing: -.04em; }
.field label { text-transform: none; font-size: 12px; letter-spacing: 0; font-weight: 500; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-input); min-height: 42px; }
.field input:focus, .field select:focus { box-shadow: 0 0 0 2px var(--accent-soft); border-color: var(--link); }
.home-profile { max-width: 930px; margin: 0 auto 22px; align-items: center; padding: 16px 20px; background: var(--bg-main); border-radius: 20px; }
.home-profile .field { margin-bottom: 0; }
#my-rooms { margin-top: 22px !important; }
.saved-room { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line2); }
.saved-room .btn { min-height: 44px; flex-shrink: 0; }
.saved-room > div { min-width: 0; overflow-wrap: anywhere; }
.modal { width: min(680px, 94vw); border: 1px solid var(--line); border-radius: 24px; background: var(--bg-main); box-shadow: 0 24px 70px #0007; }
.modal header { padding: 22px 24px 12px; }
.modal header h2 { font-size: 23px; font-weight: 650; letter-spacing: -.04em; }
.modal header p { font-size: 12px; line-height: 1.7; }
.modal .body { padding: 10px 24px 24px; }
.modal footer { border-radius: 0 0 24px 24px; background: var(--bg-panel); border-top: 1px solid var(--line2); }
.tabs { gap: 5px; }
.tab { padding: 9px 12px; border-radius: 12px; font-size: 12px; }
.theme-card { border-radius: 16px; padding: 10px; font-size: 12px; }
.palette-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 12px 0 22px; }
.palette-card { border: 2px solid transparent; background: var(--bg-panel); border-radius: 14px; color: var(--text); padding: 12px 4px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; }
.palette-card i { width: 26px; height: 26px; border-radius: 50%; }
.palette-card.sel { border-color: var(--link); }
.dm-messages { height: min(380px,45vh); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 0; }
.dm-bubble { border-radius: 14px; border: 1px solid var(--line2); background: var(--bg-panel); padding: 12px; max-width: 90%; white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; line-height: 1.6; }
.dm-bubble.mine { align-self: flex-end; background: var(--active); }
.dm-bubble small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.dm-compose { display: flex; gap: 8px; }
.dm-compose textarea { flex: 1; min-width: 0; resize: none; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-input); }
.capture-help { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 14px; background: var(--bg-panel); border-radius: 16px; }
.capture-help > span { font-size: 12px; color: var(--muted); flex-basis: 100%; }
.perf-summary { padding: 18px; background: var(--bg-panel); border-radius: 16px; margin: 14px 0; line-height: 1.6; }
.tile-tools .live-call-control, .tile-tools .live-exit-label { display: none; }
.tile.is-screen:fullscreen { width: 100vw !important; height: 100vh !important; max-width: none; max-height: none; border-radius: 0; background: #000; border: 0; }
.tile.is-screen:fullscreen .tile-body { position: absolute; inset: 0; padding-bottom: 0; }
.tile.is-screen:fullscreen .tile-tools { opacity: 1; top: auto; bottom: 20px; right: auto; left: 50%; transform: translateX(-50%); gap: 8px; z-index: 5; max-width: calc(100% - 24px); padding: 8px; border: 1px solid #ffffff30; border-radius: 40px; background: #12141df2; }
.tile.is-screen:fullscreen .tile-tools button, html.light .tile.is-screen:fullscreen .tile-tools button { flex-shrink: 0; width: 44px !important; height: 44px !important; border-radius: 50%; background: #242733; color: #fff; }
.tile.is-screen:fullscreen .tile-tools .live-call-control { display: flex; }
.tile.is-screen:fullscreen .tile-tools .off { background: #8f2540; }
.tile.is-screen:fullscreen .tile-tools [data-stop] { width: auto !important; padding: 0 14px; gap: 7px; background: #8f2540; border-radius: 24px; }
.tile.is-screen:fullscreen .live-exit-label { display: inline; font-size: 12px; }
.tile.is-screen:fullscreen .label { top: 12px; bottom: auto; }
.tile.is-screen:fullscreen .live { display: none; }
.tile.is-screen:fullscreen:not(.controls-visible) { cursor: none; }
.tile.is-screen:fullscreen:not(.controls-visible) .tile-tools, .tile.is-screen:fullscreen:not(.controls-visible) .label { opacity: 0; pointer-events: none; }
.tile.is-screen:fullscreen .tile-tools, .tile.is-screen:fullscreen .label { transition: opacity 160ms var(--ease-out); }
.tile.is-screen:fullscreen .tile-tools:has(:focus-visible) { opacity: 1; pointer-events: auto; }
.web-nav { display: none; }
@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) {
  .web-viewer .web-nav { left: 0; right: 0; padding: 7px 12px env(safe-area-inset-bottom); gap: 8px; z-index: 20; background: var(--bg-side); }
  .web-viewer .web-nav button { flex: 1; border: 0; border-radius: 16px; background: transparent; color: var(--text); font-size: 12px; }
  .web-viewer .web-nav button.active { background: var(--active); color: var(--link); }
}
@media (max-width: 1100px) and (min-width: 761px) {
  #main { padding: 6px; gap: 6px; }
  #sidebar { width: min(var(--side-w,240px),220px); }
  #chat { min-width: 250px; width: min(var(--chat-w,360px),30vw); }
  #call { min-width: 220px; }
  .pane-header { padding: 12px; }
  #call-stage { padding: 10px; }
}
@media (max-width: 760px) {
  #main { padding: 4px 8px 66px; gap: 0; }
  #rail, .splitter { display: none; }
  body #sidebar, body #call, body #chat { width: 100% !important; max-width: none; margin: 0; flex: 1; min-width: 0; }
  #main[data-mobile-pane=call] #sidebar, #main[data-mobile-pane=call] #chat,
  #main[data-mobile-pane=chat] #sidebar, #main[data-mobile-pane=chat] #call,
  #main[data-mobile-pane=sidebar] #call, #main[data-mobile-pane=sidebar] #chat { display: none; }
  .web-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(60px + env(safe-area-inset-bottom)); padding: 7px 12px env(safe-area-inset-bottom); background: var(--bg-side); display: flex; gap: 8px; z-index: 20; }
  .web-nav button { flex: 1; background: transparent; border: 0; border-radius: 16px; font-size: 12px; color: var(--text); }
  .web-nav button.active { background: var(--active); color: var(--link); }
  .home-profile { gap: 10px; padding: 16px; }
  .card { padding: 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: repeat(2,1fr); }
  .palette-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .pane-header { height: 60px; min-height: 60px; padding: 10px 14px; }
  #call-stage { padding: 10px; }
  #pips { width: min(260px,76%); }
  .focus-strip { display: none; }
  .modal { width: 96vw; max-height: 90dvh; }
  .modal header, .modal .body { padding-left: 16px; padding-right: 16px; }
  .icon-btn, .vp-btn, .channel { min-height: 40px; }
}
@media(max-width:420px) { .tile.is-screen:fullscreen .live-exit-label { display: none; } .tile.is-screen:fullscreen .tile-tools { gap: 5px; } }
/* (removido no redesign vidro: o bloqueio geral de animações com "reduzir movimento" do Windows; as animações do app são curtas e só movem camadas) */
