:root {
  --app-inline-padding: clamp(8px, 1.6vw, 24px);
}

.topbar {
  flex-wrap: wrap;
  row-gap: 10px;
}

.topbar__right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.content {
  max-width: none;
  width: 100%;
  padding-left: var(--app-inline-padding);
  padding-right: var(--app-inline-padding);
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: start;
  grid-auto-flow: dense;
}

.grid-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

#cardTemplates {
  min-width: 0;
}

#cardTemplates .tablewrap--templates {
  max-height: min(72vh, 980px);
  overflow: auto;
}

.card,
.step,
.statusbox,
.codebox,
.logconsole,
.mailbody {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.brand__title,
.brand__sub,
.small,
.muted,
label,
p,
li,
a {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: pretty;
}

.btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
  line-height: 1.25;
}

.row .btn {
  flex: 0 1 auto;
}

.row,
.card__head,
.brand,
.form--inline {
  flex-wrap: wrap;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  justify-content: flex-start;
}

.row > .btn,
.row > a.btn,
.row > label,
.row > .pill,
.row > span {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 100%;
}

.row > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.form--inline > label {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
}

.form--inline input[type="number"],
.form--inline input[type="email"],
.form--inline input[type="password"],
.form--inline input[type="text"] {
  width: 100%;
}

.sensitive-input-row {
  flex-wrap: wrap;
}

.sensitive-input-row input {
  min-width: min(100%, 240px);
}

.table {
  min-width: 0;
  table-layout: fixed;
}

.table th,
.table td {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: pretty;
}

.drawer {
  max-width: 100vw;
}

.tablewrap,
.diag .tablewrap,
.logconsole,
.drawer__body,
.mailbody {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.upload-messages {
  max-height: min(220px, 36vh);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

#loopMonitorCard,
#loopMonitorCard .tablewrap {
  max-height: min(420px, calc(100vh - 96px));
  overflow: auto;
}

.tablewrap {
  min-height: 0;
  scrollbar-gutter: stable both-edges;
}

.table {
  width: max-content;
  min-width: 100%;
}

.codebox,
.logconsole {
  word-break: normal;
  overflow-wrap: anywhere;
}

.resizable-height-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.resizable-height-container.is-resizing {
  user-select: none;
}

.resizable-height-container > .resize-edge-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  cursor: ns-resize;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(122, 162, 255, 0.2)
  );
}

.diag .tablewrap table,
.tablewrap table {
  min-width: max(100%, 920px);
}

@media (max-width: 700px) {
  .grid-column {
    display: contents;
  }

  #cardTemplates .tablewrap--templates {
    max-height: none;
  }

  .content {
    padding-left: 8px;
    padding-right: 8px;
  }
}
