html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

#app {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto 64px;
  overflow: hidden;
}

header {
  position: static;
  height: 58px;
  padding-inline: 12px;
}

.content {
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 14px 12px;
  overflow: auto;
}

nav {
  position: static;
  height: 64px;
  grid-template-columns: repeat(3, 1fr);
}

.last-read {
  min-height: 44px;
  padding: 6px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(72px, .5fr);
  gap: 12px;
  align-items: center;
  background: #edf1f2;
  border-top: 1px solid var(--line);
}

.last-read div { min-width: 0; }

.last-read span,
.last-read strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-read span {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.last-read strong {
  color: var(--ink);
  font-size: .82rem;
}

.screen.active {
  min-height: 0;
}

.menu-logo {
  display: block;
  width: min(100%, 240px);
  height: auto;
  margin: 6px auto 20px;
}

.home-actions {
  grid-template-columns: 1fr;
}

.screen h1 {
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.title {
  align-items: flex-start;
}

.back {
  width: 40px;
  min-height: 40px;
}

.actions button {
  min-height: 66px;
  padding: 10px 12px;
}

.actions b {
  width: 38px;
  height: 38px;
}

.operation {
  padding: 12px 0;
}

.operation label {
  margin-bottom: 0;
}

.operation input,
.operation select {
  height: 50px;
}

.context-strip {
  margin-bottom: 8px;
}

.context-strip div {
  padding: 8px 10px;
}

.result {
  margin-top: 10px;
}

.result.error {
  background: #fff1f2;
  border: 2px solid var(--red);
  border-top-width: 7px;
  box-shadow: 0 4px 12px rgb(159 37 48 / 18%);
}

.result.error .state {
  position: relative;
  min-height: 68px;
  padding: 16px 14px 16px 58px;
  display: flex;
  align-items: center;
  color: #8f1f29;
  border-bottom: 0;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.3;
}

.result.error .state::before {
  content: "!";
  position: absolute;
  left: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 900;
}

.route {
  padding: 14px;
}

#receiving.screen.active,
#receiving-storage.screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#receiving-result,
#storage-result {
  display: flex;
  flex: 1;
  min-height: 0;
  margin-bottom: -14px;
  flex-direction: column;
}

#receiving-result .route-only,
#storage-result .route-only {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#receiving-result .route-only strong,
#storage-result .route-only strong {
  color: #fff;
  font-weight: 800;
  line-height: 1;
  display: block;
  max-width: 100%;
  white-space: nowrap;
}

#receiving-result .route-driver,
#storage-result .route-driver {
  color: #fff;
  font-size: clamp(1rem, 5vw, 1.35rem);
  font-weight: 750;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#receiving-result .route-driver.missing,
#storage-result .route-driver.missing {
  color: #ffd166;
}

#receiving-result .route-control-short,
#storage-result .route-control-short {
  font-size: clamp(10rem, min(71.45vw, 40.58dvh), 18rem);
}

#receiving-result .route-control-medium,
#storage-result .route-control-medium {
  font-size: clamp(6rem, min(38vw, 28dvh), 9rem);
}

#receiving-result .route-control-long,
#storage-result .route-control-long {
  font-size: clamp(4rem, min(27vw, 22dvh), 7rem);
}

#receiving-result .route-control-xlong,
#storage-result .route-control-xlong {
  font-size: clamp(2.25rem, min(17vw, 15dvh), 4.5rem);
}

#receiving-result .operation {
  flex: none;
}

#shipping-batch.screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#batch-result {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

#batch-result .volume-list {
  min-height: 0;
  overflow-y: auto;
}

@media (max-height: 600px) {
  #app {
    grid-template-rows: 52px minmax(0, 1fr) auto 56px;
  }

  header,
  nav {
    height: auto;
  }

  .content {
    padding-block: 9px;
  }

  .screen h1 {
    margin-bottom: 9px;
    font-size: 1.25rem;
  }

  .actions button {
    min-height: 56px;
  }
}
