html, body {
  margin: 0;
  padding: 0;
  font-family: Verdana, Geneva, sans-serif;
  width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}

#app-container,
#banner,
#doodler-main,
#main-content,
#no-display {
  box-sizing: border-box;
}

#banner {
  max-width: 1380px;
  margin: 0 auto;
}

#main-content {
  max-width: 1380px;
  margin: 12px auto 0 auto;
}

#left-column,
#submit-panel,
#controls-panel {
  min-width: 0;
}

#label-class-buttons {
  gap: 8px;
}

#label-class-buttons button {
  min-width: 72px;
  flex: 1 1 auto;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  text-decoration: none !important;
  appearance: button;
  -webkit-appearance: button;
}

#graph {
  width: 100%;
}

#doodler-main {
  font-size: 0.93rem;
}

#doodler-main h2 {
  font-size: 1.25rem !important;
}

#doodler-main h4 {
  font-size: 1rem !important;
}

#doodler-main p,
#doodler-main label,
#doodler-main button,
#doodler-main input,
#doodler-main textarea,
#doodler-main .js-plotly-plot {
  font-size: 0.92rem !important;
}

#left-column,
#submit-panel,
#controls-panel {
  overflow: hidden;
}

.responsive-card {
  width: 100%;
  padding: 12px;
  padding-top: 4px;
  box-sizing: border-box;
}

.info-sections {
  width: 100%;
}

.info-card {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  padding-top: 4px;
  overflow-x: hidden;
}

.about-content {
  display: grid;
  grid-template-columns: minmax(96px, 136px) minmax(0, 1fr);
  gap: clamp(6px, 1.2vw, 14px);
  align-items: center;
  width: 100%;
}

.about-avatar {
  width: 100%;
  max-width: 136px;
  height: auto;
  aspect-ratio: 136 / 112;
  justify-self: start;
}

.about-text {
  min-width: 0;
}

@media (max-width: 900px) {
  #banner > div:nth-child(2) {
    grid-template-columns: 1fr !important;
  }

  #main-content {
    grid-template-columns: 1fr !important;
  }

  #controls-panel,
  #left-column,
  #submit-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  .info-sections,
  .info-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .about-content {
    grid-template-columns: minmax(88px, 128px) minmax(0, 1fr);
    gap: 8px;
  }

  .about-avatar {
    max-width: 128px;
  }

  #controls-panel { order: 1; }
  #left-column { order: 2; }
  #submit-panel { order: 3; }
}

@media (max-width: 640px) {
  html, body {
    font-size: 19px;
  }

  #banner,
  #doodler-main,
  #main-content,
  .info-sections,
  .info-card {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #banner {
    padding-top: 12px !important;
  }

  #main-content {
    align-items: center !important;
  }

  #doodler-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 1rem;
  }

  #banner > div:nth-child(2) {
    gap: 12px !important;
    margin-top: 12px !important;
  }

  #banner h1,
  #banner h4,
  #banner p {
    word-break: break-word;
  }

  #banner img {
    max-width: 100%;
    height: auto;
  }

  #banner > div,
  #banner > div > div,
  #doodler-main > div,
  #main-content > div,
  .info-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  #conference-banner {
    border-radius: 14px !important;
  }

  #banner > div:nth-child(2) > div,
  #main-content > div,
  .info-card {
    padding: 3px !important;
  }

  .info-card {
    padding: 12px !important;
    padding-top: 4px !important;
  }

  .about-content {
    grid-template-columns: minmax(72px, 112px) minmax(0, 1fr);
    align-items: flex-start;
    gap: 4px;
  }

  .about-avatar {
    max-width: 112px;
  }

  #controls-panel.responsive-card {
    padding: 12px !important;
    padding-top: 4px !important;
  }

  .responsive-card {
    padding: 12px !important;
    padding-top: 4px !important;
  }

  #controls-panel,
  #submit-panel {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden;
    text-align: left;
  }

  #submit-panel {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  #controls-panel {
    order: 1;
  }

  #left-column {
    order: 2;
  }

  #submit-panel {
    order: 3;
  }

  #left-column {
    padding: 4px !important;
  }

  #label-class-buttons {
    justify-content: stretch;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

  #label-class-buttons button {
    min-width: 0;
    width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #controls-panel button,
  #submit-panel button {
    font-size: 0.98rem;
    padding-left: 12px;
    padding-right: 12px;
  }

  #doodler-main h2 {
    font-size: 1.65rem !important;
  }

  #doodler-main h4 {
    font-size: 1.2rem !important;
  }

  #doodler-main p,
  #doodler-main label,
  #doodler-main input,
  #doodler-main textarea,
  #doodler-main button,
  #doodler-main .js-plotly-plot {
    font-size: 1rem !important;
  }

  #doodler-main > div:first-child,
  #controls-panel,
  #submit-panel,
  #doodler-main > div:last-child {
    font-size: 1rem !important;
  }

  #doodler-main > div:first-child h4,
  #controls-panel h4,
  #submit-panel h4,
  #doodler-main > div:last-child h4 {
    font-size: 1.2rem !important;
  }

  #doodler-main > div:first-child p,
  #controls-panel p,
  #submit-panel p,
  #doodler-main > div:last-child p,
  #doodler-main > div:last-child a,
  #doodler-main > div:last-child span,
  #doodler-main > div:last-child div {
    font-size: 0.98rem !important;
  }

  #my-id,
  #button,
  #submit-iou,
  #iou-output,
  #crf-show-segmentation,
  #label-class-buttons button {
    font-size: 0.98rem !important;
  }

  #controls-panel .js-plotly-plot,
  #submit-panel .js-plotly-plot {
    max-height: 74vh;
  }

  #graph {
    min-height: 0;
    height: auto !important;
  }

  #graph .modebar {
    padding: 2px !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72) !important;
  }

  #graph .modebar-btn {
    width: 38px !important;
    height: 38px !important;
  }

  #graph .modebar-btn svg {
    transform: scale(1.2);
    transform-origin: center;
  }

  #doodler-main > div:nth-child(2) {
    margin-top: 8px !important;
  }

  #controls-panel {
    font-size: 0.98rem;
  }

  #controls-panel .js-plotly-plot,
  #submit-panel .js-plotly-plot {
    max-height: none;
  }

  #graph,
  #graph .js-plotly-plot,
  #controls-panel .js-plotly-plot,
  #submit-panel .js-plotly-plot {
    margin-left: auto;
    margin-right: auto;
    width: 100% !important;
    max-width: 100% !important;
  }

  #select-image,
  #my-id,
  #thisimage_output {
    width: 100% !important;
  }
}
