@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap
}

:root {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 16px;
  color: #202b36;
  background: #e5e5e5;
  --accent: #263f5a;
  --accent-hover: #182e46;
  --muted: #536170;
  --border: #cbd2da;
  --surface: #fff;
  --selection: #e8eef4;
  --danger: #9b2828
}

* {
  box-sizing: border-box
}

[hidden] {
  display: none !important
}

body {
  margin: 0
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px max(24px, calc((100vw - 1280px)/2))
}

.brand,
.inline,
.actions,
.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px
}

.brand h1 {
  font: 650 24px/1.1 "Source Sans 3", Arial, sans-serif;
  margin: 0;
  color: #202b36
}

.brand small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px
}

.mark {
  background: #143a43;
  color: #fff;
  font: 800 27px Arial, sans-serif;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: grid;
  place-content: center;
  position: relative;
  flex: none
}

.mark span {
  position: absolute;
  bottom: 3px;
  right: 4px;
  color: #86dec1;
  font-size: 18px
}

main {
  max-width: 1328px;
  margin: 0 auto;
  padding: 0 24px 36px
}

nav {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 20px;
  overflow-x: auto;
  padding-top: 6px
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 13px 15px 11px;
  color: var(--muted);
  white-space: nowrap
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 650
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 20px;
  align-items: start
}

.stack {
  display: grid;
  gap: 0;
  min-width: 0;
  background: var(--surface)
}

.panel {
  padding: 20px 22px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--border);
  min-width: 0
}

.stack>.panel:last-child {
  border-bottom: 0
}

.panel-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: flex-start
}

h2,
h3 {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-weight: 650;
  line-height: 1.25;
  color: #202b36
}

h2 {
  font-size: 19px;
  margin: 0 0 10px
}

h3 {
  font-size: 18px;
  margin: 0 0 10px
}

p {
  line-height: 1.5;
  margin: 8px 0
}

a {
  color: var(--accent);
  text-underline-offset: 3px
}

.tag,
.document-format {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px
}

.wide {
  grid-column: 1/-1
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px
}

input:not([type=radio]):not([type=checkbox]),
select,
textarea {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #b9c3ce;
  border-radius: 2px;
  font: inherit;
  font-weight: 400;
  color: #202b36;
  background: #fff;
  margin: 5px 0 4px;
  min-width: 0
}

input[type=file] {
  font-size: 13px;
  padding: 7px
}

textarea {
  resize: vertical;
  line-height: 1.5
}

input:read-only {
  background: #eef1f4
}

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  padding: 6px 11px;
  border: 1px solid transparent
}

button:disabled {
  opacity: .5;
  cursor: not-allowed
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #4c76a4;
  outline-offset: 2px
}

.primary {
  background: var(--accent);
  color: #fff
}

.primary:hover:not(:disabled) {
  background: var(--accent-hover)
}

.secondary {
  background: #fff;
  color: var(--accent);
  border-color: #aebbc8
}

.secondary:hover:not(:disabled) {
  background: #f1f4f7
}

.danger {
  color: var(--danger);
  background: #fff;
  border-color: #d9b8b8
}

.small {
  font-size: 13px;
  padding: 5px 9px
}

.full {
  width: 100%;
  margin: 5px 0
}

.choice {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  margin: 0;
  border-bottom: 1px solid var(--border)
}

.choice:has(input:checked) {
  background: var(--selection)
}

.choice small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px
}

.choice input,
.tick input,
.answerbar input {
  accent-color: var(--accent)
}

fieldset {
  border: 0;
  margin: 0 0 12px;
  padding: 0
}

legend {
  font-size: 14px;
  color: var(--muted);
  padding: 0 0 5px
}

.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45
}

.tick {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  align-items: center
}

.status {
  font-size: 14px;
  color: var(--accent);
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.status.error,
.preview-warning,
.omr-error {
  color: var(--danger)
}

.actions {
  flex-wrap: wrap;
  margin: 10px 0
}

.tablewrap {
  overflow: auto
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 9px 8px;
  white-space: nowrap
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: #f5f6f8
}

td button {
  font-size: 13px;
  padding: 5px 10px
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 18px;
  font-size: 13px;
  color: var(--muted)
}

details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 14px
}

#logoPreview {
  max-height: 56px;
  max-width: 110px;
  object-fit: contain
}

.header-editor {
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: 14px
}

.header-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px
}

.preset {
  border: 1px solid var(--border);
  background: #f7f8fa;
  text-align: left;
  color: #202b36;
  padding: 8px;
  min-width: 0
}

.preset:hover {
  border-color: var(--accent);
  background: var(--selection)
}

.preset strong,
.preset small {
  display: block;
  line-height: 1.35
}

.preset small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px
}

.mini-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border);
  background: #fff;
  height: 57px;
  padding: 6px;
  margin-bottom: 7px
}

.mini-header i,
.mini-header b,
.mini-header em {
  display: block;
  height: 3px;
  width: 85%;
  background: #c2cad3
}

.mini-header b {
  height: 5px;
  background: #66788d;
  width: 60%
}

.mini-header.table em {
  height: 10px;
  background: linear-gradient(90deg, transparent 32%, #a8b4c0 32%, #a8b4c0 34%, transparent 34%, transparent 65%, #a8b4c0 65%, #a8b4c0 67%, transparent 67%);
  border: 1px solid #a8b4c0;
  width: 100%
}

.mini-header.compact {
  align-items: flex-start
}

.mini-header.compact i {
  width: 100%
}

.token {
  font-size: 13px;
  background: #eef2f6;
  color: var(--accent);
  padding: 5px 8px;
  border-color: var(--border)
}

.header-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 12px 0
}

.header-grid td {
  border: 1px solid #a8b4c0;
  padding: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: pointer;
  min-height: 38px;
  vertical-align: middle;
  font-size: 13px
}

.header-grid td.selected,
.header-grid td:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--selection)
}

.header-grid td.anchor {
  box-shadow: inset 0 0 0 2px #557cc4
}

.paper {
  background: #fff;
  color: #111;
  border: 1px solid var(--border);
  min-height: 150px;
  padding: 5%;
  font-family: "Times New Roman", serif
}

.paper .header-preview-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible
}

.paper .paper-instructions {
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.preview-panel,
.question-preview {
  position: sticky;
  top: 12px;
  min-width: 0
}

.qtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap
}

.qtop h2 {
  margin: 0;
  font-size: 20px
}

.qweight {
  width: 112px
}

.qweight input {
  margin: 0 !important
}

.question .stem {
  min-height: 78px
}

#questionList .stem,
#questionList [data-alt] {
  font-size: var(--question-editor-size, 16px);
  line-height: 1.55
}

.altrow {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 6px
}

.altrow span {
  padding-top: 12px;
  font-weight: 650
}

.altrow textarea {
  min-height: 42px;
  margin: 0
}

.answerbar {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap
}

.answerbar label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  margin: 0;
  font-weight: 400
}

.answerbar input {
  width: 18px;
  height: 18px
}

.qactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px
}

.qactions button {
  font-size: 13px;
  padding: 6px 9px
}

.qactions label {
  margin: 0;
  font-size: 13px
}

.media-controls {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  border-top: 1px solid var(--border);
  padding-top: 6px
}

.media-control {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) minmax(100px, 1.4fr) minmax(76px, .75fr);
  align-items: center;
  gap: 8px
}

.media-control label {
  margin: 0;
  font-size: 12px
}

.media-control select,
.media-control input {
  width: 100%;
  max-width: none;
  margin: 3px 0;
  padding: 6px;
  font-size: 13px
}

.media-control>span {
  font-size: 13px
}

.question-preview .panel {
  padding: 16px
}

.proof-page {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  padding: 0;
  width: 100%;
  cursor: zoom-in;
  line-height: 0;
  overflow: hidden
}

.proof-page svg,
.proof-all svg {
  display: block;
  width: 100%;
  height: auto
}

.proof-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px
}

.proof-all {
  display: grid;
  gap: 22px;
  max-width: 850px;
  margin: auto
}

.proof-all section>svg {
  border: 1px solid var(--border)
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: -20px;
  background: #f1f3f5;
  padding: 8px 0;
  z-index: 2
}

#proofDialog {
  width: min(980px, 96vw);
  max-height: 95vh;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #f1f3f5
}

#proofDialog::backdrop {
  background: #1d293899
}

.omr-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 18px
}

.omr-image {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--border)
}

.omr-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px
}

.omr-answers label {
  font-size: 13px
}

.omr-answers select {
  padding: 5px
}

.omr-answers .needs-review {
  background: #fff1d9;
  border-color: #bc8135
}

.omr-good {
  color: #22633e
}

.omr-warn {
  color: #80510c
}

@media(max-width:800px) {
  .workspace {
    grid-template-columns: 1fr
  }

  .preview-panel,
  .question-preview {
    position: static
  }

  .omr-card {
    grid-template-columns: 1fr
  }

  .fields {
    grid-template-columns: 1fr
  }

  .wide {
    grid-column: auto
  }

  main {
    padding: 0 12px 28px
  }

  header {
    padding: 12px 16px
  }

  .panel {
    padding: 16px
  }

  #setup .workspace>.stack {
    display: contents
  }

  #setup .workspace>.stack:first-child>.panel:first-child {
    order: 0
  }

  #headerPreviewPanel {
    order: 1
  }

  #setup .workspace>.stack:first-child>.panel:last-child {
    order: 2
  }

  #setup .workspace>aside>.panel:last-child {
    order: 3
  }
}

@media(max-width:480px) {
  .header-presets {
    gap: 5px
  }

  .preset {
    padding: 6px
  }

  .preset strong,
  .preset small {
    font-size: 11px
  }

  .media-control {
    grid-template-columns: 1fr 1fr
  }

  .media-control>span {
    grid-column: 1/-1
  }

  .brand h1 {
    font-size: 25px
  }

  .brand small {
    font-size: 12px
  }

  .answerbar {
    gap: 10px
  }
}

/* Interface de trabalho, inspirada nos editores tradicionais de documentos. */
.app-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:9px 22px;background:#fafafa}
.app-header .mark{width:38px;height:38px;font-size:24px;border-radius:10px}
.app-header-links{display:flex;gap:22px;align-items:center;font-size:14px}
.app-header-links a,.nav-link{text-decoration:none}
.app-header-links a:hover,.nav-link:hover{text-decoration:underline}
.app-shell{max-width:none;margin:0;padding:0;display:grid;grid-template-columns:208px minmax(0,1fr);min-height:calc(100vh - 108px);align-items:start}
.app-navigation{position:sticky;top:0;display:flex;flex-direction:column;gap:0;margin:0;padding:17px 0;overflow:visible;min-width:0;background:#ededed;border:0;border-right:1px solid #c8c8c8;min-height:calc(100vh - 65px)}
.nav-heading{font-size:12px;font-weight:600;color:#5a5a5a;padding:0 16px 10px}
.app-navigation .tab{text-align:left;white-space:normal;line-height:1.25;color:#333;font-size:14px;font-weight:400;border:0;border-left:3px solid transparent;padding:11px 13px;border-radius:0}
.app-navigation .tab:hover{background:#e0e0e0}
.app-navigation .tab.active{background:#dce7f1;border-left-color:#234d72;color:#173c5f;font-weight:650}
.nav-divider{border-top:1px solid #ccc;margin:16px 13px 8px}
.nav-link{padding:9px 16px;color:#444;font-size:14px}
.app-content{min-width:0;padding:18px;background:#e5e5e5}
.app-content .workspace{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:1px;border:1px solid #c8c8c8;background:#c8c8c8}
.app-content .stack{background:#fff}
.app-content .panel{padding:15px 19px}
.app-content aside.stack{background:#d8d8d8;gap:1px}
.app-content aside .panel{background:#e9e9e9}
.app-content aside .panel-heading{align-items:center;border-bottom:1px solid #c3c3c3;margin:0 0 12px;padding:0 0 8px}
.app-content aside .panel-heading h2{margin:0;font-size:16px}
.app-content .paper,.app-content .proof-page{border:1px solid #b6b6b6;background:#fff;box-shadow:1px 2px 5px #0002}
.app-content .question{border-top:1px solid #c8c8c8}
.app-content .question .qtop{background:#f0f0f0;margin:-15px -19px 12px;padding:8px 19px;border-bottom:1px solid #d1d1d1}
.app-content .qtop h2{font-size:17px}
.app-content .qactions{padding:6px 0}
.app-content .answerbar{background:#f5f5f5;padding:10px 8px}
.app-content .choice{padding:7px 8px}
.app-content .tabpage>.panel{border:1px solid #c8c8c8}
.app-footer{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;text-align:left;background:#fafafa;padding:10px 22px;font-size:12px}
.about-page{max-width:870px;margin:0 auto;padding:35px 24px 45px;background:white}
.about-page h1{font:600 32px/1.2 "Source Serif 4",Georgia,serif}
.about-page h2{font:600 23px/1.3 "Source Serif 4",Georgia,serif;margin:28px 0 9px}
.about-page p{line-height:1.65}
.about-page .open-app{display:inline-block;text-decoration:none;padding:8px 16px;background:var(--accent);color:white}
@media(max-width:1050px){.app-shell{grid-template-columns:178px minmax(0,1fr)}.app-content{padding:12px}}
@media(max-width:800px){.app-header{padding:10px 13px}.app-header-links{gap:10px;flex-wrap:wrap;font-size:12px}.app-shell{display:block;min-height:0}.app-navigation{position:static;display:flex;flex-direction:row;min-height:0;overflow-x:auto;padding:0;background:#ededed;border-right:0;border-bottom:1px solid #bbb}.app-navigation .tab{white-space:nowrap;padding:11px 12px;border-left:0;border-bottom:3px solid transparent}.app-navigation .tab.active{border-bottom-color:var(--accent)}.nav-heading,.nav-divider,.app-navigation .nav-link{display:none}.app-content{padding:8px}.app-content .workspace{grid-template-columns:1fr}.app-content .panel{padding:16px}.app-content .question .qtop{margin:-16px -16px 10px;padding:8px 16px}.app-footer{padding:12px 14px}}
