* {
  font-family: Arial;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
    --header-height: 60px;
}

html, body {
  height: 100%;
  scrollbar-gutter: both-edges;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
    margin: 0;
    font-size: 16px;
    background-color: cadetblue;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 816px) {
    body {
        background-color: white;
    }
}

.stuff-under-header {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    margin-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5em;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.top-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    padding: 0;
    background-color: white;
    border: 1px solid black;
    border-radius: 8px;
    cursor: pointer;
    font-size: 48px;
    color: black;
}

.top-menu-button img {
  object-fit: contain;
  pointer-events: none;
  height: 46px;
  width: 46px;
}

.printer-icon img {
    height: 42px;
}

.hamburger-menu-button {
    position: absolute;
    left: 6px;
}

.hamburger-menu button {
    font-size: 32px;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

/* Editor grid for word-grid type */
.word-grid-editor {
  display: table;
  border-collapse: collapse;
  margin-top: 1em;
  margin-bottom: 2em;
}

.word-grid-editor-row {
  display: table-row;
}

.word-grid-editor-cell {
  display: table-cell;
  padding: 0.2em;
  border: 1px solid black;
  vertical-align: top;
}

.word-grid-editor-cell input[type="text"] {
  width: 10em;
  height: 2.2em;
  font-size: inherit;
  border: none;
  text-align: center;
}

.word-grid-blank-label {
  display: block;
  font-size: 0.85em;
  margin-top: 0.25em;
  text-align: right;
}

/* Legacy names kept in case they're referenced elsewhere */
.word-grid-editor-table {
  border-collapse: collapse;
}

.word-grid-cell-input {
  width: 10em;
  height: 3em;
  font-size: inherit;
}

.word-grid-checkbox-wrapper {
  text-align: right;
}

.word-grid-blank-toggle {
  transform: translateY(-48px);
}

.menu-overlay {
    position: fixed;
    height: calc(100vh - var(--header-height));
    width: 100%;
    top: var(--header-height);
    left: 0;
    z-index: 2;
    background-color: white;
    padding: 3em;
    overflow-y: auto;
    padding-bottom: 5em;
}

.menu-buttons {
    font-size: 36px;
    height: 1.5em;
}

.hidden {
    display: none;
}

header {
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    width: 100%;
    background-color: lightgray;
    border-bottom: solid 1px black;
    position: fixed;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.header-title {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
}

@media (max-width: 600px) {
    header {
        top: 0;
        left: 0;
        right: 0;
        height: var(--header-height);
        width: 100%;
        background-color: lightgray;
        border-bottom: solid 1px black;
        position: fixed;
        z-index: 5;
        display: flex;
        flex: 0 0 auto;
        justify-content: left;
    }
}

@media (max-width: 720px) {
    header {
        justify-content: left;
    }

    .header-title {
        padding-left: 2em;
    }
}

.exercise-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1em;
}

.exercise-button-caption {
    text-align: center;
    font-size: 24px;
}

.exercise-type-button {
    height: 250px;
    width: 250px;
    font-size: 16px;
}

.exercise-type {
    text-align: center;
}

.exercise-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.exercise-block {
    position: relative;
    padding: 0;
    z-index: 0;
    -webkit-text-size-adjust: 100%;
}

.exercise-block::before {
    content: "";
    position: absolute;
    top: -1em;
    bottom: -1em;
    left: -1em;
    right: -1em;
    background-color: transparent;
    border-radius: 10px;
    z-index: -1;
    pointer-events: none;
}

.exercise-block.toolbar-visible::before {
  background-color: lightgray;
}

.block-content {
    width: 100%;
}

/* Toolbar: hidden by default (not in layout; not clickable) */
.block-toolbar {
    position: absolute;
    top: -0.5em;
    right: 0.5em;
    gap: 0.25em;

    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.exercise-block.toolbar-visible .block-toolbar {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.toolbar-btns {
    background-color: white;
    height: 50px;
    width: 50px;
    border-radius: 30%;
    user-select: none;
}

.toolbar-btns img {
  pointer-events: none;
}

.text-box {
    width: 100%;
    height: 8em;
    font-size: 24px;
}

.heading-input {
    width: 100%;
    height: 4em;
    font-size: 24px;
}

ul {
    list-style-type: none;
}

.bold {
    font-weight: bold;
}

.worksheet-page {
    width: 816px;              /* MUST stay exact */
    min-width: 816px;          /* prevent any shrink attempts */
    margin: 24px auto;
    padding: 96px;
    background: white;
    line-height: 1.35;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 816px) {
    .worksheet-page {
        width: 624px;
        min-width: 624px;
        margin: 24px auto;
        margin-top: 2em;
        margin-bottom: 2em;
        padding: 0;
    }
}

@media (max-width: 662px) {
    .worksheet-page {
        margin-left: 20px;
        margin-right: 20px;
    }
}

.overlay-open {
  overflow: hidden;
}

.checkboxGroup {
    padding-bottom: 1em;
}

.answer-line {
    color: black;
}

label {
    font-size: 24px;
}

.label-top {
    padding-bottom: 1em;
    font-weight: bold;
}

.word-bank {
  text-align: center;
}

.word-bank-item {
  display: inline-block;
}

.underlined {
    text-decoration: underline;
    font-weight: bold;
}

.cloze-test-choices {
    width: 100%;
    text-align: left;
}

.multiple-choice-options {
    table-layout: fixed;
    padding-bottom: 1em;
}

.simulate-line-height {
    line-height: 2em;
}

.letter-cell {
    text-align: right;
    font-weight: bold;
    width: 1.5em;
    vertical-align: top;
}

.matching-left {
    width: 200px;
    vertical-align: top;
}

.matching-right {
    width: 200px;
    vertical-align: top;
}

.space-and-number {
    width: 3.5em;
    vertical-align: top;
    text-align: right;
}

.buffer-cell {
    width: 2em;
}

.choice-cell {
    width: 6em;
    vertical-align: top;
}

.answer-label {
    font-size: 16px;
}

.matching-layout {
    text-align: left;
}

.right {
    text-align: right;
}

.word-grid {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border: 1px solid black;
}

.word-grid th, .word-grid td {
    border: 1px solid black;
}

.essay-rows {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid black;
}

.essay-rows td {
    border: 1px solid black;
    height: 2em;
}

.title-table {
    width: 100%;
    border-collapse: collapse;
}

.title-labels {
    text-align: left;
    vertical-align: top;
}

.title-left-cell {
    font-size: 32px;
    font-weight: bold;
    width: 420px;
    vertical-align: top;
}

.title-right-cell {
    font-size: 16px;
}

.title-values {
    text-align: right;
    vertical-align: top;
}

.left-space {
    padding-left: 1em;
}

.lined {
    line-height: 1em;
    border-spacing: 0;
    padding: 0;
}

.box {
    border-collapse: collapse;
    width: 100%;
}

.box td {
    border: 1px solid black;
    height: 66px;
    padding: 0;
}

.simple-lines {
    border-collapse: collapse;
    width: 100%;
}

.simple-lines td {
    border: none;
    border-bottom: 1px solid black;
    height: 3em;
    line-height: 1em;
    padding: 0;
}

table.lined td {
  padding: 0;
  height: 3em;
  line-height: 22px;
  text-align: center;
  vertical-align: middle;
}

table.lined tr {
    height: 1em;
}

td.lined {
  border: 1px solid black;
}

table.lined td.spacer-row {
  border: none;
  height: 1em;
}

.preserve-spaces {
  white-space: pre-wrap;
}

.word-grid-editor-table {
  border-collapse: collapse;
}

.word-grid-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 0.75em;
    row-gap: 0.5em;
}

.word-grid-corner-spacer {
    grid-column: 1;
    grid-row: 1;
}

.word-grid-heading-col-toggle {
    grid-column: 2;
    grid-row: 1;
}

.word-grid-heading-row-toggle {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding-top: 0.75em;
}

.word-grid-table-wrapper {
    grid-column: 2;
    grid-row: 2;
}

.editor-heading {
  font-weight: bold;
}

.italics {
    font-style: italic;
}

.word-grid-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    border: 1px solid black;
}

.word-grid-table th, .word-grid-table td {
    border: 1px solid black;
    width: 3em;
}

.editor-body {
    padding-bottom: 2em;
}

.exercise-description {
    padding-top: 1em;
}