:root {
  font-family: Inter, "Segoe UI", sans-serif;
  color: #17202a;
  background: #eef2f6;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

button, textarea, input, select { font: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  min-height: 82px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #d9e0e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow { color: #5d6d7e; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
h1 { margin: 2px 0 0; font-size: 24px; }

.primary {
  border: 1px solid #0969da;
  border-radius: 6px;
  padding: 8px 16px;
  background: #0969da;
  color: #fff;
  cursor: pointer;
}
.primary:hover { background: #075bbd; }

.workspace { flex: 1; display: grid; grid-template-columns: minmax(420px, 46%) 1fr; min-height: 0; }
.exercise-instructions { padding: 14px 24px; border-bottom: 1px solid #d9e0e7; background: #fff; }
.exercise-instructions h2 { margin: 0 0 5px; font-size: 16px; }
.exercise-instructions p { margin: 0 0 7px; color: #425466; }
.exercise-instructions ol { display: flex; gap: 28px; margin: 0; padding-left: 20px; color: #5d6d7e; font-size: 12px; }
.exercise-instructions kbd { padding: 1px 4px; border: 1px solid #b7c0c8; border-radius: 3px; background: #f6f8fa; }
.editor-pane, .preview-pane { min-width: 0; display: flex; flex-direction: column; }
.editor-pane { background: #141a21; border-right: 1px solid #2d3742; }
.preview-pane { background: #dce3ea; }

.pane-title {
  height: 40px;
  padding: 11px 16px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #ccd4dc;
  color: #425466;
  font-size: 13px;
  font-weight: 600;
}

.code-editor { position: relative; flex: 1; min-height: 560px; overflow: hidden; background: #141a21; }

#source, #highlighting {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
  font: 14px/1.55 Consolas, "Courier New", monospace;
}

#source {
  flex: 1;
  resize: none;
  outline: 0;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: #f8f8f2;
  -webkit-text-fill-color: transparent;
}
#source::selection { background: rgba(74, 144, 226, .45); }
#highlighting { z-index: 0; pointer-events: none; color: #d9e3ec; background: #141a21; }
.syntax-comment { color: #6a9955; font-style: italic; }
.syntax-directive { color: #c586c0; }
.syntax-string { color: #ce9178; }
.syntax-number { color: #b5cea8; }
.syntax-boolean { color: #569cd6; font-weight: 600; }
.syntax-keyword { color: #569cd6; }
.syntax-function { color: #dcdcaa; }
.syntax-method { color: #4ec9b0; }
}

.status { min-height: 34px; padding: 8px 16px; background: #1e2731; color: #aebdca; font-size: 12px; }
.status.error { color: #ffb4b4; }
.status.success { color: #9ee6b1; }
.status.warning { color: #ffd889; }
.diagnostics { max-height: 94px; overflow: auto; border-top: 1px solid #394754; background: #17212b; color: #dce7ef; font: 12px/1.4 Consolas, "Courier New", monospace; }
.diagnostics[hidden] { display: none; }
.diagnostic { padding: 7px 16px; border-left: 4px solid #7b8791; }
.diagnostic-warning { border-left-color: #e4ac31; color: #ffd889; }
.diagnostic-error { border-left-color: #d95555; color: #ffb4b4; }
.ppo-inspector { border-top: 1px solid #394754; background: #111820; color: #dce7ef; font: 12px/1.4 Consolas, "Courier New", monospace; }
.ppo-inspector[hidden] { display: none; }
.ppo-inspector summary { cursor: pointer; padding: 8px 16px; color: #9ed8ff; user-select: none; }
.ppo-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; max-height: 300px; background: #394754; }
.ppo-columns section { min-width: 0; padding: 8px; overflow: auto; background: #141a21; }
.ppo-columns strong { display: block; margin-bottom: 6px; color: #aebdca; }
.ppo-columns pre { min-width: max-content; margin: 0; white-space: pre; tab-size: 4; }
.ppo-capabilities { padding: 7px 16px; border-top: 1px solid #394754; color: #aebdca; }

.desktop {
  flex: 1;
  min-height: 560px;
  position: relative;
  overflow: auto;
  padding: 32px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.65), transparent 36%),
    linear-gradient(145deg, #cbd6df, #e9eef2);
}

.empty-state { color: #6b7885; text-align: center; margin-top: 180px; }

.headless body { min-height: 100vh; background: transparent; }
.headless .app-shell { min-height: 100vh; }
.headless .topbar, .headless .editor-pane, .headless .preview-pane > .pane-title { display: none; }
.headless .workspace { display: block; min-height: 100vh; }
.headless .preview-pane, .headless .desktop { width: 100%; min-height: 100vh; }
.headless .desktop { padding: 0; }
.emulator-brand {
  position: fixed;
  right: 8px;
  bottom: 6px;
  z-index: 15;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.72);
  color: #53646c;
  opacity: .72;
  pointer-events: none;
  user-select: none;
  font: 9px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .01em;
}

.ms-dialog {
  position: absolute;
  min-width: 220px;
  min-height: 120px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fbfbfb;
  color: #000;
  font: 11px Arial, sans-serif;
  box-shadow: 0 18px 44px rgba(31,45,61,.28), 0 2px 7px rgba(31,45,61,.18);
}

.ms-titlebar {
  height: 29px;
  padding: 6px 10px;
  color: #fff;
  background: linear-gradient(#3378b8, #225d95);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ms-close { border: 0; padding: 0 2px; color: #fff; background: transparent; font: 16px/1 "Segoe UI", sans-serif; cursor: pointer; }

.ms-client { position: relative; background: #fbfbfb; }
.ms-control { position: absolute; font-family: "Segoe UI", sans-serif; font-size: 12px; }
.ms-say { display: flex; align-items: center; color: #20262c; white-space: nowrap; }
.ms-get { border: 1px solid #8e9aa5; background: #fff; padding: 1px 4px; outline: none; }
.ms-get:focus { border-color: #2576bd; box-shadow: 0 0 0 1px #2576bd; }
.ms-button { border: 1px solid #8c969f; border-radius: 3px; background: linear-gradient(#fff, #dce1e5); cursor: pointer; }
.ms-button:hover { background: linear-gradient(#fff, #cfdbe5); border-color: #5d7d98; }
.ms-tbutton { display: grid; place-items: center; border: 2px solid #00659a; border-radius: 3px; background: transparent; color: #00659a; cursor: pointer; font: 11px Arial, sans-serif; }
.ms-tbutton:hover { border-color: #051f31; background: #afd3fa; color: #051f31; }
.ms-tbutton:focus { outline: 2px solid #00659a; outline-offset: -4px; color: #051f31; font-weight: bold; }
.ms-checkbox { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ms-checkbox input { margin: 0; }
.ms-browse { display: block; overflow: auto; border: 1px none #3dadfa; background: #fbfbfb; color: #000; cursor: pointer; font: 11px Arial, sans-serif; }
.ms-browse table { width: 100%; border-collapse: collapse; table-layout: auto; color: #000; font: inherit; }
.ms-browse th { height: 27px; padding: 2px 5px; border: 0; background: #e5e5e5; color: #0d0d0d; text-align: left; font-weight: 700; }
.ms-browse th:first-child, .ms-browse td:first-child { width: 28px; text-align: center; }
.ms-browse td { height: 17px; padding: 1px 5px; border-bottom: 1px solid #c9c9c9; white-space: nowrap; }
.ms-browse tr:nth-child(even):not(.selected) td { background: #eee; }
.ms-browse tr.selected td { background: #3dadfa; color: #000; }
.ms-browse tr:focus td { outline: 2px solid #004064; outline-offset: -2px; }
.browse-lamp { display: inline-block; width: 13px; height: 13px; border: 1px solid #929292; border-radius: 50%; box-shadow: inset -2px -2px 3px rgba(0,0,0,.25), inset 2px 2px 3px rgba(255,255,255,.75); vertical-align: middle; }
.browse-lamp.yes { background: #7ee635; }
.browse-lamp.no { background: #ed343b; }
.ms-getdados { overflow: scroll; font-family: Arial, sans-serif; }
.ms-getdados th { height: 22px; }
.ms-getdados th:first-child, .ms-getdados td:first-child { width: auto; text-align: left; }
.ms-getdados td { height: 17px; }
.ms-getdados td.selected-cell { background: #3dadfa; outline: 2px solid #004064; outline-offset: -2px; }

.axcadastro { position: absolute; inset: 0; z-index: 3000; display: grid; grid-template-rows: 40px 40px minmax(180px,1fr) auto 30px; width: 100%; height: 100%; overflow: hidden; background: #fbfbfb; color: #000; font: 11px Arial, sans-serif; }
.ax-header { display: flex; align-items: center; gap: 10px; padding: 0 0 0 10px; background: #fbfbfb; }
.ax-header h2 { margin: 0; flex: 1; font: normal 18px Arial, sans-serif; }
.ax-custom-buttons { display: flex; gap: 4px; }
.ax-custom-buttons button, .ax-close { height: 30px; padding: 0 12px; border: 0; background: transparent; color: #00659a; cursor: pointer; font: 11px Arial, sans-serif; }
.ax-close { width: 36px; padding: 0; color: #333; font-size: 20px; }
.ax-toolbar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-top: 1px solid #eee; border-bottom: 1px solid #ddd; }
.ax-actions { display: flex; align-items: center; gap: 4px; flex: 1; }
.ax-actions > button, .ax-more > button { height: 30px; padding: 0 13px; border: 1px solid #e5e5e5; border-radius: 3px; background: #fbfbfb; color: #00659a; cursor: pointer; font: 11px Arial, sans-serif; }
.ax-actions button:hover, .ax-custom-buttons button:hover { background: #afd3fa; color: #051f31; }
.ax-toolbar input { width: min(234px,30vw); height: 30px; padding: 0 7px; border: 1px solid #a1a1a1; border-radius: 3px; background: #fbfbfb; font: 11px Arial, sans-serif; }
.ax-filter { height: 30px; border: 0; background: transparent; color: #666; text-decoration: underline; cursor: pointer; }
.ax-more { position: relative; }
.ax-menu { position: absolute; left: 0; top: 33px; z-index: 4; min-width: 160px; padding: 4px; border: 1px solid #a1a1a1; background: #fbfbfb; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.ax-menu[hidden] { display: none; }
.ax-menu button { display: block; width: 100%; padding: 7px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.ax-grid { display: block; min-height: 180px; overflow: auto; background: #fbfbfb; font: 14px Arial, sans-serif; }
.ax-grid table { width: 100%; border-collapse: collapse; }
.ax-grid th { position: sticky; top: 0; height: 27px; padding: 0 8px; background: #e5e5e5; color: #0d0d0d; text-align: left; font: bold 11px Arial, sans-serif; }
.ax-grid td { height: 30px; padding: 0 8px; border-bottom: 1px solid #eee; white-space: nowrap; }
.ax-grid tr:nth-child(even):not(.selected) { background: #eee; }
.ax-grid tr.selected { background: #3dadfa; color: #000; }
.ax-details { max-height: 197px; margin: 0; overflow: auto; padding: 14px 20px; border-top: 1px solid #c5cbcd; background: #fbfbfb; font: 11px/1.45 Consolas, monospace; }
.ax-details[hidden] { display: none; }
.ax-detail-toggle { height: 30px; padding-left: 10px; border: 1px solid #e5e5e5; background: #fbfbfb; text-align: left; cursor: pointer; font: bold 12px Arial, sans-serif; }
.ax-editor-overlay { position: absolute; inset: 0; z-index: 3300; display: grid; place-items: center; background: rgba(255,255,255,.3); }
.ax-editor { width: min(480px,90%); background: #fbfbfb; box-shadow: 0 18px 45px rgba(0,0,0,.3); font: 11px Arial, sans-serif; }
.ax-editor h3 { margin: 0; padding: 8px 10px; background: linear-gradient(#292522,#171513); color: #fff; font-size: 12px; }
.ax-editor-fields { display: grid; gap: 9px; padding: 18px; }
.ax-editor-fields label { display: grid; grid-template-columns: 110px 1fr; align-items: center; }
.ax-editor-fields input { height: 25px; border: 1px solid #a1a1a1; background: #fff; }
.ax-editor footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px; border-top: 1px solid #ddd; }
.ax-editor footer button { min-width: 62px; height: 27px; border: 2px solid #00659a; border-radius: 3px; background: #fbfbfb; color: #00659a; }
.ax-editor footer .primary { background: #00659a; color: #fff; }

.fwmbrowse { position: absolute; inset: 0; z-index: 3000; display: grid; grid-template-rows: 40px 40px minmax(180px,1fr) auto 30px; width: 100%; height: 100%; overflow: hidden; background: #fbfbfb; color: #000; font: 11px Arial, sans-serif; }
.fwm-header { display: flex; align-items: center; padding-left: 10px; background: #fbfbfb; }
.fwm-header h2 { margin: 0; flex: 1; font: normal 18px Arial, sans-serif; }
.fwm-header button { width: 36px; height: 40px; border: 0; background: transparent; color: #00659a; cursor: pointer; font-size: 17px; }
.fwm-toolbar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-top: 1px solid #eee; border-bottom: 1px solid #ddd; }
.fwm-toolbar button { height: 30px; border: 1px solid #e5e5e5; border-radius: 3px; background: #fbfbfb; color: #00659a; cursor: pointer; font: 11px Arial, sans-serif; }
.fwm-toolbar button:first-child { margin-right: auto; padding: 0 13px; }
.fwm-toolbar button:last-child { border: 0; color: #666; text-decoration: underline; }
.fwm-toolbar input { width: min(234px,30vw); height: 30px; padding: 0 7px; border: 1px solid #a1a1a1; border-radius: 3px; background: #fbfbfb; font: 11px Arial, sans-serif; }
.fwm-grid { min-height: 0; }
.fwm-details { max-height: 142px; }
.fwm-detail-toggle { width: 100%; }

.message-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(18, 27, 36, .35);
}
.message-overlay[hidden] { display: none; }
.message-box { width: min(360px, 90vw); padding: 18px; border-radius: 8px; background: #fff; box-shadow: 0 20px 55px rgba(0,0,0,.3); }
.message-title { font-weight: 700; margin-bottom: 14px; }
.message-text { min-height: 42px; margin-bottom: 16px; }
.message-box .primary { float: right; min-width: 72px; }
.message-content { display: flex; align-items: center; gap: 14px; }
.message-icon { display: none; width: 44px; height: 44px; flex: 0 0 44px; border: 4px solid #fff; border-radius: 50%; background: #d8222a; color: #fff; box-shadow: 0 0 0 2px #999; font: bold 40px/34px Arial, sans-serif; text-align: center; }
.message-overlay.stop .message-icon { display: block; }
.message-overlay.alert .message-icon { display: block; width: 48px; height: 42px; flex-basis: 48px; border: 0; border-radius: 0; clip-path: polygon(50% 0,100% 100%,0 100%); background: #f2bd16; color: #111; box-shadow: none; font: bold 26px/52px Arial, sans-serif; }
.message-overlay.stop .message-box { width: min(300px, 90vw); border-radius: 0; padding: 0 12px 10px; }
.message-overlay.stop .message-title { margin: 0 -12px 12px; padding: 6px 12px; color: #fff; background: linear-gradient(#292522, #171513); font-size: 12px; }
.message-overlay.stop .message-text { display: flex; align-items: center; margin: 0; font-size: 12px; }
.message-overlay.stop .primary { border: 2px solid #006fc9; border-radius: 3px; padding: 5px 14px; color: #111; background: #f5f5f5; }

.standalone-message-box { position: absolute; left: 50%; top: 50%; z-index: 3000; display: block; width: 200px; height: 154px; transform: translate(-50%,-50%); background: #fbfbfb; color: #000; box-shadow: 0 16px 42px rgba(0,0,0,.28); font: 11px Arial, sans-serif; }
.standalone-message-title { height: 28px; padding: 7px 12px; color: #fff; background: linear-gradient(#292522,#171513); font-weight: bold; }
.standalone-message-content { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 10px 12px 4px; }
.standalone-message-content p { margin: 0; line-height: 1.3; white-space: pre-line; }
.standalone-message-box .icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 3px solid #fff; border-radius: 50%; background: #d8222a; color: #fff; box-shadow: 0 0 0 2px #999; font: bold 36px/1 Arial, sans-serif; }
.standalone-message-box.info .icon { background: #1677ad; font: bold 30px/1 Georgia, serif; }
.standalone-message-box.alert .icon { width: 44px; height: 40px; flex-basis: 44px; border: 0; border-radius: 0; clip-path: polygon(50% 0,100% 100%,0 100%); background: #f2bd16; color: #111; box-shadow: none; font: bold 25px/50px Arial, sans-serif; }
.standalone-message-box button { position: absolute; right: 10px; bottom: 8px; min-width: 48px; height: 26px; border: 2px solid #00659a; border-radius: 3px; background: #fbfbfb; color: #051f31; font: 11px Arial, sans-serif; }
.dynamic-message-layer { position: absolute; inset: 0; z-index: 3400; background: rgba(18,27,36,.35); }
.dynamic-message-layer .standalone-message-box { z-index: 1; }

.emulator-console { position: absolute; right: 12px; bottom: 12px; z-index: 3100; display: flex; max-width: calc(100% - 24px); flex-direction: column; align-items: flex-end; }
.console-toggle { height: 30px; padding: 0 12px; border: 1px solid #5f7384; border-radius: 4px; background: #1e2a35; color: #dce7ef; cursor: pointer; font: 12px Arial, sans-serif; }
.console-toggle:hover { background: #2a3946; }
.console-panel { width: min(520px, calc(100vw - 60px)); max-height: 190px; margin: 6px 0 0; overflow: auto; padding: 12px; border: 1px solid #506171; border-radius: 4px; background: #101820; color: #9ee6b1; box-shadow: 0 10px 28px rgba(0,0,0,.28); font: 12px/1.5 Consolas, "Courier New", monospace; text-align: left; white-space: pre-wrap; }
.console-panel[hidden] { display: none; }
.emulator-console.console-only { inset: 0; max-width: none; padding: 10px; align-items: stretch; background: #101820; }
.console-only .console-toggle { align-self: flex-end; }
.console-only .console-panel { box-sizing: border-box; width: 100%; max-height: none; min-height: 0; margin-top: 10px; flex: 1; border-color: #304251; border-radius: 0; box-shadow: none; }
.run-again { position: absolute; left: 50%; top: 50%; z-index: 3200; min-width: 148px; height: 36px; padding: 0 16px; transform: translate(-50%,-50%); border: 2px solid #00659a; border-radius: 4px; background: #fbfbfb; color: #051f31; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.2); font: 12px Arial, sans-serif; }
.run-again:hover, .run-again:focus { border-color: #051f31; background: #afd3fa; outline: none; }

.confirm-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.confirm-overlay[hidden] { display: none; }
.confirm-dialog { display: block; width: 508px; height: 203px; padding: 5px; background: #a1a1a1; box-shadow: 0 18px 45px rgba(0,0,0,.3); font: 11px Arial, sans-serif; }
.confirm-body { height: 136px; padding: 17px 20px; display: grid; grid-template-columns: 70px 1fr; gap: 15px; align-items: center; background: #fbfbfb; }
.confirm-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #00659a; color: #fff; font: bold 42px/1 Georgia, serif; }
.confirm-body strong { display: block; font: 16px "Arial Black", Arial, sans-serif; }
.confirm-body p { margin: 12px 0 0; font: 11px Arial, sans-serif; }
.confirm-actions { height: 52px; display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; padding: 8px 18px; background: #fbfbfb; }
.confirm-actions button { height: 35px; min-width: 60px; border-radius: 3px; cursor: pointer; font: 11px Arial, sans-serif; }
.confirm-primary { border: 2px solid transparent; background: #00659a; color: #fbfbfb; font-weight: bold !important; outline: 4px solid #004064; outline-offset: -4px; }
.confirm-secondary { border: 2px solid #00659a; background: transparent; color: #00659a; }

.printer-setup-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(255,255,255,.15); }
.printer-setup-overlay[hidden] { display: none; }
.printer-setup-dialog { display: block; width: 406px; height: 579px; background: #fbfbfb; box-shadow: 0 18px 45px rgba(0,0,0,.3); font: 11px Arial, sans-serif; }
.printer-setup-title { height: 28px; padding: 7px 10px; background: linear-gradient(#25211e,#151311); color: #fff; font-weight: bold; }
.printer-setup-content { display: grid; grid-template-columns: 122px 284px; height: 496px; }
.printer-setup-nav { padding: 5px; border-right: 1px solid #c5c9ca; display: flex; flex-direction: column; gap: 5px; }
.printer-setup-nav strong { padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px 5px 0 0; }
.printer-symbol { height: 82px; display: grid; place-items: center; color: #00659a; font-size: 54px; }
.printer-setup-nav button { height: 38px; border: 0; background: transparent; text-align: left; color: #333; }
.printer-setup-nav button.selected { color: #00659a; font-weight: bold; }
.printer-setup-options { padding: 10px; }
.printer-setup-options h3 { margin: 0 0 10px; padding: 8px; border: 1px solid #c5c9ca; border-radius: 7px; color: #00659a; font-size: 12px; }
.printer-setup-options label { display: grid; grid-template-columns: 90px 1fr; align-items: center; margin: 10px 4px; }
.printer-setup-options input, .printer-setup-options select { height: 24px; border: 1px solid #aaa; background: #fff; font: 11px Arial; }
.printer-setup-actions { height: 55px; display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 6px; align-items: center; padding: 8px 10px; border-top: 1px solid #ddd; }
.printer-setup-actions button { height: 22px; border: 2px solid #00659a; border-radius: 3px; background: transparent; color: #00659a; font: 11px Arial; }
.printer-setup-actions button:disabled { opacity: .45; }
.legacy-printer-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.legacy-printer-overlay[hidden] { display: none; }
.legacy-printer-dialog { display: block; width: 406px; height: 239px; background: #fbfbfb; box-shadow: 0 18px 45px rgba(0,0,0,.3); font: 11px Arial, sans-serif; }
.legacy-printer-title { height: 28px; padding: 7px 10px; background: linear-gradient(#25211e,#151311); color: #fff; font-weight: bold; }
.legacy-printer-body { height: 170px; padding: 6px 10px; position: relative; }
.legacy-printer-body h3 { margin: 0 0 8px; padding: 2px 10px 8px; border-bottom: 1px solid #aaa; font-size: 13px; }
.legacy-printer-body fieldset { display: inline-flex; width: 150px; height: 80px; margin: 0 5px 0 0; padding: 12px; flex-direction: column; gap: 8px; }
.legacy-printer-body fieldset:nth-of-type(2) { width: 220px; }
.legacy-printer-select { display: grid; grid-template-columns: 80px 1fr; align-items: center; margin-top: 7px; }
.legacy-printer-select select { height: 23px; border: 1px solid #a1a1a1; background: #fbfbfb; font: 11px Arial; }
.legacy-printer-actions { height: 41px; padding: 7px 10px; display: flex; justify-content: flex-end; gap: 8px; }
.legacy-printer-actions button { width: 52px; height: 22px; border: 2px solid #00659a; border-radius: 3px; background: transparent; color: #00659a; font: 11px Arial; }

.report-preview { min-width: 650px; width: 100%; }
.report-toolbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #263442; color: #fff; font-size: 12px; }
.report-page { position: relative; width: 595px; height: 842px; margin: 24px auto; padding: 20px 27px 18px; background: #fff; color: #000; box-shadow: 0 8px 30px rgba(0,0,0,.25); font: 9px Arial, sans-serif; }
.report-page.report-landscape { width: 842px; height: 595px; }
.report-page.report-portrait { width: 595px; height: 842px; }
.report-page h2 { margin: 0; height: 21px; color: #b4b4b4; text-align: center; font: bold 13px Arial, sans-serif; }
.report-page hr { margin: 7px 0 10px; border: 0; border-top: 1px solid #b4b4b4; }
.report-page table { border-collapse: collapse; width: 300px; font: 9px Arial, sans-serif; }
.report-page th { padding: 0 5px 6px; text-align: left; font-weight: bold; }
.report-page th:first-child, .report-page td:first-child { width: 80px; }
.report-page td { height: 10px; padding: 0 5px; }
.report-page footer { position: absolute; left: 27px; right: 27px; bottom: 17px; display: flex; justify-content: space-between; padding-top: 5px; border-top: 1px solid #b4b4b4; color: #b4b4b4; font: 8px Arial, sans-serif; }
.report-page.absolute-report { padding: 0; }
.report-absolute-element { position: absolute; font: 12px Arial, sans-serif; }
.report-barcode rect { fill: #000; }
.report-qrcode svg { display: block; width: 100%; height: 100%; }
.report-line { background: #000; }
.report-box { border: 1px solid #000; }
.report-fill { border: 0; }
.report-missing-bitmap { display: none; }

@media print {
  body * { visibility: hidden; }
  .report-page, .report-page * { visibility: visible; }
  .report-page { position: absolute; inset: 0; margin: 0; box-shadow: none; }
}

@media (max-width: 900px) {
  .ppo-columns { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .editor-pane { min-height: 520px; }
  .exercise-instructions ol { display: block; }
}

/* Os dois modos permanecem selecionáveis também em telas estreitas. */
.topbar { gap: 12px; flex-wrap: wrap; }
.topbar label { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; font-size: 13px; }
.topbar select { max-width: 100%; min-width: 0; padding: 6px; }
.execution-hint { margin: 0; padding: 8px 16px; color: #dce7ef; background: #253443; font-size: 12px; }
.execution-hint[hidden], #cancelExecution[hidden] { display: none; }

.classic-exercise-link { color: #0969da; font-size: 13px; }
