/* author: https://github.com/nhermab
   rewrite by: https://github.com/broodje565 */

#app-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#screen-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  background: var(--color-bg-dark);
  position: relative;
  animation: fade-in 0.25s ease-out;
}

.screen-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: var(--color-bg-darker);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.screen-header-content-with-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.screen-header-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.screen-header-main--align-right {
  margin-left: auto;
  text-align: right;
}

.screen-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.screen-header-subtitle {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.tabs.tabs-in-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  background: transparent;
}

.tabs.tabs-in-header .tab-button {
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
}

@media (max-width: 640px) {
  .screen-header-content-with-tabs {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .screen-header-main--align-right {
    margin-left: 0;
    text-align: left;
  }
}

.screen-body {
  padding: 1rem 1.25rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.screen-body > div:last-child {
  flex: 1;
  min-height: 0;
}

#global-status {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--border-color);
  display: none;
  flex-shrink: 0;
}

#global-status.is-visible {
  display: block;
}

.chapter-header-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
}

.chapter-header-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
