@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0e0f11;
  --surface: #17191c;
  --raised: #23262a;
  --line: #23262a;
  --line-strong: #2a2d31;
  --text: #ecedee;
  --muted: #9ba1a6;
  --live: #3dd68c;
  --wait: #f5b547;
  --danger: #d93036;
  --off: #ff8a8f;
  --radius: 14px;
  --font: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; border-bottom: 1px solid var(--line); }
.topbar.plain { border-bottom: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--text); display: grid; place-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--surface); }
.avatars { display: flex; }
.avatars > * + * { margin-left: -8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--raised); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.soft { background: var(--raised); border-color: var(--raised); font-weight: 600; }
.btn.soft:hover { background: #2e3237; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 12px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .round:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Layout: salas ---------- */
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 32px 64px; display: flex; flex-direction: column; gap: 48px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-weight: 600; font-size: 17px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: none; }
.status.live { color: var(--live); }
.status.wait { color: var(--wait); }
.status.live::before, .status.wait::before { display: block; }
.who { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; color: var(--muted); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; padding: 20px 24px; }
.row + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.row-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.row-title strong { font-weight: 600; font-size: 16px; }
.row-link { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-state { flex: 0 1 220px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { padding: 32px 24px; color: var(--muted); text-align: center; }

/* ---------- Dialogs ---------- */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; padding: 24px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.input { height: 44px; background: var(--bg); border: 1px solid #3a3f45; border-radius: 10px; padding: 0 12px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.error { color: var(--off); font-size: 13px; min-height: 1em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; z-index: 50; }

/* ---------- Entrada / espera ---------- */
.center { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.preview-col { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.preview { aspect-ratio: 16 / 10; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; position: relative; display: grid; place-items: center; overflow: hidden; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .placeholder { width: 96px; height: 96px; border-radius: 50%; background: var(--line-strong); display: grid; place-items: center; font-size: 36px; font-weight: 600; color: var(--muted); }
.preview .note { position: absolute; top: 16px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); }
.preview .controls { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; gap: 12px; }
.devices { display: flex; flex-wrap: wrap; gap: 8px; }
.device { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 40px; color: var(--muted); }
.device select { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font-size: 13px; }
.device select option { background: var(--surface); }
.join-form { flex: 0 1 360px; display: flex; flex-direction: column; gap: 24px; }
.join-form h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--text); }
.fine { margin: 0; font-size: 12px; color: var(--muted); }

.waiting { max-width: 560px; flex-direction: column; text-align: center; gap: 32px; }
.waiting .preview { width: 100%; max-width: 360px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--text); animation: pulse 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: .7; } }
.pill { display: inline-flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: 14px; }

/* ---------- Chamada ---------- */
.call { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.call-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.call-top .title { display: flex; align-items: center; gap: 12px; font-weight: 600; min-width: 0; }
.call-body { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 0 20px; }
.stage { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; position: relative; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.side { width: 360px; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.side h2 { margin: 0; font-size: 16px; font-weight: 600; }
.copyline { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copyline span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--mono); color: var(--muted); }
.copyline .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.people .who-name { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.people .who-name small { color: var(--muted); font-size: 12px; }
.bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--line-strong); display: grid; place-items: center; cursor: pointer; }
.round:hover { background: #33373c; }
.round.off { background: #3a1d20; color: var(--off); }
.round.on { background: var(--text); color: var(--bg); }
.round.err { background: var(--danger); color: #fff; }
.perm-banner { margin: 0 20px 8px; padding: 10px 14px; border: 1px solid var(--danger); border-radius: 12px; background: #2a1517; color: var(--text); }
.perm-banner[hidden] { display: none; }
.perm-row { display: flex; align-items: center; gap: 10px; }
.perm-row span { flex: 1; min-width: 0; }
.perm-help { margin: 8px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.leave { height: 52px; border-radius: 26px; border: 0; background: var(--danger); color: #fff; padding: 0 22px; margin-left: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.leave:hover { background: #c4282e; }

.ended { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px; text-align: center; }
.ended h1 { margin: 0; font-size: 28px; font-weight: 600; }

@media (max-width: 820px) {
  .topbar { padding: 14px 16px; }
  .page { padding: 24px 16px 48px; }
  .center { padding: 16px; gap: 24px; }
  .side { display: none; }
  .video-slot { display: none !important; }
  .call-top .status { display: none; }
  .seg { min-width: 64px; }
  .side.open { display: flex; position: fixed; inset: 64px 12px 96px; width: auto; z-index: 10; }
  .call-body { padding: 0 8px; }
  .round { width: 46px; height: 46px; }
  .leave { margin-left: 0; }
}

/* Seta de aparelhos junto ao microfone/câmara */
.pill-btn { position: relative; display: inline-flex; align-items: center; background: var(--line-strong); border-radius: 26px; }
.pill-btn .round { width: 52px; border-radius: 26px 0 0 26px; background: transparent; }
.pill-btn .round.off { background: #3a1d20; }
.pill-btn .round.on { background: var(--text); }
.pill-btn:has(.round.off) { background: #3a1d20; }
.arrow { width: 36px; height: 52px; min-height: 44px; border: 0; background: transparent; color: inherit; border-radius: 0 26px 26px 0; display: grid; place-items: center; cursor: pointer; }
.arrow:hover, .pill-btn .round:hover { background: rgb(255 255 255 / .08); }
.arrow:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.popover { position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 20; min-width: 280px; max-width: min(360px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px; box-shadow: 0 12px 40px rgb(0 0 0 / .5); display: flex; flex-direction: column; }
.pop-title { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pop-item { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: transparent; border: 0; border-radius: 10px; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pop-item:hover, .pop-item:focus-visible { background: var(--raised); outline: none; }
.pop-item .tick { width: 18px; flex: none; color: var(--live); display: grid; place-items: center; }
.pop-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-empty { padding: 12px; margin: 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
@media (max-width: 820px) { .pill-btn .round { width: 46px; } .arrow { height: 46px; width: 40px; } .popover { left: 50%; transform: translateX(-30%); } }

/* Tablet/telemóvel em landscape: o vídeo ocupa o máximo */
@media (orientation: landscape) and (max-height: 520px) {
  .call-top { display: none; }
  .bar { padding: 8px 12px; }
  .call-body { padding: 8px; }
  .side.open { inset: 8px 8px 72px; }
}

/* Workspace */
.stack { display: flex; flex-direction: column; gap: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; min-height: 44px; font-weight: 500; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 14px 20px; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.file-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-main .muted { font-size: 13px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--live); }
.badge.err { color: var(--off); }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 44px; }
.drop { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.drop.over { border-color: var(--text); color: var(--text); background: var(--surface); }
.home { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 24px; }
.home h1 { margin: 0; font-size: 32px; letter-spacing: -.02em; }
@media (max-width: 820px) { .page { padding: 24px 16px 48px; } .file-row { padding: 12px 14px; } }

.legal section { display: flex; flex-direction: column; gap: 8px; }
.legal h2 { margin: 16px 0 0; font-size: 18px; }
.legal p, .legal li { line-height: 1.6; }
.legal a { color: var(--text); }

/* Painel lateral com separadores e notas */
.side .card-head .tabs { margin: 0; border: 0; flex: 1; }
.side-view { display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1; }
.notes-panel { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }

/* Notas: secções */
.n-tabs { margin-bottom: 4px; }
.n-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.n-title { margin: 0; font-size: 16px; }
.n-mount, .n-board { display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1; }
.n-status { margin: 0; font-size: 12px; color: var(--muted); }
.n-foot { margin: 0; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); }
.n-section { display: flex; flex-direction: column; gap: 8px; }
.n-section h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.n-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.n-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 44px; padding: 4px 6px; border-radius: 8px; }
.n-item:hover { background: var(--raised); }
.n-text { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; cursor: text; }
.n-item.done .n-text { text-decoration: line-through; color: var(--muted); }
.n-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; margin: 0 6px; }
.n-mark { color: var(--live); display: grid; place-items: center; flex: none; }
.n-item input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--live); }
.n-meta { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 100%; padding-left: 28px; }
.n-who, .n-due { height: 36px; min-height: 36px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; }
.n-edit { flex: 1; height: 36px; }
.n-add { height: 40px; }
.n-del { opacity: 0; width: 32px; height: 44px; min-height: 44px; flex: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.n-item:hover .n-del, .n-item:focus-within .n-del, .n-item.show-del .n-del { opacity: 1; }
.n-del:hover { color: var(--off); }

/* Quadro */
.board-host { position: absolute; inset: 0; display: none; background: var(--bg); z-index: 1; }
.stage.board-mode .board-host { display: block; }
/* Vista de ferramenta: o iframe do Jitsi é posicionado por JS (call.js, placeVideo) sobre a ranhura da coluna direita */
.stage.tool-mode iframe { border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .5); }
.video-slot { display: none; position: relative; flex: none; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }
.side.with-video .video-slot { display: block; }
.slot-expand { position: absolute; top: 6px; right: 6px; z-index: 40; width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgb(0 0 0 / .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.slot-expand:hover { background: rgb(0 0 0 / .85); }
.view-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg { height: 36px; min-width: 76px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.seg[aria-selected=true] { background: var(--text); color: var(--bg); }
.seg:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.stage.board-mode .board-host { display: block; }
.board-save { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 6; height: 44px; }
.board-wrap { position: relative; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board-wrap .board-host { display: block; }
@media (max-width: 820px) { .stage.board-mode iframe { width: 160px !important; height: 90px !important; right: 8px; bottom: 8px; } }
.board-inner { position: absolute; inset: 0; }

/* Resumo */
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo-row .input { flex: 1 1 220px; }
textarea.input { font: inherit; line-height: 1.5; }

/* Pedidos de entrada na chamada */
.admit-banner { margin: 0 20px 8px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.admit-banner[hidden] { display: none; }
.admit-row { display: flex; align-items: center; gap: 10px; }
.admit-row span { flex: 1; min-width: 0; font-weight: 600; }
.admit-row .btn { height: 40px; }

/* Início do cliente: entrar é a ação principal; os ficheiros são secundários */
.enter-block { display: flex; flex-direction: column; gap: 8px; }
.enter-block .btn { width: 100%; height: 60px; font-size: 18px; }
#ws .stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* Penpot na chamada */
.penpot-host { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); z-index: 1; }
.stage.penpot-mode .penpot-host { display: flex; }
.pp-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pp-crumbs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-follow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.pp-bar .btn { height: 40px; }
.pp-body { flex: 1; min-height: 0; display: flex; }
.pp-strip { width: 220px; flex: none; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); }
.pp-page { margin-bottom: 4px; }
.pp-board { text-align: left; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.pp-board:hover { background: var(--raised); }
.pp-board[aria-current=true] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pp-frame { flex: 1; min-width: 0; position: relative; }
.pp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.pp-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; }
.pp-modal { position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / .6); display: grid; place-items: center; padding: 16px; }
.pp-dialog { width: min(960px, 100%); max-height: min(720px, 100%); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; }
.pp-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pp-dialog h2 { margin: 0; font-size: 18px; }
.pp-pick { flex: 1; min-height: 0; display: flex; }
.pp-pick aside { width: 220px; flex: none; overflow-y: auto; border-right: 1px solid var(--line); padding: 8px; }
.pp-pick section { flex: 1; min-width: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pp-projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-projects button { width: 100%; min-height: 44px; text-align: left; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.pp-projects button:hover { background: var(--raised); }
.pp-projects button[aria-current=true] { background: var(--raised); font-weight: 600; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pp-file { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.pp-file:hover { border-color: var(--line-strong); background: var(--raised); }
.pp-file img, .pp-nothumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: #fff; }
.pp-nothumb { display: grid; place-items: center; color: var(--muted); font-size: 12px; background: var(--raised); }
@media (max-width: 820px) {
  .pp-body { flex-direction: column; }
  .pp-strip { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .pp-board { white-space: nowrap; }
  .pp-pick { flex-direction: column; }
  .pp-pick aside { width: auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: 140px; }
}

/* Visão geral do Penpot: ecrãs lado a lado como no canvas */
.pp-mode .seg { min-width: 0; height: 32px; padding: 0 12px; font-size: 14px; }
.pp-overview { position: absolute; inset: 0; overflow: auto; background: var(--raised); padding: 20px; }
.pp-overview[hidden], .pp-frame iframe[hidden] { display: none; }
.pp-canvas { position: relative; margin: 0 auto; }
.pp-ov-board { position: absolute; padding: 0; border: 2px solid transparent; border-radius: 4px; background: #fff; overflow: hidden; cursor: pointer; }
.pp-ov-board:hover { border-color: var(--muted); }
.pp-ov-board[aria-current=true] { border-color: var(--live, #3ddc84); }
.pp-ov-board img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pp-ov-board .pp-nothumb { height: 100%; }
.pp-ov-name { position: absolute; left: 0; right: 0; top: 0; padding: 3px 6px; font-size: 11px; text-align: left; color: #fff; background: rgb(0 0 0 / .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Abas do painel: três abas + fechar cabem sem partir o texto */
.side .card-head { gap: 4px; }
.side .tab { white-space: nowrap; padding: 10px 9px; }
